fidl_fidl_serversuite/
fidl_fidl_serversuite.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_fidl_serversuite__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15#[repr(C)]
16pub struct ClosedTargetCreateNHandleVectorRequest {
17    pub n: u32,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21    for ClosedTargetCreateNHandleVectorRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct ClosedTargetCreateNHandleVectorResponse {
27    pub vec: Vec<fidl::Event>,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
31    for ClosedTargetCreateNHandleVectorResponse
32{
33}
34
35#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct ClosedTargetEchoAsTransferableSignalableEventRequest {
37    pub handle: fidl::NullableHandle,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41    for ClosedTargetEchoAsTransferableSignalableEventRequest
42{
43}
44
45#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct ClosedTargetEchoAsTransferableSignalableEventResponse {
47    pub handle: fidl::Event,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
51    for ClosedTargetEchoAsTransferableSignalableEventResponse
52{
53}
54
55#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
56pub struct ClosedTargetGetHandleRightsRequest {
57    pub handle: fidl::NullableHandle,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
61    for ClosedTargetGetHandleRightsRequest
62{
63}
64
65#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
66pub struct ClosedTargetGetSignalableEventRightsRequest {
67    pub handle: fidl::Event,
68}
69
70impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
71    for ClosedTargetGetSignalableEventRightsRequest
72{
73}
74
75#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
76pub struct ClosedTargetHandleVectorSizeRequest {
77    pub vec: Vec<fidl::Event>,
78}
79
80impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
81    for ClosedTargetHandleVectorSizeRequest
82{
83}
84
85#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
86pub struct RunnerStartRequest {
87    pub test: Test,
88    pub any_target: AnyTarget,
89}
90
91impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunnerStartRequest {}
92
93#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
94pub enum AnyTarget {
95    Closed(fidl::endpoints::ServerEnd<ClosedTargetMarker>),
96    Ajar(fidl::endpoints::ServerEnd<AjarTargetMarker>),
97    Open(fidl::endpoints::ServerEnd<OpenTargetMarker>),
98}
99
100impl AnyTarget {
101    #[inline]
102    pub fn ordinal(&self) -> u64 {
103        match *self {
104            Self::Closed(_) => 1,
105            Self::Ajar(_) => 2,
106            Self::Open(_) => 3,
107        }
108    }
109}
110
111impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for AnyTarget {}
112
113#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
114pub struct AjarTargetMarker;
115
116impl fidl::endpoints::ProtocolMarker for AjarTargetMarker {
117    type Proxy = AjarTargetProxy;
118    type RequestStream = AjarTargetRequestStream;
119    #[cfg(target_os = "fuchsia")]
120    type SynchronousProxy = AjarTargetSynchronousProxy;
121
122    const DEBUG_NAME: &'static str = "(anonymous) AjarTarget";
123}
124
125pub trait AjarTargetProxyInterface: Send + Sync {}
126#[derive(Debug)]
127#[cfg(target_os = "fuchsia")]
128pub struct AjarTargetSynchronousProxy {
129    client: fidl::client::sync::Client,
130}
131
132#[cfg(target_os = "fuchsia")]
133impl fidl::endpoints::SynchronousProxy for AjarTargetSynchronousProxy {
134    type Proxy = AjarTargetProxy;
135    type Protocol = AjarTargetMarker;
136
137    fn from_channel(inner: fidl::Channel) -> Self {
138        Self::new(inner)
139    }
140
141    fn into_channel(self) -> fidl::Channel {
142        self.client.into_channel()
143    }
144
145    fn as_channel(&self) -> &fidl::Channel {
146        self.client.as_channel()
147    }
148}
149
150#[cfg(target_os = "fuchsia")]
151impl AjarTargetSynchronousProxy {
152    pub fn new(channel: fidl::Channel) -> Self {
153        let protocol_name = <AjarTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
154        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
155    }
156
157    pub fn into_channel(self) -> fidl::Channel {
158        self.client.into_channel()
159    }
160
161    /// Waits until an event arrives and returns it. It is safe for other
162    /// threads to make concurrent requests while waiting for an event.
163    pub fn wait_for_event(
164        &self,
165        deadline: zx::MonotonicInstant,
166    ) -> Result<AjarTargetEvent, fidl::Error> {
167        AjarTargetEvent::decode(self.client.wait_for_event(deadline)?)
168    }
169}
170
171#[cfg(target_os = "fuchsia")]
172impl From<AjarTargetSynchronousProxy> for zx::NullableHandle {
173    fn from(value: AjarTargetSynchronousProxy) -> Self {
174        value.into_channel().into()
175    }
176}
177
178#[cfg(target_os = "fuchsia")]
179impl From<fidl::Channel> for AjarTargetSynchronousProxy {
180    fn from(value: fidl::Channel) -> Self {
181        Self::new(value)
182    }
183}
184
185#[cfg(target_os = "fuchsia")]
186impl fidl::endpoints::FromClient for AjarTargetSynchronousProxy {
187    type Protocol = AjarTargetMarker;
188
189    fn from_client(value: fidl::endpoints::ClientEnd<AjarTargetMarker>) -> Self {
190        Self::new(value.into_channel())
191    }
192}
193
194#[derive(Debug, Clone)]
195pub struct AjarTargetProxy {
196    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
197}
198
199impl fidl::endpoints::Proxy for AjarTargetProxy {
200    type Protocol = AjarTargetMarker;
201
202    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
203        Self::new(inner)
204    }
205
206    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
207        self.client.into_channel().map_err(|client| Self { client })
208    }
209
210    fn as_channel(&self) -> &::fidl::AsyncChannel {
211        self.client.as_channel()
212    }
213}
214
215impl AjarTargetProxy {
216    /// Create a new Proxy for fidl.serversuite/AjarTarget.
217    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
218        let protocol_name = <AjarTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
219        Self { client: fidl::client::Client::new(channel, protocol_name) }
220    }
221
222    /// Get a Stream of events from the remote end of the protocol.
223    ///
224    /// # Panics
225    ///
226    /// Panics if the event stream was already taken.
227    pub fn take_event_stream(&self) -> AjarTargetEventStream {
228        AjarTargetEventStream { event_receiver: self.client.take_event_receiver() }
229    }
230}
231
232impl AjarTargetProxyInterface for AjarTargetProxy {}
233
234pub struct AjarTargetEventStream {
235    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
236}
237
238impl std::marker::Unpin for AjarTargetEventStream {}
239
240impl futures::stream::FusedStream for AjarTargetEventStream {
241    fn is_terminated(&self) -> bool {
242        self.event_receiver.is_terminated()
243    }
244}
245
246impl futures::Stream for AjarTargetEventStream {
247    type Item = Result<AjarTargetEvent, fidl::Error>;
248
249    fn poll_next(
250        mut self: std::pin::Pin<&mut Self>,
251        cx: &mut std::task::Context<'_>,
252    ) -> std::task::Poll<Option<Self::Item>> {
253        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
254            &mut self.event_receiver,
255            cx
256        )?) {
257            Some(buf) => std::task::Poll::Ready(Some(AjarTargetEvent::decode(buf))),
258            None => std::task::Poll::Ready(None),
259        }
260    }
261}
262
263#[derive(Debug)]
264pub enum AjarTargetEvent {
265    #[non_exhaustive]
266    _UnknownEvent {
267        /// Ordinal of the event that was sent.
268        ordinal: u64,
269    },
270}
271
272impl AjarTargetEvent {
273    /// Decodes a message buffer as a [`AjarTargetEvent`].
274    fn decode(
275        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
276    ) -> Result<AjarTargetEvent, fidl::Error> {
277        let (bytes, _handles) = buf.split_mut();
278        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
279        debug_assert_eq!(tx_header.tx_id, 0);
280        match tx_header.ordinal {
281            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
282                Ok(AjarTargetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
283            }
284            _ => Err(fidl::Error::UnknownOrdinal {
285                ordinal: tx_header.ordinal,
286                protocol_name: <AjarTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
287            }),
288        }
289    }
290}
291
292/// A Stream of incoming requests for fidl.serversuite/AjarTarget.
293pub struct AjarTargetRequestStream {
294    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
295    is_terminated: bool,
296}
297
298impl std::marker::Unpin for AjarTargetRequestStream {}
299
300impl futures::stream::FusedStream for AjarTargetRequestStream {
301    fn is_terminated(&self) -> bool {
302        self.is_terminated
303    }
304}
305
306impl fidl::endpoints::RequestStream for AjarTargetRequestStream {
307    type Protocol = AjarTargetMarker;
308    type ControlHandle = AjarTargetControlHandle;
309
310    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
311        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
312    }
313
314    fn control_handle(&self) -> Self::ControlHandle {
315        AjarTargetControlHandle { inner: self.inner.clone() }
316    }
317
318    fn into_inner(
319        self,
320    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
321    {
322        (self.inner, self.is_terminated)
323    }
324
325    fn from_inner(
326        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
327        is_terminated: bool,
328    ) -> Self {
329        Self { inner, is_terminated }
330    }
331}
332
333impl futures::Stream for AjarTargetRequestStream {
334    type Item = Result<AjarTargetRequest, fidl::Error>;
335
336    fn poll_next(
337        mut self: std::pin::Pin<&mut Self>,
338        cx: &mut std::task::Context<'_>,
339    ) -> std::task::Poll<Option<Self::Item>> {
340        let this = &mut *self;
341        if this.inner.check_shutdown(cx) {
342            this.is_terminated = true;
343            return std::task::Poll::Ready(None);
344        }
345        if this.is_terminated {
346            panic!("polled AjarTargetRequestStream after completion");
347        }
348        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
349            |bytes, handles| {
350                match this.inner.channel().read_etc(cx, bytes, handles) {
351                    std::task::Poll::Ready(Ok(())) => {}
352                    std::task::Poll::Pending => return std::task::Poll::Pending,
353                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
354                        this.is_terminated = true;
355                        return std::task::Poll::Ready(None);
356                    }
357                    std::task::Poll::Ready(Err(e)) => {
358                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
359                            e.into(),
360                        ))));
361                    }
362                }
363
364                // A message has been received from the channel
365                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
366
367                std::task::Poll::Ready(Some(match header.ordinal {
368                    _ if header.tx_id == 0
369                        && header
370                            .dynamic_flags()
371                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
372                    {
373                        Ok(AjarTargetRequest::_UnknownMethod {
374                            ordinal: header.ordinal,
375                            control_handle: AjarTargetControlHandle { inner: this.inner.clone() },
376                        })
377                    }
378                    _ => Err(fidl::Error::UnknownOrdinal {
379                        ordinal: header.ordinal,
380                        protocol_name:
381                            <AjarTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
382                    }),
383                }))
384            },
385        )
386    }
387}
388
389#[derive(Debug)]
390pub enum AjarTargetRequest {
391    /// An interaction was received which does not match any known method.
392    #[non_exhaustive]
393    _UnknownMethod {
394        /// Ordinal of the method that was called.
395        ordinal: u64,
396        control_handle: AjarTargetControlHandle,
397    },
398}
399
400impl AjarTargetRequest {
401    /// Name of the method defined in FIDL
402    pub fn method_name(&self) -> &'static str {
403        match *self {
404            AjarTargetRequest::_UnknownMethod { .. } => "unknown one-way method",
405        }
406    }
407}
408
409#[derive(Debug, Clone)]
410pub struct AjarTargetControlHandle {
411    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
412}
413
414impl fidl::endpoints::ControlHandle for AjarTargetControlHandle {
415    fn shutdown(&self) {
416        self.inner.shutdown()
417    }
418
419    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
420        self.inner.shutdown_with_epitaph(status)
421    }
422
423    fn is_closed(&self) -> bool {
424        self.inner.channel().is_closed()
425    }
426    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
427        self.inner.channel().on_closed()
428    }
429
430    #[cfg(target_os = "fuchsia")]
431    fn signal_peer(
432        &self,
433        clear_mask: zx::Signals,
434        set_mask: zx::Signals,
435    ) -> Result<(), zx_status::Status> {
436        use fidl::Peered;
437        self.inner.channel().signal_peer(clear_mask, set_mask)
438    }
439}
440
441impl AjarTargetControlHandle {}
442
443#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
444pub struct ClosedTargetMarker;
445
446impl fidl::endpoints::ProtocolMarker for ClosedTargetMarker {
447    type Proxy = ClosedTargetProxy;
448    type RequestStream = ClosedTargetRequestStream;
449    #[cfg(target_os = "fuchsia")]
450    type SynchronousProxy = ClosedTargetSynchronousProxy;
451
452    const DEBUG_NAME: &'static str = "(anonymous) ClosedTarget";
453}
454pub type ClosedTargetTwoWayResultResult = Result<String, u32>;
455
456pub trait ClosedTargetProxyInterface: Send + Sync {
457    fn r#one_way_no_payload(&self) -> Result<(), fidl::Error>;
458    type TwoWayNoPayloadResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
459    fn r#two_way_no_payload(&self) -> Self::TwoWayNoPayloadResponseFut;
460    type TwoWayStructPayloadResponseFut: std::future::Future<Output = Result<i8, fidl::Error>>
461        + Send;
462    fn r#two_way_struct_payload(&self, v: i8) -> Self::TwoWayStructPayloadResponseFut;
463    type TwoWayTablePayloadResponseFut: std::future::Future<Output = Result<ClosedTargetTwoWayTablePayloadResponse, fidl::Error>>
464        + Send;
465    fn r#two_way_table_payload(
466        &self,
467        payload: &ClosedTargetTwoWayTablePayloadRequest,
468    ) -> Self::TwoWayTablePayloadResponseFut;
469    type TwoWayUnionPayloadResponseFut: std::future::Future<Output = Result<ClosedTargetTwoWayUnionPayloadResponse, fidl::Error>>
470        + Send;
471    fn r#two_way_union_payload(
472        &self,
473        payload: &ClosedTargetTwoWayUnionPayloadRequest,
474    ) -> Self::TwoWayUnionPayloadResponseFut;
475    type TwoWayResultResponseFut: std::future::Future<Output = Result<ClosedTargetTwoWayResultResult, fidl::Error>>
476        + Send;
477    fn r#two_way_result(
478        &self,
479        payload: &ClosedTargetTwoWayResultRequest,
480    ) -> Self::TwoWayResultResponseFut;
481    type GetHandleRightsResponseFut: std::future::Future<Output = Result<fidl::Rights, fidl::Error>>
482        + Send;
483    fn r#get_handle_rights(&self, handle: fidl::NullableHandle)
484    -> Self::GetHandleRightsResponseFut;
485    type GetSignalableEventRightsResponseFut: std::future::Future<Output = Result<fidl::Rights, fidl::Error>>
486        + Send;
487    fn r#get_signalable_event_rights(
488        &self,
489        handle: fidl::Event,
490    ) -> Self::GetSignalableEventRightsResponseFut;
491    type EchoAsTransferableSignalableEventResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
492        + Send;
493    fn r#echo_as_transferable_signalable_event(
494        &self,
495        handle: fidl::NullableHandle,
496    ) -> Self::EchoAsTransferableSignalableEventResponseFut;
497    type ByteVectorSizeResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
498    fn r#byte_vector_size(&self, vec: &[u8]) -> Self::ByteVectorSizeResponseFut;
499    type HandleVectorSizeResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
500    fn r#handle_vector_size(&self, vec: Vec<fidl::Event>) -> Self::HandleVectorSizeResponseFut;
501    type CreateNByteVectorResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>>
502        + Send;
503    fn r#create_n_byte_vector(&self, n: u32) -> Self::CreateNByteVectorResponseFut;
504    type CreateNHandleVectorResponseFut: std::future::Future<Output = Result<Vec<fidl::Event>, fidl::Error>>
505        + Send;
506    fn r#create_n_handle_vector(&self, n: u32) -> Self::CreateNHandleVectorResponseFut;
507}
508#[derive(Debug)]
509#[cfg(target_os = "fuchsia")]
510pub struct ClosedTargetSynchronousProxy {
511    client: fidl::client::sync::Client,
512}
513
514#[cfg(target_os = "fuchsia")]
515impl fidl::endpoints::SynchronousProxy for ClosedTargetSynchronousProxy {
516    type Proxy = ClosedTargetProxy;
517    type Protocol = ClosedTargetMarker;
518
519    fn from_channel(inner: fidl::Channel) -> Self {
520        Self::new(inner)
521    }
522
523    fn into_channel(self) -> fidl::Channel {
524        self.client.into_channel()
525    }
526
527    fn as_channel(&self) -> &fidl::Channel {
528        self.client.as_channel()
529    }
530}
531
532#[cfg(target_os = "fuchsia")]
533impl ClosedTargetSynchronousProxy {
534    pub fn new(channel: fidl::Channel) -> Self {
535        let protocol_name = <ClosedTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
536        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
537    }
538
539    pub fn into_channel(self) -> fidl::Channel {
540        self.client.into_channel()
541    }
542
543    /// Waits until an event arrives and returns it. It is safe for other
544    /// threads to make concurrent requests while waiting for an event.
545    pub fn wait_for_event(
546        &self,
547        deadline: zx::MonotonicInstant,
548    ) -> Result<ClosedTargetEvent, fidl::Error> {
549        ClosedTargetEvent::decode(self.client.wait_for_event(deadline)?)
550    }
551
552    pub fn r#one_way_no_payload(&self) -> Result<(), fidl::Error> {
553        self.client.send::<fidl::encoding::EmptyPayload>(
554            (),
555            0x66bd5fe1d4c019e,
556            fidl::encoding::DynamicFlags::empty(),
557        )
558    }
559
560    pub fn r#two_way_no_payload(
561        &self,
562        ___deadline: zx::MonotonicInstant,
563    ) -> Result<(), fidl::Error> {
564        let _response =
565            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
566                (),
567                0x5bda1d1c46a5ae5f,
568                fidl::encoding::DynamicFlags::empty(),
569                ___deadline,
570            )?;
571        Ok(_response)
572    }
573
574    pub fn r#two_way_struct_payload(
575        &self,
576        mut v: i8,
577        ___deadline: zx::MonotonicInstant,
578    ) -> Result<i8, fidl::Error> {
579        let _response = self.client.send_query::<
580            ClosedTargetTwoWayStructPayloadRequest,
581            ClosedTargetTwoWayStructPayloadResponse,
582        >(
583            (v,),
584            0x313769ab1b770c90,
585            fidl::encoding::DynamicFlags::empty(),
586            ___deadline,
587        )?;
588        Ok(_response.v)
589    }
590
591    pub fn r#two_way_table_payload(
592        &self,
593        mut payload: &ClosedTargetTwoWayTablePayloadRequest,
594        ___deadline: zx::MonotonicInstant,
595    ) -> Result<ClosedTargetTwoWayTablePayloadResponse, fidl::Error> {
596        let _response = self.client.send_query::<
597            ClosedTargetTwoWayTablePayloadRequest,
598            ClosedTargetTwoWayTablePayloadResponse,
599        >(
600            payload,
601            0x631f7f27b6872baa,
602            fidl::encoding::DynamicFlags::empty(),
603            ___deadline,
604        )?;
605        Ok(_response)
606    }
607
608    pub fn r#two_way_union_payload(
609        &self,
610        mut payload: &ClosedTargetTwoWayUnionPayloadRequest,
611        ___deadline: zx::MonotonicInstant,
612    ) -> Result<ClosedTargetTwoWayUnionPayloadResponse, fidl::Error> {
613        let _response = self.client.send_query::<
614            ClosedTargetTwoWayUnionPayloadRequest,
615            ClosedTargetTwoWayUnionPayloadResponse,
616        >(
617            payload,
618            0x77d0365370536dba,
619            fidl::encoding::DynamicFlags::empty(),
620            ___deadline,
621        )?;
622        Ok(_response)
623    }
624
625    pub fn r#two_way_result(
626        &self,
627        mut payload: &ClosedTargetTwoWayResultRequest,
628        ___deadline: zx::MonotonicInstant,
629    ) -> Result<ClosedTargetTwoWayResultResult, fidl::Error> {
630        let _response = self.client.send_query::<
631            ClosedTargetTwoWayResultRequest,
632            fidl::encoding::ResultType<ClosedTargetTwoWayResultResponse, u32>,
633        >(
634            payload,
635            0xb32549e6f50894c,
636            fidl::encoding::DynamicFlags::empty(),
637            ___deadline,
638        )?;
639        Ok(_response.map(|x| x.payload))
640    }
641
642    pub fn r#get_handle_rights(
643        &self,
644        mut handle: fidl::NullableHandle,
645        ___deadline: zx::MonotonicInstant,
646    ) -> Result<fidl::Rights, fidl::Error> {
647        let _response = self
648            .client
649            .send_query::<ClosedTargetGetHandleRightsRequest, ClosedTargetGetHandleRightsResponse>(
650                (handle,),
651                0x1098d82f79effbe8,
652                fidl::encoding::DynamicFlags::empty(),
653                ___deadline,
654            )?;
655        Ok(_response.rights)
656    }
657
658    pub fn r#get_signalable_event_rights(
659        &self,
660        mut handle: fidl::Event,
661        ___deadline: zx::MonotonicInstant,
662    ) -> Result<fidl::Rights, fidl::Error> {
663        let _response = self.client.send_query::<
664            ClosedTargetGetSignalableEventRightsRequest,
665            ClosedTargetGetSignalableEventRightsResponse,
666        >(
667            (handle,),
668            0x698c31448fd5daf,
669            fidl::encoding::DynamicFlags::empty(),
670            ___deadline,
671        )?;
672        Ok(_response.rights)
673    }
674
675    pub fn r#echo_as_transferable_signalable_event(
676        &self,
677        mut handle: fidl::NullableHandle,
678        ___deadline: zx::MonotonicInstant,
679    ) -> Result<fidl::Event, fidl::Error> {
680        let _response = self.client.send_query::<
681            ClosedTargetEchoAsTransferableSignalableEventRequest,
682            ClosedTargetEchoAsTransferableSignalableEventResponse,
683        >(
684            (handle,),
685            0x5ec627bdc2e02ca0,
686            fidl::encoding::DynamicFlags::empty(),
687            ___deadline,
688        )?;
689        Ok(_response.handle)
690    }
691
692    pub fn r#byte_vector_size(
693        &self,
694        mut vec: &[u8],
695        ___deadline: zx::MonotonicInstant,
696    ) -> Result<u32, fidl::Error> {
697        let _response = self
698            .client
699            .send_query::<ClosedTargetByteVectorSizeRequest, ClosedTargetByteVectorSizeResponse>(
700                (vec,),
701                0x104b2f9aa8b7fe25,
702                fidl::encoding::DynamicFlags::empty(),
703                ___deadline,
704            )?;
705        Ok(_response.n)
706    }
707
708    pub fn r#handle_vector_size(
709        &self,
710        mut vec: Vec<fidl::Event>,
711        ___deadline: zx::MonotonicInstant,
712    ) -> Result<u32, fidl::Error> {
713        let _response = self.client.send_query::<
714            ClosedTargetHandleVectorSizeRequest,
715            ClosedTargetHandleVectorSizeResponse,
716        >(
717            (vec.as_mut(),),
718            0x4c1ac83570a98537,
719            fidl::encoding::DynamicFlags::empty(),
720            ___deadline,
721        )?;
722        Ok(_response.n)
723    }
724
725    pub fn r#create_n_byte_vector(
726        &self,
727        mut n: u32,
728        ___deadline: zx::MonotonicInstant,
729    ) -> Result<Vec<u8>, fidl::Error> {
730        let _response = self.client.send_query::<
731            ClosedTargetCreateNByteVectorRequest,
732            ClosedTargetCreateNByteVectorResponse,
733        >(
734            (n,),
735            0x1ecd88ef664e9c61,
736            fidl::encoding::DynamicFlags::empty(),
737            ___deadline,
738        )?;
739        Ok(_response.vec)
740    }
741
742    pub fn r#create_n_handle_vector(
743        &self,
744        mut n: u32,
745        ___deadline: zx::MonotonicInstant,
746    ) -> Result<Vec<fidl::Event>, fidl::Error> {
747        let _response = self.client.send_query::<
748            ClosedTargetCreateNHandleVectorRequest,
749            ClosedTargetCreateNHandleVectorResponse,
750        >(
751            (n,),
752            0x26341ba1fa66813d,
753            fidl::encoding::DynamicFlags::empty(),
754            ___deadline,
755        )?;
756        Ok(_response.vec)
757    }
758}
759
760#[cfg(target_os = "fuchsia")]
761impl From<ClosedTargetSynchronousProxy> for zx::NullableHandle {
762    fn from(value: ClosedTargetSynchronousProxy) -> Self {
763        value.into_channel().into()
764    }
765}
766
767#[cfg(target_os = "fuchsia")]
768impl From<fidl::Channel> for ClosedTargetSynchronousProxy {
769    fn from(value: fidl::Channel) -> Self {
770        Self::new(value)
771    }
772}
773
774#[cfg(target_os = "fuchsia")]
775impl fidl::endpoints::FromClient for ClosedTargetSynchronousProxy {
776    type Protocol = ClosedTargetMarker;
777
778    fn from_client(value: fidl::endpoints::ClientEnd<ClosedTargetMarker>) -> Self {
779        Self::new(value.into_channel())
780    }
781}
782
783#[derive(Debug, Clone)]
784pub struct ClosedTargetProxy {
785    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
786}
787
788impl fidl::endpoints::Proxy for ClosedTargetProxy {
789    type Protocol = ClosedTargetMarker;
790
791    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
792        Self::new(inner)
793    }
794
795    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
796        self.client.into_channel().map_err(|client| Self { client })
797    }
798
799    fn as_channel(&self) -> &::fidl::AsyncChannel {
800        self.client.as_channel()
801    }
802}
803
804impl ClosedTargetProxy {
805    /// Create a new Proxy for fidl.serversuite/ClosedTarget.
806    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
807        let protocol_name = <ClosedTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
808        Self { client: fidl::client::Client::new(channel, protocol_name) }
809    }
810
811    /// Get a Stream of events from the remote end of the protocol.
812    ///
813    /// # Panics
814    ///
815    /// Panics if the event stream was already taken.
816    pub fn take_event_stream(&self) -> ClosedTargetEventStream {
817        ClosedTargetEventStream { event_receiver: self.client.take_event_receiver() }
818    }
819
820    pub fn r#one_way_no_payload(&self) -> Result<(), fidl::Error> {
821        ClosedTargetProxyInterface::r#one_way_no_payload(self)
822    }
823
824    pub fn r#two_way_no_payload(
825        &self,
826    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
827        ClosedTargetProxyInterface::r#two_way_no_payload(self)
828    }
829
830    pub fn r#two_way_struct_payload(
831        &self,
832        mut v: i8,
833    ) -> fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect> {
834        ClosedTargetProxyInterface::r#two_way_struct_payload(self, v)
835    }
836
837    pub fn r#two_way_table_payload(
838        &self,
839        mut payload: &ClosedTargetTwoWayTablePayloadRequest,
840    ) -> fidl::client::QueryResponseFut<
841        ClosedTargetTwoWayTablePayloadResponse,
842        fidl::encoding::DefaultFuchsiaResourceDialect,
843    > {
844        ClosedTargetProxyInterface::r#two_way_table_payload(self, payload)
845    }
846
847    pub fn r#two_way_union_payload(
848        &self,
849        mut payload: &ClosedTargetTwoWayUnionPayloadRequest,
850    ) -> fidl::client::QueryResponseFut<
851        ClosedTargetTwoWayUnionPayloadResponse,
852        fidl::encoding::DefaultFuchsiaResourceDialect,
853    > {
854        ClosedTargetProxyInterface::r#two_way_union_payload(self, payload)
855    }
856
857    pub fn r#two_way_result(
858        &self,
859        mut payload: &ClosedTargetTwoWayResultRequest,
860    ) -> fidl::client::QueryResponseFut<
861        ClosedTargetTwoWayResultResult,
862        fidl::encoding::DefaultFuchsiaResourceDialect,
863    > {
864        ClosedTargetProxyInterface::r#two_way_result(self, payload)
865    }
866
867    pub fn r#get_handle_rights(
868        &self,
869        mut handle: fidl::NullableHandle,
870    ) -> fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>
871    {
872        ClosedTargetProxyInterface::r#get_handle_rights(self, handle)
873    }
874
875    pub fn r#get_signalable_event_rights(
876        &self,
877        mut handle: fidl::Event,
878    ) -> fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>
879    {
880        ClosedTargetProxyInterface::r#get_signalable_event_rights(self, handle)
881    }
882
883    pub fn r#echo_as_transferable_signalable_event(
884        &self,
885        mut handle: fidl::NullableHandle,
886    ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
887    {
888        ClosedTargetProxyInterface::r#echo_as_transferable_signalable_event(self, handle)
889    }
890
891    pub fn r#byte_vector_size(
892        &self,
893        mut vec: &[u8],
894    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
895        ClosedTargetProxyInterface::r#byte_vector_size(self, vec)
896    }
897
898    pub fn r#handle_vector_size(
899        &self,
900        mut vec: Vec<fidl::Event>,
901    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
902        ClosedTargetProxyInterface::r#handle_vector_size(self, vec)
903    }
904
905    pub fn r#create_n_byte_vector(
906        &self,
907        mut n: u32,
908    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
909    {
910        ClosedTargetProxyInterface::r#create_n_byte_vector(self, n)
911    }
912
913    pub fn r#create_n_handle_vector(
914        &self,
915        mut n: u32,
916    ) -> fidl::client::QueryResponseFut<
917        Vec<fidl::Event>,
918        fidl::encoding::DefaultFuchsiaResourceDialect,
919    > {
920        ClosedTargetProxyInterface::r#create_n_handle_vector(self, n)
921    }
922}
923
924impl ClosedTargetProxyInterface for ClosedTargetProxy {
925    fn r#one_way_no_payload(&self) -> Result<(), fidl::Error> {
926        self.client.send::<fidl::encoding::EmptyPayload>(
927            (),
928            0x66bd5fe1d4c019e,
929            fidl::encoding::DynamicFlags::empty(),
930        )
931    }
932
933    type TwoWayNoPayloadResponseFut =
934        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
935    fn r#two_way_no_payload(&self) -> Self::TwoWayNoPayloadResponseFut {
936        fn _decode(
937            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
938        ) -> Result<(), fidl::Error> {
939            let _response = fidl::client::decode_transaction_body::<
940                fidl::encoding::EmptyPayload,
941                fidl::encoding::DefaultFuchsiaResourceDialect,
942                0x5bda1d1c46a5ae5f,
943            >(_buf?)?;
944            Ok(_response)
945        }
946        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
947            (),
948            0x5bda1d1c46a5ae5f,
949            fidl::encoding::DynamicFlags::empty(),
950            _decode,
951        )
952    }
953
954    type TwoWayStructPayloadResponseFut =
955        fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect>;
956    fn r#two_way_struct_payload(&self, mut v: i8) -> Self::TwoWayStructPayloadResponseFut {
957        fn _decode(
958            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
959        ) -> Result<i8, fidl::Error> {
960            let _response = fidl::client::decode_transaction_body::<
961                ClosedTargetTwoWayStructPayloadResponse,
962                fidl::encoding::DefaultFuchsiaResourceDialect,
963                0x313769ab1b770c90,
964            >(_buf?)?;
965            Ok(_response.v)
966        }
967        self.client.send_query_and_decode::<ClosedTargetTwoWayStructPayloadRequest, i8>(
968            (v,),
969            0x313769ab1b770c90,
970            fidl::encoding::DynamicFlags::empty(),
971            _decode,
972        )
973    }
974
975    type TwoWayTablePayloadResponseFut = fidl::client::QueryResponseFut<
976        ClosedTargetTwoWayTablePayloadResponse,
977        fidl::encoding::DefaultFuchsiaResourceDialect,
978    >;
979    fn r#two_way_table_payload(
980        &self,
981        mut payload: &ClosedTargetTwoWayTablePayloadRequest,
982    ) -> Self::TwoWayTablePayloadResponseFut {
983        fn _decode(
984            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
985        ) -> Result<ClosedTargetTwoWayTablePayloadResponse, fidl::Error> {
986            let _response = fidl::client::decode_transaction_body::<
987                ClosedTargetTwoWayTablePayloadResponse,
988                fidl::encoding::DefaultFuchsiaResourceDialect,
989                0x631f7f27b6872baa,
990            >(_buf?)?;
991            Ok(_response)
992        }
993        self.client.send_query_and_decode::<
994            ClosedTargetTwoWayTablePayloadRequest,
995            ClosedTargetTwoWayTablePayloadResponse,
996        >(
997            payload,
998            0x631f7f27b6872baa,
999            fidl::encoding::DynamicFlags::empty(),
1000            _decode,
1001        )
1002    }
1003
1004    type TwoWayUnionPayloadResponseFut = fidl::client::QueryResponseFut<
1005        ClosedTargetTwoWayUnionPayloadResponse,
1006        fidl::encoding::DefaultFuchsiaResourceDialect,
1007    >;
1008    fn r#two_way_union_payload(
1009        &self,
1010        mut payload: &ClosedTargetTwoWayUnionPayloadRequest,
1011    ) -> Self::TwoWayUnionPayloadResponseFut {
1012        fn _decode(
1013            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1014        ) -> Result<ClosedTargetTwoWayUnionPayloadResponse, fidl::Error> {
1015            let _response = fidl::client::decode_transaction_body::<
1016                ClosedTargetTwoWayUnionPayloadResponse,
1017                fidl::encoding::DefaultFuchsiaResourceDialect,
1018                0x77d0365370536dba,
1019            >(_buf?)?;
1020            Ok(_response)
1021        }
1022        self.client.send_query_and_decode::<
1023            ClosedTargetTwoWayUnionPayloadRequest,
1024            ClosedTargetTwoWayUnionPayloadResponse,
1025        >(
1026            payload,
1027            0x77d0365370536dba,
1028            fidl::encoding::DynamicFlags::empty(),
1029            _decode,
1030        )
1031    }
1032
1033    type TwoWayResultResponseFut = fidl::client::QueryResponseFut<
1034        ClosedTargetTwoWayResultResult,
1035        fidl::encoding::DefaultFuchsiaResourceDialect,
1036    >;
1037    fn r#two_way_result(
1038        &self,
1039        mut payload: &ClosedTargetTwoWayResultRequest,
1040    ) -> Self::TwoWayResultResponseFut {
1041        fn _decode(
1042            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1043        ) -> Result<ClosedTargetTwoWayResultResult, fidl::Error> {
1044            let _response = fidl::client::decode_transaction_body::<
1045                fidl::encoding::ResultType<ClosedTargetTwoWayResultResponse, u32>,
1046                fidl::encoding::DefaultFuchsiaResourceDialect,
1047                0xb32549e6f50894c,
1048            >(_buf?)?;
1049            Ok(_response.map(|x| x.payload))
1050        }
1051        self.client.send_query_and_decode::<
1052            ClosedTargetTwoWayResultRequest,
1053            ClosedTargetTwoWayResultResult,
1054        >(
1055            payload,
1056            0xb32549e6f50894c,
1057            fidl::encoding::DynamicFlags::empty(),
1058            _decode,
1059        )
1060    }
1061
1062    type GetHandleRightsResponseFut =
1063        fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>;
1064    fn r#get_handle_rights(
1065        &self,
1066        mut handle: fidl::NullableHandle,
1067    ) -> Self::GetHandleRightsResponseFut {
1068        fn _decode(
1069            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1070        ) -> Result<fidl::Rights, fidl::Error> {
1071            let _response = fidl::client::decode_transaction_body::<
1072                ClosedTargetGetHandleRightsResponse,
1073                fidl::encoding::DefaultFuchsiaResourceDialect,
1074                0x1098d82f79effbe8,
1075            >(_buf?)?;
1076            Ok(_response.rights)
1077        }
1078        self.client.send_query_and_decode::<ClosedTargetGetHandleRightsRequest, fidl::Rights>(
1079            (handle,),
1080            0x1098d82f79effbe8,
1081            fidl::encoding::DynamicFlags::empty(),
1082            _decode,
1083        )
1084    }
1085
1086    type GetSignalableEventRightsResponseFut =
1087        fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>;
1088    fn r#get_signalable_event_rights(
1089        &self,
1090        mut handle: fidl::Event,
1091    ) -> Self::GetSignalableEventRightsResponseFut {
1092        fn _decode(
1093            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1094        ) -> Result<fidl::Rights, fidl::Error> {
1095            let _response = fidl::client::decode_transaction_body::<
1096                ClosedTargetGetSignalableEventRightsResponse,
1097                fidl::encoding::DefaultFuchsiaResourceDialect,
1098                0x698c31448fd5daf,
1099            >(_buf?)?;
1100            Ok(_response.rights)
1101        }
1102        self.client
1103            .send_query_and_decode::<ClosedTargetGetSignalableEventRightsRequest, fidl::Rights>(
1104                (handle,),
1105                0x698c31448fd5daf,
1106                fidl::encoding::DynamicFlags::empty(),
1107                _decode,
1108            )
1109    }
1110
1111    type EchoAsTransferableSignalableEventResponseFut =
1112        fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
1113    fn r#echo_as_transferable_signalable_event(
1114        &self,
1115        mut handle: fidl::NullableHandle,
1116    ) -> Self::EchoAsTransferableSignalableEventResponseFut {
1117        fn _decode(
1118            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1119        ) -> Result<fidl::Event, fidl::Error> {
1120            let _response = fidl::client::decode_transaction_body::<
1121                ClosedTargetEchoAsTransferableSignalableEventResponse,
1122                fidl::encoding::DefaultFuchsiaResourceDialect,
1123                0x5ec627bdc2e02ca0,
1124            >(_buf?)?;
1125            Ok(_response.handle)
1126        }
1127        self.client.send_query_and_decode::<
1128            ClosedTargetEchoAsTransferableSignalableEventRequest,
1129            fidl::Event,
1130        >(
1131            (handle,),
1132            0x5ec627bdc2e02ca0,
1133            fidl::encoding::DynamicFlags::empty(),
1134            _decode,
1135        )
1136    }
1137
1138    type ByteVectorSizeResponseFut =
1139        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1140    fn r#byte_vector_size(&self, mut vec: &[u8]) -> Self::ByteVectorSizeResponseFut {
1141        fn _decode(
1142            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1143        ) -> Result<u32, fidl::Error> {
1144            let _response = fidl::client::decode_transaction_body::<
1145                ClosedTargetByteVectorSizeResponse,
1146                fidl::encoding::DefaultFuchsiaResourceDialect,
1147                0x104b2f9aa8b7fe25,
1148            >(_buf?)?;
1149            Ok(_response.n)
1150        }
1151        self.client.send_query_and_decode::<ClosedTargetByteVectorSizeRequest, u32>(
1152            (vec,),
1153            0x104b2f9aa8b7fe25,
1154            fidl::encoding::DynamicFlags::empty(),
1155            _decode,
1156        )
1157    }
1158
1159    type HandleVectorSizeResponseFut =
1160        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1161    fn r#handle_vector_size(&self, mut vec: Vec<fidl::Event>) -> Self::HandleVectorSizeResponseFut {
1162        fn _decode(
1163            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1164        ) -> Result<u32, fidl::Error> {
1165            let _response = fidl::client::decode_transaction_body::<
1166                ClosedTargetHandleVectorSizeResponse,
1167                fidl::encoding::DefaultFuchsiaResourceDialect,
1168                0x4c1ac83570a98537,
1169            >(_buf?)?;
1170            Ok(_response.n)
1171        }
1172        self.client.send_query_and_decode::<ClosedTargetHandleVectorSizeRequest, u32>(
1173            (vec.as_mut(),),
1174            0x4c1ac83570a98537,
1175            fidl::encoding::DynamicFlags::empty(),
1176            _decode,
1177        )
1178    }
1179
1180    type CreateNByteVectorResponseFut =
1181        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
1182    fn r#create_n_byte_vector(&self, mut n: u32) -> Self::CreateNByteVectorResponseFut {
1183        fn _decode(
1184            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1185        ) -> Result<Vec<u8>, fidl::Error> {
1186            let _response = fidl::client::decode_transaction_body::<
1187                ClosedTargetCreateNByteVectorResponse,
1188                fidl::encoding::DefaultFuchsiaResourceDialect,
1189                0x1ecd88ef664e9c61,
1190            >(_buf?)?;
1191            Ok(_response.vec)
1192        }
1193        self.client.send_query_and_decode::<ClosedTargetCreateNByteVectorRequest, Vec<u8>>(
1194            (n,),
1195            0x1ecd88ef664e9c61,
1196            fidl::encoding::DynamicFlags::empty(),
1197            _decode,
1198        )
1199    }
1200
1201    type CreateNHandleVectorResponseFut = fidl::client::QueryResponseFut<
1202        Vec<fidl::Event>,
1203        fidl::encoding::DefaultFuchsiaResourceDialect,
1204    >;
1205    fn r#create_n_handle_vector(&self, mut n: u32) -> Self::CreateNHandleVectorResponseFut {
1206        fn _decode(
1207            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1208        ) -> Result<Vec<fidl::Event>, fidl::Error> {
1209            let _response = fidl::client::decode_transaction_body::<
1210                ClosedTargetCreateNHandleVectorResponse,
1211                fidl::encoding::DefaultFuchsiaResourceDialect,
1212                0x26341ba1fa66813d,
1213            >(_buf?)?;
1214            Ok(_response.vec)
1215        }
1216        self.client
1217            .send_query_and_decode::<ClosedTargetCreateNHandleVectorRequest, Vec<fidl::Event>>(
1218                (n,),
1219                0x26341ba1fa66813d,
1220                fidl::encoding::DynamicFlags::empty(),
1221                _decode,
1222            )
1223    }
1224}
1225
1226pub struct ClosedTargetEventStream {
1227    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1228}
1229
1230impl std::marker::Unpin for ClosedTargetEventStream {}
1231
1232impl futures::stream::FusedStream for ClosedTargetEventStream {
1233    fn is_terminated(&self) -> bool {
1234        self.event_receiver.is_terminated()
1235    }
1236}
1237
1238impl futures::Stream for ClosedTargetEventStream {
1239    type Item = Result<ClosedTargetEvent, fidl::Error>;
1240
1241    fn poll_next(
1242        mut self: std::pin::Pin<&mut Self>,
1243        cx: &mut std::task::Context<'_>,
1244    ) -> std::task::Poll<Option<Self::Item>> {
1245        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1246            &mut self.event_receiver,
1247            cx
1248        )?) {
1249            Some(buf) => std::task::Poll::Ready(Some(ClosedTargetEvent::decode(buf))),
1250            None => std::task::Poll::Ready(None),
1251        }
1252    }
1253}
1254
1255#[derive(Debug)]
1256pub enum ClosedTargetEvent {}
1257
1258impl ClosedTargetEvent {
1259    /// Decodes a message buffer as a [`ClosedTargetEvent`].
1260    fn decode(
1261        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1262    ) -> Result<ClosedTargetEvent, fidl::Error> {
1263        let (bytes, _handles) = buf.split_mut();
1264        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1265        debug_assert_eq!(tx_header.tx_id, 0);
1266        match tx_header.ordinal {
1267            _ => Err(fidl::Error::UnknownOrdinal {
1268                ordinal: tx_header.ordinal,
1269                protocol_name: <ClosedTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1270            }),
1271        }
1272    }
1273}
1274
1275/// A Stream of incoming requests for fidl.serversuite/ClosedTarget.
1276pub struct ClosedTargetRequestStream {
1277    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1278    is_terminated: bool,
1279}
1280
1281impl std::marker::Unpin for ClosedTargetRequestStream {}
1282
1283impl futures::stream::FusedStream for ClosedTargetRequestStream {
1284    fn is_terminated(&self) -> bool {
1285        self.is_terminated
1286    }
1287}
1288
1289impl fidl::endpoints::RequestStream for ClosedTargetRequestStream {
1290    type Protocol = ClosedTargetMarker;
1291    type ControlHandle = ClosedTargetControlHandle;
1292
1293    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1294        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1295    }
1296
1297    fn control_handle(&self) -> Self::ControlHandle {
1298        ClosedTargetControlHandle { inner: self.inner.clone() }
1299    }
1300
1301    fn into_inner(
1302        self,
1303    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1304    {
1305        (self.inner, self.is_terminated)
1306    }
1307
1308    fn from_inner(
1309        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1310        is_terminated: bool,
1311    ) -> Self {
1312        Self { inner, is_terminated }
1313    }
1314}
1315
1316impl futures::Stream for ClosedTargetRequestStream {
1317    type Item = Result<ClosedTargetRequest, fidl::Error>;
1318
1319    fn poll_next(
1320        mut self: std::pin::Pin<&mut Self>,
1321        cx: &mut std::task::Context<'_>,
1322    ) -> std::task::Poll<Option<Self::Item>> {
1323        let this = &mut *self;
1324        if this.inner.check_shutdown(cx) {
1325            this.is_terminated = true;
1326            return std::task::Poll::Ready(None);
1327        }
1328        if this.is_terminated {
1329            panic!("polled ClosedTargetRequestStream after completion");
1330        }
1331        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1332            |bytes, handles| {
1333                match this.inner.channel().read_etc(cx, bytes, handles) {
1334                    std::task::Poll::Ready(Ok(())) => {}
1335                    std::task::Poll::Pending => return std::task::Poll::Pending,
1336                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1337                        this.is_terminated = true;
1338                        return std::task::Poll::Ready(None);
1339                    }
1340                    std::task::Poll::Ready(Err(e)) => {
1341                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1342                            e.into(),
1343                        ))));
1344                    }
1345                }
1346
1347                // A message has been received from the channel
1348                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1349
1350                std::task::Poll::Ready(Some(match header.ordinal {
1351                    0x66bd5fe1d4c019e => {
1352                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1353                        let mut req = fidl::new_empty!(
1354                            fidl::encoding::EmptyPayload,
1355                            fidl::encoding::DefaultFuchsiaResourceDialect
1356                        );
1357                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1358                        let control_handle =
1359                            ClosedTargetControlHandle { inner: this.inner.clone() };
1360                        Ok(ClosedTargetRequest::OneWayNoPayload { control_handle })
1361                    }
1362                    0x5bda1d1c46a5ae5f => {
1363                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1364                        let mut req = fidl::new_empty!(
1365                            fidl::encoding::EmptyPayload,
1366                            fidl::encoding::DefaultFuchsiaResourceDialect
1367                        );
1368                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1369                        let control_handle =
1370                            ClosedTargetControlHandle { inner: this.inner.clone() };
1371                        Ok(ClosedTargetRequest::TwoWayNoPayload {
1372                            responder: ClosedTargetTwoWayNoPayloadResponder {
1373                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1374                                tx_id: header.tx_id,
1375                            },
1376                        })
1377                    }
1378                    0x313769ab1b770c90 => {
1379                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1380                        let mut req = fidl::new_empty!(
1381                            ClosedTargetTwoWayStructPayloadRequest,
1382                            fidl::encoding::DefaultFuchsiaResourceDialect
1383                        );
1384                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayStructPayloadRequest>(&header, _body_bytes, handles, &mut req)?;
1385                        let control_handle =
1386                            ClosedTargetControlHandle { inner: this.inner.clone() };
1387                        Ok(ClosedTargetRequest::TwoWayStructPayload {
1388                            v: req.v,
1389
1390                            responder: ClosedTargetTwoWayStructPayloadResponder {
1391                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1392                                tx_id: header.tx_id,
1393                            },
1394                        })
1395                    }
1396                    0x631f7f27b6872baa => {
1397                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1398                        let mut req = fidl::new_empty!(
1399                            ClosedTargetTwoWayTablePayloadRequest,
1400                            fidl::encoding::DefaultFuchsiaResourceDialect
1401                        );
1402                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayTablePayloadRequest>(&header, _body_bytes, handles, &mut req)?;
1403                        let control_handle =
1404                            ClosedTargetControlHandle { inner: this.inner.clone() };
1405                        Ok(ClosedTargetRequest::TwoWayTablePayload {
1406                            payload: req,
1407                            responder: ClosedTargetTwoWayTablePayloadResponder {
1408                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1409                                tx_id: header.tx_id,
1410                            },
1411                        })
1412                    }
1413                    0x77d0365370536dba => {
1414                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1415                        let mut req = fidl::new_empty!(
1416                            ClosedTargetTwoWayUnionPayloadRequest,
1417                            fidl::encoding::DefaultFuchsiaResourceDialect
1418                        );
1419                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayUnionPayloadRequest>(&header, _body_bytes, handles, &mut req)?;
1420                        let control_handle =
1421                            ClosedTargetControlHandle { inner: this.inner.clone() };
1422                        Ok(ClosedTargetRequest::TwoWayUnionPayload {
1423                            payload: req,
1424                            responder: ClosedTargetTwoWayUnionPayloadResponder {
1425                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1426                                tx_id: header.tx_id,
1427                            },
1428                        })
1429                    }
1430                    0xb32549e6f50894c => {
1431                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1432                        let mut req = fidl::new_empty!(
1433                            ClosedTargetTwoWayResultRequest,
1434                            fidl::encoding::DefaultFuchsiaResourceDialect
1435                        );
1436                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayResultRequest>(&header, _body_bytes, handles, &mut req)?;
1437                        let control_handle =
1438                            ClosedTargetControlHandle { inner: this.inner.clone() };
1439                        Ok(ClosedTargetRequest::TwoWayResult {
1440                            payload: req,
1441                            responder: ClosedTargetTwoWayResultResponder {
1442                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1443                                tx_id: header.tx_id,
1444                            },
1445                        })
1446                    }
1447                    0x1098d82f79effbe8 => {
1448                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1449                        let mut req = fidl::new_empty!(
1450                            ClosedTargetGetHandleRightsRequest,
1451                            fidl::encoding::DefaultFuchsiaResourceDialect
1452                        );
1453                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetGetHandleRightsRequest>(&header, _body_bytes, handles, &mut req)?;
1454                        let control_handle =
1455                            ClosedTargetControlHandle { inner: this.inner.clone() };
1456                        Ok(ClosedTargetRequest::GetHandleRights {
1457                            handle: req.handle,
1458
1459                            responder: ClosedTargetGetHandleRightsResponder {
1460                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1461                                tx_id: header.tx_id,
1462                            },
1463                        })
1464                    }
1465                    0x698c31448fd5daf => {
1466                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1467                        let mut req = fidl::new_empty!(
1468                            ClosedTargetGetSignalableEventRightsRequest,
1469                            fidl::encoding::DefaultFuchsiaResourceDialect
1470                        );
1471                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetGetSignalableEventRightsRequest>(&header, _body_bytes, handles, &mut req)?;
1472                        let control_handle =
1473                            ClosedTargetControlHandle { inner: this.inner.clone() };
1474                        Ok(ClosedTargetRequest::GetSignalableEventRights {
1475                            handle: req.handle,
1476
1477                            responder: ClosedTargetGetSignalableEventRightsResponder {
1478                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1479                                tx_id: header.tx_id,
1480                            },
1481                        })
1482                    }
1483                    0x5ec627bdc2e02ca0 => {
1484                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1485                        let mut req = fidl::new_empty!(
1486                            ClosedTargetEchoAsTransferableSignalableEventRequest,
1487                            fidl::encoding::DefaultFuchsiaResourceDialect
1488                        );
1489                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetEchoAsTransferableSignalableEventRequest>(&header, _body_bytes, handles, &mut req)?;
1490                        let control_handle =
1491                            ClosedTargetControlHandle { inner: this.inner.clone() };
1492                        Ok(ClosedTargetRequest::EchoAsTransferableSignalableEvent {
1493                            handle: req.handle,
1494
1495                            responder: ClosedTargetEchoAsTransferableSignalableEventResponder {
1496                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1497                                tx_id: header.tx_id,
1498                            },
1499                        })
1500                    }
1501                    0x104b2f9aa8b7fe25 => {
1502                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1503                        let mut req = fidl::new_empty!(
1504                            ClosedTargetByteVectorSizeRequest,
1505                            fidl::encoding::DefaultFuchsiaResourceDialect
1506                        );
1507                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetByteVectorSizeRequest>(&header, _body_bytes, handles, &mut req)?;
1508                        let control_handle =
1509                            ClosedTargetControlHandle { inner: this.inner.clone() };
1510                        Ok(ClosedTargetRequest::ByteVectorSize {
1511                            vec: req.vec,
1512
1513                            responder: ClosedTargetByteVectorSizeResponder {
1514                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1515                                tx_id: header.tx_id,
1516                            },
1517                        })
1518                    }
1519                    0x4c1ac83570a98537 => {
1520                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1521                        let mut req = fidl::new_empty!(
1522                            ClosedTargetHandleVectorSizeRequest,
1523                            fidl::encoding::DefaultFuchsiaResourceDialect
1524                        );
1525                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetHandleVectorSizeRequest>(&header, _body_bytes, handles, &mut req)?;
1526                        let control_handle =
1527                            ClosedTargetControlHandle { inner: this.inner.clone() };
1528                        Ok(ClosedTargetRequest::HandleVectorSize {
1529                            vec: req.vec,
1530
1531                            responder: ClosedTargetHandleVectorSizeResponder {
1532                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1533                                tx_id: header.tx_id,
1534                            },
1535                        })
1536                    }
1537                    0x1ecd88ef664e9c61 => {
1538                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1539                        let mut req = fidl::new_empty!(
1540                            ClosedTargetCreateNByteVectorRequest,
1541                            fidl::encoding::DefaultFuchsiaResourceDialect
1542                        );
1543                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetCreateNByteVectorRequest>(&header, _body_bytes, handles, &mut req)?;
1544                        let control_handle =
1545                            ClosedTargetControlHandle { inner: this.inner.clone() };
1546                        Ok(ClosedTargetRequest::CreateNByteVector {
1547                            n: req.n,
1548
1549                            responder: ClosedTargetCreateNByteVectorResponder {
1550                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1551                                tx_id: header.tx_id,
1552                            },
1553                        })
1554                    }
1555                    0x26341ba1fa66813d => {
1556                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1557                        let mut req = fidl::new_empty!(
1558                            ClosedTargetCreateNHandleVectorRequest,
1559                            fidl::encoding::DefaultFuchsiaResourceDialect
1560                        );
1561                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetCreateNHandleVectorRequest>(&header, _body_bytes, handles, &mut req)?;
1562                        let control_handle =
1563                            ClosedTargetControlHandle { inner: this.inner.clone() };
1564                        Ok(ClosedTargetRequest::CreateNHandleVector {
1565                            n: req.n,
1566
1567                            responder: ClosedTargetCreateNHandleVectorResponder {
1568                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1569                                tx_id: header.tx_id,
1570                            },
1571                        })
1572                    }
1573                    _ => Err(fidl::Error::UnknownOrdinal {
1574                        ordinal: header.ordinal,
1575                        protocol_name:
1576                            <ClosedTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1577                    }),
1578                }))
1579            },
1580        )
1581    }
1582}
1583
1584#[derive(Debug)]
1585pub enum ClosedTargetRequest {
1586    OneWayNoPayload {
1587        control_handle: ClosedTargetControlHandle,
1588    },
1589    TwoWayNoPayload {
1590        responder: ClosedTargetTwoWayNoPayloadResponder,
1591    },
1592    TwoWayStructPayload {
1593        v: i8,
1594        responder: ClosedTargetTwoWayStructPayloadResponder,
1595    },
1596    TwoWayTablePayload {
1597        payload: ClosedTargetTwoWayTablePayloadRequest,
1598        responder: ClosedTargetTwoWayTablePayloadResponder,
1599    },
1600    TwoWayUnionPayload {
1601        payload: ClosedTargetTwoWayUnionPayloadRequest,
1602        responder: ClosedTargetTwoWayUnionPayloadResponder,
1603    },
1604    TwoWayResult {
1605        payload: ClosedTargetTwoWayResultRequest,
1606        responder: ClosedTargetTwoWayResultResponder,
1607    },
1608    GetHandleRights {
1609        handle: fidl::NullableHandle,
1610        responder: ClosedTargetGetHandleRightsResponder,
1611    },
1612    GetSignalableEventRights {
1613        handle: fidl::Event,
1614        responder: ClosedTargetGetSignalableEventRightsResponder,
1615    },
1616    EchoAsTransferableSignalableEvent {
1617        handle: fidl::NullableHandle,
1618        responder: ClosedTargetEchoAsTransferableSignalableEventResponder,
1619    },
1620    ByteVectorSize {
1621        vec: Vec<u8>,
1622        responder: ClosedTargetByteVectorSizeResponder,
1623    },
1624    HandleVectorSize {
1625        vec: Vec<fidl::Event>,
1626        responder: ClosedTargetHandleVectorSizeResponder,
1627    },
1628    CreateNByteVector {
1629        n: u32,
1630        responder: ClosedTargetCreateNByteVectorResponder,
1631    },
1632    CreateNHandleVector {
1633        n: u32,
1634        responder: ClosedTargetCreateNHandleVectorResponder,
1635    },
1636}
1637
1638impl ClosedTargetRequest {
1639    #[allow(irrefutable_let_patterns)]
1640    pub fn into_one_way_no_payload(self) -> Option<(ClosedTargetControlHandle)> {
1641        if let ClosedTargetRequest::OneWayNoPayload { control_handle } = self {
1642            Some((control_handle))
1643        } else {
1644            None
1645        }
1646    }
1647
1648    #[allow(irrefutable_let_patterns)]
1649    pub fn into_two_way_no_payload(self) -> Option<(ClosedTargetTwoWayNoPayloadResponder)> {
1650        if let ClosedTargetRequest::TwoWayNoPayload { responder } = self {
1651            Some((responder))
1652        } else {
1653            None
1654        }
1655    }
1656
1657    #[allow(irrefutable_let_patterns)]
1658    pub fn into_two_way_struct_payload(
1659        self,
1660    ) -> Option<(i8, ClosedTargetTwoWayStructPayloadResponder)> {
1661        if let ClosedTargetRequest::TwoWayStructPayload { v, responder } = self {
1662            Some((v, responder))
1663        } else {
1664            None
1665        }
1666    }
1667
1668    #[allow(irrefutable_let_patterns)]
1669    pub fn into_two_way_table_payload(
1670        self,
1671    ) -> Option<(ClosedTargetTwoWayTablePayloadRequest, ClosedTargetTwoWayTablePayloadResponder)>
1672    {
1673        if let ClosedTargetRequest::TwoWayTablePayload { payload, responder } = self {
1674            Some((payload, responder))
1675        } else {
1676            None
1677        }
1678    }
1679
1680    #[allow(irrefutable_let_patterns)]
1681    pub fn into_two_way_union_payload(
1682        self,
1683    ) -> Option<(ClosedTargetTwoWayUnionPayloadRequest, ClosedTargetTwoWayUnionPayloadResponder)>
1684    {
1685        if let ClosedTargetRequest::TwoWayUnionPayload { payload, responder } = self {
1686            Some((payload, responder))
1687        } else {
1688            None
1689        }
1690    }
1691
1692    #[allow(irrefutable_let_patterns)]
1693    pub fn into_two_way_result(
1694        self,
1695    ) -> Option<(ClosedTargetTwoWayResultRequest, ClosedTargetTwoWayResultResponder)> {
1696        if let ClosedTargetRequest::TwoWayResult { payload, responder } = self {
1697            Some((payload, responder))
1698        } else {
1699            None
1700        }
1701    }
1702
1703    #[allow(irrefutable_let_patterns)]
1704    pub fn into_get_handle_rights(
1705        self,
1706    ) -> Option<(fidl::NullableHandle, ClosedTargetGetHandleRightsResponder)> {
1707        if let ClosedTargetRequest::GetHandleRights { handle, responder } = self {
1708            Some((handle, responder))
1709        } else {
1710            None
1711        }
1712    }
1713
1714    #[allow(irrefutable_let_patterns)]
1715    pub fn into_get_signalable_event_rights(
1716        self,
1717    ) -> Option<(fidl::Event, ClosedTargetGetSignalableEventRightsResponder)> {
1718        if let ClosedTargetRequest::GetSignalableEventRights { handle, responder } = self {
1719            Some((handle, responder))
1720        } else {
1721            None
1722        }
1723    }
1724
1725    #[allow(irrefutable_let_patterns)]
1726    pub fn into_echo_as_transferable_signalable_event(
1727        self,
1728    ) -> Option<(fidl::NullableHandle, ClosedTargetEchoAsTransferableSignalableEventResponder)>
1729    {
1730        if let ClosedTargetRequest::EchoAsTransferableSignalableEvent { handle, responder } = self {
1731            Some((handle, responder))
1732        } else {
1733            None
1734        }
1735    }
1736
1737    #[allow(irrefutable_let_patterns)]
1738    pub fn into_byte_vector_size(self) -> Option<(Vec<u8>, ClosedTargetByteVectorSizeResponder)> {
1739        if let ClosedTargetRequest::ByteVectorSize { vec, responder } = self {
1740            Some((vec, responder))
1741        } else {
1742            None
1743        }
1744    }
1745
1746    #[allow(irrefutable_let_patterns)]
1747    pub fn into_handle_vector_size(
1748        self,
1749    ) -> Option<(Vec<fidl::Event>, ClosedTargetHandleVectorSizeResponder)> {
1750        if let ClosedTargetRequest::HandleVectorSize { vec, responder } = self {
1751            Some((vec, responder))
1752        } else {
1753            None
1754        }
1755    }
1756
1757    #[allow(irrefutable_let_patterns)]
1758    pub fn into_create_n_byte_vector(
1759        self,
1760    ) -> Option<(u32, ClosedTargetCreateNByteVectorResponder)> {
1761        if let ClosedTargetRequest::CreateNByteVector { n, responder } = self {
1762            Some((n, responder))
1763        } else {
1764            None
1765        }
1766    }
1767
1768    #[allow(irrefutable_let_patterns)]
1769    pub fn into_create_n_handle_vector(
1770        self,
1771    ) -> Option<(u32, ClosedTargetCreateNHandleVectorResponder)> {
1772        if let ClosedTargetRequest::CreateNHandleVector { n, responder } = self {
1773            Some((n, responder))
1774        } else {
1775            None
1776        }
1777    }
1778
1779    /// Name of the method defined in FIDL
1780    pub fn method_name(&self) -> &'static str {
1781        match *self {
1782            ClosedTargetRequest::OneWayNoPayload { .. } => "one_way_no_payload",
1783            ClosedTargetRequest::TwoWayNoPayload { .. } => "two_way_no_payload",
1784            ClosedTargetRequest::TwoWayStructPayload { .. } => "two_way_struct_payload",
1785            ClosedTargetRequest::TwoWayTablePayload { .. } => "two_way_table_payload",
1786            ClosedTargetRequest::TwoWayUnionPayload { .. } => "two_way_union_payload",
1787            ClosedTargetRequest::TwoWayResult { .. } => "two_way_result",
1788            ClosedTargetRequest::GetHandleRights { .. } => "get_handle_rights",
1789            ClosedTargetRequest::GetSignalableEventRights { .. } => "get_signalable_event_rights",
1790            ClosedTargetRequest::EchoAsTransferableSignalableEvent { .. } => {
1791                "echo_as_transferable_signalable_event"
1792            }
1793            ClosedTargetRequest::ByteVectorSize { .. } => "byte_vector_size",
1794            ClosedTargetRequest::HandleVectorSize { .. } => "handle_vector_size",
1795            ClosedTargetRequest::CreateNByteVector { .. } => "create_n_byte_vector",
1796            ClosedTargetRequest::CreateNHandleVector { .. } => "create_n_handle_vector",
1797        }
1798    }
1799}
1800
1801#[derive(Debug, Clone)]
1802pub struct ClosedTargetControlHandle {
1803    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1804}
1805
1806impl fidl::endpoints::ControlHandle for ClosedTargetControlHandle {
1807    fn shutdown(&self) {
1808        self.inner.shutdown()
1809    }
1810
1811    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1812        self.inner.shutdown_with_epitaph(status)
1813    }
1814
1815    fn is_closed(&self) -> bool {
1816        self.inner.channel().is_closed()
1817    }
1818    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1819        self.inner.channel().on_closed()
1820    }
1821
1822    #[cfg(target_os = "fuchsia")]
1823    fn signal_peer(
1824        &self,
1825        clear_mask: zx::Signals,
1826        set_mask: zx::Signals,
1827    ) -> Result<(), zx_status::Status> {
1828        use fidl::Peered;
1829        self.inner.channel().signal_peer(clear_mask, set_mask)
1830    }
1831}
1832
1833impl ClosedTargetControlHandle {}
1834
1835#[must_use = "FIDL methods require a response to be sent"]
1836#[derive(Debug)]
1837pub struct ClosedTargetTwoWayNoPayloadResponder {
1838    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
1839    tx_id: u32,
1840}
1841
1842/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
1843/// if the responder is dropped without sending a response, so that the client
1844/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1845impl std::ops::Drop for ClosedTargetTwoWayNoPayloadResponder {
1846    fn drop(&mut self) {
1847        self.control_handle.shutdown();
1848        // Safety: drops once, never accessed again
1849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1850    }
1851}
1852
1853impl fidl::endpoints::Responder for ClosedTargetTwoWayNoPayloadResponder {
1854    type ControlHandle = ClosedTargetControlHandle;
1855
1856    fn control_handle(&self) -> &ClosedTargetControlHandle {
1857        &self.control_handle
1858    }
1859
1860    fn drop_without_shutdown(mut self) {
1861        // Safety: drops once, never accessed again due to mem::forget
1862        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1863        // Prevent Drop from running (which would shut down the channel)
1864        std::mem::forget(self);
1865    }
1866}
1867
1868impl ClosedTargetTwoWayNoPayloadResponder {
1869    /// Sends a response to the FIDL transaction.
1870    ///
1871    /// Sets the channel to shutdown if an error occurs.
1872    pub fn send(self) -> Result<(), fidl::Error> {
1873        let _result = self.send_raw();
1874        if _result.is_err() {
1875            self.control_handle.shutdown();
1876        }
1877        self.drop_without_shutdown();
1878        _result
1879    }
1880
1881    /// Similar to "send" but does not shutdown the channel if an error occurs.
1882    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1883        let _result = self.send_raw();
1884        self.drop_without_shutdown();
1885        _result
1886    }
1887
1888    fn send_raw(&self) -> Result<(), fidl::Error> {
1889        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1890            (),
1891            self.tx_id,
1892            0x5bda1d1c46a5ae5f,
1893            fidl::encoding::DynamicFlags::empty(),
1894        )
1895    }
1896}
1897
1898#[must_use = "FIDL methods require a response to be sent"]
1899#[derive(Debug)]
1900pub struct ClosedTargetTwoWayStructPayloadResponder {
1901    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
1902    tx_id: u32,
1903}
1904
1905/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
1906/// if the responder is dropped without sending a response, so that the client
1907/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1908impl std::ops::Drop for ClosedTargetTwoWayStructPayloadResponder {
1909    fn drop(&mut self) {
1910        self.control_handle.shutdown();
1911        // Safety: drops once, never accessed again
1912        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1913    }
1914}
1915
1916impl fidl::endpoints::Responder for ClosedTargetTwoWayStructPayloadResponder {
1917    type ControlHandle = ClosedTargetControlHandle;
1918
1919    fn control_handle(&self) -> &ClosedTargetControlHandle {
1920        &self.control_handle
1921    }
1922
1923    fn drop_without_shutdown(mut self) {
1924        // Safety: drops once, never accessed again due to mem::forget
1925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1926        // Prevent Drop from running (which would shut down the channel)
1927        std::mem::forget(self);
1928    }
1929}
1930
1931impl ClosedTargetTwoWayStructPayloadResponder {
1932    /// Sends a response to the FIDL transaction.
1933    ///
1934    /// Sets the channel to shutdown if an error occurs.
1935    pub fn send(self, mut v: i8) -> Result<(), fidl::Error> {
1936        let _result = self.send_raw(v);
1937        if _result.is_err() {
1938            self.control_handle.shutdown();
1939        }
1940        self.drop_without_shutdown();
1941        _result
1942    }
1943
1944    /// Similar to "send" but does not shutdown the channel if an error occurs.
1945    pub fn send_no_shutdown_on_err(self, mut v: i8) -> Result<(), fidl::Error> {
1946        let _result = self.send_raw(v);
1947        self.drop_without_shutdown();
1948        _result
1949    }
1950
1951    fn send_raw(&self, mut v: i8) -> Result<(), fidl::Error> {
1952        self.control_handle.inner.send::<ClosedTargetTwoWayStructPayloadResponse>(
1953            (v,),
1954            self.tx_id,
1955            0x313769ab1b770c90,
1956            fidl::encoding::DynamicFlags::empty(),
1957        )
1958    }
1959}
1960
1961#[must_use = "FIDL methods require a response to be sent"]
1962#[derive(Debug)]
1963pub struct ClosedTargetTwoWayTablePayloadResponder {
1964    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
1965    tx_id: u32,
1966}
1967
1968/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
1969/// if the responder is dropped without sending a response, so that the client
1970/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1971impl std::ops::Drop for ClosedTargetTwoWayTablePayloadResponder {
1972    fn drop(&mut self) {
1973        self.control_handle.shutdown();
1974        // Safety: drops once, never accessed again
1975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1976    }
1977}
1978
1979impl fidl::endpoints::Responder for ClosedTargetTwoWayTablePayloadResponder {
1980    type ControlHandle = ClosedTargetControlHandle;
1981
1982    fn control_handle(&self) -> &ClosedTargetControlHandle {
1983        &self.control_handle
1984    }
1985
1986    fn drop_without_shutdown(mut self) {
1987        // Safety: drops once, never accessed again due to mem::forget
1988        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1989        // Prevent Drop from running (which would shut down the channel)
1990        std::mem::forget(self);
1991    }
1992}
1993
1994impl ClosedTargetTwoWayTablePayloadResponder {
1995    /// Sends a response to the FIDL transaction.
1996    ///
1997    /// Sets the channel to shutdown if an error occurs.
1998    pub fn send(
1999        self,
2000        mut payload: &ClosedTargetTwoWayTablePayloadResponse,
2001    ) -> Result<(), fidl::Error> {
2002        let _result = self.send_raw(payload);
2003        if _result.is_err() {
2004            self.control_handle.shutdown();
2005        }
2006        self.drop_without_shutdown();
2007        _result
2008    }
2009
2010    /// Similar to "send" but does not shutdown the channel if an error occurs.
2011    pub fn send_no_shutdown_on_err(
2012        self,
2013        mut payload: &ClosedTargetTwoWayTablePayloadResponse,
2014    ) -> Result<(), fidl::Error> {
2015        let _result = self.send_raw(payload);
2016        self.drop_without_shutdown();
2017        _result
2018    }
2019
2020    fn send_raw(
2021        &self,
2022        mut payload: &ClosedTargetTwoWayTablePayloadResponse,
2023    ) -> Result<(), fidl::Error> {
2024        self.control_handle.inner.send::<ClosedTargetTwoWayTablePayloadResponse>(
2025            payload,
2026            self.tx_id,
2027            0x631f7f27b6872baa,
2028            fidl::encoding::DynamicFlags::empty(),
2029        )
2030    }
2031}
2032
2033#[must_use = "FIDL methods require a response to be sent"]
2034#[derive(Debug)]
2035pub struct ClosedTargetTwoWayUnionPayloadResponder {
2036    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2037    tx_id: u32,
2038}
2039
2040/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2041/// if the responder is dropped without sending a response, so that the client
2042/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2043impl std::ops::Drop for ClosedTargetTwoWayUnionPayloadResponder {
2044    fn drop(&mut self) {
2045        self.control_handle.shutdown();
2046        // Safety: drops once, never accessed again
2047        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2048    }
2049}
2050
2051impl fidl::endpoints::Responder for ClosedTargetTwoWayUnionPayloadResponder {
2052    type ControlHandle = ClosedTargetControlHandle;
2053
2054    fn control_handle(&self) -> &ClosedTargetControlHandle {
2055        &self.control_handle
2056    }
2057
2058    fn drop_without_shutdown(mut self) {
2059        // Safety: drops once, never accessed again due to mem::forget
2060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2061        // Prevent Drop from running (which would shut down the channel)
2062        std::mem::forget(self);
2063    }
2064}
2065
2066impl ClosedTargetTwoWayUnionPayloadResponder {
2067    /// Sends a response to the FIDL transaction.
2068    ///
2069    /// Sets the channel to shutdown if an error occurs.
2070    pub fn send(
2071        self,
2072        mut payload: &ClosedTargetTwoWayUnionPayloadResponse,
2073    ) -> Result<(), fidl::Error> {
2074        let _result = self.send_raw(payload);
2075        if _result.is_err() {
2076            self.control_handle.shutdown();
2077        }
2078        self.drop_without_shutdown();
2079        _result
2080    }
2081
2082    /// Similar to "send" but does not shutdown the channel if an error occurs.
2083    pub fn send_no_shutdown_on_err(
2084        self,
2085        mut payload: &ClosedTargetTwoWayUnionPayloadResponse,
2086    ) -> Result<(), fidl::Error> {
2087        let _result = self.send_raw(payload);
2088        self.drop_without_shutdown();
2089        _result
2090    }
2091
2092    fn send_raw(
2093        &self,
2094        mut payload: &ClosedTargetTwoWayUnionPayloadResponse,
2095    ) -> Result<(), fidl::Error> {
2096        self.control_handle.inner.send::<ClosedTargetTwoWayUnionPayloadResponse>(
2097            payload,
2098            self.tx_id,
2099            0x77d0365370536dba,
2100            fidl::encoding::DynamicFlags::empty(),
2101        )
2102    }
2103}
2104
2105#[must_use = "FIDL methods require a response to be sent"]
2106#[derive(Debug)]
2107pub struct ClosedTargetTwoWayResultResponder {
2108    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2109    tx_id: u32,
2110}
2111
2112/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2113/// if the responder is dropped without sending a response, so that the client
2114/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2115impl std::ops::Drop for ClosedTargetTwoWayResultResponder {
2116    fn drop(&mut self) {
2117        self.control_handle.shutdown();
2118        // Safety: drops once, never accessed again
2119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2120    }
2121}
2122
2123impl fidl::endpoints::Responder for ClosedTargetTwoWayResultResponder {
2124    type ControlHandle = ClosedTargetControlHandle;
2125
2126    fn control_handle(&self) -> &ClosedTargetControlHandle {
2127        &self.control_handle
2128    }
2129
2130    fn drop_without_shutdown(mut self) {
2131        // Safety: drops once, never accessed again due to mem::forget
2132        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2133        // Prevent Drop from running (which would shut down the channel)
2134        std::mem::forget(self);
2135    }
2136}
2137
2138impl ClosedTargetTwoWayResultResponder {
2139    /// Sends a response to the FIDL transaction.
2140    ///
2141    /// Sets the channel to shutdown if an error occurs.
2142    pub fn send(self, mut result: Result<&str, u32>) -> Result<(), fidl::Error> {
2143        let _result = self.send_raw(result);
2144        if _result.is_err() {
2145            self.control_handle.shutdown();
2146        }
2147        self.drop_without_shutdown();
2148        _result
2149    }
2150
2151    /// Similar to "send" but does not shutdown the channel if an error occurs.
2152    pub fn send_no_shutdown_on_err(self, mut result: Result<&str, u32>) -> Result<(), fidl::Error> {
2153        let _result = self.send_raw(result);
2154        self.drop_without_shutdown();
2155        _result
2156    }
2157
2158    fn send_raw(&self, mut result: Result<&str, u32>) -> Result<(), fidl::Error> {
2159        self.control_handle
2160            .inner
2161            .send::<fidl::encoding::ResultType<ClosedTargetTwoWayResultResponse, u32>>(
2162                result.map(|payload| (payload,)),
2163                self.tx_id,
2164                0xb32549e6f50894c,
2165                fidl::encoding::DynamicFlags::empty(),
2166            )
2167    }
2168}
2169
2170#[must_use = "FIDL methods require a response to be sent"]
2171#[derive(Debug)]
2172pub struct ClosedTargetGetHandleRightsResponder {
2173    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2174    tx_id: u32,
2175}
2176
2177/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2178/// if the responder is dropped without sending a response, so that the client
2179/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2180impl std::ops::Drop for ClosedTargetGetHandleRightsResponder {
2181    fn drop(&mut self) {
2182        self.control_handle.shutdown();
2183        // Safety: drops once, never accessed again
2184        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2185    }
2186}
2187
2188impl fidl::endpoints::Responder for ClosedTargetGetHandleRightsResponder {
2189    type ControlHandle = ClosedTargetControlHandle;
2190
2191    fn control_handle(&self) -> &ClosedTargetControlHandle {
2192        &self.control_handle
2193    }
2194
2195    fn drop_without_shutdown(mut self) {
2196        // Safety: drops once, never accessed again due to mem::forget
2197        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2198        // Prevent Drop from running (which would shut down the channel)
2199        std::mem::forget(self);
2200    }
2201}
2202
2203impl ClosedTargetGetHandleRightsResponder {
2204    /// Sends a response to the FIDL transaction.
2205    ///
2206    /// Sets the channel to shutdown if an error occurs.
2207    pub fn send(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
2208        let _result = self.send_raw(rights);
2209        if _result.is_err() {
2210            self.control_handle.shutdown();
2211        }
2212        self.drop_without_shutdown();
2213        _result
2214    }
2215
2216    /// Similar to "send" but does not shutdown the channel if an error occurs.
2217    pub fn send_no_shutdown_on_err(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
2218        let _result = self.send_raw(rights);
2219        self.drop_without_shutdown();
2220        _result
2221    }
2222
2223    fn send_raw(&self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
2224        self.control_handle.inner.send::<ClosedTargetGetHandleRightsResponse>(
2225            (rights,),
2226            self.tx_id,
2227            0x1098d82f79effbe8,
2228            fidl::encoding::DynamicFlags::empty(),
2229        )
2230    }
2231}
2232
2233#[must_use = "FIDL methods require a response to be sent"]
2234#[derive(Debug)]
2235pub struct ClosedTargetGetSignalableEventRightsResponder {
2236    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2237    tx_id: u32,
2238}
2239
2240/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2241/// if the responder is dropped without sending a response, so that the client
2242/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2243impl std::ops::Drop for ClosedTargetGetSignalableEventRightsResponder {
2244    fn drop(&mut self) {
2245        self.control_handle.shutdown();
2246        // Safety: drops once, never accessed again
2247        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2248    }
2249}
2250
2251impl fidl::endpoints::Responder for ClosedTargetGetSignalableEventRightsResponder {
2252    type ControlHandle = ClosedTargetControlHandle;
2253
2254    fn control_handle(&self) -> &ClosedTargetControlHandle {
2255        &self.control_handle
2256    }
2257
2258    fn drop_without_shutdown(mut self) {
2259        // Safety: drops once, never accessed again due to mem::forget
2260        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2261        // Prevent Drop from running (which would shut down the channel)
2262        std::mem::forget(self);
2263    }
2264}
2265
2266impl ClosedTargetGetSignalableEventRightsResponder {
2267    /// Sends a response to the FIDL transaction.
2268    ///
2269    /// Sets the channel to shutdown if an error occurs.
2270    pub fn send(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
2271        let _result = self.send_raw(rights);
2272        if _result.is_err() {
2273            self.control_handle.shutdown();
2274        }
2275        self.drop_without_shutdown();
2276        _result
2277    }
2278
2279    /// Similar to "send" but does not shutdown the channel if an error occurs.
2280    pub fn send_no_shutdown_on_err(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
2281        let _result = self.send_raw(rights);
2282        self.drop_without_shutdown();
2283        _result
2284    }
2285
2286    fn send_raw(&self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
2287        self.control_handle.inner.send::<ClosedTargetGetSignalableEventRightsResponse>(
2288            (rights,),
2289            self.tx_id,
2290            0x698c31448fd5daf,
2291            fidl::encoding::DynamicFlags::empty(),
2292        )
2293    }
2294}
2295
2296#[must_use = "FIDL methods require a response to be sent"]
2297#[derive(Debug)]
2298pub struct ClosedTargetEchoAsTransferableSignalableEventResponder {
2299    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2300    tx_id: u32,
2301}
2302
2303/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2304/// if the responder is dropped without sending a response, so that the client
2305/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2306impl std::ops::Drop for ClosedTargetEchoAsTransferableSignalableEventResponder {
2307    fn drop(&mut self) {
2308        self.control_handle.shutdown();
2309        // Safety: drops once, never accessed again
2310        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2311    }
2312}
2313
2314impl fidl::endpoints::Responder for ClosedTargetEchoAsTransferableSignalableEventResponder {
2315    type ControlHandle = ClosedTargetControlHandle;
2316
2317    fn control_handle(&self) -> &ClosedTargetControlHandle {
2318        &self.control_handle
2319    }
2320
2321    fn drop_without_shutdown(mut self) {
2322        // Safety: drops once, never accessed again due to mem::forget
2323        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2324        // Prevent Drop from running (which would shut down the channel)
2325        std::mem::forget(self);
2326    }
2327}
2328
2329impl ClosedTargetEchoAsTransferableSignalableEventResponder {
2330    /// Sends a response to the FIDL transaction.
2331    ///
2332    /// Sets the channel to shutdown if an error occurs.
2333    pub fn send(self, mut handle: fidl::Event) -> Result<(), fidl::Error> {
2334        let _result = self.send_raw(handle);
2335        if _result.is_err() {
2336            self.control_handle.shutdown();
2337        }
2338        self.drop_without_shutdown();
2339        _result
2340    }
2341
2342    /// Similar to "send" but does not shutdown the channel if an error occurs.
2343    pub fn send_no_shutdown_on_err(self, mut handle: fidl::Event) -> Result<(), fidl::Error> {
2344        let _result = self.send_raw(handle);
2345        self.drop_without_shutdown();
2346        _result
2347    }
2348
2349    fn send_raw(&self, mut handle: fidl::Event) -> Result<(), fidl::Error> {
2350        self.control_handle.inner.send::<ClosedTargetEchoAsTransferableSignalableEventResponse>(
2351            (handle,),
2352            self.tx_id,
2353            0x5ec627bdc2e02ca0,
2354            fidl::encoding::DynamicFlags::empty(),
2355        )
2356    }
2357}
2358
2359#[must_use = "FIDL methods require a response to be sent"]
2360#[derive(Debug)]
2361pub struct ClosedTargetByteVectorSizeResponder {
2362    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2363    tx_id: u32,
2364}
2365
2366/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2367/// if the responder is dropped without sending a response, so that the client
2368/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2369impl std::ops::Drop for ClosedTargetByteVectorSizeResponder {
2370    fn drop(&mut self) {
2371        self.control_handle.shutdown();
2372        // Safety: drops once, never accessed again
2373        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2374    }
2375}
2376
2377impl fidl::endpoints::Responder for ClosedTargetByteVectorSizeResponder {
2378    type ControlHandle = ClosedTargetControlHandle;
2379
2380    fn control_handle(&self) -> &ClosedTargetControlHandle {
2381        &self.control_handle
2382    }
2383
2384    fn drop_without_shutdown(mut self) {
2385        // Safety: drops once, never accessed again due to mem::forget
2386        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2387        // Prevent Drop from running (which would shut down the channel)
2388        std::mem::forget(self);
2389    }
2390}
2391
2392impl ClosedTargetByteVectorSizeResponder {
2393    /// Sends a response to the FIDL transaction.
2394    ///
2395    /// Sets the channel to shutdown if an error occurs.
2396    pub fn send(self, mut n: u32) -> Result<(), fidl::Error> {
2397        let _result = self.send_raw(n);
2398        if _result.is_err() {
2399            self.control_handle.shutdown();
2400        }
2401        self.drop_without_shutdown();
2402        _result
2403    }
2404
2405    /// Similar to "send" but does not shutdown the channel if an error occurs.
2406    pub fn send_no_shutdown_on_err(self, mut n: u32) -> Result<(), fidl::Error> {
2407        let _result = self.send_raw(n);
2408        self.drop_without_shutdown();
2409        _result
2410    }
2411
2412    fn send_raw(&self, mut n: u32) -> Result<(), fidl::Error> {
2413        self.control_handle.inner.send::<ClosedTargetByteVectorSizeResponse>(
2414            (n,),
2415            self.tx_id,
2416            0x104b2f9aa8b7fe25,
2417            fidl::encoding::DynamicFlags::empty(),
2418        )
2419    }
2420}
2421
2422#[must_use = "FIDL methods require a response to be sent"]
2423#[derive(Debug)]
2424pub struct ClosedTargetHandleVectorSizeResponder {
2425    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2426    tx_id: u32,
2427}
2428
2429/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2430/// if the responder is dropped without sending a response, so that the client
2431/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2432impl std::ops::Drop for ClosedTargetHandleVectorSizeResponder {
2433    fn drop(&mut self) {
2434        self.control_handle.shutdown();
2435        // Safety: drops once, never accessed again
2436        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2437    }
2438}
2439
2440impl fidl::endpoints::Responder for ClosedTargetHandleVectorSizeResponder {
2441    type ControlHandle = ClosedTargetControlHandle;
2442
2443    fn control_handle(&self) -> &ClosedTargetControlHandle {
2444        &self.control_handle
2445    }
2446
2447    fn drop_without_shutdown(mut self) {
2448        // Safety: drops once, never accessed again due to mem::forget
2449        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2450        // Prevent Drop from running (which would shut down the channel)
2451        std::mem::forget(self);
2452    }
2453}
2454
2455impl ClosedTargetHandleVectorSizeResponder {
2456    /// Sends a response to the FIDL transaction.
2457    ///
2458    /// Sets the channel to shutdown if an error occurs.
2459    pub fn send(self, mut n: u32) -> Result<(), fidl::Error> {
2460        let _result = self.send_raw(n);
2461        if _result.is_err() {
2462            self.control_handle.shutdown();
2463        }
2464        self.drop_without_shutdown();
2465        _result
2466    }
2467
2468    /// Similar to "send" but does not shutdown the channel if an error occurs.
2469    pub fn send_no_shutdown_on_err(self, mut n: u32) -> Result<(), fidl::Error> {
2470        let _result = self.send_raw(n);
2471        self.drop_without_shutdown();
2472        _result
2473    }
2474
2475    fn send_raw(&self, mut n: u32) -> Result<(), fidl::Error> {
2476        self.control_handle.inner.send::<ClosedTargetHandleVectorSizeResponse>(
2477            (n,),
2478            self.tx_id,
2479            0x4c1ac83570a98537,
2480            fidl::encoding::DynamicFlags::empty(),
2481        )
2482    }
2483}
2484
2485#[must_use = "FIDL methods require a response to be sent"]
2486#[derive(Debug)]
2487pub struct ClosedTargetCreateNByteVectorResponder {
2488    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2489    tx_id: u32,
2490}
2491
2492/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2493/// if the responder is dropped without sending a response, so that the client
2494/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2495impl std::ops::Drop for ClosedTargetCreateNByteVectorResponder {
2496    fn drop(&mut self) {
2497        self.control_handle.shutdown();
2498        // Safety: drops once, never accessed again
2499        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2500    }
2501}
2502
2503impl fidl::endpoints::Responder for ClosedTargetCreateNByteVectorResponder {
2504    type ControlHandle = ClosedTargetControlHandle;
2505
2506    fn control_handle(&self) -> &ClosedTargetControlHandle {
2507        &self.control_handle
2508    }
2509
2510    fn drop_without_shutdown(mut self) {
2511        // Safety: drops once, never accessed again due to mem::forget
2512        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2513        // Prevent Drop from running (which would shut down the channel)
2514        std::mem::forget(self);
2515    }
2516}
2517
2518impl ClosedTargetCreateNByteVectorResponder {
2519    /// Sends a response to the FIDL transaction.
2520    ///
2521    /// Sets the channel to shutdown if an error occurs.
2522    pub fn send(self, mut vec: &[u8]) -> Result<(), fidl::Error> {
2523        let _result = self.send_raw(vec);
2524        if _result.is_err() {
2525            self.control_handle.shutdown();
2526        }
2527        self.drop_without_shutdown();
2528        _result
2529    }
2530
2531    /// Similar to "send" but does not shutdown the channel if an error occurs.
2532    pub fn send_no_shutdown_on_err(self, mut vec: &[u8]) -> Result<(), fidl::Error> {
2533        let _result = self.send_raw(vec);
2534        self.drop_without_shutdown();
2535        _result
2536    }
2537
2538    fn send_raw(&self, mut vec: &[u8]) -> Result<(), fidl::Error> {
2539        self.control_handle.inner.send::<ClosedTargetCreateNByteVectorResponse>(
2540            (vec,),
2541            self.tx_id,
2542            0x1ecd88ef664e9c61,
2543            fidl::encoding::DynamicFlags::empty(),
2544        )
2545    }
2546}
2547
2548#[must_use = "FIDL methods require a response to be sent"]
2549#[derive(Debug)]
2550pub struct ClosedTargetCreateNHandleVectorResponder {
2551    control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
2552    tx_id: u32,
2553}
2554
2555/// Set the the channel to be shutdown (see [`ClosedTargetControlHandle::shutdown`])
2556/// if the responder is dropped without sending a response, so that the client
2557/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2558impl std::ops::Drop for ClosedTargetCreateNHandleVectorResponder {
2559    fn drop(&mut self) {
2560        self.control_handle.shutdown();
2561        // Safety: drops once, never accessed again
2562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2563    }
2564}
2565
2566impl fidl::endpoints::Responder for ClosedTargetCreateNHandleVectorResponder {
2567    type ControlHandle = ClosedTargetControlHandle;
2568
2569    fn control_handle(&self) -> &ClosedTargetControlHandle {
2570        &self.control_handle
2571    }
2572
2573    fn drop_without_shutdown(mut self) {
2574        // Safety: drops once, never accessed again due to mem::forget
2575        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2576        // Prevent Drop from running (which would shut down the channel)
2577        std::mem::forget(self);
2578    }
2579}
2580
2581impl ClosedTargetCreateNHandleVectorResponder {
2582    /// Sends a response to the FIDL transaction.
2583    ///
2584    /// Sets the channel to shutdown if an error occurs.
2585    pub fn send(self, mut vec: Vec<fidl::Event>) -> Result<(), fidl::Error> {
2586        let _result = self.send_raw(vec);
2587        if _result.is_err() {
2588            self.control_handle.shutdown();
2589        }
2590        self.drop_without_shutdown();
2591        _result
2592    }
2593
2594    /// Similar to "send" but does not shutdown the channel if an error occurs.
2595    pub fn send_no_shutdown_on_err(self, mut vec: Vec<fidl::Event>) -> Result<(), fidl::Error> {
2596        let _result = self.send_raw(vec);
2597        self.drop_without_shutdown();
2598        _result
2599    }
2600
2601    fn send_raw(&self, mut vec: Vec<fidl::Event>) -> Result<(), fidl::Error> {
2602        self.control_handle.inner.send::<ClosedTargetCreateNHandleVectorResponse>(
2603            (vec.as_mut(),),
2604            self.tx_id,
2605            0x26341ba1fa66813d,
2606            fidl::encoding::DynamicFlags::empty(),
2607        )
2608    }
2609}
2610
2611#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2612pub struct OpenTargetMarker;
2613
2614impl fidl::endpoints::ProtocolMarker for OpenTargetMarker {
2615    type Proxy = OpenTargetProxy;
2616    type RequestStream = OpenTargetRequestStream;
2617    #[cfg(target_os = "fuchsia")]
2618    type SynchronousProxy = OpenTargetSynchronousProxy;
2619
2620    const DEBUG_NAME: &'static str = "(anonymous) OpenTarget";
2621}
2622pub type OpenTargetStrictTwoWayErrResult = Result<(), i32>;
2623pub type OpenTargetStrictTwoWayFieldsErrResult = Result<i32, i32>;
2624pub type OpenTargetFlexibleTwoWayErrResult = Result<(), i32>;
2625pub type OpenTargetFlexibleTwoWayFieldsErrResult = Result<i32, i32>;
2626
2627pub trait OpenTargetProxyInterface: Send + Sync {
2628    fn r#strict_one_way(&self) -> Result<(), fidl::Error>;
2629    fn r#flexible_one_way(&self) -> Result<(), fidl::Error>;
2630    type StrictTwoWayResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2631    fn r#strict_two_way(&self) -> Self::StrictTwoWayResponseFut;
2632    type StrictTwoWayFieldsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
2633        + Send;
2634    fn r#strict_two_way_fields(&self, reply_with: i32) -> Self::StrictTwoWayFieldsResponseFut;
2635    type StrictTwoWayErrResponseFut: std::future::Future<Output = Result<OpenTargetStrictTwoWayErrResult, fidl::Error>>
2636        + Send;
2637    fn r#strict_two_way_err(
2638        &self,
2639        payload: &OpenTargetStrictTwoWayErrRequest,
2640    ) -> Self::StrictTwoWayErrResponseFut;
2641    type StrictTwoWayFieldsErrResponseFut: std::future::Future<Output = Result<OpenTargetStrictTwoWayFieldsErrResult, fidl::Error>>
2642        + Send;
2643    fn r#strict_two_way_fields_err(
2644        &self,
2645        payload: &OpenTargetStrictTwoWayFieldsErrRequest,
2646    ) -> Self::StrictTwoWayFieldsErrResponseFut;
2647    type FlexibleTwoWayResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2648    fn r#flexible_two_way(&self) -> Self::FlexibleTwoWayResponseFut;
2649    type FlexibleTwoWayFieldsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
2650        + Send;
2651    fn r#flexible_two_way_fields(&self, reply_with: i32) -> Self::FlexibleTwoWayFieldsResponseFut;
2652    type FlexibleTwoWayErrResponseFut: std::future::Future<Output = Result<OpenTargetFlexibleTwoWayErrResult, fidl::Error>>
2653        + Send;
2654    fn r#flexible_two_way_err(
2655        &self,
2656        payload: &OpenTargetFlexibleTwoWayErrRequest,
2657    ) -> Self::FlexibleTwoWayErrResponseFut;
2658    type FlexibleTwoWayFieldsErrResponseFut: std::future::Future<Output = Result<OpenTargetFlexibleTwoWayFieldsErrResult, fidl::Error>>
2659        + Send;
2660    fn r#flexible_two_way_fields_err(
2661        &self,
2662        payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
2663    ) -> Self::FlexibleTwoWayFieldsErrResponseFut;
2664}
2665#[derive(Debug)]
2666#[cfg(target_os = "fuchsia")]
2667pub struct OpenTargetSynchronousProxy {
2668    client: fidl::client::sync::Client,
2669}
2670
2671#[cfg(target_os = "fuchsia")]
2672impl fidl::endpoints::SynchronousProxy for OpenTargetSynchronousProxy {
2673    type Proxy = OpenTargetProxy;
2674    type Protocol = OpenTargetMarker;
2675
2676    fn from_channel(inner: fidl::Channel) -> Self {
2677        Self::new(inner)
2678    }
2679
2680    fn into_channel(self) -> fidl::Channel {
2681        self.client.into_channel()
2682    }
2683
2684    fn as_channel(&self) -> &fidl::Channel {
2685        self.client.as_channel()
2686    }
2687}
2688
2689#[cfg(target_os = "fuchsia")]
2690impl OpenTargetSynchronousProxy {
2691    pub fn new(channel: fidl::Channel) -> Self {
2692        let protocol_name = <OpenTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2693        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2694    }
2695
2696    pub fn into_channel(self) -> fidl::Channel {
2697        self.client.into_channel()
2698    }
2699
2700    /// Waits until an event arrives and returns it. It is safe for other
2701    /// threads to make concurrent requests while waiting for an event.
2702    pub fn wait_for_event(
2703        &self,
2704        deadline: zx::MonotonicInstant,
2705    ) -> Result<OpenTargetEvent, fidl::Error> {
2706        OpenTargetEvent::decode(self.client.wait_for_event(deadline)?)
2707    }
2708
2709    pub fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
2710        self.client.send::<fidl::encoding::EmptyPayload>(
2711            (),
2712            0x24dd8be3750aba9b,
2713            fidl::encoding::DynamicFlags::empty(),
2714        )
2715    }
2716
2717    pub fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
2718        self.client.send::<fidl::encoding::EmptyPayload>(
2719            (),
2720            0x421bbeb2bbc84a58,
2721            fidl::encoding::DynamicFlags::FLEXIBLE,
2722        )
2723    }
2724
2725    pub fn r#strict_two_way(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2726        let _response =
2727            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
2728                (),
2729                0x70020c582a57ef03,
2730                fidl::encoding::DynamicFlags::empty(),
2731                ___deadline,
2732            )?;
2733        Ok(_response)
2734    }
2735
2736    pub fn r#strict_two_way_fields(
2737        &self,
2738        mut reply_with: i32,
2739        ___deadline: zx::MonotonicInstant,
2740    ) -> Result<i32, fidl::Error> {
2741        let _response = self.client.send_query::<
2742            OpenTargetStrictTwoWayFieldsRequest,
2743            OpenTargetStrictTwoWayFieldsResponse,
2744        >(
2745            (reply_with,),
2746            0x2be6e1cc40008010,
2747            fidl::encoding::DynamicFlags::empty(),
2748            ___deadline,
2749        )?;
2750        Ok(_response.some_field)
2751    }
2752
2753    pub fn r#strict_two_way_err(
2754        &self,
2755        mut payload: &OpenTargetStrictTwoWayErrRequest,
2756        ___deadline: zx::MonotonicInstant,
2757    ) -> Result<OpenTargetStrictTwoWayErrResult, fidl::Error> {
2758        let _response = self.client.send_query::<
2759            OpenTargetStrictTwoWayErrRequest,
2760            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2761        >(
2762            payload,
2763            0x6efc16069ebd0b2c,
2764            fidl::encoding::DynamicFlags::empty(),
2765            ___deadline,
2766        )?;
2767        Ok(_response.map(|x| x))
2768    }
2769
2770    pub fn r#strict_two_way_fields_err(
2771        &self,
2772        mut payload: &OpenTargetStrictTwoWayFieldsErrRequest,
2773        ___deadline: zx::MonotonicInstant,
2774    ) -> Result<OpenTargetStrictTwoWayFieldsErrResult, fidl::Error> {
2775        let _response = self.client.send_query::<
2776            OpenTargetStrictTwoWayFieldsErrRequest,
2777            fidl::encoding::ResultType<OpenTargetStrictTwoWayFieldsErrResponse, i32>,
2778        >(
2779            payload,
2780            0x309c8adda770fcf0,
2781            fidl::encoding::DynamicFlags::empty(),
2782            ___deadline,
2783        )?;
2784        Ok(_response.map(|x| x.some_field))
2785    }
2786
2787    pub fn r#flexible_two_way(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2788        let _response = self.client.send_query::<
2789            fidl::encoding::EmptyPayload,
2790            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2791        >(
2792            (),
2793            0x19f932dac7810c71,
2794            fidl::encoding::DynamicFlags::FLEXIBLE,
2795            ___deadline,
2796        )?
2797        .into_result::<OpenTargetMarker>("flexible_two_way")?;
2798        Ok(_response)
2799    }
2800
2801    pub fn r#flexible_two_way_fields(
2802        &self,
2803        mut reply_with: i32,
2804        ___deadline: zx::MonotonicInstant,
2805    ) -> Result<i32, fidl::Error> {
2806        let _response = self.client.send_query::<
2807            OpenTargetFlexibleTwoWayFieldsRequest,
2808            fidl::encoding::FlexibleType<OpenTargetFlexibleTwoWayFieldsResponse>,
2809        >(
2810            (reply_with,),
2811            0x47cca5ddb4207774,
2812            fidl::encoding::DynamicFlags::FLEXIBLE,
2813            ___deadline,
2814        )?
2815        .into_result::<OpenTargetMarker>("flexible_two_way_fields")?;
2816        Ok(_response.some_field)
2817    }
2818
2819    pub fn r#flexible_two_way_err(
2820        &self,
2821        mut payload: &OpenTargetFlexibleTwoWayErrRequest,
2822        ___deadline: zx::MonotonicInstant,
2823    ) -> Result<OpenTargetFlexibleTwoWayErrResult, fidl::Error> {
2824        let _response = self.client.send_query::<
2825            OpenTargetFlexibleTwoWayErrRequest,
2826            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2827        >(
2828            payload,
2829            0x52aa19681fea3a0,
2830            fidl::encoding::DynamicFlags::FLEXIBLE,
2831            ___deadline,
2832        )?
2833        .into_result::<OpenTargetMarker>("flexible_two_way_err")?;
2834        Ok(_response.map(|x| x))
2835    }
2836
2837    pub fn r#flexible_two_way_fields_err(
2838        &self,
2839        mut payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
2840        ___deadline: zx::MonotonicInstant,
2841    ) -> Result<OpenTargetFlexibleTwoWayFieldsErrResult, fidl::Error> {
2842        let _response = self.client.send_query::<
2843            OpenTargetFlexibleTwoWayFieldsErrRequest,
2844            fidl::encoding::FlexibleResultType<OpenTargetFlexibleTwoWayFieldsErrResponse, i32>,
2845        >(
2846            payload,
2847            0x1ab7dd4c6a3650b6,
2848            fidl::encoding::DynamicFlags::FLEXIBLE,
2849            ___deadline,
2850        )?
2851        .into_result::<OpenTargetMarker>("flexible_two_way_fields_err")?;
2852        Ok(_response.map(|x| x.some_field))
2853    }
2854}
2855
2856#[cfg(target_os = "fuchsia")]
2857impl From<OpenTargetSynchronousProxy> for zx::NullableHandle {
2858    fn from(value: OpenTargetSynchronousProxy) -> Self {
2859        value.into_channel().into()
2860    }
2861}
2862
2863#[cfg(target_os = "fuchsia")]
2864impl From<fidl::Channel> for OpenTargetSynchronousProxy {
2865    fn from(value: fidl::Channel) -> Self {
2866        Self::new(value)
2867    }
2868}
2869
2870#[cfg(target_os = "fuchsia")]
2871impl fidl::endpoints::FromClient for OpenTargetSynchronousProxy {
2872    type Protocol = OpenTargetMarker;
2873
2874    fn from_client(value: fidl::endpoints::ClientEnd<OpenTargetMarker>) -> Self {
2875        Self::new(value.into_channel())
2876    }
2877}
2878
2879#[derive(Debug, Clone)]
2880pub struct OpenTargetProxy {
2881    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2882}
2883
2884impl fidl::endpoints::Proxy for OpenTargetProxy {
2885    type Protocol = OpenTargetMarker;
2886
2887    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2888        Self::new(inner)
2889    }
2890
2891    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2892        self.client.into_channel().map_err(|client| Self { client })
2893    }
2894
2895    fn as_channel(&self) -> &::fidl::AsyncChannel {
2896        self.client.as_channel()
2897    }
2898}
2899
2900impl OpenTargetProxy {
2901    /// Create a new Proxy for fidl.serversuite/OpenTarget.
2902    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2903        let protocol_name = <OpenTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2904        Self { client: fidl::client::Client::new(channel, protocol_name) }
2905    }
2906
2907    /// Get a Stream of events from the remote end of the protocol.
2908    ///
2909    /// # Panics
2910    ///
2911    /// Panics if the event stream was already taken.
2912    pub fn take_event_stream(&self) -> OpenTargetEventStream {
2913        OpenTargetEventStream { event_receiver: self.client.take_event_receiver() }
2914    }
2915
2916    pub fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
2917        OpenTargetProxyInterface::r#strict_one_way(self)
2918    }
2919
2920    pub fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
2921        OpenTargetProxyInterface::r#flexible_one_way(self)
2922    }
2923
2924    pub fn r#strict_two_way(
2925        &self,
2926    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2927        OpenTargetProxyInterface::r#strict_two_way(self)
2928    }
2929
2930    pub fn r#strict_two_way_fields(
2931        &self,
2932        mut reply_with: i32,
2933    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2934        OpenTargetProxyInterface::r#strict_two_way_fields(self, reply_with)
2935    }
2936
2937    pub fn r#strict_two_way_err(
2938        &self,
2939        mut payload: &OpenTargetStrictTwoWayErrRequest,
2940    ) -> fidl::client::QueryResponseFut<
2941        OpenTargetStrictTwoWayErrResult,
2942        fidl::encoding::DefaultFuchsiaResourceDialect,
2943    > {
2944        OpenTargetProxyInterface::r#strict_two_way_err(self, payload)
2945    }
2946
2947    pub fn r#strict_two_way_fields_err(
2948        &self,
2949        mut payload: &OpenTargetStrictTwoWayFieldsErrRequest,
2950    ) -> fidl::client::QueryResponseFut<
2951        OpenTargetStrictTwoWayFieldsErrResult,
2952        fidl::encoding::DefaultFuchsiaResourceDialect,
2953    > {
2954        OpenTargetProxyInterface::r#strict_two_way_fields_err(self, payload)
2955    }
2956
2957    pub fn r#flexible_two_way(
2958        &self,
2959    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2960        OpenTargetProxyInterface::r#flexible_two_way(self)
2961    }
2962
2963    pub fn r#flexible_two_way_fields(
2964        &self,
2965        mut reply_with: i32,
2966    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
2967        OpenTargetProxyInterface::r#flexible_two_way_fields(self, reply_with)
2968    }
2969
2970    pub fn r#flexible_two_way_err(
2971        &self,
2972        mut payload: &OpenTargetFlexibleTwoWayErrRequest,
2973    ) -> fidl::client::QueryResponseFut<
2974        OpenTargetFlexibleTwoWayErrResult,
2975        fidl::encoding::DefaultFuchsiaResourceDialect,
2976    > {
2977        OpenTargetProxyInterface::r#flexible_two_way_err(self, payload)
2978    }
2979
2980    pub fn r#flexible_two_way_fields_err(
2981        &self,
2982        mut payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
2983    ) -> fidl::client::QueryResponseFut<
2984        OpenTargetFlexibleTwoWayFieldsErrResult,
2985        fidl::encoding::DefaultFuchsiaResourceDialect,
2986    > {
2987        OpenTargetProxyInterface::r#flexible_two_way_fields_err(self, payload)
2988    }
2989}
2990
2991impl OpenTargetProxyInterface for OpenTargetProxy {
2992    fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
2993        self.client.send::<fidl::encoding::EmptyPayload>(
2994            (),
2995            0x24dd8be3750aba9b,
2996            fidl::encoding::DynamicFlags::empty(),
2997        )
2998    }
2999
3000    fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
3001        self.client.send::<fidl::encoding::EmptyPayload>(
3002            (),
3003            0x421bbeb2bbc84a58,
3004            fidl::encoding::DynamicFlags::FLEXIBLE,
3005        )
3006    }
3007
3008    type StrictTwoWayResponseFut =
3009        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3010    fn r#strict_two_way(&self) -> Self::StrictTwoWayResponseFut {
3011        fn _decode(
3012            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3013        ) -> Result<(), fidl::Error> {
3014            let _response = fidl::client::decode_transaction_body::<
3015                fidl::encoding::EmptyPayload,
3016                fidl::encoding::DefaultFuchsiaResourceDialect,
3017                0x70020c582a57ef03,
3018            >(_buf?)?;
3019            Ok(_response)
3020        }
3021        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
3022            (),
3023            0x70020c582a57ef03,
3024            fidl::encoding::DynamicFlags::empty(),
3025            _decode,
3026        )
3027    }
3028
3029    type StrictTwoWayFieldsResponseFut =
3030        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
3031    fn r#strict_two_way_fields(&self, mut reply_with: i32) -> Self::StrictTwoWayFieldsResponseFut {
3032        fn _decode(
3033            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3034        ) -> Result<i32, fidl::Error> {
3035            let _response = fidl::client::decode_transaction_body::<
3036                OpenTargetStrictTwoWayFieldsResponse,
3037                fidl::encoding::DefaultFuchsiaResourceDialect,
3038                0x2be6e1cc40008010,
3039            >(_buf?)?;
3040            Ok(_response.some_field)
3041        }
3042        self.client.send_query_and_decode::<OpenTargetStrictTwoWayFieldsRequest, i32>(
3043            (reply_with,),
3044            0x2be6e1cc40008010,
3045            fidl::encoding::DynamicFlags::empty(),
3046            _decode,
3047        )
3048    }
3049
3050    type StrictTwoWayErrResponseFut = fidl::client::QueryResponseFut<
3051        OpenTargetStrictTwoWayErrResult,
3052        fidl::encoding::DefaultFuchsiaResourceDialect,
3053    >;
3054    fn r#strict_two_way_err(
3055        &self,
3056        mut payload: &OpenTargetStrictTwoWayErrRequest,
3057    ) -> Self::StrictTwoWayErrResponseFut {
3058        fn _decode(
3059            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3060        ) -> Result<OpenTargetStrictTwoWayErrResult, fidl::Error> {
3061            let _response = fidl::client::decode_transaction_body::<
3062                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3063                fidl::encoding::DefaultFuchsiaResourceDialect,
3064                0x6efc16069ebd0b2c,
3065            >(_buf?)?;
3066            Ok(_response.map(|x| x))
3067        }
3068        self.client.send_query_and_decode::<
3069            OpenTargetStrictTwoWayErrRequest,
3070            OpenTargetStrictTwoWayErrResult,
3071        >(
3072            payload,
3073            0x6efc16069ebd0b2c,
3074            fidl::encoding::DynamicFlags::empty(),
3075            _decode,
3076        )
3077    }
3078
3079    type StrictTwoWayFieldsErrResponseFut = fidl::client::QueryResponseFut<
3080        OpenTargetStrictTwoWayFieldsErrResult,
3081        fidl::encoding::DefaultFuchsiaResourceDialect,
3082    >;
3083    fn r#strict_two_way_fields_err(
3084        &self,
3085        mut payload: &OpenTargetStrictTwoWayFieldsErrRequest,
3086    ) -> Self::StrictTwoWayFieldsErrResponseFut {
3087        fn _decode(
3088            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3089        ) -> Result<OpenTargetStrictTwoWayFieldsErrResult, fidl::Error> {
3090            let _response = fidl::client::decode_transaction_body::<
3091                fidl::encoding::ResultType<OpenTargetStrictTwoWayFieldsErrResponse, i32>,
3092                fidl::encoding::DefaultFuchsiaResourceDialect,
3093                0x309c8adda770fcf0,
3094            >(_buf?)?;
3095            Ok(_response.map(|x| x.some_field))
3096        }
3097        self.client.send_query_and_decode::<
3098            OpenTargetStrictTwoWayFieldsErrRequest,
3099            OpenTargetStrictTwoWayFieldsErrResult,
3100        >(
3101            payload,
3102            0x309c8adda770fcf0,
3103            fidl::encoding::DynamicFlags::empty(),
3104            _decode,
3105        )
3106    }
3107
3108    type FlexibleTwoWayResponseFut =
3109        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3110    fn r#flexible_two_way(&self) -> Self::FlexibleTwoWayResponseFut {
3111        fn _decode(
3112            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3113        ) -> Result<(), fidl::Error> {
3114            let _response = fidl::client::decode_transaction_body::<
3115                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3116                fidl::encoding::DefaultFuchsiaResourceDialect,
3117                0x19f932dac7810c71,
3118            >(_buf?)?
3119            .into_result::<OpenTargetMarker>("flexible_two_way")?;
3120            Ok(_response)
3121        }
3122        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
3123            (),
3124            0x19f932dac7810c71,
3125            fidl::encoding::DynamicFlags::FLEXIBLE,
3126            _decode,
3127        )
3128    }
3129
3130    type FlexibleTwoWayFieldsResponseFut =
3131        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
3132    fn r#flexible_two_way_fields(
3133        &self,
3134        mut reply_with: i32,
3135    ) -> Self::FlexibleTwoWayFieldsResponseFut {
3136        fn _decode(
3137            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3138        ) -> Result<i32, fidl::Error> {
3139            let _response = fidl::client::decode_transaction_body::<
3140                fidl::encoding::FlexibleType<OpenTargetFlexibleTwoWayFieldsResponse>,
3141                fidl::encoding::DefaultFuchsiaResourceDialect,
3142                0x47cca5ddb4207774,
3143            >(_buf?)?
3144            .into_result::<OpenTargetMarker>("flexible_two_way_fields")?;
3145            Ok(_response.some_field)
3146        }
3147        self.client.send_query_and_decode::<OpenTargetFlexibleTwoWayFieldsRequest, i32>(
3148            (reply_with,),
3149            0x47cca5ddb4207774,
3150            fidl::encoding::DynamicFlags::FLEXIBLE,
3151            _decode,
3152        )
3153    }
3154
3155    type FlexibleTwoWayErrResponseFut = fidl::client::QueryResponseFut<
3156        OpenTargetFlexibleTwoWayErrResult,
3157        fidl::encoding::DefaultFuchsiaResourceDialect,
3158    >;
3159    fn r#flexible_two_way_err(
3160        &self,
3161        mut payload: &OpenTargetFlexibleTwoWayErrRequest,
3162    ) -> Self::FlexibleTwoWayErrResponseFut {
3163        fn _decode(
3164            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3165        ) -> Result<OpenTargetFlexibleTwoWayErrResult, fidl::Error> {
3166            let _response = fidl::client::decode_transaction_body::<
3167                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
3168                fidl::encoding::DefaultFuchsiaResourceDialect,
3169                0x52aa19681fea3a0,
3170            >(_buf?)?
3171            .into_result::<OpenTargetMarker>("flexible_two_way_err")?;
3172            Ok(_response.map(|x| x))
3173        }
3174        self.client.send_query_and_decode::<
3175            OpenTargetFlexibleTwoWayErrRequest,
3176            OpenTargetFlexibleTwoWayErrResult,
3177        >(
3178            payload,
3179            0x52aa19681fea3a0,
3180            fidl::encoding::DynamicFlags::FLEXIBLE,
3181            _decode,
3182        )
3183    }
3184
3185    type FlexibleTwoWayFieldsErrResponseFut = fidl::client::QueryResponseFut<
3186        OpenTargetFlexibleTwoWayFieldsErrResult,
3187        fidl::encoding::DefaultFuchsiaResourceDialect,
3188    >;
3189    fn r#flexible_two_way_fields_err(
3190        &self,
3191        mut payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
3192    ) -> Self::FlexibleTwoWayFieldsErrResponseFut {
3193        fn _decode(
3194            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3195        ) -> Result<OpenTargetFlexibleTwoWayFieldsErrResult, fidl::Error> {
3196            let _response = fidl::client::decode_transaction_body::<
3197                fidl::encoding::FlexibleResultType<OpenTargetFlexibleTwoWayFieldsErrResponse, i32>,
3198                fidl::encoding::DefaultFuchsiaResourceDialect,
3199                0x1ab7dd4c6a3650b6,
3200            >(_buf?)?
3201            .into_result::<OpenTargetMarker>("flexible_two_way_fields_err")?;
3202            Ok(_response.map(|x| x.some_field))
3203        }
3204        self.client.send_query_and_decode::<
3205            OpenTargetFlexibleTwoWayFieldsErrRequest,
3206            OpenTargetFlexibleTwoWayFieldsErrResult,
3207        >(
3208            payload,
3209            0x1ab7dd4c6a3650b6,
3210            fidl::encoding::DynamicFlags::FLEXIBLE,
3211            _decode,
3212        )
3213    }
3214}
3215
3216pub struct OpenTargetEventStream {
3217    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3218}
3219
3220impl std::marker::Unpin for OpenTargetEventStream {}
3221
3222impl futures::stream::FusedStream for OpenTargetEventStream {
3223    fn is_terminated(&self) -> bool {
3224        self.event_receiver.is_terminated()
3225    }
3226}
3227
3228impl futures::Stream for OpenTargetEventStream {
3229    type Item = Result<OpenTargetEvent, fidl::Error>;
3230
3231    fn poll_next(
3232        mut self: std::pin::Pin<&mut Self>,
3233        cx: &mut std::task::Context<'_>,
3234    ) -> std::task::Poll<Option<Self::Item>> {
3235        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3236            &mut self.event_receiver,
3237            cx
3238        )?) {
3239            Some(buf) => std::task::Poll::Ready(Some(OpenTargetEvent::decode(buf))),
3240            None => std::task::Poll::Ready(None),
3241        }
3242    }
3243}
3244
3245#[derive(Debug)]
3246pub enum OpenTargetEvent {
3247    StrictEvent {},
3248    FlexibleEvent {},
3249    #[non_exhaustive]
3250    _UnknownEvent {
3251        /// Ordinal of the event that was sent.
3252        ordinal: u64,
3253    },
3254}
3255
3256impl OpenTargetEvent {
3257    #[allow(irrefutable_let_patterns)]
3258    pub fn into_strict_event(self) -> Option<()> {
3259        if let OpenTargetEvent::StrictEvent {} = self { Some(()) } else { None }
3260    }
3261    #[allow(irrefutable_let_patterns)]
3262    pub fn into_flexible_event(self) -> Option<()> {
3263        if let OpenTargetEvent::FlexibleEvent {} = self { Some(()) } else { None }
3264    }
3265
3266    /// Decodes a message buffer as a [`OpenTargetEvent`].
3267    fn decode(
3268        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3269    ) -> Result<OpenTargetEvent, fidl::Error> {
3270        let (bytes, _handles) = buf.split_mut();
3271        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3272        debug_assert_eq!(tx_header.tx_id, 0);
3273        match tx_header.ordinal {
3274            0x778f95d421c0685 => {
3275                let mut out = fidl::new_empty!(
3276                    fidl::encoding::EmptyPayload,
3277                    fidl::encoding::DefaultFuchsiaResourceDialect
3278                );
3279                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
3280                Ok((OpenTargetEvent::StrictEvent {}))
3281            }
3282            0x43d9ee0dca2bb33e => {
3283                let mut out = fidl::new_empty!(
3284                    fidl::encoding::EmptyPayload,
3285                    fidl::encoding::DefaultFuchsiaResourceDialect
3286                );
3287                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
3288                Ok((OpenTargetEvent::FlexibleEvent {}))
3289            }
3290            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3291                Ok(OpenTargetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3292            }
3293            _ => Err(fidl::Error::UnknownOrdinal {
3294                ordinal: tx_header.ordinal,
3295                protocol_name: <OpenTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3296            }),
3297        }
3298    }
3299}
3300
3301/// A Stream of incoming requests for fidl.serversuite/OpenTarget.
3302pub struct OpenTargetRequestStream {
3303    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3304    is_terminated: bool,
3305}
3306
3307impl std::marker::Unpin for OpenTargetRequestStream {}
3308
3309impl futures::stream::FusedStream for OpenTargetRequestStream {
3310    fn is_terminated(&self) -> bool {
3311        self.is_terminated
3312    }
3313}
3314
3315impl fidl::endpoints::RequestStream for OpenTargetRequestStream {
3316    type Protocol = OpenTargetMarker;
3317    type ControlHandle = OpenTargetControlHandle;
3318
3319    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3320        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3321    }
3322
3323    fn control_handle(&self) -> Self::ControlHandle {
3324        OpenTargetControlHandle { inner: self.inner.clone() }
3325    }
3326
3327    fn into_inner(
3328        self,
3329    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3330    {
3331        (self.inner, self.is_terminated)
3332    }
3333
3334    fn from_inner(
3335        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3336        is_terminated: bool,
3337    ) -> Self {
3338        Self { inner, is_terminated }
3339    }
3340}
3341
3342impl futures::Stream for OpenTargetRequestStream {
3343    type Item = Result<OpenTargetRequest, fidl::Error>;
3344
3345    fn poll_next(
3346        mut self: std::pin::Pin<&mut Self>,
3347        cx: &mut std::task::Context<'_>,
3348    ) -> std::task::Poll<Option<Self::Item>> {
3349        let this = &mut *self;
3350        if this.inner.check_shutdown(cx) {
3351            this.is_terminated = true;
3352            return std::task::Poll::Ready(None);
3353        }
3354        if this.is_terminated {
3355            panic!("polled OpenTargetRequestStream after completion");
3356        }
3357        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3358            |bytes, handles| {
3359                match this.inner.channel().read_etc(cx, bytes, handles) {
3360                    std::task::Poll::Ready(Ok(())) => {}
3361                    std::task::Poll::Pending => return std::task::Poll::Pending,
3362                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3363                        this.is_terminated = true;
3364                        return std::task::Poll::Ready(None);
3365                    }
3366                    std::task::Poll::Ready(Err(e)) => {
3367                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3368                            e.into(),
3369                        ))));
3370                    }
3371                }
3372
3373                // A message has been received from the channel
3374                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3375
3376                std::task::Poll::Ready(Some(match header.ordinal {
3377                    0x24dd8be3750aba9b => {
3378                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3379                        let mut req = fidl::new_empty!(
3380                            fidl::encoding::EmptyPayload,
3381                            fidl::encoding::DefaultFuchsiaResourceDialect
3382                        );
3383                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3384                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3385                        Ok(OpenTargetRequest::StrictOneWay { control_handle })
3386                    }
3387                    0x421bbeb2bbc84a58 => {
3388                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3389                        let mut req = fidl::new_empty!(
3390                            fidl::encoding::EmptyPayload,
3391                            fidl::encoding::DefaultFuchsiaResourceDialect
3392                        );
3393                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3394                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3395                        Ok(OpenTargetRequest::FlexibleOneWay { control_handle })
3396                    }
3397                    0x70020c582a57ef03 => {
3398                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3399                        let mut req = fidl::new_empty!(
3400                            fidl::encoding::EmptyPayload,
3401                            fidl::encoding::DefaultFuchsiaResourceDialect
3402                        );
3403                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3404                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3405                        Ok(OpenTargetRequest::StrictTwoWay {
3406                            responder: OpenTargetStrictTwoWayResponder {
3407                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3408                                tx_id: header.tx_id,
3409                            },
3410                        })
3411                    }
3412                    0x2be6e1cc40008010 => {
3413                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3414                        let mut req = fidl::new_empty!(
3415                            OpenTargetStrictTwoWayFieldsRequest,
3416                            fidl::encoding::DefaultFuchsiaResourceDialect
3417                        );
3418                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetStrictTwoWayFieldsRequest>(&header, _body_bytes, handles, &mut req)?;
3419                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3420                        Ok(OpenTargetRequest::StrictTwoWayFields {
3421                            reply_with: req.reply_with,
3422
3423                            responder: OpenTargetStrictTwoWayFieldsResponder {
3424                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3425                                tx_id: header.tx_id,
3426                            },
3427                        })
3428                    }
3429                    0x6efc16069ebd0b2c => {
3430                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3431                        let mut req = fidl::new_empty!(
3432                            OpenTargetStrictTwoWayErrRequest,
3433                            fidl::encoding::DefaultFuchsiaResourceDialect
3434                        );
3435                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetStrictTwoWayErrRequest>(&header, _body_bytes, handles, &mut req)?;
3436                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3437                        Ok(OpenTargetRequest::StrictTwoWayErr {
3438                            payload: req,
3439                            responder: OpenTargetStrictTwoWayErrResponder {
3440                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3441                                tx_id: header.tx_id,
3442                            },
3443                        })
3444                    }
3445                    0x309c8adda770fcf0 => {
3446                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3447                        let mut req = fidl::new_empty!(
3448                            OpenTargetStrictTwoWayFieldsErrRequest,
3449                            fidl::encoding::DefaultFuchsiaResourceDialect
3450                        );
3451                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetStrictTwoWayFieldsErrRequest>(&header, _body_bytes, handles, &mut req)?;
3452                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3453                        Ok(OpenTargetRequest::StrictTwoWayFieldsErr {
3454                            payload: req,
3455                            responder: OpenTargetStrictTwoWayFieldsErrResponder {
3456                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3457                                tx_id: header.tx_id,
3458                            },
3459                        })
3460                    }
3461                    0x19f932dac7810c71 => {
3462                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3463                        let mut req = fidl::new_empty!(
3464                            fidl::encoding::EmptyPayload,
3465                            fidl::encoding::DefaultFuchsiaResourceDialect
3466                        );
3467                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3468                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3469                        Ok(OpenTargetRequest::FlexibleTwoWay {
3470                            responder: OpenTargetFlexibleTwoWayResponder {
3471                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3472                                tx_id: header.tx_id,
3473                            },
3474                        })
3475                    }
3476                    0x47cca5ddb4207774 => {
3477                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3478                        let mut req = fidl::new_empty!(
3479                            OpenTargetFlexibleTwoWayFieldsRequest,
3480                            fidl::encoding::DefaultFuchsiaResourceDialect
3481                        );
3482                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetFlexibleTwoWayFieldsRequest>(&header, _body_bytes, handles, &mut req)?;
3483                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3484                        Ok(OpenTargetRequest::FlexibleTwoWayFields {
3485                            reply_with: req.reply_with,
3486
3487                            responder: OpenTargetFlexibleTwoWayFieldsResponder {
3488                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3489                                tx_id: header.tx_id,
3490                            },
3491                        })
3492                    }
3493                    0x52aa19681fea3a0 => {
3494                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3495                        let mut req = fidl::new_empty!(
3496                            OpenTargetFlexibleTwoWayErrRequest,
3497                            fidl::encoding::DefaultFuchsiaResourceDialect
3498                        );
3499                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetFlexibleTwoWayErrRequest>(&header, _body_bytes, handles, &mut req)?;
3500                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3501                        Ok(OpenTargetRequest::FlexibleTwoWayErr {
3502                            payload: req,
3503                            responder: OpenTargetFlexibleTwoWayErrResponder {
3504                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3505                                tx_id: header.tx_id,
3506                            },
3507                        })
3508                    }
3509                    0x1ab7dd4c6a3650b6 => {
3510                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3511                        let mut req = fidl::new_empty!(
3512                            OpenTargetFlexibleTwoWayFieldsErrRequest,
3513                            fidl::encoding::DefaultFuchsiaResourceDialect
3514                        );
3515                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetFlexibleTwoWayFieldsErrRequest>(&header, _body_bytes, handles, &mut req)?;
3516                        let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
3517                        Ok(OpenTargetRequest::FlexibleTwoWayFieldsErr {
3518                            payload: req,
3519                            responder: OpenTargetFlexibleTwoWayFieldsErrResponder {
3520                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3521                                tx_id: header.tx_id,
3522                            },
3523                        })
3524                    }
3525                    _ if header.tx_id == 0
3526                        && header
3527                            .dynamic_flags()
3528                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3529                    {
3530                        Ok(OpenTargetRequest::_UnknownMethod {
3531                            ordinal: header.ordinal,
3532                            control_handle: OpenTargetControlHandle { inner: this.inner.clone() },
3533                            method_type: fidl::MethodType::OneWay,
3534                        })
3535                    }
3536                    _ if header
3537                        .dynamic_flags()
3538                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3539                    {
3540                        this.inner.send_framework_err(
3541                            fidl::encoding::FrameworkErr::UnknownMethod,
3542                            header.tx_id,
3543                            header.ordinal,
3544                            header.dynamic_flags(),
3545                            (bytes, handles),
3546                        )?;
3547                        Ok(OpenTargetRequest::_UnknownMethod {
3548                            ordinal: header.ordinal,
3549                            control_handle: OpenTargetControlHandle { inner: this.inner.clone() },
3550                            method_type: fidl::MethodType::TwoWay,
3551                        })
3552                    }
3553                    _ => Err(fidl::Error::UnknownOrdinal {
3554                        ordinal: header.ordinal,
3555                        protocol_name:
3556                            <OpenTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3557                    }),
3558                }))
3559            },
3560        )
3561    }
3562}
3563
3564#[derive(Debug)]
3565pub enum OpenTargetRequest {
3566    StrictOneWay {
3567        control_handle: OpenTargetControlHandle,
3568    },
3569    FlexibleOneWay {
3570        control_handle: OpenTargetControlHandle,
3571    },
3572    StrictTwoWay {
3573        responder: OpenTargetStrictTwoWayResponder,
3574    },
3575    StrictTwoWayFields {
3576        reply_with: i32,
3577        responder: OpenTargetStrictTwoWayFieldsResponder,
3578    },
3579    StrictTwoWayErr {
3580        payload: OpenTargetStrictTwoWayErrRequest,
3581        responder: OpenTargetStrictTwoWayErrResponder,
3582    },
3583    StrictTwoWayFieldsErr {
3584        payload: OpenTargetStrictTwoWayFieldsErrRequest,
3585        responder: OpenTargetStrictTwoWayFieldsErrResponder,
3586    },
3587    FlexibleTwoWay {
3588        responder: OpenTargetFlexibleTwoWayResponder,
3589    },
3590    FlexibleTwoWayFields {
3591        reply_with: i32,
3592        responder: OpenTargetFlexibleTwoWayFieldsResponder,
3593    },
3594    FlexibleTwoWayErr {
3595        payload: OpenTargetFlexibleTwoWayErrRequest,
3596        responder: OpenTargetFlexibleTwoWayErrResponder,
3597    },
3598    FlexibleTwoWayFieldsErr {
3599        payload: OpenTargetFlexibleTwoWayFieldsErrRequest,
3600        responder: OpenTargetFlexibleTwoWayFieldsErrResponder,
3601    },
3602    /// An interaction was received which does not match any known method.
3603    #[non_exhaustive]
3604    _UnknownMethod {
3605        /// Ordinal of the method that was called.
3606        ordinal: u64,
3607        control_handle: OpenTargetControlHandle,
3608        method_type: fidl::MethodType,
3609    },
3610}
3611
3612impl OpenTargetRequest {
3613    #[allow(irrefutable_let_patterns)]
3614    pub fn into_strict_one_way(self) -> Option<(OpenTargetControlHandle)> {
3615        if let OpenTargetRequest::StrictOneWay { control_handle } = self {
3616            Some((control_handle))
3617        } else {
3618            None
3619        }
3620    }
3621
3622    #[allow(irrefutable_let_patterns)]
3623    pub fn into_flexible_one_way(self) -> Option<(OpenTargetControlHandle)> {
3624        if let OpenTargetRequest::FlexibleOneWay { control_handle } = self {
3625            Some((control_handle))
3626        } else {
3627            None
3628        }
3629    }
3630
3631    #[allow(irrefutable_let_patterns)]
3632    pub fn into_strict_two_way(self) -> Option<(OpenTargetStrictTwoWayResponder)> {
3633        if let OpenTargetRequest::StrictTwoWay { responder } = self {
3634            Some((responder))
3635        } else {
3636            None
3637        }
3638    }
3639
3640    #[allow(irrefutable_let_patterns)]
3641    pub fn into_strict_two_way_fields(
3642        self,
3643    ) -> Option<(i32, OpenTargetStrictTwoWayFieldsResponder)> {
3644        if let OpenTargetRequest::StrictTwoWayFields { reply_with, responder } = self {
3645            Some((reply_with, responder))
3646        } else {
3647            None
3648        }
3649    }
3650
3651    #[allow(irrefutable_let_patterns)]
3652    pub fn into_strict_two_way_err(
3653        self,
3654    ) -> Option<(OpenTargetStrictTwoWayErrRequest, OpenTargetStrictTwoWayErrResponder)> {
3655        if let OpenTargetRequest::StrictTwoWayErr { payload, responder } = self {
3656            Some((payload, responder))
3657        } else {
3658            None
3659        }
3660    }
3661
3662    #[allow(irrefutable_let_patterns)]
3663    pub fn into_strict_two_way_fields_err(
3664        self,
3665    ) -> Option<(OpenTargetStrictTwoWayFieldsErrRequest, OpenTargetStrictTwoWayFieldsErrResponder)>
3666    {
3667        if let OpenTargetRequest::StrictTwoWayFieldsErr { payload, responder } = self {
3668            Some((payload, responder))
3669        } else {
3670            None
3671        }
3672    }
3673
3674    #[allow(irrefutable_let_patterns)]
3675    pub fn into_flexible_two_way(self) -> Option<(OpenTargetFlexibleTwoWayResponder)> {
3676        if let OpenTargetRequest::FlexibleTwoWay { responder } = self {
3677            Some((responder))
3678        } else {
3679            None
3680        }
3681    }
3682
3683    #[allow(irrefutable_let_patterns)]
3684    pub fn into_flexible_two_way_fields(
3685        self,
3686    ) -> Option<(i32, OpenTargetFlexibleTwoWayFieldsResponder)> {
3687        if let OpenTargetRequest::FlexibleTwoWayFields { reply_with, responder } = self {
3688            Some((reply_with, responder))
3689        } else {
3690            None
3691        }
3692    }
3693
3694    #[allow(irrefutable_let_patterns)]
3695    pub fn into_flexible_two_way_err(
3696        self,
3697    ) -> Option<(OpenTargetFlexibleTwoWayErrRequest, OpenTargetFlexibleTwoWayErrResponder)> {
3698        if let OpenTargetRequest::FlexibleTwoWayErr { payload, responder } = self {
3699            Some((payload, responder))
3700        } else {
3701            None
3702        }
3703    }
3704
3705    #[allow(irrefutable_let_patterns)]
3706    pub fn into_flexible_two_way_fields_err(
3707        self,
3708    ) -> Option<(
3709        OpenTargetFlexibleTwoWayFieldsErrRequest,
3710        OpenTargetFlexibleTwoWayFieldsErrResponder,
3711    )> {
3712        if let OpenTargetRequest::FlexibleTwoWayFieldsErr { payload, responder } = self {
3713            Some((payload, responder))
3714        } else {
3715            None
3716        }
3717    }
3718
3719    /// Name of the method defined in FIDL
3720    pub fn method_name(&self) -> &'static str {
3721        match *self {
3722            OpenTargetRequest::StrictOneWay { .. } => "strict_one_way",
3723            OpenTargetRequest::FlexibleOneWay { .. } => "flexible_one_way",
3724            OpenTargetRequest::StrictTwoWay { .. } => "strict_two_way",
3725            OpenTargetRequest::StrictTwoWayFields { .. } => "strict_two_way_fields",
3726            OpenTargetRequest::StrictTwoWayErr { .. } => "strict_two_way_err",
3727            OpenTargetRequest::StrictTwoWayFieldsErr { .. } => "strict_two_way_fields_err",
3728            OpenTargetRequest::FlexibleTwoWay { .. } => "flexible_two_way",
3729            OpenTargetRequest::FlexibleTwoWayFields { .. } => "flexible_two_way_fields",
3730            OpenTargetRequest::FlexibleTwoWayErr { .. } => "flexible_two_way_err",
3731            OpenTargetRequest::FlexibleTwoWayFieldsErr { .. } => "flexible_two_way_fields_err",
3732            OpenTargetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3733                "unknown one-way method"
3734            }
3735            OpenTargetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3736                "unknown two-way method"
3737            }
3738        }
3739    }
3740}
3741
3742#[derive(Debug, Clone)]
3743pub struct OpenTargetControlHandle {
3744    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3745}
3746
3747impl fidl::endpoints::ControlHandle for OpenTargetControlHandle {
3748    fn shutdown(&self) {
3749        self.inner.shutdown()
3750    }
3751
3752    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3753        self.inner.shutdown_with_epitaph(status)
3754    }
3755
3756    fn is_closed(&self) -> bool {
3757        self.inner.channel().is_closed()
3758    }
3759    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3760        self.inner.channel().on_closed()
3761    }
3762
3763    #[cfg(target_os = "fuchsia")]
3764    fn signal_peer(
3765        &self,
3766        clear_mask: zx::Signals,
3767        set_mask: zx::Signals,
3768    ) -> Result<(), zx_status::Status> {
3769        use fidl::Peered;
3770        self.inner.channel().signal_peer(clear_mask, set_mask)
3771    }
3772}
3773
3774impl OpenTargetControlHandle {
3775    pub fn send_strict_event(&self) -> Result<(), fidl::Error> {
3776        self.inner.send::<fidl::encoding::EmptyPayload>(
3777            (),
3778            0,
3779            0x778f95d421c0685,
3780            fidl::encoding::DynamicFlags::empty(),
3781        )
3782    }
3783
3784    pub fn send_flexible_event(&self) -> Result<(), fidl::Error> {
3785        self.inner.send::<fidl::encoding::EmptyPayload>(
3786            (),
3787            0,
3788            0x43d9ee0dca2bb33e,
3789            fidl::encoding::DynamicFlags::FLEXIBLE,
3790        )
3791    }
3792}
3793
3794#[must_use = "FIDL methods require a response to be sent"]
3795#[derive(Debug)]
3796pub struct OpenTargetStrictTwoWayResponder {
3797    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
3798    tx_id: u32,
3799}
3800
3801/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
3802/// if the responder is dropped without sending a response, so that the client
3803/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3804impl std::ops::Drop for OpenTargetStrictTwoWayResponder {
3805    fn drop(&mut self) {
3806        self.control_handle.shutdown();
3807        // Safety: drops once, never accessed again
3808        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3809    }
3810}
3811
3812impl fidl::endpoints::Responder for OpenTargetStrictTwoWayResponder {
3813    type ControlHandle = OpenTargetControlHandle;
3814
3815    fn control_handle(&self) -> &OpenTargetControlHandle {
3816        &self.control_handle
3817    }
3818
3819    fn drop_without_shutdown(mut self) {
3820        // Safety: drops once, never accessed again due to mem::forget
3821        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3822        // Prevent Drop from running (which would shut down the channel)
3823        std::mem::forget(self);
3824    }
3825}
3826
3827impl OpenTargetStrictTwoWayResponder {
3828    /// Sends a response to the FIDL transaction.
3829    ///
3830    /// Sets the channel to shutdown if an error occurs.
3831    pub fn send(self) -> Result<(), fidl::Error> {
3832        let _result = self.send_raw();
3833        if _result.is_err() {
3834            self.control_handle.shutdown();
3835        }
3836        self.drop_without_shutdown();
3837        _result
3838    }
3839
3840    /// Similar to "send" but does not shutdown the channel if an error occurs.
3841    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3842        let _result = self.send_raw();
3843        self.drop_without_shutdown();
3844        _result
3845    }
3846
3847    fn send_raw(&self) -> Result<(), fidl::Error> {
3848        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3849            (),
3850            self.tx_id,
3851            0x70020c582a57ef03,
3852            fidl::encoding::DynamicFlags::empty(),
3853        )
3854    }
3855}
3856
3857#[must_use = "FIDL methods require a response to be sent"]
3858#[derive(Debug)]
3859pub struct OpenTargetStrictTwoWayFieldsResponder {
3860    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
3861    tx_id: u32,
3862}
3863
3864/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
3865/// if the responder is dropped without sending a response, so that the client
3866/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3867impl std::ops::Drop for OpenTargetStrictTwoWayFieldsResponder {
3868    fn drop(&mut self) {
3869        self.control_handle.shutdown();
3870        // Safety: drops once, never accessed again
3871        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3872    }
3873}
3874
3875impl fidl::endpoints::Responder for OpenTargetStrictTwoWayFieldsResponder {
3876    type ControlHandle = OpenTargetControlHandle;
3877
3878    fn control_handle(&self) -> &OpenTargetControlHandle {
3879        &self.control_handle
3880    }
3881
3882    fn drop_without_shutdown(mut self) {
3883        // Safety: drops once, never accessed again due to mem::forget
3884        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3885        // Prevent Drop from running (which would shut down the channel)
3886        std::mem::forget(self);
3887    }
3888}
3889
3890impl OpenTargetStrictTwoWayFieldsResponder {
3891    /// Sends a response to the FIDL transaction.
3892    ///
3893    /// Sets the channel to shutdown if an error occurs.
3894    pub fn send(self, mut some_field: i32) -> Result<(), fidl::Error> {
3895        let _result = self.send_raw(some_field);
3896        if _result.is_err() {
3897            self.control_handle.shutdown();
3898        }
3899        self.drop_without_shutdown();
3900        _result
3901    }
3902
3903    /// Similar to "send" but does not shutdown the channel if an error occurs.
3904    pub fn send_no_shutdown_on_err(self, mut some_field: i32) -> Result<(), fidl::Error> {
3905        let _result = self.send_raw(some_field);
3906        self.drop_without_shutdown();
3907        _result
3908    }
3909
3910    fn send_raw(&self, mut some_field: i32) -> Result<(), fidl::Error> {
3911        self.control_handle.inner.send::<OpenTargetStrictTwoWayFieldsResponse>(
3912            (some_field,),
3913            self.tx_id,
3914            0x2be6e1cc40008010,
3915            fidl::encoding::DynamicFlags::empty(),
3916        )
3917    }
3918}
3919
3920#[must_use = "FIDL methods require a response to be sent"]
3921#[derive(Debug)]
3922pub struct OpenTargetStrictTwoWayErrResponder {
3923    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
3924    tx_id: u32,
3925}
3926
3927/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
3928/// if the responder is dropped without sending a response, so that the client
3929/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3930impl std::ops::Drop for OpenTargetStrictTwoWayErrResponder {
3931    fn drop(&mut self) {
3932        self.control_handle.shutdown();
3933        // Safety: drops once, never accessed again
3934        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3935    }
3936}
3937
3938impl fidl::endpoints::Responder for OpenTargetStrictTwoWayErrResponder {
3939    type ControlHandle = OpenTargetControlHandle;
3940
3941    fn control_handle(&self) -> &OpenTargetControlHandle {
3942        &self.control_handle
3943    }
3944
3945    fn drop_without_shutdown(mut self) {
3946        // Safety: drops once, never accessed again due to mem::forget
3947        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3948        // Prevent Drop from running (which would shut down the channel)
3949        std::mem::forget(self);
3950    }
3951}
3952
3953impl OpenTargetStrictTwoWayErrResponder {
3954    /// Sends a response to the FIDL transaction.
3955    ///
3956    /// Sets the channel to shutdown if an error occurs.
3957    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3958        let _result = self.send_raw(result);
3959        if _result.is_err() {
3960            self.control_handle.shutdown();
3961        }
3962        self.drop_without_shutdown();
3963        _result
3964    }
3965
3966    /// Similar to "send" but does not shutdown the channel if an error occurs.
3967    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3968        let _result = self.send_raw(result);
3969        self.drop_without_shutdown();
3970        _result
3971    }
3972
3973    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3974        self.control_handle
3975            .inner
3976            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3977                result,
3978                self.tx_id,
3979                0x6efc16069ebd0b2c,
3980                fidl::encoding::DynamicFlags::empty(),
3981            )
3982    }
3983}
3984
3985#[must_use = "FIDL methods require a response to be sent"]
3986#[derive(Debug)]
3987pub struct OpenTargetStrictTwoWayFieldsErrResponder {
3988    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
3989    tx_id: u32,
3990}
3991
3992/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
3993/// if the responder is dropped without sending a response, so that the client
3994/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3995impl std::ops::Drop for OpenTargetStrictTwoWayFieldsErrResponder {
3996    fn drop(&mut self) {
3997        self.control_handle.shutdown();
3998        // Safety: drops once, never accessed again
3999        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4000    }
4001}
4002
4003impl fidl::endpoints::Responder for OpenTargetStrictTwoWayFieldsErrResponder {
4004    type ControlHandle = OpenTargetControlHandle;
4005
4006    fn control_handle(&self) -> &OpenTargetControlHandle {
4007        &self.control_handle
4008    }
4009
4010    fn drop_without_shutdown(mut self) {
4011        // Safety: drops once, never accessed again due to mem::forget
4012        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4013        // Prevent Drop from running (which would shut down the channel)
4014        std::mem::forget(self);
4015    }
4016}
4017
4018impl OpenTargetStrictTwoWayFieldsErrResponder {
4019    /// Sends a response to the FIDL transaction.
4020    ///
4021    /// Sets the channel to shutdown if an error occurs.
4022    pub fn send(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
4023        let _result = self.send_raw(result);
4024        if _result.is_err() {
4025            self.control_handle.shutdown();
4026        }
4027        self.drop_without_shutdown();
4028        _result
4029    }
4030
4031    /// Similar to "send" but does not shutdown the channel if an error occurs.
4032    pub fn send_no_shutdown_on_err(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
4033        let _result = self.send_raw(result);
4034        self.drop_without_shutdown();
4035        _result
4036    }
4037
4038    fn send_raw(&self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
4039        self.control_handle.inner.send::<fidl::encoding::ResultType<
4040            OpenTargetStrictTwoWayFieldsErrResponse,
4041            i32,
4042        >>(
4043            result.map(|some_field| (some_field,)),
4044            self.tx_id,
4045            0x309c8adda770fcf0,
4046            fidl::encoding::DynamicFlags::empty(),
4047        )
4048    }
4049}
4050
4051#[must_use = "FIDL methods require a response to be sent"]
4052#[derive(Debug)]
4053pub struct OpenTargetFlexibleTwoWayResponder {
4054    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
4055    tx_id: u32,
4056}
4057
4058/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
4059/// if the responder is dropped without sending a response, so that the client
4060/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4061impl std::ops::Drop for OpenTargetFlexibleTwoWayResponder {
4062    fn drop(&mut self) {
4063        self.control_handle.shutdown();
4064        // Safety: drops once, never accessed again
4065        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4066    }
4067}
4068
4069impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayResponder {
4070    type ControlHandle = OpenTargetControlHandle;
4071
4072    fn control_handle(&self) -> &OpenTargetControlHandle {
4073        &self.control_handle
4074    }
4075
4076    fn drop_without_shutdown(mut self) {
4077        // Safety: drops once, never accessed again due to mem::forget
4078        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4079        // Prevent Drop from running (which would shut down the channel)
4080        std::mem::forget(self);
4081    }
4082}
4083
4084impl OpenTargetFlexibleTwoWayResponder {
4085    /// Sends a response to the FIDL transaction.
4086    ///
4087    /// Sets the channel to shutdown if an error occurs.
4088    pub fn send(self) -> Result<(), fidl::Error> {
4089        let _result = self.send_raw();
4090        if _result.is_err() {
4091            self.control_handle.shutdown();
4092        }
4093        self.drop_without_shutdown();
4094        _result
4095    }
4096
4097    /// Similar to "send" but does not shutdown the channel if an error occurs.
4098    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4099        let _result = self.send_raw();
4100        self.drop_without_shutdown();
4101        _result
4102    }
4103
4104    fn send_raw(&self) -> Result<(), fidl::Error> {
4105        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
4106            fidl::encoding::Flexible::new(()),
4107            self.tx_id,
4108            0x19f932dac7810c71,
4109            fidl::encoding::DynamicFlags::FLEXIBLE,
4110        )
4111    }
4112}
4113
4114#[must_use = "FIDL methods require a response to be sent"]
4115#[derive(Debug)]
4116pub struct OpenTargetFlexibleTwoWayFieldsResponder {
4117    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
4118    tx_id: u32,
4119}
4120
4121/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
4122/// if the responder is dropped without sending a response, so that the client
4123/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4124impl std::ops::Drop for OpenTargetFlexibleTwoWayFieldsResponder {
4125    fn drop(&mut self) {
4126        self.control_handle.shutdown();
4127        // Safety: drops once, never accessed again
4128        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4129    }
4130}
4131
4132impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayFieldsResponder {
4133    type ControlHandle = OpenTargetControlHandle;
4134
4135    fn control_handle(&self) -> &OpenTargetControlHandle {
4136        &self.control_handle
4137    }
4138
4139    fn drop_without_shutdown(mut self) {
4140        // Safety: drops once, never accessed again due to mem::forget
4141        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4142        // Prevent Drop from running (which would shut down the channel)
4143        std::mem::forget(self);
4144    }
4145}
4146
4147impl OpenTargetFlexibleTwoWayFieldsResponder {
4148    /// Sends a response to the FIDL transaction.
4149    ///
4150    /// Sets the channel to shutdown if an error occurs.
4151    pub fn send(self, mut some_field: i32) -> Result<(), fidl::Error> {
4152        let _result = self.send_raw(some_field);
4153        if _result.is_err() {
4154            self.control_handle.shutdown();
4155        }
4156        self.drop_without_shutdown();
4157        _result
4158    }
4159
4160    /// Similar to "send" but does not shutdown the channel if an error occurs.
4161    pub fn send_no_shutdown_on_err(self, mut some_field: i32) -> Result<(), fidl::Error> {
4162        let _result = self.send_raw(some_field);
4163        self.drop_without_shutdown();
4164        _result
4165    }
4166
4167    fn send_raw(&self, mut some_field: i32) -> Result<(), fidl::Error> {
4168        self.control_handle.inner.send::<fidl::encoding::FlexibleType<
4169            OpenTargetFlexibleTwoWayFieldsResponse,
4170        >>(
4171            fidl::encoding::Flexible::new((some_field,)),
4172            self.tx_id,
4173            0x47cca5ddb4207774,
4174            fidl::encoding::DynamicFlags::FLEXIBLE,
4175        )
4176    }
4177}
4178
4179#[must_use = "FIDL methods require a response to be sent"]
4180#[derive(Debug)]
4181pub struct OpenTargetFlexibleTwoWayErrResponder {
4182    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
4183    tx_id: u32,
4184}
4185
4186/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
4187/// if the responder is dropped without sending a response, so that the client
4188/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4189impl std::ops::Drop for OpenTargetFlexibleTwoWayErrResponder {
4190    fn drop(&mut self) {
4191        self.control_handle.shutdown();
4192        // Safety: drops once, never accessed again
4193        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4194    }
4195}
4196
4197impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayErrResponder {
4198    type ControlHandle = OpenTargetControlHandle;
4199
4200    fn control_handle(&self) -> &OpenTargetControlHandle {
4201        &self.control_handle
4202    }
4203
4204    fn drop_without_shutdown(mut self) {
4205        // Safety: drops once, never accessed again due to mem::forget
4206        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4207        // Prevent Drop from running (which would shut down the channel)
4208        std::mem::forget(self);
4209    }
4210}
4211
4212impl OpenTargetFlexibleTwoWayErrResponder {
4213    /// Sends a response to the FIDL transaction.
4214    ///
4215    /// Sets the channel to shutdown if an error occurs.
4216    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4217        let _result = self.send_raw(result);
4218        if _result.is_err() {
4219            self.control_handle.shutdown();
4220        }
4221        self.drop_without_shutdown();
4222        _result
4223    }
4224
4225    /// Similar to "send" but does not shutdown the channel if an error occurs.
4226    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4227        let _result = self.send_raw(result);
4228        self.drop_without_shutdown();
4229        _result
4230    }
4231
4232    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4233        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4234            fidl::encoding::EmptyStruct,
4235            i32,
4236        >>(
4237            fidl::encoding::FlexibleResult::new(result),
4238            self.tx_id,
4239            0x52aa19681fea3a0,
4240            fidl::encoding::DynamicFlags::FLEXIBLE,
4241        )
4242    }
4243}
4244
4245#[must_use = "FIDL methods require a response to be sent"]
4246#[derive(Debug)]
4247pub struct OpenTargetFlexibleTwoWayFieldsErrResponder {
4248    control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
4249    tx_id: u32,
4250}
4251
4252/// Set the the channel to be shutdown (see [`OpenTargetControlHandle::shutdown`])
4253/// if the responder is dropped without sending a response, so that the client
4254/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4255impl std::ops::Drop for OpenTargetFlexibleTwoWayFieldsErrResponder {
4256    fn drop(&mut self) {
4257        self.control_handle.shutdown();
4258        // Safety: drops once, never accessed again
4259        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4260    }
4261}
4262
4263impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayFieldsErrResponder {
4264    type ControlHandle = OpenTargetControlHandle;
4265
4266    fn control_handle(&self) -> &OpenTargetControlHandle {
4267        &self.control_handle
4268    }
4269
4270    fn drop_without_shutdown(mut self) {
4271        // Safety: drops once, never accessed again due to mem::forget
4272        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4273        // Prevent Drop from running (which would shut down the channel)
4274        std::mem::forget(self);
4275    }
4276}
4277
4278impl OpenTargetFlexibleTwoWayFieldsErrResponder {
4279    /// Sends a response to the FIDL transaction.
4280    ///
4281    /// Sets the channel to shutdown if an error occurs.
4282    pub fn send(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
4283        let _result = self.send_raw(result);
4284        if _result.is_err() {
4285            self.control_handle.shutdown();
4286        }
4287        self.drop_without_shutdown();
4288        _result
4289    }
4290
4291    /// Similar to "send" but does not shutdown the channel if an error occurs.
4292    pub fn send_no_shutdown_on_err(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
4293        let _result = self.send_raw(result);
4294        self.drop_without_shutdown();
4295        _result
4296    }
4297
4298    fn send_raw(&self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
4299        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4300            OpenTargetFlexibleTwoWayFieldsErrResponse,
4301            i32,
4302        >>(
4303            fidl::encoding::FlexibleResult::new(result.map(|some_field| (some_field,))),
4304            self.tx_id,
4305            0x1ab7dd4c6a3650b6,
4306            fidl::encoding::DynamicFlags::FLEXIBLE,
4307        )
4308    }
4309}
4310
4311#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4312pub struct RunnerMarker;
4313
4314impl fidl::endpoints::ProtocolMarker for RunnerMarker {
4315    type Proxy = RunnerProxy;
4316    type RequestStream = RunnerRequestStream;
4317    #[cfg(target_os = "fuchsia")]
4318    type SynchronousProxy = RunnerSynchronousProxy;
4319
4320    const DEBUG_NAME: &'static str = "fidl.serversuite.Runner";
4321}
4322impl fidl::endpoints::DiscoverableProtocolMarker for RunnerMarker {}
4323pub type RunnerStartResult = Result<(), StartError>;
4324
4325pub trait RunnerProxyInterface: Send + Sync {
4326    type GetVersionResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
4327    fn r#get_version(&self) -> Self::GetVersionResponseFut;
4328    type CheckAliveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
4329    fn r#check_alive(&self) -> Self::CheckAliveResponseFut;
4330    type StartResponseFut: std::future::Future<Output = Result<RunnerStartResult, fidl::Error>>
4331        + Send;
4332    fn r#start(&self, test: Test, any_target: AnyTarget) -> Self::StartResponseFut;
4333    type ShutdownWithEpitaphResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
4334        + Send;
4335    fn r#shutdown_with_epitaph(&self, epitaph_status: i32) -> Self::ShutdownWithEpitaphResponseFut;
4336    type SendOpenTargetStrictEventResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
4337        + Send;
4338    fn r#send_open_target_strict_event(&self) -> Self::SendOpenTargetStrictEventResponseFut;
4339    type SendOpenTargetFlexibleEventResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
4340        + Send;
4341    fn r#send_open_target_flexible_event(&self) -> Self::SendOpenTargetFlexibleEventResponseFut;
4342}
4343#[derive(Debug)]
4344#[cfg(target_os = "fuchsia")]
4345pub struct RunnerSynchronousProxy {
4346    client: fidl::client::sync::Client,
4347}
4348
4349#[cfg(target_os = "fuchsia")]
4350impl fidl::endpoints::SynchronousProxy for RunnerSynchronousProxy {
4351    type Proxy = RunnerProxy;
4352    type Protocol = RunnerMarker;
4353
4354    fn from_channel(inner: fidl::Channel) -> Self {
4355        Self::new(inner)
4356    }
4357
4358    fn into_channel(self) -> fidl::Channel {
4359        self.client.into_channel()
4360    }
4361
4362    fn as_channel(&self) -> &fidl::Channel {
4363        self.client.as_channel()
4364    }
4365}
4366
4367#[cfg(target_os = "fuchsia")]
4368impl RunnerSynchronousProxy {
4369    pub fn new(channel: fidl::Channel) -> Self {
4370        let protocol_name = <RunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4371        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4372    }
4373
4374    pub fn into_channel(self) -> fidl::Channel {
4375        self.client.into_channel()
4376    }
4377
4378    /// Waits until an event arrives and returns it. It is safe for other
4379    /// threads to make concurrent requests while waiting for an event.
4380    pub fn wait_for_event(
4381        &self,
4382        deadline: zx::MonotonicInstant,
4383    ) -> Result<RunnerEvent, fidl::Error> {
4384        RunnerEvent::decode(self.client.wait_for_event(deadline)?)
4385    }
4386
4387    pub fn r#get_version(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
4388        let _response =
4389            self.client.send_query::<fidl::encoding::EmptyPayload, RunnerGetVersionResponse>(
4390                (),
4391                0x3c70bef2e59d06a7,
4392                fidl::encoding::DynamicFlags::empty(),
4393                ___deadline,
4394            )?;
4395        Ok(_response.version)
4396    }
4397
4398    pub fn r#check_alive(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
4399        let _response =
4400            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
4401                (),
4402                0x2449c31d30d6f5b7,
4403                fidl::encoding::DynamicFlags::empty(),
4404                ___deadline,
4405            )?;
4406        Ok(_response)
4407    }
4408
4409    pub fn r#start(
4410        &self,
4411        mut test: Test,
4412        mut any_target: AnyTarget,
4413        ___deadline: zx::MonotonicInstant,
4414    ) -> Result<RunnerStartResult, fidl::Error> {
4415        let _response = self.client.send_query::<RunnerStartRequest, fidl::encoding::ResultType<
4416            fidl::encoding::EmptyStruct,
4417            StartError,
4418        >>(
4419            (test, &mut any_target),
4420            0x2d4735726d30a5b0,
4421            fidl::encoding::DynamicFlags::empty(),
4422            ___deadline,
4423        )?;
4424        Ok(_response.map(|x| x))
4425    }
4426
4427    pub fn r#shutdown_with_epitaph(
4428        &self,
4429        mut epitaph_status: i32,
4430        ___deadline: zx::MonotonicInstant,
4431    ) -> Result<(), fidl::Error> {
4432        let _response = self
4433            .client
4434            .send_query::<RunnerShutdownWithEpitaphRequest, fidl::encoding::EmptyPayload>(
4435                (epitaph_status,),
4436                0x7a15369d88e1e8ec,
4437                fidl::encoding::DynamicFlags::empty(),
4438                ___deadline,
4439            )?;
4440        Ok(_response)
4441    }
4442
4443    pub fn r#send_open_target_strict_event(
4444        &self,
4445        ___deadline: zx::MonotonicInstant,
4446    ) -> Result<(), fidl::Error> {
4447        let _response =
4448            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
4449                (),
4450                0x1c3e4452a20c9590,
4451                fidl::encoding::DynamicFlags::empty(),
4452                ___deadline,
4453            )?;
4454        Ok(_response)
4455    }
4456
4457    pub fn r#send_open_target_flexible_event(
4458        &self,
4459        ___deadline: zx::MonotonicInstant,
4460    ) -> Result<(), fidl::Error> {
4461        let _response =
4462            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
4463                (),
4464                0x2d2c9446799baeb6,
4465                fidl::encoding::DynamicFlags::empty(),
4466                ___deadline,
4467            )?;
4468        Ok(_response)
4469    }
4470}
4471
4472#[cfg(target_os = "fuchsia")]
4473impl From<RunnerSynchronousProxy> for zx::NullableHandle {
4474    fn from(value: RunnerSynchronousProxy) -> Self {
4475        value.into_channel().into()
4476    }
4477}
4478
4479#[cfg(target_os = "fuchsia")]
4480impl From<fidl::Channel> for RunnerSynchronousProxy {
4481    fn from(value: fidl::Channel) -> Self {
4482        Self::new(value)
4483    }
4484}
4485
4486#[cfg(target_os = "fuchsia")]
4487impl fidl::endpoints::FromClient for RunnerSynchronousProxy {
4488    type Protocol = RunnerMarker;
4489
4490    fn from_client(value: fidl::endpoints::ClientEnd<RunnerMarker>) -> Self {
4491        Self::new(value.into_channel())
4492    }
4493}
4494
4495#[derive(Debug, Clone)]
4496pub struct RunnerProxy {
4497    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4498}
4499
4500impl fidl::endpoints::Proxy for RunnerProxy {
4501    type Protocol = RunnerMarker;
4502
4503    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4504        Self::new(inner)
4505    }
4506
4507    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4508        self.client.into_channel().map_err(|client| Self { client })
4509    }
4510
4511    fn as_channel(&self) -> &::fidl::AsyncChannel {
4512        self.client.as_channel()
4513    }
4514}
4515
4516impl RunnerProxy {
4517    /// Create a new Proxy for fidl.serversuite/Runner.
4518    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4519        let protocol_name = <RunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4520        Self { client: fidl::client::Client::new(channel, protocol_name) }
4521    }
4522
4523    /// Get a Stream of events from the remote end of the protocol.
4524    ///
4525    /// # Panics
4526    ///
4527    /// Panics if the event stream was already taken.
4528    pub fn take_event_stream(&self) -> RunnerEventStream {
4529        RunnerEventStream { event_receiver: self.client.take_event_receiver() }
4530    }
4531
4532    pub fn r#get_version(
4533        &self,
4534    ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
4535        RunnerProxyInterface::r#get_version(self)
4536    }
4537
4538    pub fn r#check_alive(
4539        &self,
4540    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4541        RunnerProxyInterface::r#check_alive(self)
4542    }
4543
4544    pub fn r#start(
4545        &self,
4546        mut test: Test,
4547        mut any_target: AnyTarget,
4548    ) -> fidl::client::QueryResponseFut<
4549        RunnerStartResult,
4550        fidl::encoding::DefaultFuchsiaResourceDialect,
4551    > {
4552        RunnerProxyInterface::r#start(self, test, any_target)
4553    }
4554
4555    pub fn r#shutdown_with_epitaph(
4556        &self,
4557        mut epitaph_status: i32,
4558    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4559        RunnerProxyInterface::r#shutdown_with_epitaph(self, epitaph_status)
4560    }
4561
4562    pub fn r#send_open_target_strict_event(
4563        &self,
4564    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4565        RunnerProxyInterface::r#send_open_target_strict_event(self)
4566    }
4567
4568    pub fn r#send_open_target_flexible_event(
4569        &self,
4570    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4571        RunnerProxyInterface::r#send_open_target_flexible_event(self)
4572    }
4573}
4574
4575impl RunnerProxyInterface for RunnerProxy {
4576    type GetVersionResponseFut =
4577        fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
4578    fn r#get_version(&self) -> Self::GetVersionResponseFut {
4579        fn _decode(
4580            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4581        ) -> Result<u64, fidl::Error> {
4582            let _response = fidl::client::decode_transaction_body::<
4583                RunnerGetVersionResponse,
4584                fidl::encoding::DefaultFuchsiaResourceDialect,
4585                0x3c70bef2e59d06a7,
4586            >(_buf?)?;
4587            Ok(_response.version)
4588        }
4589        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
4590            (),
4591            0x3c70bef2e59d06a7,
4592            fidl::encoding::DynamicFlags::empty(),
4593            _decode,
4594        )
4595    }
4596
4597    type CheckAliveResponseFut =
4598        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4599    fn r#check_alive(&self) -> Self::CheckAliveResponseFut {
4600        fn _decode(
4601            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4602        ) -> Result<(), fidl::Error> {
4603            let _response = fidl::client::decode_transaction_body::<
4604                fidl::encoding::EmptyPayload,
4605                fidl::encoding::DefaultFuchsiaResourceDialect,
4606                0x2449c31d30d6f5b7,
4607            >(_buf?)?;
4608            Ok(_response)
4609        }
4610        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
4611            (),
4612            0x2449c31d30d6f5b7,
4613            fidl::encoding::DynamicFlags::empty(),
4614            _decode,
4615        )
4616    }
4617
4618    type StartResponseFut = fidl::client::QueryResponseFut<
4619        RunnerStartResult,
4620        fidl::encoding::DefaultFuchsiaResourceDialect,
4621    >;
4622    fn r#start(&self, mut test: Test, mut any_target: AnyTarget) -> Self::StartResponseFut {
4623        fn _decode(
4624            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4625        ) -> Result<RunnerStartResult, fidl::Error> {
4626            let _response = fidl::client::decode_transaction_body::<
4627                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
4628                fidl::encoding::DefaultFuchsiaResourceDialect,
4629                0x2d4735726d30a5b0,
4630            >(_buf?)?;
4631            Ok(_response.map(|x| x))
4632        }
4633        self.client.send_query_and_decode::<RunnerStartRequest, RunnerStartResult>(
4634            (test, &mut any_target),
4635            0x2d4735726d30a5b0,
4636            fidl::encoding::DynamicFlags::empty(),
4637            _decode,
4638        )
4639    }
4640
4641    type ShutdownWithEpitaphResponseFut =
4642        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4643    fn r#shutdown_with_epitaph(
4644        &self,
4645        mut epitaph_status: i32,
4646    ) -> Self::ShutdownWithEpitaphResponseFut {
4647        fn _decode(
4648            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4649        ) -> Result<(), fidl::Error> {
4650            let _response = fidl::client::decode_transaction_body::<
4651                fidl::encoding::EmptyPayload,
4652                fidl::encoding::DefaultFuchsiaResourceDialect,
4653                0x7a15369d88e1e8ec,
4654            >(_buf?)?;
4655            Ok(_response)
4656        }
4657        self.client.send_query_and_decode::<RunnerShutdownWithEpitaphRequest, ()>(
4658            (epitaph_status,),
4659            0x7a15369d88e1e8ec,
4660            fidl::encoding::DynamicFlags::empty(),
4661            _decode,
4662        )
4663    }
4664
4665    type SendOpenTargetStrictEventResponseFut =
4666        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4667    fn r#send_open_target_strict_event(&self) -> Self::SendOpenTargetStrictEventResponseFut {
4668        fn _decode(
4669            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4670        ) -> Result<(), fidl::Error> {
4671            let _response = fidl::client::decode_transaction_body::<
4672                fidl::encoding::EmptyPayload,
4673                fidl::encoding::DefaultFuchsiaResourceDialect,
4674                0x1c3e4452a20c9590,
4675            >(_buf?)?;
4676            Ok(_response)
4677        }
4678        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
4679            (),
4680            0x1c3e4452a20c9590,
4681            fidl::encoding::DynamicFlags::empty(),
4682            _decode,
4683        )
4684    }
4685
4686    type SendOpenTargetFlexibleEventResponseFut =
4687        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4688    fn r#send_open_target_flexible_event(&self) -> Self::SendOpenTargetFlexibleEventResponseFut {
4689        fn _decode(
4690            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4691        ) -> Result<(), fidl::Error> {
4692            let _response = fidl::client::decode_transaction_body::<
4693                fidl::encoding::EmptyPayload,
4694                fidl::encoding::DefaultFuchsiaResourceDialect,
4695                0x2d2c9446799baeb6,
4696            >(_buf?)?;
4697            Ok(_response)
4698        }
4699        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
4700            (),
4701            0x2d2c9446799baeb6,
4702            fidl::encoding::DynamicFlags::empty(),
4703            _decode,
4704        )
4705    }
4706}
4707
4708pub struct RunnerEventStream {
4709    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4710}
4711
4712impl std::marker::Unpin for RunnerEventStream {}
4713
4714impl futures::stream::FusedStream for RunnerEventStream {
4715    fn is_terminated(&self) -> bool {
4716        self.event_receiver.is_terminated()
4717    }
4718}
4719
4720impl futures::Stream for RunnerEventStream {
4721    type Item = Result<RunnerEvent, fidl::Error>;
4722
4723    fn poll_next(
4724        mut self: std::pin::Pin<&mut Self>,
4725        cx: &mut std::task::Context<'_>,
4726    ) -> std::task::Poll<Option<Self::Item>> {
4727        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4728            &mut self.event_receiver,
4729            cx
4730        )?) {
4731            Some(buf) => std::task::Poll::Ready(Some(RunnerEvent::decode(buf))),
4732            None => std::task::Poll::Ready(None),
4733        }
4734    }
4735}
4736
4737#[derive(Debug)]
4738pub enum RunnerEvent {
4739    OnTeardown { reason: TeardownReason },
4740    OnReceivedUnknownMethod { ordinal: u64, unknown_method_type: UnknownMethodType },
4741    OnReceivedClosedTargetOneWayNoPayload {},
4742    OnReceivedOpenTargetStrictOneWay {},
4743    OnReceivedOpenTargetFlexibleOneWay {},
4744}
4745
4746impl RunnerEvent {
4747    #[allow(irrefutable_let_patterns)]
4748    pub fn into_on_teardown(self) -> Option<TeardownReason> {
4749        if let RunnerEvent::OnTeardown { reason } = self { Some((reason)) } else { None }
4750    }
4751    #[allow(irrefutable_let_patterns)]
4752    pub fn into_on_received_unknown_method(self) -> Option<(u64, UnknownMethodType)> {
4753        if let RunnerEvent::OnReceivedUnknownMethod { ordinal, unknown_method_type } = self {
4754            Some((ordinal, unknown_method_type))
4755        } else {
4756            None
4757        }
4758    }
4759    #[allow(irrefutable_let_patterns)]
4760    pub fn into_on_received_closed_target_one_way_no_payload(self) -> Option<()> {
4761        if let RunnerEvent::OnReceivedClosedTargetOneWayNoPayload {} = self {
4762            Some(())
4763        } else {
4764            None
4765        }
4766    }
4767    #[allow(irrefutable_let_patterns)]
4768    pub fn into_on_received_open_target_strict_one_way(self) -> Option<()> {
4769        if let RunnerEvent::OnReceivedOpenTargetStrictOneWay {} = self { Some(()) } else { None }
4770    }
4771    #[allow(irrefutable_let_patterns)]
4772    pub fn into_on_received_open_target_flexible_one_way(self) -> Option<()> {
4773        if let RunnerEvent::OnReceivedOpenTargetFlexibleOneWay {} = self { Some(()) } else { None }
4774    }
4775
4776    /// Decodes a message buffer as a [`RunnerEvent`].
4777    fn decode(
4778        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4779    ) -> Result<RunnerEvent, fidl::Error> {
4780        let (bytes, _handles) = buf.split_mut();
4781        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4782        debug_assert_eq!(tx_header.tx_id, 0);
4783        match tx_header.ordinal {
4784            0x4472273866753acf => {
4785                let mut out = fidl::new_empty!(
4786                    RunnerOnTeardownRequest,
4787                    fidl::encoding::DefaultFuchsiaResourceDialect
4788                );
4789                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunnerOnTeardownRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4790                Ok((RunnerEvent::OnTeardown { reason: out.reason }))
4791            }
4792            0x3c7f8d66a4f4c0e4 => {
4793                let mut out = fidl::new_empty!(
4794                    UnknownMethodInfo,
4795                    fidl::encoding::DefaultFuchsiaResourceDialect
4796                );
4797                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UnknownMethodInfo>(&tx_header, _body_bytes, _handles, &mut out)?;
4798                Ok((RunnerEvent::OnReceivedUnknownMethod {
4799                    ordinal: out.ordinal,
4800                    unknown_method_type: out.unknown_method_type,
4801                }))
4802            }
4803            0x56915f3fcde32b6f => {
4804                let mut out = fidl::new_empty!(
4805                    fidl::encoding::EmptyPayload,
4806                    fidl::encoding::DefaultFuchsiaResourceDialect
4807                );
4808                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
4809                Ok((RunnerEvent::OnReceivedClosedTargetOneWayNoPayload {}))
4810            }
4811            0x5b82db8b0ffe97c5 => {
4812                let mut out = fidl::new_empty!(
4813                    fidl::encoding::EmptyPayload,
4814                    fidl::encoding::DefaultFuchsiaResourceDialect
4815                );
4816                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
4817                Ok((RunnerEvent::OnReceivedOpenTargetStrictOneWay {}))
4818            }
4819            0x2428c34ecface889 => {
4820                let mut out = fidl::new_empty!(
4821                    fidl::encoding::EmptyPayload,
4822                    fidl::encoding::DefaultFuchsiaResourceDialect
4823                );
4824                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
4825                Ok((RunnerEvent::OnReceivedOpenTargetFlexibleOneWay {}))
4826            }
4827            _ => Err(fidl::Error::UnknownOrdinal {
4828                ordinal: tx_header.ordinal,
4829                protocol_name: <RunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4830            }),
4831        }
4832    }
4833}
4834
4835/// A Stream of incoming requests for fidl.serversuite/Runner.
4836pub struct RunnerRequestStream {
4837    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4838    is_terminated: bool,
4839}
4840
4841impl std::marker::Unpin for RunnerRequestStream {}
4842
4843impl futures::stream::FusedStream for RunnerRequestStream {
4844    fn is_terminated(&self) -> bool {
4845        self.is_terminated
4846    }
4847}
4848
4849impl fidl::endpoints::RequestStream for RunnerRequestStream {
4850    type Protocol = RunnerMarker;
4851    type ControlHandle = RunnerControlHandle;
4852
4853    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4854        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4855    }
4856
4857    fn control_handle(&self) -> Self::ControlHandle {
4858        RunnerControlHandle { inner: self.inner.clone() }
4859    }
4860
4861    fn into_inner(
4862        self,
4863    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4864    {
4865        (self.inner, self.is_terminated)
4866    }
4867
4868    fn from_inner(
4869        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4870        is_terminated: bool,
4871    ) -> Self {
4872        Self { inner, is_terminated }
4873    }
4874}
4875
4876impl futures::Stream for RunnerRequestStream {
4877    type Item = Result<RunnerRequest, fidl::Error>;
4878
4879    fn poll_next(
4880        mut self: std::pin::Pin<&mut Self>,
4881        cx: &mut std::task::Context<'_>,
4882    ) -> std::task::Poll<Option<Self::Item>> {
4883        let this = &mut *self;
4884        if this.inner.check_shutdown(cx) {
4885            this.is_terminated = true;
4886            return std::task::Poll::Ready(None);
4887        }
4888        if this.is_terminated {
4889            panic!("polled RunnerRequestStream after completion");
4890        }
4891        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4892            |bytes, handles| {
4893                match this.inner.channel().read_etc(cx, bytes, handles) {
4894                    std::task::Poll::Ready(Ok(())) => {}
4895                    std::task::Poll::Pending => return std::task::Poll::Pending,
4896                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4897                        this.is_terminated = true;
4898                        return std::task::Poll::Ready(None);
4899                    }
4900                    std::task::Poll::Ready(Err(e)) => {
4901                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4902                            e.into(),
4903                        ))));
4904                    }
4905                }
4906
4907                // A message has been received from the channel
4908                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4909
4910                std::task::Poll::Ready(Some(match header.ordinal {
4911                    0x3c70bef2e59d06a7 => {
4912                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4913                        let mut req = fidl::new_empty!(
4914                            fidl::encoding::EmptyPayload,
4915                            fidl::encoding::DefaultFuchsiaResourceDialect
4916                        );
4917                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4918                        let control_handle = RunnerControlHandle { inner: this.inner.clone() };
4919                        Ok(RunnerRequest::GetVersion {
4920                            responder: RunnerGetVersionResponder {
4921                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4922                                tx_id: header.tx_id,
4923                            },
4924                        })
4925                    }
4926                    0x2449c31d30d6f5b7 => {
4927                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4928                        let mut req = fidl::new_empty!(
4929                            fidl::encoding::EmptyPayload,
4930                            fidl::encoding::DefaultFuchsiaResourceDialect
4931                        );
4932                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4933                        let control_handle = RunnerControlHandle { inner: this.inner.clone() };
4934                        Ok(RunnerRequest::CheckAlive {
4935                            responder: RunnerCheckAliveResponder {
4936                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4937                                tx_id: header.tx_id,
4938                            },
4939                        })
4940                    }
4941                    0x2d4735726d30a5b0 => {
4942                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4943                        let mut req = fidl::new_empty!(
4944                            RunnerStartRequest,
4945                            fidl::encoding::DefaultFuchsiaResourceDialect
4946                        );
4947                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunnerStartRequest>(&header, _body_bytes, handles, &mut req)?;
4948                        let control_handle = RunnerControlHandle { inner: this.inner.clone() };
4949                        Ok(RunnerRequest::Start {
4950                            test: req.test,
4951                            any_target: req.any_target,
4952
4953                            responder: RunnerStartResponder {
4954                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4955                                tx_id: header.tx_id,
4956                            },
4957                        })
4958                    }
4959                    0x7a15369d88e1e8ec => {
4960                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4961                        let mut req = fidl::new_empty!(
4962                            RunnerShutdownWithEpitaphRequest,
4963                            fidl::encoding::DefaultFuchsiaResourceDialect
4964                        );
4965                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunnerShutdownWithEpitaphRequest>(&header, _body_bytes, handles, &mut req)?;
4966                        let control_handle = RunnerControlHandle { inner: this.inner.clone() };
4967                        Ok(RunnerRequest::ShutdownWithEpitaph {
4968                            epitaph_status: req.epitaph_status,
4969
4970                            responder: RunnerShutdownWithEpitaphResponder {
4971                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4972                                tx_id: header.tx_id,
4973                            },
4974                        })
4975                    }
4976                    0x1c3e4452a20c9590 => {
4977                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4978                        let mut req = fidl::new_empty!(
4979                            fidl::encoding::EmptyPayload,
4980                            fidl::encoding::DefaultFuchsiaResourceDialect
4981                        );
4982                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4983                        let control_handle = RunnerControlHandle { inner: this.inner.clone() };
4984                        Ok(RunnerRequest::SendOpenTargetStrictEvent {
4985                            responder: RunnerSendOpenTargetStrictEventResponder {
4986                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4987                                tx_id: header.tx_id,
4988                            },
4989                        })
4990                    }
4991                    0x2d2c9446799baeb6 => {
4992                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4993                        let mut req = fidl::new_empty!(
4994                            fidl::encoding::EmptyPayload,
4995                            fidl::encoding::DefaultFuchsiaResourceDialect
4996                        );
4997                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4998                        let control_handle = RunnerControlHandle { inner: this.inner.clone() };
4999                        Ok(RunnerRequest::SendOpenTargetFlexibleEvent {
5000                            responder: RunnerSendOpenTargetFlexibleEventResponder {
5001                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5002                                tx_id: header.tx_id,
5003                            },
5004                        })
5005                    }
5006                    _ => Err(fidl::Error::UnknownOrdinal {
5007                        ordinal: header.ordinal,
5008                        protocol_name:
5009                            <RunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5010                    }),
5011                }))
5012            },
5013        )
5014    }
5015}
5016
5017#[derive(Debug)]
5018pub enum RunnerRequest {
5019    GetVersion { responder: RunnerGetVersionResponder },
5020    CheckAlive { responder: RunnerCheckAliveResponder },
5021    Start { test: Test, any_target: AnyTarget, responder: RunnerStartResponder },
5022    ShutdownWithEpitaph { epitaph_status: i32, responder: RunnerShutdownWithEpitaphResponder },
5023    SendOpenTargetStrictEvent { responder: RunnerSendOpenTargetStrictEventResponder },
5024    SendOpenTargetFlexibleEvent { responder: RunnerSendOpenTargetFlexibleEventResponder },
5025}
5026
5027impl RunnerRequest {
5028    #[allow(irrefutable_let_patterns)]
5029    pub fn into_get_version(self) -> Option<(RunnerGetVersionResponder)> {
5030        if let RunnerRequest::GetVersion { responder } = self { Some((responder)) } else { None }
5031    }
5032
5033    #[allow(irrefutable_let_patterns)]
5034    pub fn into_check_alive(self) -> Option<(RunnerCheckAliveResponder)> {
5035        if let RunnerRequest::CheckAlive { responder } = self { Some((responder)) } else { None }
5036    }
5037
5038    #[allow(irrefutable_let_patterns)]
5039    pub fn into_start(self) -> Option<(Test, AnyTarget, RunnerStartResponder)> {
5040        if let RunnerRequest::Start { test, any_target, responder } = self {
5041            Some((test, any_target, responder))
5042        } else {
5043            None
5044        }
5045    }
5046
5047    #[allow(irrefutable_let_patterns)]
5048    pub fn into_shutdown_with_epitaph(self) -> Option<(i32, RunnerShutdownWithEpitaphResponder)> {
5049        if let RunnerRequest::ShutdownWithEpitaph { epitaph_status, responder } = self {
5050            Some((epitaph_status, responder))
5051        } else {
5052            None
5053        }
5054    }
5055
5056    #[allow(irrefutable_let_patterns)]
5057    pub fn into_send_open_target_strict_event(
5058        self,
5059    ) -> Option<(RunnerSendOpenTargetStrictEventResponder)> {
5060        if let RunnerRequest::SendOpenTargetStrictEvent { responder } = self {
5061            Some((responder))
5062        } else {
5063            None
5064        }
5065    }
5066
5067    #[allow(irrefutable_let_patterns)]
5068    pub fn into_send_open_target_flexible_event(
5069        self,
5070    ) -> Option<(RunnerSendOpenTargetFlexibleEventResponder)> {
5071        if let RunnerRequest::SendOpenTargetFlexibleEvent { responder } = self {
5072            Some((responder))
5073        } else {
5074            None
5075        }
5076    }
5077
5078    /// Name of the method defined in FIDL
5079    pub fn method_name(&self) -> &'static str {
5080        match *self {
5081            RunnerRequest::GetVersion { .. } => "get_version",
5082            RunnerRequest::CheckAlive { .. } => "check_alive",
5083            RunnerRequest::Start { .. } => "start",
5084            RunnerRequest::ShutdownWithEpitaph { .. } => "shutdown_with_epitaph",
5085            RunnerRequest::SendOpenTargetStrictEvent { .. } => "send_open_target_strict_event",
5086            RunnerRequest::SendOpenTargetFlexibleEvent { .. } => "send_open_target_flexible_event",
5087        }
5088    }
5089}
5090
5091#[derive(Debug, Clone)]
5092pub struct RunnerControlHandle {
5093    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5094}
5095
5096impl fidl::endpoints::ControlHandle for RunnerControlHandle {
5097    fn shutdown(&self) {
5098        self.inner.shutdown()
5099    }
5100
5101    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5102        self.inner.shutdown_with_epitaph(status)
5103    }
5104
5105    fn is_closed(&self) -> bool {
5106        self.inner.channel().is_closed()
5107    }
5108    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5109        self.inner.channel().on_closed()
5110    }
5111
5112    #[cfg(target_os = "fuchsia")]
5113    fn signal_peer(
5114        &self,
5115        clear_mask: zx::Signals,
5116        set_mask: zx::Signals,
5117    ) -> Result<(), zx_status::Status> {
5118        use fidl::Peered;
5119        self.inner.channel().signal_peer(clear_mask, set_mask)
5120    }
5121}
5122
5123impl RunnerControlHandle {
5124    pub fn send_on_teardown(&self, mut reason: TeardownReason) -> Result<(), fidl::Error> {
5125        self.inner.send::<RunnerOnTeardownRequest>(
5126            (reason,),
5127            0,
5128            0x4472273866753acf,
5129            fidl::encoding::DynamicFlags::empty(),
5130        )
5131    }
5132
5133    pub fn send_on_received_unknown_method(
5134        &self,
5135        mut ordinal: u64,
5136        mut unknown_method_type: UnknownMethodType,
5137    ) -> Result<(), fidl::Error> {
5138        self.inner.send::<UnknownMethodInfo>(
5139            (ordinal, unknown_method_type),
5140            0,
5141            0x3c7f8d66a4f4c0e4,
5142            fidl::encoding::DynamicFlags::empty(),
5143        )
5144    }
5145
5146    pub fn send_on_received_closed_target_one_way_no_payload(&self) -> Result<(), fidl::Error> {
5147        self.inner.send::<fidl::encoding::EmptyPayload>(
5148            (),
5149            0,
5150            0x56915f3fcde32b6f,
5151            fidl::encoding::DynamicFlags::empty(),
5152        )
5153    }
5154
5155    pub fn send_on_received_open_target_strict_one_way(&self) -> Result<(), fidl::Error> {
5156        self.inner.send::<fidl::encoding::EmptyPayload>(
5157            (),
5158            0,
5159            0x5b82db8b0ffe97c5,
5160            fidl::encoding::DynamicFlags::empty(),
5161        )
5162    }
5163
5164    pub fn send_on_received_open_target_flexible_one_way(&self) -> Result<(), fidl::Error> {
5165        self.inner.send::<fidl::encoding::EmptyPayload>(
5166            (),
5167            0,
5168            0x2428c34ecface889,
5169            fidl::encoding::DynamicFlags::empty(),
5170        )
5171    }
5172}
5173
5174#[must_use = "FIDL methods require a response to be sent"]
5175#[derive(Debug)]
5176pub struct RunnerGetVersionResponder {
5177    control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
5178    tx_id: u32,
5179}
5180
5181/// Set the the channel to be shutdown (see [`RunnerControlHandle::shutdown`])
5182/// if the responder is dropped without sending a response, so that the client
5183/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5184impl std::ops::Drop for RunnerGetVersionResponder {
5185    fn drop(&mut self) {
5186        self.control_handle.shutdown();
5187        // Safety: drops once, never accessed again
5188        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5189    }
5190}
5191
5192impl fidl::endpoints::Responder for RunnerGetVersionResponder {
5193    type ControlHandle = RunnerControlHandle;
5194
5195    fn control_handle(&self) -> &RunnerControlHandle {
5196        &self.control_handle
5197    }
5198
5199    fn drop_without_shutdown(mut self) {
5200        // Safety: drops once, never accessed again due to mem::forget
5201        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5202        // Prevent Drop from running (which would shut down the channel)
5203        std::mem::forget(self);
5204    }
5205}
5206
5207impl RunnerGetVersionResponder {
5208    /// Sends a response to the FIDL transaction.
5209    ///
5210    /// Sets the channel to shutdown if an error occurs.
5211    pub fn send(self, mut version: u64) -> Result<(), fidl::Error> {
5212        let _result = self.send_raw(version);
5213        if _result.is_err() {
5214            self.control_handle.shutdown();
5215        }
5216        self.drop_without_shutdown();
5217        _result
5218    }
5219
5220    /// Similar to "send" but does not shutdown the channel if an error occurs.
5221    pub fn send_no_shutdown_on_err(self, mut version: u64) -> Result<(), fidl::Error> {
5222        let _result = self.send_raw(version);
5223        self.drop_without_shutdown();
5224        _result
5225    }
5226
5227    fn send_raw(&self, mut version: u64) -> Result<(), fidl::Error> {
5228        self.control_handle.inner.send::<RunnerGetVersionResponse>(
5229            (version,),
5230            self.tx_id,
5231            0x3c70bef2e59d06a7,
5232            fidl::encoding::DynamicFlags::empty(),
5233        )
5234    }
5235}
5236
5237#[must_use = "FIDL methods require a response to be sent"]
5238#[derive(Debug)]
5239pub struct RunnerCheckAliveResponder {
5240    control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
5241    tx_id: u32,
5242}
5243
5244/// Set the the channel to be shutdown (see [`RunnerControlHandle::shutdown`])
5245/// if the responder is dropped without sending a response, so that the client
5246/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5247impl std::ops::Drop for RunnerCheckAliveResponder {
5248    fn drop(&mut self) {
5249        self.control_handle.shutdown();
5250        // Safety: drops once, never accessed again
5251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5252    }
5253}
5254
5255impl fidl::endpoints::Responder for RunnerCheckAliveResponder {
5256    type ControlHandle = RunnerControlHandle;
5257
5258    fn control_handle(&self) -> &RunnerControlHandle {
5259        &self.control_handle
5260    }
5261
5262    fn drop_without_shutdown(mut self) {
5263        // Safety: drops once, never accessed again due to mem::forget
5264        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5265        // Prevent Drop from running (which would shut down the channel)
5266        std::mem::forget(self);
5267    }
5268}
5269
5270impl RunnerCheckAliveResponder {
5271    /// Sends a response to the FIDL transaction.
5272    ///
5273    /// Sets the channel to shutdown if an error occurs.
5274    pub fn send(self) -> Result<(), fidl::Error> {
5275        let _result = self.send_raw();
5276        if _result.is_err() {
5277            self.control_handle.shutdown();
5278        }
5279        self.drop_without_shutdown();
5280        _result
5281    }
5282
5283    /// Similar to "send" but does not shutdown the channel if an error occurs.
5284    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5285        let _result = self.send_raw();
5286        self.drop_without_shutdown();
5287        _result
5288    }
5289
5290    fn send_raw(&self) -> Result<(), fidl::Error> {
5291        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5292            (),
5293            self.tx_id,
5294            0x2449c31d30d6f5b7,
5295            fidl::encoding::DynamicFlags::empty(),
5296        )
5297    }
5298}
5299
5300#[must_use = "FIDL methods require a response to be sent"]
5301#[derive(Debug)]
5302pub struct RunnerStartResponder {
5303    control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
5304    tx_id: u32,
5305}
5306
5307/// Set the the channel to be shutdown (see [`RunnerControlHandle::shutdown`])
5308/// if the responder is dropped without sending a response, so that the client
5309/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5310impl std::ops::Drop for RunnerStartResponder {
5311    fn drop(&mut self) {
5312        self.control_handle.shutdown();
5313        // Safety: drops once, never accessed again
5314        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5315    }
5316}
5317
5318impl fidl::endpoints::Responder for RunnerStartResponder {
5319    type ControlHandle = RunnerControlHandle;
5320
5321    fn control_handle(&self) -> &RunnerControlHandle {
5322        &self.control_handle
5323    }
5324
5325    fn drop_without_shutdown(mut self) {
5326        // Safety: drops once, never accessed again due to mem::forget
5327        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5328        // Prevent Drop from running (which would shut down the channel)
5329        std::mem::forget(self);
5330    }
5331}
5332
5333impl RunnerStartResponder {
5334    /// Sends a response to the FIDL transaction.
5335    ///
5336    /// Sets the channel to shutdown if an error occurs.
5337    pub fn send(self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
5338        let _result = self.send_raw(result);
5339        if _result.is_err() {
5340            self.control_handle.shutdown();
5341        }
5342        self.drop_without_shutdown();
5343        _result
5344    }
5345
5346    /// Similar to "send" but does not shutdown the channel if an error occurs.
5347    pub fn send_no_shutdown_on_err(
5348        self,
5349        mut result: Result<(), StartError>,
5350    ) -> Result<(), fidl::Error> {
5351        let _result = self.send_raw(result);
5352        self.drop_without_shutdown();
5353        _result
5354    }
5355
5356    fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
5357        self.control_handle
5358            .inner
5359            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>>(
5360                result,
5361                self.tx_id,
5362                0x2d4735726d30a5b0,
5363                fidl::encoding::DynamicFlags::empty(),
5364            )
5365    }
5366}
5367
5368#[must_use = "FIDL methods require a response to be sent"]
5369#[derive(Debug)]
5370pub struct RunnerShutdownWithEpitaphResponder {
5371    control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
5372    tx_id: u32,
5373}
5374
5375/// Set the the channel to be shutdown (see [`RunnerControlHandle::shutdown`])
5376/// if the responder is dropped without sending a response, so that the client
5377/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5378impl std::ops::Drop for RunnerShutdownWithEpitaphResponder {
5379    fn drop(&mut self) {
5380        self.control_handle.shutdown();
5381        // Safety: drops once, never accessed again
5382        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5383    }
5384}
5385
5386impl fidl::endpoints::Responder for RunnerShutdownWithEpitaphResponder {
5387    type ControlHandle = RunnerControlHandle;
5388
5389    fn control_handle(&self) -> &RunnerControlHandle {
5390        &self.control_handle
5391    }
5392
5393    fn drop_without_shutdown(mut self) {
5394        // Safety: drops once, never accessed again due to mem::forget
5395        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5396        // Prevent Drop from running (which would shut down the channel)
5397        std::mem::forget(self);
5398    }
5399}
5400
5401impl RunnerShutdownWithEpitaphResponder {
5402    /// Sends a response to the FIDL transaction.
5403    ///
5404    /// Sets the channel to shutdown if an error occurs.
5405    pub fn send(self) -> Result<(), fidl::Error> {
5406        let _result = self.send_raw();
5407        if _result.is_err() {
5408            self.control_handle.shutdown();
5409        }
5410        self.drop_without_shutdown();
5411        _result
5412    }
5413
5414    /// Similar to "send" but does not shutdown the channel if an error occurs.
5415    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5416        let _result = self.send_raw();
5417        self.drop_without_shutdown();
5418        _result
5419    }
5420
5421    fn send_raw(&self) -> Result<(), fidl::Error> {
5422        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5423            (),
5424            self.tx_id,
5425            0x7a15369d88e1e8ec,
5426            fidl::encoding::DynamicFlags::empty(),
5427        )
5428    }
5429}
5430
5431#[must_use = "FIDL methods require a response to be sent"]
5432#[derive(Debug)]
5433pub struct RunnerSendOpenTargetStrictEventResponder {
5434    control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
5435    tx_id: u32,
5436}
5437
5438/// Set the the channel to be shutdown (see [`RunnerControlHandle::shutdown`])
5439/// if the responder is dropped without sending a response, so that the client
5440/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5441impl std::ops::Drop for RunnerSendOpenTargetStrictEventResponder {
5442    fn drop(&mut self) {
5443        self.control_handle.shutdown();
5444        // Safety: drops once, never accessed again
5445        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5446    }
5447}
5448
5449impl fidl::endpoints::Responder for RunnerSendOpenTargetStrictEventResponder {
5450    type ControlHandle = RunnerControlHandle;
5451
5452    fn control_handle(&self) -> &RunnerControlHandle {
5453        &self.control_handle
5454    }
5455
5456    fn drop_without_shutdown(mut self) {
5457        // Safety: drops once, never accessed again due to mem::forget
5458        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5459        // Prevent Drop from running (which would shut down the channel)
5460        std::mem::forget(self);
5461    }
5462}
5463
5464impl RunnerSendOpenTargetStrictEventResponder {
5465    /// Sends a response to the FIDL transaction.
5466    ///
5467    /// Sets the channel to shutdown if an error occurs.
5468    pub fn send(self) -> Result<(), fidl::Error> {
5469        let _result = self.send_raw();
5470        if _result.is_err() {
5471            self.control_handle.shutdown();
5472        }
5473        self.drop_without_shutdown();
5474        _result
5475    }
5476
5477    /// Similar to "send" but does not shutdown the channel if an error occurs.
5478    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5479        let _result = self.send_raw();
5480        self.drop_without_shutdown();
5481        _result
5482    }
5483
5484    fn send_raw(&self) -> Result<(), fidl::Error> {
5485        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5486            (),
5487            self.tx_id,
5488            0x1c3e4452a20c9590,
5489            fidl::encoding::DynamicFlags::empty(),
5490        )
5491    }
5492}
5493
5494#[must_use = "FIDL methods require a response to be sent"]
5495#[derive(Debug)]
5496pub struct RunnerSendOpenTargetFlexibleEventResponder {
5497    control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
5498    tx_id: u32,
5499}
5500
5501/// Set the the channel to be shutdown (see [`RunnerControlHandle::shutdown`])
5502/// if the responder is dropped without sending a response, so that the client
5503/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5504impl std::ops::Drop for RunnerSendOpenTargetFlexibleEventResponder {
5505    fn drop(&mut self) {
5506        self.control_handle.shutdown();
5507        // Safety: drops once, never accessed again
5508        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5509    }
5510}
5511
5512impl fidl::endpoints::Responder for RunnerSendOpenTargetFlexibleEventResponder {
5513    type ControlHandle = RunnerControlHandle;
5514
5515    fn control_handle(&self) -> &RunnerControlHandle {
5516        &self.control_handle
5517    }
5518
5519    fn drop_without_shutdown(mut self) {
5520        // Safety: drops once, never accessed again due to mem::forget
5521        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5522        // Prevent Drop from running (which would shut down the channel)
5523        std::mem::forget(self);
5524    }
5525}
5526
5527impl RunnerSendOpenTargetFlexibleEventResponder {
5528    /// Sends a response to the FIDL transaction.
5529    ///
5530    /// Sets the channel to shutdown if an error occurs.
5531    pub fn send(self) -> Result<(), fidl::Error> {
5532        let _result = self.send_raw();
5533        if _result.is_err() {
5534            self.control_handle.shutdown();
5535        }
5536        self.drop_without_shutdown();
5537        _result
5538    }
5539
5540    /// Similar to "send" but does not shutdown the channel if an error occurs.
5541    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5542        let _result = self.send_raw();
5543        self.drop_without_shutdown();
5544        _result
5545    }
5546
5547    fn send_raw(&self) -> Result<(), fidl::Error> {
5548        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
5549            (),
5550            self.tx_id,
5551            0x2d2c9446799baeb6,
5552            fidl::encoding::DynamicFlags::empty(),
5553        )
5554    }
5555}
5556
5557mod internal {
5558    use super::*;
5559
5560    impl fidl::encoding::ResourceTypeMarker for ClosedTargetCreateNHandleVectorRequest {
5561        type Borrowed<'a> = &'a mut Self;
5562        fn take_or_borrow<'a>(
5563            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5564        ) -> Self::Borrowed<'a> {
5565            value
5566        }
5567    }
5568
5569    unsafe impl fidl::encoding::TypeMarker for ClosedTargetCreateNHandleVectorRequest {
5570        type Owned = Self;
5571
5572        #[inline(always)]
5573        fn inline_align(_context: fidl::encoding::Context) -> usize {
5574            4
5575        }
5576
5577        #[inline(always)]
5578        fn inline_size(_context: fidl::encoding::Context) -> usize {
5579            4
5580        }
5581        #[inline(always)]
5582        fn encode_is_copy() -> bool {
5583            true
5584        }
5585
5586        #[inline(always)]
5587        fn decode_is_copy() -> bool {
5588            true
5589        }
5590    }
5591
5592    unsafe impl
5593        fidl::encoding::Encode<
5594            ClosedTargetCreateNHandleVectorRequest,
5595            fidl::encoding::DefaultFuchsiaResourceDialect,
5596        > for &mut ClosedTargetCreateNHandleVectorRequest
5597    {
5598        #[inline]
5599        unsafe fn encode(
5600            self,
5601            encoder: &mut fidl::encoding::Encoder<
5602                '_,
5603                fidl::encoding::DefaultFuchsiaResourceDialect,
5604            >,
5605            offset: usize,
5606            _depth: fidl::encoding::Depth,
5607        ) -> fidl::Result<()> {
5608            encoder.debug_check_bounds::<ClosedTargetCreateNHandleVectorRequest>(offset);
5609            unsafe {
5610                // Copy the object into the buffer.
5611                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5612                (buf_ptr as *mut ClosedTargetCreateNHandleVectorRequest).write_unaligned(
5613                    (self as *const ClosedTargetCreateNHandleVectorRequest).read(),
5614                );
5615                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5616                // done second because the memcpy will write garbage to these bytes.
5617            }
5618            Ok(())
5619        }
5620    }
5621    unsafe impl<T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>>
5622        fidl::encoding::Encode<
5623            ClosedTargetCreateNHandleVectorRequest,
5624            fidl::encoding::DefaultFuchsiaResourceDialect,
5625        > for (T0,)
5626    {
5627        #[inline]
5628        unsafe fn encode(
5629            self,
5630            encoder: &mut fidl::encoding::Encoder<
5631                '_,
5632                fidl::encoding::DefaultFuchsiaResourceDialect,
5633            >,
5634            offset: usize,
5635            depth: fidl::encoding::Depth,
5636        ) -> fidl::Result<()> {
5637            encoder.debug_check_bounds::<ClosedTargetCreateNHandleVectorRequest>(offset);
5638            // Zero out padding regions. There's no need to apply masks
5639            // because the unmasked parts will be overwritten by fields.
5640            // Write the fields.
5641            self.0.encode(encoder, offset + 0, depth)?;
5642            Ok(())
5643        }
5644    }
5645
5646    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5647        for ClosedTargetCreateNHandleVectorRequest
5648    {
5649        #[inline(always)]
5650        fn new_empty() -> Self {
5651            Self { n: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect) }
5652        }
5653
5654        #[inline]
5655        unsafe fn decode(
5656            &mut self,
5657            decoder: &mut fidl::encoding::Decoder<
5658                '_,
5659                fidl::encoding::DefaultFuchsiaResourceDialect,
5660            >,
5661            offset: usize,
5662            _depth: fidl::encoding::Depth,
5663        ) -> fidl::Result<()> {
5664            decoder.debug_check_bounds::<Self>(offset);
5665            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5666            // Verify that padding bytes are zero.
5667            // Copy from the buffer into the object.
5668            unsafe {
5669                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5670            }
5671            Ok(())
5672        }
5673    }
5674
5675    impl fidl::encoding::ResourceTypeMarker for ClosedTargetCreateNHandleVectorResponse {
5676        type Borrowed<'a> = &'a mut Self;
5677        fn take_or_borrow<'a>(
5678            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5679        ) -> Self::Borrowed<'a> {
5680            value
5681        }
5682    }
5683
5684    unsafe impl fidl::encoding::TypeMarker for ClosedTargetCreateNHandleVectorResponse {
5685        type Owned = Self;
5686
5687        #[inline(always)]
5688        fn inline_align(_context: fidl::encoding::Context) -> usize {
5689            8
5690        }
5691
5692        #[inline(always)]
5693        fn inline_size(_context: fidl::encoding::Context) -> usize {
5694            16
5695        }
5696    }
5697
5698    unsafe impl
5699        fidl::encoding::Encode<
5700            ClosedTargetCreateNHandleVectorResponse,
5701            fidl::encoding::DefaultFuchsiaResourceDialect,
5702        > for &mut ClosedTargetCreateNHandleVectorResponse
5703    {
5704        #[inline]
5705        unsafe fn encode(
5706            self,
5707            encoder: &mut fidl::encoding::Encoder<
5708                '_,
5709                fidl::encoding::DefaultFuchsiaResourceDialect,
5710            >,
5711            offset: usize,
5712            _depth: fidl::encoding::Depth,
5713        ) -> fidl::Result<()> {
5714            encoder.debug_check_bounds::<ClosedTargetCreateNHandleVectorResponse>(offset);
5715            // Delegate to tuple encoding.
5716            fidl::encoding::Encode::<
5717                ClosedTargetCreateNHandleVectorResponse,
5718                fidl::encoding::DefaultFuchsiaResourceDialect,
5719            >::encode(
5720                (<fidl::encoding::UnboundedVector<
5721                    fidl::encoding::HandleType<
5722                        fidl::Event,
5723                        { fidl::ObjectType::EVENT.into_raw() },
5724                        2147483648,
5725                    >,
5726                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5727                    &mut self.vec
5728                ),),
5729                encoder,
5730                offset,
5731                _depth,
5732            )
5733        }
5734    }
5735    unsafe impl<
5736        T0: fidl::encoding::Encode<
5737                fidl::encoding::UnboundedVector<
5738                    fidl::encoding::HandleType<
5739                        fidl::Event,
5740                        { fidl::ObjectType::EVENT.into_raw() },
5741                        2147483648,
5742                    >,
5743                >,
5744                fidl::encoding::DefaultFuchsiaResourceDialect,
5745            >,
5746    >
5747        fidl::encoding::Encode<
5748            ClosedTargetCreateNHandleVectorResponse,
5749            fidl::encoding::DefaultFuchsiaResourceDialect,
5750        > for (T0,)
5751    {
5752        #[inline]
5753        unsafe fn encode(
5754            self,
5755            encoder: &mut fidl::encoding::Encoder<
5756                '_,
5757                fidl::encoding::DefaultFuchsiaResourceDialect,
5758            >,
5759            offset: usize,
5760            depth: fidl::encoding::Depth,
5761        ) -> fidl::Result<()> {
5762            encoder.debug_check_bounds::<ClosedTargetCreateNHandleVectorResponse>(offset);
5763            // Zero out padding regions. There's no need to apply masks
5764            // because the unmasked parts will be overwritten by fields.
5765            // Write the fields.
5766            self.0.encode(encoder, offset + 0, depth)?;
5767            Ok(())
5768        }
5769    }
5770
5771    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5772        for ClosedTargetCreateNHandleVectorResponse
5773    {
5774        #[inline(always)]
5775        fn new_empty() -> Self {
5776            Self {
5777                vec: fidl::new_empty!(
5778                    fidl::encoding::UnboundedVector<
5779                        fidl::encoding::HandleType<
5780                            fidl::Event,
5781                            { fidl::ObjectType::EVENT.into_raw() },
5782                            2147483648,
5783                        >,
5784                    >,
5785                    fidl::encoding::DefaultFuchsiaResourceDialect
5786                ),
5787            }
5788        }
5789
5790        #[inline]
5791        unsafe fn decode(
5792            &mut self,
5793            decoder: &mut fidl::encoding::Decoder<
5794                '_,
5795                fidl::encoding::DefaultFuchsiaResourceDialect,
5796            >,
5797            offset: usize,
5798            _depth: fidl::encoding::Depth,
5799        ) -> fidl::Result<()> {
5800            decoder.debug_check_bounds::<Self>(offset);
5801            // Verify that padding bytes are zero.
5802            fidl::decode!(
5803                fidl::encoding::UnboundedVector<
5804                    fidl::encoding::HandleType<
5805                        fidl::Event,
5806                        { fidl::ObjectType::EVENT.into_raw() },
5807                        2147483648,
5808                    >,
5809                >,
5810                fidl::encoding::DefaultFuchsiaResourceDialect,
5811                &mut self.vec,
5812                decoder,
5813                offset + 0,
5814                _depth
5815            )?;
5816            Ok(())
5817        }
5818    }
5819
5820    impl fidl::encoding::ResourceTypeMarker for ClosedTargetEchoAsTransferableSignalableEventRequest {
5821        type Borrowed<'a> = &'a mut Self;
5822        fn take_or_borrow<'a>(
5823            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5824        ) -> Self::Borrowed<'a> {
5825            value
5826        }
5827    }
5828
5829    unsafe impl fidl::encoding::TypeMarker for ClosedTargetEchoAsTransferableSignalableEventRequest {
5830        type Owned = Self;
5831
5832        #[inline(always)]
5833        fn inline_align(_context: fidl::encoding::Context) -> usize {
5834            4
5835        }
5836
5837        #[inline(always)]
5838        fn inline_size(_context: fidl::encoding::Context) -> usize {
5839            4
5840        }
5841    }
5842
5843    unsafe impl
5844        fidl::encoding::Encode<
5845            ClosedTargetEchoAsTransferableSignalableEventRequest,
5846            fidl::encoding::DefaultFuchsiaResourceDialect,
5847        > for &mut ClosedTargetEchoAsTransferableSignalableEventRequest
5848    {
5849        #[inline]
5850        unsafe fn encode(
5851            self,
5852            encoder: &mut fidl::encoding::Encoder<
5853                '_,
5854                fidl::encoding::DefaultFuchsiaResourceDialect,
5855            >,
5856            offset: usize,
5857            _depth: fidl::encoding::Depth,
5858        ) -> fidl::Result<()> {
5859            encoder
5860                .debug_check_bounds::<ClosedTargetEchoAsTransferableSignalableEventRequest>(offset);
5861            // Delegate to tuple encoding.
5862            fidl::encoding::Encode::<
5863                ClosedTargetEchoAsTransferableSignalableEventRequest,
5864                fidl::encoding::DefaultFuchsiaResourceDialect,
5865            >::encode(
5866                (<fidl::encoding::HandleType<
5867                    fidl::NullableHandle,
5868                    { fidl::ObjectType::NONE.into_raw() },
5869                    2147483648,
5870                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5871                    &mut self.handle
5872                ),),
5873                encoder,
5874                offset,
5875                _depth,
5876            )
5877        }
5878    }
5879    unsafe impl<
5880        T0: fidl::encoding::Encode<
5881                fidl::encoding::HandleType<
5882                    fidl::NullableHandle,
5883                    { fidl::ObjectType::NONE.into_raw() },
5884                    2147483648,
5885                >,
5886                fidl::encoding::DefaultFuchsiaResourceDialect,
5887            >,
5888    >
5889        fidl::encoding::Encode<
5890            ClosedTargetEchoAsTransferableSignalableEventRequest,
5891            fidl::encoding::DefaultFuchsiaResourceDialect,
5892        > for (T0,)
5893    {
5894        #[inline]
5895        unsafe fn encode(
5896            self,
5897            encoder: &mut fidl::encoding::Encoder<
5898                '_,
5899                fidl::encoding::DefaultFuchsiaResourceDialect,
5900            >,
5901            offset: usize,
5902            depth: fidl::encoding::Depth,
5903        ) -> fidl::Result<()> {
5904            encoder
5905                .debug_check_bounds::<ClosedTargetEchoAsTransferableSignalableEventRequest>(offset);
5906            // Zero out padding regions. There's no need to apply masks
5907            // because the unmasked parts will be overwritten by fields.
5908            // Write the fields.
5909            self.0.encode(encoder, offset + 0, depth)?;
5910            Ok(())
5911        }
5912    }
5913
5914    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5915        for ClosedTargetEchoAsTransferableSignalableEventRequest
5916    {
5917        #[inline(always)]
5918        fn new_empty() -> Self {
5919            Self {
5920                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5921            }
5922        }
5923
5924        #[inline]
5925        unsafe fn decode(
5926            &mut self,
5927            decoder: &mut fidl::encoding::Decoder<
5928                '_,
5929                fidl::encoding::DefaultFuchsiaResourceDialect,
5930            >,
5931            offset: usize,
5932            _depth: fidl::encoding::Depth,
5933        ) -> fidl::Result<()> {
5934            decoder.debug_check_bounds::<Self>(offset);
5935            // Verify that padding bytes are zero.
5936            fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
5937            Ok(())
5938        }
5939    }
5940
5941    impl fidl::encoding::ResourceTypeMarker for ClosedTargetEchoAsTransferableSignalableEventResponse {
5942        type Borrowed<'a> = &'a mut Self;
5943        fn take_or_borrow<'a>(
5944            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5945        ) -> Self::Borrowed<'a> {
5946            value
5947        }
5948    }
5949
5950    unsafe impl fidl::encoding::TypeMarker for ClosedTargetEchoAsTransferableSignalableEventResponse {
5951        type Owned = Self;
5952
5953        #[inline(always)]
5954        fn inline_align(_context: fidl::encoding::Context) -> usize {
5955            4
5956        }
5957
5958        #[inline(always)]
5959        fn inline_size(_context: fidl::encoding::Context) -> usize {
5960            4
5961        }
5962    }
5963
5964    unsafe impl
5965        fidl::encoding::Encode<
5966            ClosedTargetEchoAsTransferableSignalableEventResponse,
5967            fidl::encoding::DefaultFuchsiaResourceDialect,
5968        > for &mut ClosedTargetEchoAsTransferableSignalableEventResponse
5969    {
5970        #[inline]
5971        unsafe fn encode(
5972            self,
5973            encoder: &mut fidl::encoding::Encoder<
5974                '_,
5975                fidl::encoding::DefaultFuchsiaResourceDialect,
5976            >,
5977            offset: usize,
5978            _depth: fidl::encoding::Depth,
5979        ) -> fidl::Result<()> {
5980            encoder.debug_check_bounds::<ClosedTargetEchoAsTransferableSignalableEventResponse>(
5981                offset,
5982            );
5983            // Delegate to tuple encoding.
5984            fidl::encoding::Encode::<
5985                ClosedTargetEchoAsTransferableSignalableEventResponse,
5986                fidl::encoding::DefaultFuchsiaResourceDialect,
5987            >::encode(
5988                (<fidl::encoding::HandleType<
5989                    fidl::Event,
5990                    { fidl::ObjectType::EVENT.into_raw() },
5991                    4098,
5992                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5993                    &mut self.handle
5994                ),),
5995                encoder,
5996                offset,
5997                _depth,
5998            )
5999        }
6000    }
6001    unsafe impl<
6002        T0: fidl::encoding::Encode<
6003                fidl::encoding::HandleType<
6004                    fidl::Event,
6005                    { fidl::ObjectType::EVENT.into_raw() },
6006                    4098,
6007                >,
6008                fidl::encoding::DefaultFuchsiaResourceDialect,
6009            >,
6010    >
6011        fidl::encoding::Encode<
6012            ClosedTargetEchoAsTransferableSignalableEventResponse,
6013            fidl::encoding::DefaultFuchsiaResourceDialect,
6014        > for (T0,)
6015    {
6016        #[inline]
6017        unsafe fn encode(
6018            self,
6019            encoder: &mut fidl::encoding::Encoder<
6020                '_,
6021                fidl::encoding::DefaultFuchsiaResourceDialect,
6022            >,
6023            offset: usize,
6024            depth: fidl::encoding::Depth,
6025        ) -> fidl::Result<()> {
6026            encoder.debug_check_bounds::<ClosedTargetEchoAsTransferableSignalableEventResponse>(
6027                offset,
6028            );
6029            // Zero out padding regions. There's no need to apply masks
6030            // because the unmasked parts will be overwritten by fields.
6031            // Write the fields.
6032            self.0.encode(encoder, offset + 0, depth)?;
6033            Ok(())
6034        }
6035    }
6036
6037    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6038        for ClosedTargetEchoAsTransferableSignalableEventResponse
6039    {
6040        #[inline(always)]
6041        fn new_empty() -> Self {
6042            Self {
6043                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4098>, fidl::encoding::DefaultFuchsiaResourceDialect),
6044            }
6045        }
6046
6047        #[inline]
6048        unsafe fn decode(
6049            &mut self,
6050            decoder: &mut fidl::encoding::Decoder<
6051                '_,
6052                fidl::encoding::DefaultFuchsiaResourceDialect,
6053            >,
6054            offset: usize,
6055            _depth: fidl::encoding::Depth,
6056        ) -> fidl::Result<()> {
6057            decoder.debug_check_bounds::<Self>(offset);
6058            // Verify that padding bytes are zero.
6059            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4098>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
6060            Ok(())
6061        }
6062    }
6063
6064    impl fidl::encoding::ResourceTypeMarker for ClosedTargetGetHandleRightsRequest {
6065        type Borrowed<'a> = &'a mut Self;
6066        fn take_or_borrow<'a>(
6067            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6068        ) -> Self::Borrowed<'a> {
6069            value
6070        }
6071    }
6072
6073    unsafe impl fidl::encoding::TypeMarker for ClosedTargetGetHandleRightsRequest {
6074        type Owned = Self;
6075
6076        #[inline(always)]
6077        fn inline_align(_context: fidl::encoding::Context) -> usize {
6078            4
6079        }
6080
6081        #[inline(always)]
6082        fn inline_size(_context: fidl::encoding::Context) -> usize {
6083            4
6084        }
6085    }
6086
6087    unsafe impl
6088        fidl::encoding::Encode<
6089            ClosedTargetGetHandleRightsRequest,
6090            fidl::encoding::DefaultFuchsiaResourceDialect,
6091        > for &mut ClosedTargetGetHandleRightsRequest
6092    {
6093        #[inline]
6094        unsafe fn encode(
6095            self,
6096            encoder: &mut fidl::encoding::Encoder<
6097                '_,
6098                fidl::encoding::DefaultFuchsiaResourceDialect,
6099            >,
6100            offset: usize,
6101            _depth: fidl::encoding::Depth,
6102        ) -> fidl::Result<()> {
6103            encoder.debug_check_bounds::<ClosedTargetGetHandleRightsRequest>(offset);
6104            // Delegate to tuple encoding.
6105            fidl::encoding::Encode::<
6106                ClosedTargetGetHandleRightsRequest,
6107                fidl::encoding::DefaultFuchsiaResourceDialect,
6108            >::encode(
6109                (<fidl::encoding::HandleType<
6110                    fidl::NullableHandle,
6111                    { fidl::ObjectType::NONE.into_raw() },
6112                    2147483648,
6113                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6114                    &mut self.handle
6115                ),),
6116                encoder,
6117                offset,
6118                _depth,
6119            )
6120        }
6121    }
6122    unsafe impl<
6123        T0: fidl::encoding::Encode<
6124                fidl::encoding::HandleType<
6125                    fidl::NullableHandle,
6126                    { fidl::ObjectType::NONE.into_raw() },
6127                    2147483648,
6128                >,
6129                fidl::encoding::DefaultFuchsiaResourceDialect,
6130            >,
6131    >
6132        fidl::encoding::Encode<
6133            ClosedTargetGetHandleRightsRequest,
6134            fidl::encoding::DefaultFuchsiaResourceDialect,
6135        > for (T0,)
6136    {
6137        #[inline]
6138        unsafe fn encode(
6139            self,
6140            encoder: &mut fidl::encoding::Encoder<
6141                '_,
6142                fidl::encoding::DefaultFuchsiaResourceDialect,
6143            >,
6144            offset: usize,
6145            depth: fidl::encoding::Depth,
6146        ) -> fidl::Result<()> {
6147            encoder.debug_check_bounds::<ClosedTargetGetHandleRightsRequest>(offset);
6148            // Zero out padding regions. There's no need to apply masks
6149            // because the unmasked parts will be overwritten by fields.
6150            // Write the fields.
6151            self.0.encode(encoder, offset + 0, depth)?;
6152            Ok(())
6153        }
6154    }
6155
6156    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6157        for ClosedTargetGetHandleRightsRequest
6158    {
6159        #[inline(always)]
6160        fn new_empty() -> Self {
6161            Self {
6162                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6163            }
6164        }
6165
6166        #[inline]
6167        unsafe fn decode(
6168            &mut self,
6169            decoder: &mut fidl::encoding::Decoder<
6170                '_,
6171                fidl::encoding::DefaultFuchsiaResourceDialect,
6172            >,
6173            offset: usize,
6174            _depth: fidl::encoding::Depth,
6175        ) -> fidl::Result<()> {
6176            decoder.debug_check_bounds::<Self>(offset);
6177            // Verify that padding bytes are zero.
6178            fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
6179            Ok(())
6180        }
6181    }
6182
6183    impl fidl::encoding::ResourceTypeMarker for ClosedTargetGetSignalableEventRightsRequest {
6184        type Borrowed<'a> = &'a mut Self;
6185        fn take_or_borrow<'a>(
6186            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6187        ) -> Self::Borrowed<'a> {
6188            value
6189        }
6190    }
6191
6192    unsafe impl fidl::encoding::TypeMarker for ClosedTargetGetSignalableEventRightsRequest {
6193        type Owned = Self;
6194
6195        #[inline(always)]
6196        fn inline_align(_context: fidl::encoding::Context) -> usize {
6197            4
6198        }
6199
6200        #[inline(always)]
6201        fn inline_size(_context: fidl::encoding::Context) -> usize {
6202            4
6203        }
6204    }
6205
6206    unsafe impl
6207        fidl::encoding::Encode<
6208            ClosedTargetGetSignalableEventRightsRequest,
6209            fidl::encoding::DefaultFuchsiaResourceDialect,
6210        > for &mut ClosedTargetGetSignalableEventRightsRequest
6211    {
6212        #[inline]
6213        unsafe fn encode(
6214            self,
6215            encoder: &mut fidl::encoding::Encoder<
6216                '_,
6217                fidl::encoding::DefaultFuchsiaResourceDialect,
6218            >,
6219            offset: usize,
6220            _depth: fidl::encoding::Depth,
6221        ) -> fidl::Result<()> {
6222            encoder.debug_check_bounds::<ClosedTargetGetSignalableEventRightsRequest>(offset);
6223            // Delegate to tuple encoding.
6224            fidl::encoding::Encode::<
6225                ClosedTargetGetSignalableEventRightsRequest,
6226                fidl::encoding::DefaultFuchsiaResourceDialect,
6227            >::encode(
6228                (<fidl::encoding::HandleType<
6229                    fidl::Event,
6230                    { fidl::ObjectType::EVENT.into_raw() },
6231                    4096,
6232                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6233                    &mut self.handle
6234                ),),
6235                encoder,
6236                offset,
6237                _depth,
6238            )
6239        }
6240    }
6241    unsafe impl<
6242        T0: fidl::encoding::Encode<
6243                fidl::encoding::HandleType<
6244                    fidl::Event,
6245                    { fidl::ObjectType::EVENT.into_raw() },
6246                    4096,
6247                >,
6248                fidl::encoding::DefaultFuchsiaResourceDialect,
6249            >,
6250    >
6251        fidl::encoding::Encode<
6252            ClosedTargetGetSignalableEventRightsRequest,
6253            fidl::encoding::DefaultFuchsiaResourceDialect,
6254        > for (T0,)
6255    {
6256        #[inline]
6257        unsafe fn encode(
6258            self,
6259            encoder: &mut fidl::encoding::Encoder<
6260                '_,
6261                fidl::encoding::DefaultFuchsiaResourceDialect,
6262            >,
6263            offset: usize,
6264            depth: fidl::encoding::Depth,
6265        ) -> fidl::Result<()> {
6266            encoder.debug_check_bounds::<ClosedTargetGetSignalableEventRightsRequest>(offset);
6267            // Zero out padding regions. There's no need to apply masks
6268            // because the unmasked parts will be overwritten by fields.
6269            // Write the fields.
6270            self.0.encode(encoder, offset + 0, depth)?;
6271            Ok(())
6272        }
6273    }
6274
6275    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6276        for ClosedTargetGetSignalableEventRightsRequest
6277    {
6278        #[inline(always)]
6279        fn new_empty() -> Self {
6280            Self {
6281                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect),
6282            }
6283        }
6284
6285        #[inline]
6286        unsafe fn decode(
6287            &mut self,
6288            decoder: &mut fidl::encoding::Decoder<
6289                '_,
6290                fidl::encoding::DefaultFuchsiaResourceDialect,
6291            >,
6292            offset: usize,
6293            _depth: fidl::encoding::Depth,
6294        ) -> fidl::Result<()> {
6295            decoder.debug_check_bounds::<Self>(offset);
6296            // Verify that padding bytes are zero.
6297            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
6298            Ok(())
6299        }
6300    }
6301
6302    impl fidl::encoding::ResourceTypeMarker for ClosedTargetHandleVectorSizeRequest {
6303        type Borrowed<'a> = &'a mut Self;
6304        fn take_or_borrow<'a>(
6305            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6306        ) -> Self::Borrowed<'a> {
6307            value
6308        }
6309    }
6310
6311    unsafe impl fidl::encoding::TypeMarker for ClosedTargetHandleVectorSizeRequest {
6312        type Owned = Self;
6313
6314        #[inline(always)]
6315        fn inline_align(_context: fidl::encoding::Context) -> usize {
6316            8
6317        }
6318
6319        #[inline(always)]
6320        fn inline_size(_context: fidl::encoding::Context) -> usize {
6321            16
6322        }
6323    }
6324
6325    unsafe impl
6326        fidl::encoding::Encode<
6327            ClosedTargetHandleVectorSizeRequest,
6328            fidl::encoding::DefaultFuchsiaResourceDialect,
6329        > for &mut ClosedTargetHandleVectorSizeRequest
6330    {
6331        #[inline]
6332        unsafe fn encode(
6333            self,
6334            encoder: &mut fidl::encoding::Encoder<
6335                '_,
6336                fidl::encoding::DefaultFuchsiaResourceDialect,
6337            >,
6338            offset: usize,
6339            _depth: fidl::encoding::Depth,
6340        ) -> fidl::Result<()> {
6341            encoder.debug_check_bounds::<ClosedTargetHandleVectorSizeRequest>(offset);
6342            // Delegate to tuple encoding.
6343            fidl::encoding::Encode::<
6344                ClosedTargetHandleVectorSizeRequest,
6345                fidl::encoding::DefaultFuchsiaResourceDialect,
6346            >::encode(
6347                (<fidl::encoding::UnboundedVector<
6348                    fidl::encoding::HandleType<
6349                        fidl::Event,
6350                        { fidl::ObjectType::EVENT.into_raw() },
6351                        2147483648,
6352                    >,
6353                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6354                    &mut self.vec
6355                ),),
6356                encoder,
6357                offset,
6358                _depth,
6359            )
6360        }
6361    }
6362    unsafe impl<
6363        T0: fidl::encoding::Encode<
6364                fidl::encoding::UnboundedVector<
6365                    fidl::encoding::HandleType<
6366                        fidl::Event,
6367                        { fidl::ObjectType::EVENT.into_raw() },
6368                        2147483648,
6369                    >,
6370                >,
6371                fidl::encoding::DefaultFuchsiaResourceDialect,
6372            >,
6373    >
6374        fidl::encoding::Encode<
6375            ClosedTargetHandleVectorSizeRequest,
6376            fidl::encoding::DefaultFuchsiaResourceDialect,
6377        > for (T0,)
6378    {
6379        #[inline]
6380        unsafe fn encode(
6381            self,
6382            encoder: &mut fidl::encoding::Encoder<
6383                '_,
6384                fidl::encoding::DefaultFuchsiaResourceDialect,
6385            >,
6386            offset: usize,
6387            depth: fidl::encoding::Depth,
6388        ) -> fidl::Result<()> {
6389            encoder.debug_check_bounds::<ClosedTargetHandleVectorSizeRequest>(offset);
6390            // Zero out padding regions. There's no need to apply masks
6391            // because the unmasked parts will be overwritten by fields.
6392            // Write the fields.
6393            self.0.encode(encoder, offset + 0, depth)?;
6394            Ok(())
6395        }
6396    }
6397
6398    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6399        for ClosedTargetHandleVectorSizeRequest
6400    {
6401        #[inline(always)]
6402        fn new_empty() -> Self {
6403            Self {
6404                vec: fidl::new_empty!(
6405                    fidl::encoding::UnboundedVector<
6406                        fidl::encoding::HandleType<
6407                            fidl::Event,
6408                            { fidl::ObjectType::EVENT.into_raw() },
6409                            2147483648,
6410                        >,
6411                    >,
6412                    fidl::encoding::DefaultFuchsiaResourceDialect
6413                ),
6414            }
6415        }
6416
6417        #[inline]
6418        unsafe fn decode(
6419            &mut self,
6420            decoder: &mut fidl::encoding::Decoder<
6421                '_,
6422                fidl::encoding::DefaultFuchsiaResourceDialect,
6423            >,
6424            offset: usize,
6425            _depth: fidl::encoding::Depth,
6426        ) -> fidl::Result<()> {
6427            decoder.debug_check_bounds::<Self>(offset);
6428            // Verify that padding bytes are zero.
6429            fidl::decode!(
6430                fidl::encoding::UnboundedVector<
6431                    fidl::encoding::HandleType<
6432                        fidl::Event,
6433                        { fidl::ObjectType::EVENT.into_raw() },
6434                        2147483648,
6435                    >,
6436                >,
6437                fidl::encoding::DefaultFuchsiaResourceDialect,
6438                &mut self.vec,
6439                decoder,
6440                offset + 0,
6441                _depth
6442            )?;
6443            Ok(())
6444        }
6445    }
6446
6447    impl fidl::encoding::ResourceTypeMarker for RunnerStartRequest {
6448        type Borrowed<'a> = &'a mut Self;
6449        fn take_or_borrow<'a>(
6450            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6451        ) -> Self::Borrowed<'a> {
6452            value
6453        }
6454    }
6455
6456    unsafe impl fidl::encoding::TypeMarker for RunnerStartRequest {
6457        type Owned = Self;
6458
6459        #[inline(always)]
6460        fn inline_align(_context: fidl::encoding::Context) -> usize {
6461            8
6462        }
6463
6464        #[inline(always)]
6465        fn inline_size(_context: fidl::encoding::Context) -> usize {
6466            24
6467        }
6468    }
6469
6470    unsafe impl
6471        fidl::encoding::Encode<RunnerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
6472        for &mut RunnerStartRequest
6473    {
6474        #[inline]
6475        unsafe fn encode(
6476            self,
6477            encoder: &mut fidl::encoding::Encoder<
6478                '_,
6479                fidl::encoding::DefaultFuchsiaResourceDialect,
6480            >,
6481            offset: usize,
6482            _depth: fidl::encoding::Depth,
6483        ) -> fidl::Result<()> {
6484            encoder.debug_check_bounds::<RunnerStartRequest>(offset);
6485            // Delegate to tuple encoding.
6486            fidl::encoding::Encode::<
6487                RunnerStartRequest,
6488                fidl::encoding::DefaultFuchsiaResourceDialect,
6489            >::encode(
6490                (
6491                    <Test as fidl::encoding::ValueTypeMarker>::borrow(&self.test),
6492                    <AnyTarget as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6493                        &mut self.any_target,
6494                    ),
6495                ),
6496                encoder,
6497                offset,
6498                _depth,
6499            )
6500        }
6501    }
6502    unsafe impl<
6503        T0: fidl::encoding::Encode<Test, fidl::encoding::DefaultFuchsiaResourceDialect>,
6504        T1: fidl::encoding::Encode<AnyTarget, fidl::encoding::DefaultFuchsiaResourceDialect>,
6505    > fidl::encoding::Encode<RunnerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
6506        for (T0, T1)
6507    {
6508        #[inline]
6509        unsafe fn encode(
6510            self,
6511            encoder: &mut fidl::encoding::Encoder<
6512                '_,
6513                fidl::encoding::DefaultFuchsiaResourceDialect,
6514            >,
6515            offset: usize,
6516            depth: fidl::encoding::Depth,
6517        ) -> fidl::Result<()> {
6518            encoder.debug_check_bounds::<RunnerStartRequest>(offset);
6519            // Zero out padding regions. There's no need to apply masks
6520            // because the unmasked parts will be overwritten by fields.
6521            unsafe {
6522                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6523                (ptr as *mut u64).write_unaligned(0);
6524            }
6525            // Write the fields.
6526            self.0.encode(encoder, offset + 0, depth)?;
6527            self.1.encode(encoder, offset + 8, depth)?;
6528            Ok(())
6529        }
6530    }
6531
6532    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6533        for RunnerStartRequest
6534    {
6535        #[inline(always)]
6536        fn new_empty() -> Self {
6537            Self {
6538                test: fidl::new_empty!(Test, fidl::encoding::DefaultFuchsiaResourceDialect),
6539                any_target: fidl::new_empty!(
6540                    AnyTarget,
6541                    fidl::encoding::DefaultFuchsiaResourceDialect
6542                ),
6543            }
6544        }
6545
6546        #[inline]
6547        unsafe fn decode(
6548            &mut self,
6549            decoder: &mut fidl::encoding::Decoder<
6550                '_,
6551                fidl::encoding::DefaultFuchsiaResourceDialect,
6552            >,
6553            offset: usize,
6554            _depth: fidl::encoding::Depth,
6555        ) -> fidl::Result<()> {
6556            decoder.debug_check_bounds::<Self>(offset);
6557            // Verify that padding bytes are zero.
6558            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6559            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6560            let mask = 0xffffffff00000000u64;
6561            let maskedval = padval & mask;
6562            if maskedval != 0 {
6563                return Err(fidl::Error::NonZeroPadding {
6564                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6565                });
6566            }
6567            fidl::decode!(
6568                Test,
6569                fidl::encoding::DefaultFuchsiaResourceDialect,
6570                &mut self.test,
6571                decoder,
6572                offset + 0,
6573                _depth
6574            )?;
6575            fidl::decode!(
6576                AnyTarget,
6577                fidl::encoding::DefaultFuchsiaResourceDialect,
6578                &mut self.any_target,
6579                decoder,
6580                offset + 8,
6581                _depth
6582            )?;
6583            Ok(())
6584        }
6585    }
6586
6587    impl fidl::encoding::ResourceTypeMarker for AnyTarget {
6588        type Borrowed<'a> = &'a mut Self;
6589        fn take_or_borrow<'a>(
6590            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6591        ) -> Self::Borrowed<'a> {
6592            value
6593        }
6594    }
6595
6596    unsafe impl fidl::encoding::TypeMarker for AnyTarget {
6597        type Owned = Self;
6598
6599        #[inline(always)]
6600        fn inline_align(_context: fidl::encoding::Context) -> usize {
6601            8
6602        }
6603
6604        #[inline(always)]
6605        fn inline_size(_context: fidl::encoding::Context) -> usize {
6606            16
6607        }
6608    }
6609
6610    unsafe impl fidl::encoding::Encode<AnyTarget, fidl::encoding::DefaultFuchsiaResourceDialect>
6611        for &mut AnyTarget
6612    {
6613        #[inline]
6614        unsafe fn encode(
6615            self,
6616            encoder: &mut fidl::encoding::Encoder<
6617                '_,
6618                fidl::encoding::DefaultFuchsiaResourceDialect,
6619            >,
6620            offset: usize,
6621            _depth: fidl::encoding::Depth,
6622        ) -> fidl::Result<()> {
6623            encoder.debug_check_bounds::<AnyTarget>(offset);
6624            encoder.write_num::<u64>(self.ordinal(), offset);
6625            match self {
6626            AnyTarget::Closed(ref mut val) => {
6627                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6628                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
6629                    encoder, offset + 8, _depth
6630                )
6631            }
6632            AnyTarget::Ajar(ref mut val) => {
6633                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6634                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
6635                    encoder, offset + 8, _depth
6636                )
6637            }
6638            AnyTarget::Open(ref mut val) => {
6639                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6640                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
6641                    encoder, offset + 8, _depth
6642                )
6643            }
6644        }
6645        }
6646    }
6647
6648    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for AnyTarget {
6649        #[inline(always)]
6650        fn new_empty() -> Self {
6651            Self::Closed(fidl::new_empty!(
6652                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>>,
6653                fidl::encoding::DefaultFuchsiaResourceDialect
6654            ))
6655        }
6656
6657        #[inline]
6658        unsafe fn decode(
6659            &mut self,
6660            decoder: &mut fidl::encoding::Decoder<
6661                '_,
6662                fidl::encoding::DefaultFuchsiaResourceDialect,
6663            >,
6664            offset: usize,
6665            mut depth: fidl::encoding::Depth,
6666        ) -> fidl::Result<()> {
6667            decoder.debug_check_bounds::<Self>(offset);
6668            #[allow(unused_variables)]
6669            let next_out_of_line = decoder.next_out_of_line();
6670            let handles_before = decoder.remaining_handles();
6671            let (ordinal, inlined, num_bytes, num_handles) =
6672                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6673
6674            let member_inline_size = match ordinal {
6675            1 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6676            2 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6677            3 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6678            _ => return Err(fidl::Error::UnknownUnionTag),
6679        };
6680
6681            if inlined != (member_inline_size <= 4) {
6682                return Err(fidl::Error::InvalidInlineBitInEnvelope);
6683            }
6684            let _inner_offset;
6685            if inlined {
6686                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6687                _inner_offset = offset + 8;
6688            } else {
6689                depth.increment()?;
6690                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6691            }
6692            match ordinal {
6693                1 => {
6694                    #[allow(irrefutable_let_patterns)]
6695                    if let AnyTarget::Closed(_) = self {
6696                        // Do nothing, read the value into the object
6697                    } else {
6698                        // Initialize `self` to the right variant
6699                        *self = AnyTarget::Closed(fidl::new_empty!(
6700                            fidl::encoding::Endpoint<
6701                                fidl::endpoints::ServerEnd<ClosedTargetMarker>,
6702                            >,
6703                            fidl::encoding::DefaultFuchsiaResourceDialect
6704                        ));
6705                    }
6706                    #[allow(irrefutable_let_patterns)]
6707                    if let AnyTarget::Closed(ref mut val) = self {
6708                        fidl::decode!(
6709                            fidl::encoding::Endpoint<
6710                                fidl::endpoints::ServerEnd<ClosedTargetMarker>,
6711                            >,
6712                            fidl::encoding::DefaultFuchsiaResourceDialect,
6713                            val,
6714                            decoder,
6715                            _inner_offset,
6716                            depth
6717                        )?;
6718                    } else {
6719                        unreachable!()
6720                    }
6721                }
6722                2 => {
6723                    #[allow(irrefutable_let_patterns)]
6724                    if let AnyTarget::Ajar(_) = self {
6725                        // Do nothing, read the value into the object
6726                    } else {
6727                        // Initialize `self` to the right variant
6728                        *self = AnyTarget::Ajar(fidl::new_empty!(
6729                            fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>>,
6730                            fidl::encoding::DefaultFuchsiaResourceDialect
6731                        ));
6732                    }
6733                    #[allow(irrefutable_let_patterns)]
6734                    if let AnyTarget::Ajar(ref mut val) = self {
6735                        fidl::decode!(
6736                            fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>>,
6737                            fidl::encoding::DefaultFuchsiaResourceDialect,
6738                            val,
6739                            decoder,
6740                            _inner_offset,
6741                            depth
6742                        )?;
6743                    } else {
6744                        unreachable!()
6745                    }
6746                }
6747                3 => {
6748                    #[allow(irrefutable_let_patterns)]
6749                    if let AnyTarget::Open(_) = self {
6750                        // Do nothing, read the value into the object
6751                    } else {
6752                        // Initialize `self` to the right variant
6753                        *self = AnyTarget::Open(fidl::new_empty!(
6754                            fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>>,
6755                            fidl::encoding::DefaultFuchsiaResourceDialect
6756                        ));
6757                    }
6758                    #[allow(irrefutable_let_patterns)]
6759                    if let AnyTarget::Open(ref mut val) = self {
6760                        fidl::decode!(
6761                            fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>>,
6762                            fidl::encoding::DefaultFuchsiaResourceDialect,
6763                            val,
6764                            decoder,
6765                            _inner_offset,
6766                            depth
6767                        )?;
6768                    } else {
6769                        unreachable!()
6770                    }
6771                }
6772                ordinal => panic!("unexpected ordinal {:?}", ordinal),
6773            }
6774            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6775                return Err(fidl::Error::InvalidNumBytesInEnvelope);
6776            }
6777            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6778                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6779            }
6780            Ok(())
6781        }
6782    }
6783}