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