Skip to main content

fidl_fidl_serversuite/
fidl_fidl_serversuite.rs

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