fidl_test_unknown_interactions/
fidl_test_unknown_interactions.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_test_unknown_interactions__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct UnknownInteractionsAjarProtocolMarker;
16
17impl fidl::endpoints::ProtocolMarker for UnknownInteractionsAjarProtocolMarker {
18    type Proxy = UnknownInteractionsAjarProtocolProxy;
19    type RequestStream = UnknownInteractionsAjarProtocolRequestStream;
20    #[cfg(target_os = "fuchsia")]
21    type SynchronousProxy = UnknownInteractionsAjarProtocolSynchronousProxy;
22
23    const DEBUG_NAME: &'static str = "(anonymous) UnknownInteractionsAjarProtocol";
24}
25
26pub trait UnknownInteractionsAjarProtocolProxyInterface: Send + Sync {}
27#[derive(Debug)]
28#[cfg(target_os = "fuchsia")]
29pub struct UnknownInteractionsAjarProtocolSynchronousProxy {
30    client: fidl::client::sync::Client,
31}
32
33#[cfg(target_os = "fuchsia")]
34impl fidl::endpoints::SynchronousProxy for UnknownInteractionsAjarProtocolSynchronousProxy {
35    type Proxy = UnknownInteractionsAjarProtocolProxy;
36    type Protocol = UnknownInteractionsAjarProtocolMarker;
37
38    fn from_channel(inner: fidl::Channel) -> Self {
39        Self::new(inner)
40    }
41
42    fn into_channel(self) -> fidl::Channel {
43        self.client.into_channel()
44    }
45
46    fn as_channel(&self) -> &fidl::Channel {
47        self.client.as_channel()
48    }
49}
50
51#[cfg(target_os = "fuchsia")]
52impl UnknownInteractionsAjarProtocolSynchronousProxy {
53    pub fn new(channel: fidl::Channel) -> Self {
54        let protocol_name =
55            <UnknownInteractionsAjarProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
56        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
57    }
58
59    pub fn into_channel(self) -> fidl::Channel {
60        self.client.into_channel()
61    }
62
63    /// Waits until an event arrives and returns it. It is safe for other
64    /// threads to make concurrent requests while waiting for an event.
65    pub fn wait_for_event(
66        &self,
67        deadline: zx::MonotonicInstant,
68    ) -> Result<UnknownInteractionsAjarProtocolEvent, fidl::Error> {
69        UnknownInteractionsAjarProtocolEvent::decode(self.client.wait_for_event(deadline)?)
70    }
71}
72
73#[cfg(target_os = "fuchsia")]
74impl From<UnknownInteractionsAjarProtocolSynchronousProxy> for zx::Handle {
75    fn from(value: UnknownInteractionsAjarProtocolSynchronousProxy) -> Self {
76        value.into_channel().into()
77    }
78}
79
80#[cfg(target_os = "fuchsia")]
81impl From<fidl::Channel> for UnknownInteractionsAjarProtocolSynchronousProxy {
82    fn from(value: fidl::Channel) -> Self {
83        Self::new(value)
84    }
85}
86
87#[cfg(target_os = "fuchsia")]
88impl fidl::endpoints::FromClient for UnknownInteractionsAjarProtocolSynchronousProxy {
89    type Protocol = UnknownInteractionsAjarProtocolMarker;
90
91    fn from_client(
92        value: fidl::endpoints::ClientEnd<UnknownInteractionsAjarProtocolMarker>,
93    ) -> Self {
94        Self::new(value.into_channel())
95    }
96}
97
98#[derive(Debug, Clone)]
99pub struct UnknownInteractionsAjarProtocolProxy {
100    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
101}
102
103impl fidl::endpoints::Proxy for UnknownInteractionsAjarProtocolProxy {
104    type Protocol = UnknownInteractionsAjarProtocolMarker;
105
106    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
107        Self::new(inner)
108    }
109
110    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
111        self.client.into_channel().map_err(|client| Self { client })
112    }
113
114    fn as_channel(&self) -> &::fidl::AsyncChannel {
115        self.client.as_channel()
116    }
117}
118
119impl UnknownInteractionsAjarProtocolProxy {
120    /// Create a new Proxy for test.unknown.interactions/UnknownInteractionsAjarProtocol.
121    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
122        let protocol_name =
123            <UnknownInteractionsAjarProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
124        Self { client: fidl::client::Client::new(channel, protocol_name) }
125    }
126
127    /// Get a Stream of events from the remote end of the protocol.
128    ///
129    /// # Panics
130    ///
131    /// Panics if the event stream was already taken.
132    pub fn take_event_stream(&self) -> UnknownInteractionsAjarProtocolEventStream {
133        UnknownInteractionsAjarProtocolEventStream {
134            event_receiver: self.client.take_event_receiver(),
135        }
136    }
137}
138
139impl UnknownInteractionsAjarProtocolProxyInterface for UnknownInteractionsAjarProtocolProxy {}
140
141pub struct UnknownInteractionsAjarProtocolEventStream {
142    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
143}
144
145impl std::marker::Unpin for UnknownInteractionsAjarProtocolEventStream {}
146
147impl futures::stream::FusedStream for UnknownInteractionsAjarProtocolEventStream {
148    fn is_terminated(&self) -> bool {
149        self.event_receiver.is_terminated()
150    }
151}
152
153impl futures::Stream for UnknownInteractionsAjarProtocolEventStream {
154    type Item = Result<UnknownInteractionsAjarProtocolEvent, fidl::Error>;
155
156    fn poll_next(
157        mut self: std::pin::Pin<&mut Self>,
158        cx: &mut std::task::Context<'_>,
159    ) -> std::task::Poll<Option<Self::Item>> {
160        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
161            &mut self.event_receiver,
162            cx
163        )?) {
164            Some(buf) => {
165                std::task::Poll::Ready(Some(UnknownInteractionsAjarProtocolEvent::decode(buf)))
166            }
167            None => std::task::Poll::Ready(None),
168        }
169    }
170}
171
172#[derive(Debug)]
173pub enum UnknownInteractionsAjarProtocolEvent {
174    #[non_exhaustive]
175    _UnknownEvent {
176        /// Ordinal of the event that was sent.
177        ordinal: u64,
178    },
179}
180
181impl UnknownInteractionsAjarProtocolEvent {
182    /// Decodes a message buffer as a [`UnknownInteractionsAjarProtocolEvent`].
183    fn decode(
184        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
185    ) -> Result<UnknownInteractionsAjarProtocolEvent, fidl::Error> {
186        let (bytes, _handles) = buf.split_mut();
187        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
188        debug_assert_eq!(tx_header.tx_id, 0);
189        match tx_header.ordinal {
190            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
191                Ok(UnknownInteractionsAjarProtocolEvent::_UnknownEvent {
192                    ordinal: tx_header.ordinal,
193                })
194            }
195            _ => Err(fidl::Error::UnknownOrdinal {
196                ordinal: tx_header.ordinal,
197                protocol_name: <UnknownInteractionsAjarProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
198            })
199        }
200    }
201}
202
203/// A Stream of incoming requests for test.unknown.interactions/UnknownInteractionsAjarProtocol.
204pub struct UnknownInteractionsAjarProtocolRequestStream {
205    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
206    is_terminated: bool,
207}
208
209impl std::marker::Unpin for UnknownInteractionsAjarProtocolRequestStream {}
210
211impl futures::stream::FusedStream for UnknownInteractionsAjarProtocolRequestStream {
212    fn is_terminated(&self) -> bool {
213        self.is_terminated
214    }
215}
216
217impl fidl::endpoints::RequestStream for UnknownInteractionsAjarProtocolRequestStream {
218    type Protocol = UnknownInteractionsAjarProtocolMarker;
219    type ControlHandle = UnknownInteractionsAjarProtocolControlHandle;
220
221    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
222        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
223    }
224
225    fn control_handle(&self) -> Self::ControlHandle {
226        UnknownInteractionsAjarProtocolControlHandle { inner: self.inner.clone() }
227    }
228
229    fn into_inner(
230        self,
231    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
232    {
233        (self.inner, self.is_terminated)
234    }
235
236    fn from_inner(
237        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
238        is_terminated: bool,
239    ) -> Self {
240        Self { inner, is_terminated }
241    }
242}
243
244impl futures::Stream for UnknownInteractionsAjarProtocolRequestStream {
245    type Item = Result<UnknownInteractionsAjarProtocolRequest, fidl::Error>;
246
247    fn poll_next(
248        mut self: std::pin::Pin<&mut Self>,
249        cx: &mut std::task::Context<'_>,
250    ) -> std::task::Poll<Option<Self::Item>> {
251        let this = &mut *self;
252        if this.inner.check_shutdown(cx) {
253            this.is_terminated = true;
254            return std::task::Poll::Ready(None);
255        }
256        if this.is_terminated {
257            panic!("polled UnknownInteractionsAjarProtocolRequestStream after completion");
258        }
259        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
260            |bytes, handles| {
261                match this.inner.channel().read_etc(cx, bytes, handles) {
262                    std::task::Poll::Ready(Ok(())) => {}
263                    std::task::Poll::Pending => return std::task::Poll::Pending,
264                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
265                        this.is_terminated = true;
266                        return std::task::Poll::Ready(None);
267                    }
268                    std::task::Poll::Ready(Err(e)) => {
269                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
270                            e.into(),
271                        ))))
272                    }
273                }
274
275                // A message has been received from the channel
276                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
277
278                std::task::Poll::Ready(Some(match header.ordinal {
279                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
280                    Ok(UnknownInteractionsAjarProtocolRequest::_UnknownMethod {
281                        ordinal: header.ordinal,
282                        control_handle: UnknownInteractionsAjarProtocolControlHandle { inner: this.inner.clone() },
283                    })
284                }
285                _ => Err(fidl::Error::UnknownOrdinal {
286                    ordinal: header.ordinal,
287                    protocol_name: <UnknownInteractionsAjarProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
288                }),
289            }))
290            },
291        )
292    }
293}
294
295#[derive(Debug)]
296pub enum UnknownInteractionsAjarProtocolRequest {
297    /// An interaction was received which does not match any known method.
298    #[non_exhaustive]
299    _UnknownMethod {
300        /// Ordinal of the method that was called.
301        ordinal: u64,
302        control_handle: UnknownInteractionsAjarProtocolControlHandle,
303    },
304}
305
306impl UnknownInteractionsAjarProtocolRequest {
307    /// Name of the method defined in FIDL
308    pub fn method_name(&self) -> &'static str {
309        match *self {
310            UnknownInteractionsAjarProtocolRequest::_UnknownMethod { .. } => {
311                "unknown one-way method"
312            }
313        }
314    }
315}
316
317#[derive(Debug, Clone)]
318pub struct UnknownInteractionsAjarProtocolControlHandle {
319    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
320}
321
322impl fidl::endpoints::ControlHandle for UnknownInteractionsAjarProtocolControlHandle {
323    fn shutdown(&self) {
324        self.inner.shutdown()
325    }
326    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
327        self.inner.shutdown_with_epitaph(status)
328    }
329
330    fn is_closed(&self) -> bool {
331        self.inner.channel().is_closed()
332    }
333    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
334        self.inner.channel().on_closed()
335    }
336
337    #[cfg(target_os = "fuchsia")]
338    fn signal_peer(
339        &self,
340        clear_mask: zx::Signals,
341        set_mask: zx::Signals,
342    ) -> Result<(), zx_status::Status> {
343        use fidl::Peered;
344        self.inner.channel().signal_peer(clear_mask, set_mask)
345    }
346}
347
348impl UnknownInteractionsAjarProtocolControlHandle {}
349
350#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
351pub struct UnknownInteractionsClosedProtocolMarker;
352
353impl fidl::endpoints::ProtocolMarker for UnknownInteractionsClosedProtocolMarker {
354    type Proxy = UnknownInteractionsClosedProtocolProxy;
355    type RequestStream = UnknownInteractionsClosedProtocolRequestStream;
356    #[cfg(target_os = "fuchsia")]
357    type SynchronousProxy = UnknownInteractionsClosedProtocolSynchronousProxy;
358
359    const DEBUG_NAME: &'static str = "(anonymous) UnknownInteractionsClosedProtocol";
360}
361
362pub trait UnknownInteractionsClosedProtocolProxyInterface: Send + Sync {}
363#[derive(Debug)]
364#[cfg(target_os = "fuchsia")]
365pub struct UnknownInteractionsClosedProtocolSynchronousProxy {
366    client: fidl::client::sync::Client,
367}
368
369#[cfg(target_os = "fuchsia")]
370impl fidl::endpoints::SynchronousProxy for UnknownInteractionsClosedProtocolSynchronousProxy {
371    type Proxy = UnknownInteractionsClosedProtocolProxy;
372    type Protocol = UnknownInteractionsClosedProtocolMarker;
373
374    fn from_channel(inner: fidl::Channel) -> Self {
375        Self::new(inner)
376    }
377
378    fn into_channel(self) -> fidl::Channel {
379        self.client.into_channel()
380    }
381
382    fn as_channel(&self) -> &fidl::Channel {
383        self.client.as_channel()
384    }
385}
386
387#[cfg(target_os = "fuchsia")]
388impl UnknownInteractionsClosedProtocolSynchronousProxy {
389    pub fn new(channel: fidl::Channel) -> Self {
390        let protocol_name = <UnknownInteractionsClosedProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
391        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
392    }
393
394    pub fn into_channel(self) -> fidl::Channel {
395        self.client.into_channel()
396    }
397
398    /// Waits until an event arrives and returns it. It is safe for other
399    /// threads to make concurrent requests while waiting for an event.
400    pub fn wait_for_event(
401        &self,
402        deadline: zx::MonotonicInstant,
403    ) -> Result<UnknownInteractionsClosedProtocolEvent, fidl::Error> {
404        UnknownInteractionsClosedProtocolEvent::decode(self.client.wait_for_event(deadline)?)
405    }
406}
407
408#[cfg(target_os = "fuchsia")]
409impl From<UnknownInteractionsClosedProtocolSynchronousProxy> for zx::Handle {
410    fn from(value: UnknownInteractionsClosedProtocolSynchronousProxy) -> Self {
411        value.into_channel().into()
412    }
413}
414
415#[cfg(target_os = "fuchsia")]
416impl From<fidl::Channel> for UnknownInteractionsClosedProtocolSynchronousProxy {
417    fn from(value: fidl::Channel) -> Self {
418        Self::new(value)
419    }
420}
421
422#[cfg(target_os = "fuchsia")]
423impl fidl::endpoints::FromClient for UnknownInteractionsClosedProtocolSynchronousProxy {
424    type Protocol = UnknownInteractionsClosedProtocolMarker;
425
426    fn from_client(
427        value: fidl::endpoints::ClientEnd<UnknownInteractionsClosedProtocolMarker>,
428    ) -> Self {
429        Self::new(value.into_channel())
430    }
431}
432
433#[derive(Debug, Clone)]
434pub struct UnknownInteractionsClosedProtocolProxy {
435    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
436}
437
438impl fidl::endpoints::Proxy for UnknownInteractionsClosedProtocolProxy {
439    type Protocol = UnknownInteractionsClosedProtocolMarker;
440
441    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
442        Self::new(inner)
443    }
444
445    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
446        self.client.into_channel().map_err(|client| Self { client })
447    }
448
449    fn as_channel(&self) -> &::fidl::AsyncChannel {
450        self.client.as_channel()
451    }
452}
453
454impl UnknownInteractionsClosedProtocolProxy {
455    /// Create a new Proxy for test.unknown.interactions/UnknownInteractionsClosedProtocol.
456    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
457        let protocol_name = <UnknownInteractionsClosedProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
458        Self { client: fidl::client::Client::new(channel, protocol_name) }
459    }
460
461    /// Get a Stream of events from the remote end of the protocol.
462    ///
463    /// # Panics
464    ///
465    /// Panics if the event stream was already taken.
466    pub fn take_event_stream(&self) -> UnknownInteractionsClosedProtocolEventStream {
467        UnknownInteractionsClosedProtocolEventStream {
468            event_receiver: self.client.take_event_receiver(),
469        }
470    }
471}
472
473impl UnknownInteractionsClosedProtocolProxyInterface for UnknownInteractionsClosedProtocolProxy {}
474
475pub struct UnknownInteractionsClosedProtocolEventStream {
476    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
477}
478
479impl std::marker::Unpin for UnknownInteractionsClosedProtocolEventStream {}
480
481impl futures::stream::FusedStream for UnknownInteractionsClosedProtocolEventStream {
482    fn is_terminated(&self) -> bool {
483        self.event_receiver.is_terminated()
484    }
485}
486
487impl futures::Stream for UnknownInteractionsClosedProtocolEventStream {
488    type Item = Result<UnknownInteractionsClosedProtocolEvent, fidl::Error>;
489
490    fn poll_next(
491        mut self: std::pin::Pin<&mut Self>,
492        cx: &mut std::task::Context<'_>,
493    ) -> std::task::Poll<Option<Self::Item>> {
494        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
495            &mut self.event_receiver,
496            cx
497        )?) {
498            Some(buf) => {
499                std::task::Poll::Ready(Some(UnknownInteractionsClosedProtocolEvent::decode(buf)))
500            }
501            None => std::task::Poll::Ready(None),
502        }
503    }
504}
505
506#[derive(Debug)]
507pub enum UnknownInteractionsClosedProtocolEvent {}
508
509impl UnknownInteractionsClosedProtocolEvent {
510    /// Decodes a message buffer as a [`UnknownInteractionsClosedProtocolEvent`].
511    fn decode(
512        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
513    ) -> Result<UnknownInteractionsClosedProtocolEvent, fidl::Error> {
514        let (bytes, _handles) = buf.split_mut();
515        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
516        debug_assert_eq!(tx_header.tx_id, 0);
517        match tx_header.ordinal {
518            _ => Err(fidl::Error::UnknownOrdinal {
519                ordinal: tx_header.ordinal,
520                protocol_name: <UnknownInteractionsClosedProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
521            })
522        }
523    }
524}
525
526/// A Stream of incoming requests for test.unknown.interactions/UnknownInteractionsClosedProtocol.
527pub struct UnknownInteractionsClosedProtocolRequestStream {
528    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
529    is_terminated: bool,
530}
531
532impl std::marker::Unpin for UnknownInteractionsClosedProtocolRequestStream {}
533
534impl futures::stream::FusedStream for UnknownInteractionsClosedProtocolRequestStream {
535    fn is_terminated(&self) -> bool {
536        self.is_terminated
537    }
538}
539
540impl fidl::endpoints::RequestStream for UnknownInteractionsClosedProtocolRequestStream {
541    type Protocol = UnknownInteractionsClosedProtocolMarker;
542    type ControlHandle = UnknownInteractionsClosedProtocolControlHandle;
543
544    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
545        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
546    }
547
548    fn control_handle(&self) -> Self::ControlHandle {
549        UnknownInteractionsClosedProtocolControlHandle { inner: self.inner.clone() }
550    }
551
552    fn into_inner(
553        self,
554    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
555    {
556        (self.inner, self.is_terminated)
557    }
558
559    fn from_inner(
560        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
561        is_terminated: bool,
562    ) -> Self {
563        Self { inner, is_terminated }
564    }
565}
566
567impl futures::Stream for UnknownInteractionsClosedProtocolRequestStream {
568    type Item = Result<UnknownInteractionsClosedProtocolRequest, fidl::Error>;
569
570    fn poll_next(
571        mut self: std::pin::Pin<&mut Self>,
572        cx: &mut std::task::Context<'_>,
573    ) -> std::task::Poll<Option<Self::Item>> {
574        let this = &mut *self;
575        if this.inner.check_shutdown(cx) {
576            this.is_terminated = true;
577            return std::task::Poll::Ready(None);
578        }
579        if this.is_terminated {
580            panic!("polled UnknownInteractionsClosedProtocolRequestStream after completion");
581        }
582        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
583            |bytes, handles| {
584                match this.inner.channel().read_etc(cx, bytes, handles) {
585                    std::task::Poll::Ready(Ok(())) => {}
586                    std::task::Poll::Pending => return std::task::Poll::Pending,
587                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
588                        this.is_terminated = true;
589                        return std::task::Poll::Ready(None);
590                    }
591                    std::task::Poll::Ready(Err(e)) => {
592                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
593                            e.into(),
594                        ))))
595                    }
596                }
597
598                // A message has been received from the channel
599                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
600
601                std::task::Poll::Ready(Some(match header.ordinal {
602                _ => Err(fidl::Error::UnknownOrdinal {
603                    ordinal: header.ordinal,
604                    protocol_name: <UnknownInteractionsClosedProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
605                }),
606            }))
607            },
608        )
609    }
610}
611
612#[derive(Debug)]
613pub enum UnknownInteractionsClosedProtocolRequest {}
614
615impl UnknownInteractionsClosedProtocolRequest {
616    /// Name of the method defined in FIDL
617    pub fn method_name(&self) -> &'static str {
618        match *self {}
619    }
620}
621
622#[derive(Debug, Clone)]
623pub struct UnknownInteractionsClosedProtocolControlHandle {
624    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
625}
626
627impl fidl::endpoints::ControlHandle for UnknownInteractionsClosedProtocolControlHandle {
628    fn shutdown(&self) {
629        self.inner.shutdown()
630    }
631    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
632        self.inner.shutdown_with_epitaph(status)
633    }
634
635    fn is_closed(&self) -> bool {
636        self.inner.channel().is_closed()
637    }
638    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
639        self.inner.channel().on_closed()
640    }
641
642    #[cfg(target_os = "fuchsia")]
643    fn signal_peer(
644        &self,
645        clear_mask: zx::Signals,
646        set_mask: zx::Signals,
647    ) -> Result<(), zx_status::Status> {
648        use fidl::Peered;
649        self.inner.channel().signal_peer(clear_mask, set_mask)
650    }
651}
652
653impl UnknownInteractionsClosedProtocolControlHandle {}
654
655#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
656pub struct UnknownInteractionsProtocolMarker;
657
658impl fidl::endpoints::ProtocolMarker for UnknownInteractionsProtocolMarker {
659    type Proxy = UnknownInteractionsProtocolProxy;
660    type RequestStream = UnknownInteractionsProtocolRequestStream;
661    #[cfg(target_os = "fuchsia")]
662    type SynchronousProxy = UnknownInteractionsProtocolSynchronousProxy;
663
664    const DEBUG_NAME: &'static str = "(anonymous) UnknownInteractionsProtocol";
665}
666pub type UnknownInteractionsProtocolStrictTwoWayErrResult = Result<(), i32>;
667pub type UnknownInteractionsProtocolStrictTwoWayFieldsErrResult = Result<i32, i32>;
668pub type UnknownInteractionsProtocolFlexibleTwoWayErrResult = Result<(), i32>;
669pub type UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResult = Result<i32, i32>;
670
671pub trait UnknownInteractionsProtocolProxyInterface: Send + Sync {
672    fn r#strict_one_way(&self) -> Result<(), fidl::Error>;
673    fn r#flexible_one_way(&self) -> Result<(), fidl::Error>;
674    type StrictTwoWayResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
675    fn r#strict_two_way(&self) -> Self::StrictTwoWayResponseFut;
676    type StrictTwoWayFieldsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
677        + Send;
678    fn r#strict_two_way_fields(&self) -> Self::StrictTwoWayFieldsResponseFut;
679    type StrictTwoWayErrResponseFut: std::future::Future<
680            Output = Result<UnknownInteractionsProtocolStrictTwoWayErrResult, fidl::Error>,
681        > + Send;
682    fn r#strict_two_way_err(&self) -> Self::StrictTwoWayErrResponseFut;
683    type StrictTwoWayFieldsErrResponseFut: std::future::Future<
684            Output = Result<UnknownInteractionsProtocolStrictTwoWayFieldsErrResult, fidl::Error>,
685        > + Send;
686    fn r#strict_two_way_fields_err(&self) -> Self::StrictTwoWayFieldsErrResponseFut;
687    type FlexibleTwoWayResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
688    fn r#flexible_two_way(&self) -> Self::FlexibleTwoWayResponseFut;
689    type FlexibleTwoWayFieldsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
690        + Send;
691    fn r#flexible_two_way_fields(&self) -> Self::FlexibleTwoWayFieldsResponseFut;
692    type FlexibleTwoWayErrResponseFut: std::future::Future<
693            Output = Result<UnknownInteractionsProtocolFlexibleTwoWayErrResult, fidl::Error>,
694        > + Send;
695    fn r#flexible_two_way_err(&self) -> Self::FlexibleTwoWayErrResponseFut;
696    type FlexibleTwoWayFieldsErrResponseFut: std::future::Future<
697            Output = Result<UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResult, fidl::Error>,
698        > + Send;
699    fn r#flexible_two_way_fields_err(&self) -> Self::FlexibleTwoWayFieldsErrResponseFut;
700}
701#[derive(Debug)]
702#[cfg(target_os = "fuchsia")]
703pub struct UnknownInteractionsProtocolSynchronousProxy {
704    client: fidl::client::sync::Client,
705}
706
707#[cfg(target_os = "fuchsia")]
708impl fidl::endpoints::SynchronousProxy for UnknownInteractionsProtocolSynchronousProxy {
709    type Proxy = UnknownInteractionsProtocolProxy;
710    type Protocol = UnknownInteractionsProtocolMarker;
711
712    fn from_channel(inner: fidl::Channel) -> Self {
713        Self::new(inner)
714    }
715
716    fn into_channel(self) -> fidl::Channel {
717        self.client.into_channel()
718    }
719
720    fn as_channel(&self) -> &fidl::Channel {
721        self.client.as_channel()
722    }
723}
724
725#[cfg(target_os = "fuchsia")]
726impl UnknownInteractionsProtocolSynchronousProxy {
727    pub fn new(channel: fidl::Channel) -> Self {
728        let protocol_name =
729            <UnknownInteractionsProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
730        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
731    }
732
733    pub fn into_channel(self) -> fidl::Channel {
734        self.client.into_channel()
735    }
736
737    /// Waits until an event arrives and returns it. It is safe for other
738    /// threads to make concurrent requests while waiting for an event.
739    pub fn wait_for_event(
740        &self,
741        deadline: zx::MonotonicInstant,
742    ) -> Result<UnknownInteractionsProtocolEvent, fidl::Error> {
743        UnknownInteractionsProtocolEvent::decode(self.client.wait_for_event(deadline)?)
744    }
745
746    pub fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
747        self.client.send::<fidl::encoding::EmptyPayload>(
748            (),
749            0x1fa581504cb382d5,
750            fidl::encoding::DynamicFlags::empty(),
751        )
752    }
753
754    pub fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
755        self.client.send::<fidl::encoding::EmptyPayload>(
756            (),
757            0x2793277ae2bb90fc,
758            fidl::encoding::DynamicFlags::FLEXIBLE,
759        )
760    }
761
762    pub fn r#strict_two_way(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
763        let _response =
764            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
765                (),
766                0x73ba6f957055b0dc,
767                fidl::encoding::DynamicFlags::empty(),
768                ___deadline,
769            )?;
770        Ok(_response)
771    }
772
773    pub fn r#strict_two_way_fields(
774        &self,
775        ___deadline: zx::MonotonicInstant,
776    ) -> Result<i32, fidl::Error> {
777        let _response = self.client.send_query::<
778            fidl::encoding::EmptyPayload,
779            UnknownInteractionsProtocolStrictTwoWayFieldsResponse,
780        >(
781            (),
782            0x21513db78c6597f7,
783            fidl::encoding::DynamicFlags::empty(),
784            ___deadline,
785        )?;
786        Ok(_response.some_field)
787    }
788
789    pub fn r#strict_two_way_err(
790        &self,
791        ___deadline: zx::MonotonicInstant,
792    ) -> Result<UnknownInteractionsProtocolStrictTwoWayErrResult, fidl::Error> {
793        let _response = self.client.send_query::<
794            fidl::encoding::EmptyPayload,
795            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
796        >(
797            (),
798            0x2e9beb4e08e058bb,
799            fidl::encoding::DynamicFlags::empty(),
800            ___deadline,
801        )?;
802        Ok(_response.map(|x| x))
803    }
804
805    pub fn r#strict_two_way_fields_err(
806        &self,
807        ___deadline: zx::MonotonicInstant,
808    ) -> Result<UnknownInteractionsProtocolStrictTwoWayFieldsErrResult, fidl::Error> {
809        let _response = self
810            .client
811            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
812                UnknownInteractionsProtocolStrictTwoWayFieldsErrResponse,
813                i32,
814            >>(
815                (), 0x6dd97948e8f69be4, fidl::encoding::DynamicFlags::empty(), ___deadline
816            )?;
817        Ok(_response.map(|x| x.some_field))
818    }
819
820    pub fn r#flexible_two_way(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
821        let _response = self.client.send_query::<
822            fidl::encoding::EmptyPayload,
823            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
824        >(
825            (),
826            0x1f33517a0395609d,
827            fidl::encoding::DynamicFlags::FLEXIBLE,
828            ___deadline,
829        )?
830        .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way")?;
831        Ok(_response)
832    }
833
834    pub fn r#flexible_two_way_fields(
835        &self,
836        ___deadline: zx::MonotonicInstant,
837    ) -> Result<i32, fidl::Error> {
838        let _response =
839            self.client
840                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleType<
841                    UnknownInteractionsProtocolFlexibleTwoWayFieldsResponse,
842                >>(
843                    (), 0x58ed18873e28b84d, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
844                )?
845                .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way_fields")?;
846        Ok(_response.some_field)
847    }
848
849    pub fn r#flexible_two_way_err(
850        &self,
851        ___deadline: zx::MonotonicInstant,
852    ) -> Result<UnknownInteractionsProtocolFlexibleTwoWayErrResult, fidl::Error> {
853        let _response = self.client.send_query::<
854            fidl::encoding::EmptyPayload,
855            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
856        >(
857            (),
858            0x706905decb20bd62,
859            fidl::encoding::DynamicFlags::FLEXIBLE,
860            ___deadline,
861        )?
862        .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way_err")?;
863        Ok(_response.map(|x| x))
864    }
865
866    pub fn r#flexible_two_way_fields_err(
867        &self,
868        ___deadline: zx::MonotonicInstant,
869    ) -> Result<UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResult, fidl::Error> {
870        let _response = self
871            .client
872            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
873                UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponse,
874                i32,
875            >>(
876                (), 0x681fcbbead668390, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
877            )?
878            .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way_fields_err")?;
879        Ok(_response.map(|x| x.some_field))
880    }
881}
882
883#[cfg(target_os = "fuchsia")]
884impl From<UnknownInteractionsProtocolSynchronousProxy> for zx::Handle {
885    fn from(value: UnknownInteractionsProtocolSynchronousProxy) -> Self {
886        value.into_channel().into()
887    }
888}
889
890#[cfg(target_os = "fuchsia")]
891impl From<fidl::Channel> for UnknownInteractionsProtocolSynchronousProxy {
892    fn from(value: fidl::Channel) -> Self {
893        Self::new(value)
894    }
895}
896
897#[cfg(target_os = "fuchsia")]
898impl fidl::endpoints::FromClient for UnknownInteractionsProtocolSynchronousProxy {
899    type Protocol = UnknownInteractionsProtocolMarker;
900
901    fn from_client(value: fidl::endpoints::ClientEnd<UnknownInteractionsProtocolMarker>) -> Self {
902        Self::new(value.into_channel())
903    }
904}
905
906#[derive(Debug, Clone)]
907pub struct UnknownInteractionsProtocolProxy {
908    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
909}
910
911impl fidl::endpoints::Proxy for UnknownInteractionsProtocolProxy {
912    type Protocol = UnknownInteractionsProtocolMarker;
913
914    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
915        Self::new(inner)
916    }
917
918    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
919        self.client.into_channel().map_err(|client| Self { client })
920    }
921
922    fn as_channel(&self) -> &::fidl::AsyncChannel {
923        self.client.as_channel()
924    }
925}
926
927impl UnknownInteractionsProtocolProxy {
928    /// Create a new Proxy for test.unknown.interactions/UnknownInteractionsProtocol.
929    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
930        let protocol_name =
931            <UnknownInteractionsProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
932        Self { client: fidl::client::Client::new(channel, protocol_name) }
933    }
934
935    /// Get a Stream of events from the remote end of the protocol.
936    ///
937    /// # Panics
938    ///
939    /// Panics if the event stream was already taken.
940    pub fn take_event_stream(&self) -> UnknownInteractionsProtocolEventStream {
941        UnknownInteractionsProtocolEventStream { event_receiver: self.client.take_event_receiver() }
942    }
943
944    pub fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
945        UnknownInteractionsProtocolProxyInterface::r#strict_one_way(self)
946    }
947
948    pub fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
949        UnknownInteractionsProtocolProxyInterface::r#flexible_one_way(self)
950    }
951
952    pub fn r#strict_two_way(
953        &self,
954    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
955        UnknownInteractionsProtocolProxyInterface::r#strict_two_way(self)
956    }
957
958    pub fn r#strict_two_way_fields(
959        &self,
960    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
961        UnknownInteractionsProtocolProxyInterface::r#strict_two_way_fields(self)
962    }
963
964    pub fn r#strict_two_way_err(
965        &self,
966    ) -> fidl::client::QueryResponseFut<
967        UnknownInteractionsProtocolStrictTwoWayErrResult,
968        fidl::encoding::DefaultFuchsiaResourceDialect,
969    > {
970        UnknownInteractionsProtocolProxyInterface::r#strict_two_way_err(self)
971    }
972
973    pub fn r#strict_two_way_fields_err(
974        &self,
975    ) -> fidl::client::QueryResponseFut<
976        UnknownInteractionsProtocolStrictTwoWayFieldsErrResult,
977        fidl::encoding::DefaultFuchsiaResourceDialect,
978    > {
979        UnknownInteractionsProtocolProxyInterface::r#strict_two_way_fields_err(self)
980    }
981
982    pub fn r#flexible_two_way(
983        &self,
984    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
985        UnknownInteractionsProtocolProxyInterface::r#flexible_two_way(self)
986    }
987
988    pub fn r#flexible_two_way_fields(
989        &self,
990    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
991        UnknownInteractionsProtocolProxyInterface::r#flexible_two_way_fields(self)
992    }
993
994    pub fn r#flexible_two_way_err(
995        &self,
996    ) -> fidl::client::QueryResponseFut<
997        UnknownInteractionsProtocolFlexibleTwoWayErrResult,
998        fidl::encoding::DefaultFuchsiaResourceDialect,
999    > {
1000        UnknownInteractionsProtocolProxyInterface::r#flexible_two_way_err(self)
1001    }
1002
1003    pub fn r#flexible_two_way_fields_err(
1004        &self,
1005    ) -> fidl::client::QueryResponseFut<
1006        UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResult,
1007        fidl::encoding::DefaultFuchsiaResourceDialect,
1008    > {
1009        UnknownInteractionsProtocolProxyInterface::r#flexible_two_way_fields_err(self)
1010    }
1011}
1012
1013impl UnknownInteractionsProtocolProxyInterface for UnknownInteractionsProtocolProxy {
1014    fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
1015        self.client.send::<fidl::encoding::EmptyPayload>(
1016            (),
1017            0x1fa581504cb382d5,
1018            fidl::encoding::DynamicFlags::empty(),
1019        )
1020    }
1021
1022    fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
1023        self.client.send::<fidl::encoding::EmptyPayload>(
1024            (),
1025            0x2793277ae2bb90fc,
1026            fidl::encoding::DynamicFlags::FLEXIBLE,
1027        )
1028    }
1029
1030    type StrictTwoWayResponseFut =
1031        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1032    fn r#strict_two_way(&self) -> Self::StrictTwoWayResponseFut {
1033        fn _decode(
1034            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1035        ) -> Result<(), fidl::Error> {
1036            let _response = fidl::client::decode_transaction_body::<
1037                fidl::encoding::EmptyPayload,
1038                fidl::encoding::DefaultFuchsiaResourceDialect,
1039                0x73ba6f957055b0dc,
1040            >(_buf?)?;
1041            Ok(_response)
1042        }
1043        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1044            (),
1045            0x73ba6f957055b0dc,
1046            fidl::encoding::DynamicFlags::empty(),
1047            _decode,
1048        )
1049    }
1050
1051    type StrictTwoWayFieldsResponseFut =
1052        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1053    fn r#strict_two_way_fields(&self) -> Self::StrictTwoWayFieldsResponseFut {
1054        fn _decode(
1055            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1056        ) -> Result<i32, fidl::Error> {
1057            let _response = fidl::client::decode_transaction_body::<
1058                UnknownInteractionsProtocolStrictTwoWayFieldsResponse,
1059                fidl::encoding::DefaultFuchsiaResourceDialect,
1060                0x21513db78c6597f7,
1061            >(_buf?)?;
1062            Ok(_response.some_field)
1063        }
1064        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1065            (),
1066            0x21513db78c6597f7,
1067            fidl::encoding::DynamicFlags::empty(),
1068            _decode,
1069        )
1070    }
1071
1072    type StrictTwoWayErrResponseFut = fidl::client::QueryResponseFut<
1073        UnknownInteractionsProtocolStrictTwoWayErrResult,
1074        fidl::encoding::DefaultFuchsiaResourceDialect,
1075    >;
1076    fn r#strict_two_way_err(&self) -> Self::StrictTwoWayErrResponseFut {
1077        fn _decode(
1078            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1079        ) -> Result<UnknownInteractionsProtocolStrictTwoWayErrResult, fidl::Error> {
1080            let _response = fidl::client::decode_transaction_body::<
1081                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1082                fidl::encoding::DefaultFuchsiaResourceDialect,
1083                0x2e9beb4e08e058bb,
1084            >(_buf?)?;
1085            Ok(_response.map(|x| x))
1086        }
1087        self.client.send_query_and_decode::<
1088            fidl::encoding::EmptyPayload,
1089            UnknownInteractionsProtocolStrictTwoWayErrResult,
1090        >(
1091            (),
1092            0x2e9beb4e08e058bb,
1093            fidl::encoding::DynamicFlags::empty(),
1094            _decode,
1095        )
1096    }
1097
1098    type StrictTwoWayFieldsErrResponseFut = fidl::client::QueryResponseFut<
1099        UnknownInteractionsProtocolStrictTwoWayFieldsErrResult,
1100        fidl::encoding::DefaultFuchsiaResourceDialect,
1101    >;
1102    fn r#strict_two_way_fields_err(&self) -> Self::StrictTwoWayFieldsErrResponseFut {
1103        fn _decode(
1104            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1105        ) -> Result<UnknownInteractionsProtocolStrictTwoWayFieldsErrResult, fidl::Error> {
1106            let _response = fidl::client::decode_transaction_body::<
1107                fidl::encoding::ResultType<
1108                    UnknownInteractionsProtocolStrictTwoWayFieldsErrResponse,
1109                    i32,
1110                >,
1111                fidl::encoding::DefaultFuchsiaResourceDialect,
1112                0x6dd97948e8f69be4,
1113            >(_buf?)?;
1114            Ok(_response.map(|x| x.some_field))
1115        }
1116        self.client.send_query_and_decode::<
1117            fidl::encoding::EmptyPayload,
1118            UnknownInteractionsProtocolStrictTwoWayFieldsErrResult,
1119        >(
1120            (),
1121            0x6dd97948e8f69be4,
1122            fidl::encoding::DynamicFlags::empty(),
1123            _decode,
1124        )
1125    }
1126
1127    type FlexibleTwoWayResponseFut =
1128        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1129    fn r#flexible_two_way(&self) -> Self::FlexibleTwoWayResponseFut {
1130        fn _decode(
1131            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1132        ) -> Result<(), fidl::Error> {
1133            let _response = fidl::client::decode_transaction_body::<
1134                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1135                fidl::encoding::DefaultFuchsiaResourceDialect,
1136                0x1f33517a0395609d,
1137            >(_buf?)?
1138            .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way")?;
1139            Ok(_response)
1140        }
1141        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1142            (),
1143            0x1f33517a0395609d,
1144            fidl::encoding::DynamicFlags::FLEXIBLE,
1145            _decode,
1146        )
1147    }
1148
1149    type FlexibleTwoWayFieldsResponseFut =
1150        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1151    fn r#flexible_two_way_fields(&self) -> Self::FlexibleTwoWayFieldsResponseFut {
1152        fn _decode(
1153            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1154        ) -> Result<i32, fidl::Error> {
1155            let _response = fidl::client::decode_transaction_body::<
1156                fidl::encoding::FlexibleType<
1157                    UnknownInteractionsProtocolFlexibleTwoWayFieldsResponse,
1158                >,
1159                fidl::encoding::DefaultFuchsiaResourceDialect,
1160                0x58ed18873e28b84d,
1161            >(_buf?)?
1162            .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way_fields")?;
1163            Ok(_response.some_field)
1164        }
1165        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1166            (),
1167            0x58ed18873e28b84d,
1168            fidl::encoding::DynamicFlags::FLEXIBLE,
1169            _decode,
1170        )
1171    }
1172
1173    type FlexibleTwoWayErrResponseFut = fidl::client::QueryResponseFut<
1174        UnknownInteractionsProtocolFlexibleTwoWayErrResult,
1175        fidl::encoding::DefaultFuchsiaResourceDialect,
1176    >;
1177    fn r#flexible_two_way_err(&self) -> Self::FlexibleTwoWayErrResponseFut {
1178        fn _decode(
1179            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1180        ) -> Result<UnknownInteractionsProtocolFlexibleTwoWayErrResult, fidl::Error> {
1181            let _response = fidl::client::decode_transaction_body::<
1182                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1183                fidl::encoding::DefaultFuchsiaResourceDialect,
1184                0x706905decb20bd62,
1185            >(_buf?)?
1186            .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way_err")?;
1187            Ok(_response.map(|x| x))
1188        }
1189        self.client.send_query_and_decode::<
1190            fidl::encoding::EmptyPayload,
1191            UnknownInteractionsProtocolFlexibleTwoWayErrResult,
1192        >(
1193            (),
1194            0x706905decb20bd62,
1195            fidl::encoding::DynamicFlags::FLEXIBLE,
1196            _decode,
1197        )
1198    }
1199
1200    type FlexibleTwoWayFieldsErrResponseFut = fidl::client::QueryResponseFut<
1201        UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResult,
1202        fidl::encoding::DefaultFuchsiaResourceDialect,
1203    >;
1204    fn r#flexible_two_way_fields_err(&self) -> Self::FlexibleTwoWayFieldsErrResponseFut {
1205        fn _decode(
1206            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1207        ) -> Result<UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResult, fidl::Error> {
1208            let _response = fidl::client::decode_transaction_body::<
1209                fidl::encoding::FlexibleResultType<
1210                    UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponse,
1211                    i32,
1212                >,
1213                fidl::encoding::DefaultFuchsiaResourceDialect,
1214                0x681fcbbead668390,
1215            >(_buf?)?
1216            .into_result::<UnknownInteractionsProtocolMarker>("flexible_two_way_fields_err")?;
1217            Ok(_response.map(|x| x.some_field))
1218        }
1219        self.client.send_query_and_decode::<
1220            fidl::encoding::EmptyPayload,
1221            UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResult,
1222        >(
1223            (),
1224            0x681fcbbead668390,
1225            fidl::encoding::DynamicFlags::FLEXIBLE,
1226            _decode,
1227        )
1228    }
1229}
1230
1231pub struct UnknownInteractionsProtocolEventStream {
1232    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1233}
1234
1235impl std::marker::Unpin for UnknownInteractionsProtocolEventStream {}
1236
1237impl futures::stream::FusedStream for UnknownInteractionsProtocolEventStream {
1238    fn is_terminated(&self) -> bool {
1239        self.event_receiver.is_terminated()
1240    }
1241}
1242
1243impl futures::Stream for UnknownInteractionsProtocolEventStream {
1244    type Item = Result<UnknownInteractionsProtocolEvent, fidl::Error>;
1245
1246    fn poll_next(
1247        mut self: std::pin::Pin<&mut Self>,
1248        cx: &mut std::task::Context<'_>,
1249    ) -> std::task::Poll<Option<Self::Item>> {
1250        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1251            &mut self.event_receiver,
1252            cx
1253        )?) {
1254            Some(buf) => {
1255                std::task::Poll::Ready(Some(UnknownInteractionsProtocolEvent::decode(buf)))
1256            }
1257            None => std::task::Poll::Ready(None),
1258        }
1259    }
1260}
1261
1262#[derive(Debug)]
1263pub enum UnknownInteractionsProtocolEvent {
1264    StrictEvent {},
1265    StrictEventFields {
1266        some_field: i32,
1267    },
1268    FlexibleEvent {},
1269    FlexibleEventFields {
1270        some_field: i32,
1271    },
1272    #[non_exhaustive]
1273    _UnknownEvent {
1274        /// Ordinal of the event that was sent.
1275        ordinal: u64,
1276    },
1277}
1278
1279impl UnknownInteractionsProtocolEvent {
1280    #[allow(irrefutable_let_patterns)]
1281    pub fn into_strict_event(self) -> Option<()> {
1282        if let UnknownInteractionsProtocolEvent::StrictEvent {} = self {
1283            Some(())
1284        } else {
1285            None
1286        }
1287    }
1288    #[allow(irrefutable_let_patterns)]
1289    pub fn into_strict_event_fields(self) -> Option<i32> {
1290        if let UnknownInteractionsProtocolEvent::StrictEventFields { some_field } = self {
1291            Some((some_field))
1292        } else {
1293            None
1294        }
1295    }
1296    #[allow(irrefutable_let_patterns)]
1297    pub fn into_flexible_event(self) -> Option<()> {
1298        if let UnknownInteractionsProtocolEvent::FlexibleEvent {} = self {
1299            Some(())
1300        } else {
1301            None
1302        }
1303    }
1304    #[allow(irrefutable_let_patterns)]
1305    pub fn into_flexible_event_fields(self) -> Option<i32> {
1306        if let UnknownInteractionsProtocolEvent::FlexibleEventFields { some_field } = self {
1307            Some((some_field))
1308        } else {
1309            None
1310        }
1311    }
1312
1313    /// Decodes a message buffer as a [`UnknownInteractionsProtocolEvent`].
1314    fn decode(
1315        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1316    ) -> Result<UnknownInteractionsProtocolEvent, fidl::Error> {
1317        let (bytes, _handles) = buf.split_mut();
1318        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1319        debug_assert_eq!(tx_header.tx_id, 0);
1320        match tx_header.ordinal {
1321            0x584b419891a32738 => {
1322                let mut out = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1323                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
1324                Ok((
1325                    UnknownInteractionsProtocolEvent::StrictEvent {
1326                    }
1327                ))
1328            }
1329            0x4c622afb12e4a13b => {
1330                let mut out = fidl::new_empty!(UnknownInteractionsProtocolStrictEventFieldsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1331                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UnknownInteractionsProtocolStrictEventFieldsRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1332                Ok((
1333                    UnknownInteractionsProtocolEvent::StrictEventFields {some_field: out.some_field,
1334
1335                    }
1336                ))
1337            }
1338            0x317a1a8e0b802c6c => {
1339                let mut out = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1340                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
1341                Ok((
1342                    UnknownInteractionsProtocolEvent::FlexibleEvent {
1343                    }
1344                ))
1345            }
1346            0x40620b164591af9e => {
1347                let mut out = fidl::new_empty!(UnknownInteractionsProtocolFlexibleEventFieldsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
1348                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UnknownInteractionsProtocolFlexibleEventFieldsRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1349                Ok((
1350                    UnknownInteractionsProtocolEvent::FlexibleEventFields {some_field: out.some_field,
1351
1352                    }
1353                ))
1354            }
1355            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1356                Ok(UnknownInteractionsProtocolEvent::_UnknownEvent {
1357                    ordinal: tx_header.ordinal,
1358                })
1359            }
1360            _ => Err(fidl::Error::UnknownOrdinal {
1361                ordinal: tx_header.ordinal,
1362                protocol_name: <UnknownInteractionsProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1363            })
1364        }
1365    }
1366}
1367
1368/// A Stream of incoming requests for test.unknown.interactions/UnknownInteractionsProtocol.
1369pub struct UnknownInteractionsProtocolRequestStream {
1370    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1371    is_terminated: bool,
1372}
1373
1374impl std::marker::Unpin for UnknownInteractionsProtocolRequestStream {}
1375
1376impl futures::stream::FusedStream for UnknownInteractionsProtocolRequestStream {
1377    fn is_terminated(&self) -> bool {
1378        self.is_terminated
1379    }
1380}
1381
1382impl fidl::endpoints::RequestStream for UnknownInteractionsProtocolRequestStream {
1383    type Protocol = UnknownInteractionsProtocolMarker;
1384    type ControlHandle = UnknownInteractionsProtocolControlHandle;
1385
1386    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1387        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1388    }
1389
1390    fn control_handle(&self) -> Self::ControlHandle {
1391        UnknownInteractionsProtocolControlHandle { inner: self.inner.clone() }
1392    }
1393
1394    fn into_inner(
1395        self,
1396    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1397    {
1398        (self.inner, self.is_terminated)
1399    }
1400
1401    fn from_inner(
1402        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1403        is_terminated: bool,
1404    ) -> Self {
1405        Self { inner, is_terminated }
1406    }
1407}
1408
1409impl futures::Stream for UnknownInteractionsProtocolRequestStream {
1410    type Item = Result<UnknownInteractionsProtocolRequest, fidl::Error>;
1411
1412    fn poll_next(
1413        mut self: std::pin::Pin<&mut Self>,
1414        cx: &mut std::task::Context<'_>,
1415    ) -> std::task::Poll<Option<Self::Item>> {
1416        let this = &mut *self;
1417        if this.inner.check_shutdown(cx) {
1418            this.is_terminated = true;
1419            return std::task::Poll::Ready(None);
1420        }
1421        if this.is_terminated {
1422            panic!("polled UnknownInteractionsProtocolRequestStream after completion");
1423        }
1424        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1425            |bytes, handles| {
1426                match this.inner.channel().read_etc(cx, bytes, handles) {
1427                    std::task::Poll::Ready(Ok(())) => {}
1428                    std::task::Poll::Pending => return std::task::Poll::Pending,
1429                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1430                        this.is_terminated = true;
1431                        return std::task::Poll::Ready(None);
1432                    }
1433                    std::task::Poll::Ready(Err(e)) => {
1434                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1435                            e.into(),
1436                        ))))
1437                    }
1438                }
1439
1440                // A message has been received from the channel
1441                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1442
1443                std::task::Poll::Ready(Some(match header.ordinal {
1444                0x1fa581504cb382d5 => {
1445                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1446                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1447                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1448                    let control_handle = UnknownInteractionsProtocolControlHandle {
1449                        inner: this.inner.clone(),
1450                    };
1451                    Ok(UnknownInteractionsProtocolRequest::StrictOneWay {
1452                        control_handle,
1453                    })
1454                }
1455                0x2793277ae2bb90fc => {
1456                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1457                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1458                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1459                    let control_handle = UnknownInteractionsProtocolControlHandle {
1460                        inner: this.inner.clone(),
1461                    };
1462                    Ok(UnknownInteractionsProtocolRequest::FlexibleOneWay {
1463                        control_handle,
1464                    })
1465                }
1466                0x73ba6f957055b0dc => {
1467                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1468                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1469                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1470                    let control_handle = UnknownInteractionsProtocolControlHandle {
1471                        inner: this.inner.clone(),
1472                    };
1473                    Ok(UnknownInteractionsProtocolRequest::StrictTwoWay {
1474                        responder: UnknownInteractionsProtocolStrictTwoWayResponder {
1475                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1476                            tx_id: header.tx_id,
1477                        },
1478                    })
1479                }
1480                0x21513db78c6597f7 => {
1481                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1482                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1483                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1484                    let control_handle = UnknownInteractionsProtocolControlHandle {
1485                        inner: this.inner.clone(),
1486                    };
1487                    Ok(UnknownInteractionsProtocolRequest::StrictTwoWayFields {
1488                        responder: UnknownInteractionsProtocolStrictTwoWayFieldsResponder {
1489                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1490                            tx_id: header.tx_id,
1491                        },
1492                    })
1493                }
1494                0x2e9beb4e08e058bb => {
1495                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1496                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1497                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1498                    let control_handle = UnknownInteractionsProtocolControlHandle {
1499                        inner: this.inner.clone(),
1500                    };
1501                    Ok(UnknownInteractionsProtocolRequest::StrictTwoWayErr {
1502                        responder: UnknownInteractionsProtocolStrictTwoWayErrResponder {
1503                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1504                            tx_id: header.tx_id,
1505                        },
1506                    })
1507                }
1508                0x6dd97948e8f69be4 => {
1509                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1510                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1511                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1512                    let control_handle = UnknownInteractionsProtocolControlHandle {
1513                        inner: this.inner.clone(),
1514                    };
1515                    Ok(UnknownInteractionsProtocolRequest::StrictTwoWayFieldsErr {
1516                        responder: UnknownInteractionsProtocolStrictTwoWayFieldsErrResponder {
1517                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1518                            tx_id: header.tx_id,
1519                        },
1520                    })
1521                }
1522                0x1f33517a0395609d => {
1523                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1524                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1525                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1526                    let control_handle = UnknownInteractionsProtocolControlHandle {
1527                        inner: this.inner.clone(),
1528                    };
1529                    Ok(UnknownInteractionsProtocolRequest::FlexibleTwoWay {
1530                        responder: UnknownInteractionsProtocolFlexibleTwoWayResponder {
1531                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1532                            tx_id: header.tx_id,
1533                        },
1534                    })
1535                }
1536                0x58ed18873e28b84d => {
1537                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1538                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1539                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1540                    let control_handle = UnknownInteractionsProtocolControlHandle {
1541                        inner: this.inner.clone(),
1542                    };
1543                    Ok(UnknownInteractionsProtocolRequest::FlexibleTwoWayFields {
1544                        responder: UnknownInteractionsProtocolFlexibleTwoWayFieldsResponder {
1545                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1546                            tx_id: header.tx_id,
1547                        },
1548                    })
1549                }
1550                0x706905decb20bd62 => {
1551                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1552                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1553                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1554                    let control_handle = UnknownInteractionsProtocolControlHandle {
1555                        inner: this.inner.clone(),
1556                    };
1557                    Ok(UnknownInteractionsProtocolRequest::FlexibleTwoWayErr {
1558                        responder: UnknownInteractionsProtocolFlexibleTwoWayErrResponder {
1559                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1560                            tx_id: header.tx_id,
1561                        },
1562                    })
1563                }
1564                0x681fcbbead668390 => {
1565                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1566                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1567                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1568                    let control_handle = UnknownInteractionsProtocolControlHandle {
1569                        inner: this.inner.clone(),
1570                    };
1571                    Ok(UnknownInteractionsProtocolRequest::FlexibleTwoWayFieldsErr {
1572                        responder: UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponder {
1573                            control_handle: std::mem::ManuallyDrop::new(control_handle),
1574                            tx_id: header.tx_id,
1575                        },
1576                    })
1577                }
1578                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1579                    Ok(UnknownInteractionsProtocolRequest::_UnknownMethod {
1580                        ordinal: header.ordinal,
1581                        control_handle: UnknownInteractionsProtocolControlHandle { inner: this.inner.clone() },
1582                        method_type: fidl::MethodType::OneWay,
1583                    })
1584                }
1585                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1586                    this.inner.send_framework_err(
1587                        fidl::encoding::FrameworkErr::UnknownMethod,
1588                        header.tx_id,
1589                        header.ordinal,
1590                        header.dynamic_flags(),
1591                        (bytes, handles),
1592                    )?;
1593                    Ok(UnknownInteractionsProtocolRequest::_UnknownMethod {
1594                        ordinal: header.ordinal,
1595                        control_handle: UnknownInteractionsProtocolControlHandle { inner: this.inner.clone() },
1596                        method_type: fidl::MethodType::TwoWay,
1597                    })
1598                }
1599                _ => Err(fidl::Error::UnknownOrdinal {
1600                    ordinal: header.ordinal,
1601                    protocol_name: <UnknownInteractionsProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1602                }),
1603            }))
1604            },
1605        )
1606    }
1607}
1608
1609#[derive(Debug)]
1610pub enum UnknownInteractionsProtocolRequest {
1611    StrictOneWay {
1612        control_handle: UnknownInteractionsProtocolControlHandle,
1613    },
1614    FlexibleOneWay {
1615        control_handle: UnknownInteractionsProtocolControlHandle,
1616    },
1617    StrictTwoWay {
1618        responder: UnknownInteractionsProtocolStrictTwoWayResponder,
1619    },
1620    StrictTwoWayFields {
1621        responder: UnknownInteractionsProtocolStrictTwoWayFieldsResponder,
1622    },
1623    StrictTwoWayErr {
1624        responder: UnknownInteractionsProtocolStrictTwoWayErrResponder,
1625    },
1626    StrictTwoWayFieldsErr {
1627        responder: UnknownInteractionsProtocolStrictTwoWayFieldsErrResponder,
1628    },
1629    FlexibleTwoWay {
1630        responder: UnknownInteractionsProtocolFlexibleTwoWayResponder,
1631    },
1632    FlexibleTwoWayFields {
1633        responder: UnknownInteractionsProtocolFlexibleTwoWayFieldsResponder,
1634    },
1635    FlexibleTwoWayErr {
1636        responder: UnknownInteractionsProtocolFlexibleTwoWayErrResponder,
1637    },
1638    FlexibleTwoWayFieldsErr {
1639        responder: UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponder,
1640    },
1641    /// An interaction was received which does not match any known method.
1642    #[non_exhaustive]
1643    _UnknownMethod {
1644        /// Ordinal of the method that was called.
1645        ordinal: u64,
1646        control_handle: UnknownInteractionsProtocolControlHandle,
1647        method_type: fidl::MethodType,
1648    },
1649}
1650
1651impl UnknownInteractionsProtocolRequest {
1652    #[allow(irrefutable_let_patterns)]
1653    pub fn into_strict_one_way(self) -> Option<(UnknownInteractionsProtocolControlHandle)> {
1654        if let UnknownInteractionsProtocolRequest::StrictOneWay { control_handle } = self {
1655            Some((control_handle))
1656        } else {
1657            None
1658        }
1659    }
1660
1661    #[allow(irrefutable_let_patterns)]
1662    pub fn into_flexible_one_way(self) -> Option<(UnknownInteractionsProtocolControlHandle)> {
1663        if let UnknownInteractionsProtocolRequest::FlexibleOneWay { control_handle } = self {
1664            Some((control_handle))
1665        } else {
1666            None
1667        }
1668    }
1669
1670    #[allow(irrefutable_let_patterns)]
1671    pub fn into_strict_two_way(self) -> Option<(UnknownInteractionsProtocolStrictTwoWayResponder)> {
1672        if let UnknownInteractionsProtocolRequest::StrictTwoWay { responder } = self {
1673            Some((responder))
1674        } else {
1675            None
1676        }
1677    }
1678
1679    #[allow(irrefutable_let_patterns)]
1680    pub fn into_strict_two_way_fields(
1681        self,
1682    ) -> Option<(UnknownInteractionsProtocolStrictTwoWayFieldsResponder)> {
1683        if let UnknownInteractionsProtocolRequest::StrictTwoWayFields { responder } = self {
1684            Some((responder))
1685        } else {
1686            None
1687        }
1688    }
1689
1690    #[allow(irrefutable_let_patterns)]
1691    pub fn into_strict_two_way_err(
1692        self,
1693    ) -> Option<(UnknownInteractionsProtocolStrictTwoWayErrResponder)> {
1694        if let UnknownInteractionsProtocolRequest::StrictTwoWayErr { responder } = self {
1695            Some((responder))
1696        } else {
1697            None
1698        }
1699    }
1700
1701    #[allow(irrefutable_let_patterns)]
1702    pub fn into_strict_two_way_fields_err(
1703        self,
1704    ) -> Option<(UnknownInteractionsProtocolStrictTwoWayFieldsErrResponder)> {
1705        if let UnknownInteractionsProtocolRequest::StrictTwoWayFieldsErr { responder } = self {
1706            Some((responder))
1707        } else {
1708            None
1709        }
1710    }
1711
1712    #[allow(irrefutable_let_patterns)]
1713    pub fn into_flexible_two_way(
1714        self,
1715    ) -> Option<(UnknownInteractionsProtocolFlexibleTwoWayResponder)> {
1716        if let UnknownInteractionsProtocolRequest::FlexibleTwoWay { responder } = self {
1717            Some((responder))
1718        } else {
1719            None
1720        }
1721    }
1722
1723    #[allow(irrefutable_let_patterns)]
1724    pub fn into_flexible_two_way_fields(
1725        self,
1726    ) -> Option<(UnknownInteractionsProtocolFlexibleTwoWayFieldsResponder)> {
1727        if let UnknownInteractionsProtocolRequest::FlexibleTwoWayFields { responder } = self {
1728            Some((responder))
1729        } else {
1730            None
1731        }
1732    }
1733
1734    #[allow(irrefutable_let_patterns)]
1735    pub fn into_flexible_two_way_err(
1736        self,
1737    ) -> Option<(UnknownInteractionsProtocolFlexibleTwoWayErrResponder)> {
1738        if let UnknownInteractionsProtocolRequest::FlexibleTwoWayErr { responder } = self {
1739            Some((responder))
1740        } else {
1741            None
1742        }
1743    }
1744
1745    #[allow(irrefutable_let_patterns)]
1746    pub fn into_flexible_two_way_fields_err(
1747        self,
1748    ) -> Option<(UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponder)> {
1749        if let UnknownInteractionsProtocolRequest::FlexibleTwoWayFieldsErr { responder } = self {
1750            Some((responder))
1751        } else {
1752            None
1753        }
1754    }
1755
1756    /// Name of the method defined in FIDL
1757    pub fn method_name(&self) -> &'static str {
1758        match *self {
1759            UnknownInteractionsProtocolRequest::StrictOneWay { .. } => "strict_one_way",
1760            UnknownInteractionsProtocolRequest::FlexibleOneWay { .. } => "flexible_one_way",
1761            UnknownInteractionsProtocolRequest::StrictTwoWay { .. } => "strict_two_way",
1762            UnknownInteractionsProtocolRequest::StrictTwoWayFields { .. } => {
1763                "strict_two_way_fields"
1764            }
1765            UnknownInteractionsProtocolRequest::StrictTwoWayErr { .. } => "strict_two_way_err",
1766            UnknownInteractionsProtocolRequest::StrictTwoWayFieldsErr { .. } => {
1767                "strict_two_way_fields_err"
1768            }
1769            UnknownInteractionsProtocolRequest::FlexibleTwoWay { .. } => "flexible_two_way",
1770            UnknownInteractionsProtocolRequest::FlexibleTwoWayFields { .. } => {
1771                "flexible_two_way_fields"
1772            }
1773            UnknownInteractionsProtocolRequest::FlexibleTwoWayErr { .. } => "flexible_two_way_err",
1774            UnknownInteractionsProtocolRequest::FlexibleTwoWayFieldsErr { .. } => {
1775                "flexible_two_way_fields_err"
1776            }
1777            UnknownInteractionsProtocolRequest::_UnknownMethod {
1778                method_type: fidl::MethodType::OneWay,
1779                ..
1780            } => "unknown one-way method",
1781            UnknownInteractionsProtocolRequest::_UnknownMethod {
1782                method_type: fidl::MethodType::TwoWay,
1783                ..
1784            } => "unknown two-way method",
1785        }
1786    }
1787}
1788
1789#[derive(Debug, Clone)]
1790pub struct UnknownInteractionsProtocolControlHandle {
1791    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1792}
1793
1794impl fidl::endpoints::ControlHandle for UnknownInteractionsProtocolControlHandle {
1795    fn shutdown(&self) {
1796        self.inner.shutdown()
1797    }
1798    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1799        self.inner.shutdown_with_epitaph(status)
1800    }
1801
1802    fn is_closed(&self) -> bool {
1803        self.inner.channel().is_closed()
1804    }
1805    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1806        self.inner.channel().on_closed()
1807    }
1808
1809    #[cfg(target_os = "fuchsia")]
1810    fn signal_peer(
1811        &self,
1812        clear_mask: zx::Signals,
1813        set_mask: zx::Signals,
1814    ) -> Result<(), zx_status::Status> {
1815        use fidl::Peered;
1816        self.inner.channel().signal_peer(clear_mask, set_mask)
1817    }
1818}
1819
1820impl UnknownInteractionsProtocolControlHandle {
1821    pub fn send_strict_event(&self) -> Result<(), fidl::Error> {
1822        self.inner.send::<fidl::encoding::EmptyPayload>(
1823            (),
1824            0,
1825            0x584b419891a32738,
1826            fidl::encoding::DynamicFlags::empty(),
1827        )
1828    }
1829
1830    pub fn send_strict_event_fields(&self, mut some_field: i32) -> Result<(), fidl::Error> {
1831        self.inner.send::<UnknownInteractionsProtocolStrictEventFieldsRequest>(
1832            (some_field,),
1833            0,
1834            0x4c622afb12e4a13b,
1835            fidl::encoding::DynamicFlags::empty(),
1836        )
1837    }
1838
1839    pub fn send_flexible_event(&self) -> Result<(), fidl::Error> {
1840        self.inner.send::<fidl::encoding::EmptyPayload>(
1841            (),
1842            0,
1843            0x317a1a8e0b802c6c,
1844            fidl::encoding::DynamicFlags::FLEXIBLE,
1845        )
1846    }
1847
1848    pub fn send_flexible_event_fields(&self, mut some_field: i32) -> Result<(), fidl::Error> {
1849        self.inner.send::<UnknownInteractionsProtocolFlexibleEventFieldsRequest>(
1850            (some_field,),
1851            0,
1852            0x40620b164591af9e,
1853            fidl::encoding::DynamicFlags::FLEXIBLE,
1854        )
1855    }
1856}
1857
1858#[must_use = "FIDL methods require a response to be sent"]
1859#[derive(Debug)]
1860pub struct UnknownInteractionsProtocolStrictTwoWayResponder {
1861    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
1862    tx_id: u32,
1863}
1864
1865/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
1866/// if the responder is dropped without sending a response, so that the client
1867/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1868impl std::ops::Drop for UnknownInteractionsProtocolStrictTwoWayResponder {
1869    fn drop(&mut self) {
1870        self.control_handle.shutdown();
1871        // Safety: drops once, never accessed again
1872        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1873    }
1874}
1875
1876impl fidl::endpoints::Responder for UnknownInteractionsProtocolStrictTwoWayResponder {
1877    type ControlHandle = UnknownInteractionsProtocolControlHandle;
1878
1879    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
1880        &self.control_handle
1881    }
1882
1883    fn drop_without_shutdown(mut self) {
1884        // Safety: drops once, never accessed again due to mem::forget
1885        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1886        // Prevent Drop from running (which would shut down the channel)
1887        std::mem::forget(self);
1888    }
1889}
1890
1891impl UnknownInteractionsProtocolStrictTwoWayResponder {
1892    /// Sends a response to the FIDL transaction.
1893    ///
1894    /// Sets the channel to shutdown if an error occurs.
1895    pub fn send(self) -> Result<(), fidl::Error> {
1896        let _result = self.send_raw();
1897        if _result.is_err() {
1898            self.control_handle.shutdown();
1899        }
1900        self.drop_without_shutdown();
1901        _result
1902    }
1903
1904    /// Similar to "send" but does not shutdown the channel if an error occurs.
1905    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1906        let _result = self.send_raw();
1907        self.drop_without_shutdown();
1908        _result
1909    }
1910
1911    fn send_raw(&self) -> Result<(), fidl::Error> {
1912        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1913            (),
1914            self.tx_id,
1915            0x73ba6f957055b0dc,
1916            fidl::encoding::DynamicFlags::empty(),
1917        )
1918    }
1919}
1920
1921#[must_use = "FIDL methods require a response to be sent"]
1922#[derive(Debug)]
1923pub struct UnknownInteractionsProtocolStrictTwoWayFieldsResponder {
1924    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
1925    tx_id: u32,
1926}
1927
1928/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
1929/// if the responder is dropped without sending a response, so that the client
1930/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1931impl std::ops::Drop for UnknownInteractionsProtocolStrictTwoWayFieldsResponder {
1932    fn drop(&mut self) {
1933        self.control_handle.shutdown();
1934        // Safety: drops once, never accessed again
1935        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1936    }
1937}
1938
1939impl fidl::endpoints::Responder for UnknownInteractionsProtocolStrictTwoWayFieldsResponder {
1940    type ControlHandle = UnknownInteractionsProtocolControlHandle;
1941
1942    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
1943        &self.control_handle
1944    }
1945
1946    fn drop_without_shutdown(mut self) {
1947        // Safety: drops once, never accessed again due to mem::forget
1948        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1949        // Prevent Drop from running (which would shut down the channel)
1950        std::mem::forget(self);
1951    }
1952}
1953
1954impl UnknownInteractionsProtocolStrictTwoWayFieldsResponder {
1955    /// Sends a response to the FIDL transaction.
1956    ///
1957    /// Sets the channel to shutdown if an error occurs.
1958    pub fn send(self, mut some_field: i32) -> Result<(), fidl::Error> {
1959        let _result = self.send_raw(some_field);
1960        if _result.is_err() {
1961            self.control_handle.shutdown();
1962        }
1963        self.drop_without_shutdown();
1964        _result
1965    }
1966
1967    /// Similar to "send" but does not shutdown the channel if an error occurs.
1968    pub fn send_no_shutdown_on_err(self, mut some_field: i32) -> Result<(), fidl::Error> {
1969        let _result = self.send_raw(some_field);
1970        self.drop_without_shutdown();
1971        _result
1972    }
1973
1974    fn send_raw(&self, mut some_field: i32) -> Result<(), fidl::Error> {
1975        self.control_handle.inner.send::<UnknownInteractionsProtocolStrictTwoWayFieldsResponse>(
1976            (some_field,),
1977            self.tx_id,
1978            0x21513db78c6597f7,
1979            fidl::encoding::DynamicFlags::empty(),
1980        )
1981    }
1982}
1983
1984#[must_use = "FIDL methods require a response to be sent"]
1985#[derive(Debug)]
1986pub struct UnknownInteractionsProtocolStrictTwoWayErrResponder {
1987    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
1988    tx_id: u32,
1989}
1990
1991/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
1992/// if the responder is dropped without sending a response, so that the client
1993/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1994impl std::ops::Drop for UnknownInteractionsProtocolStrictTwoWayErrResponder {
1995    fn drop(&mut self) {
1996        self.control_handle.shutdown();
1997        // Safety: drops once, never accessed again
1998        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1999    }
2000}
2001
2002impl fidl::endpoints::Responder for UnknownInteractionsProtocolStrictTwoWayErrResponder {
2003    type ControlHandle = UnknownInteractionsProtocolControlHandle;
2004
2005    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
2006        &self.control_handle
2007    }
2008
2009    fn drop_without_shutdown(mut self) {
2010        // Safety: drops once, never accessed again due to mem::forget
2011        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2012        // Prevent Drop from running (which would shut down the channel)
2013        std::mem::forget(self);
2014    }
2015}
2016
2017impl UnknownInteractionsProtocolStrictTwoWayErrResponder {
2018    /// Sends a response to the FIDL transaction.
2019    ///
2020    /// Sets the channel to shutdown if an error occurs.
2021    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2022        let _result = self.send_raw(result);
2023        if _result.is_err() {
2024            self.control_handle.shutdown();
2025        }
2026        self.drop_without_shutdown();
2027        _result
2028    }
2029
2030    /// Similar to "send" but does not shutdown the channel if an error occurs.
2031    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2032        let _result = self.send_raw(result);
2033        self.drop_without_shutdown();
2034        _result
2035    }
2036
2037    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2038        self.control_handle
2039            .inner
2040            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2041                result,
2042                self.tx_id,
2043                0x2e9beb4e08e058bb,
2044                fidl::encoding::DynamicFlags::empty(),
2045            )
2046    }
2047}
2048
2049#[must_use = "FIDL methods require a response to be sent"]
2050#[derive(Debug)]
2051pub struct UnknownInteractionsProtocolStrictTwoWayFieldsErrResponder {
2052    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
2053    tx_id: u32,
2054}
2055
2056/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
2057/// if the responder is dropped without sending a response, so that the client
2058/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2059impl std::ops::Drop for UnknownInteractionsProtocolStrictTwoWayFieldsErrResponder {
2060    fn drop(&mut self) {
2061        self.control_handle.shutdown();
2062        // Safety: drops once, never accessed again
2063        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2064    }
2065}
2066
2067impl fidl::endpoints::Responder for UnknownInteractionsProtocolStrictTwoWayFieldsErrResponder {
2068    type ControlHandle = UnknownInteractionsProtocolControlHandle;
2069
2070    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
2071        &self.control_handle
2072    }
2073
2074    fn drop_without_shutdown(mut self) {
2075        // Safety: drops once, never accessed again due to mem::forget
2076        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2077        // Prevent Drop from running (which would shut down the channel)
2078        std::mem::forget(self);
2079    }
2080}
2081
2082impl UnknownInteractionsProtocolStrictTwoWayFieldsErrResponder {
2083    /// Sends a response to the FIDL transaction.
2084    ///
2085    /// Sets the channel to shutdown if an error occurs.
2086    pub fn send(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
2087        let _result = self.send_raw(result);
2088        if _result.is_err() {
2089            self.control_handle.shutdown();
2090        }
2091        self.drop_without_shutdown();
2092        _result
2093    }
2094
2095    /// Similar to "send" but does not shutdown the channel if an error occurs.
2096    pub fn send_no_shutdown_on_err(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
2097        let _result = self.send_raw(result);
2098        self.drop_without_shutdown();
2099        _result
2100    }
2101
2102    fn send_raw(&self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
2103        self.control_handle.inner.send::<fidl::encoding::ResultType<
2104            UnknownInteractionsProtocolStrictTwoWayFieldsErrResponse,
2105            i32,
2106        >>(
2107            result.map(|some_field| (some_field,)),
2108            self.tx_id,
2109            0x6dd97948e8f69be4,
2110            fidl::encoding::DynamicFlags::empty(),
2111        )
2112    }
2113}
2114
2115#[must_use = "FIDL methods require a response to be sent"]
2116#[derive(Debug)]
2117pub struct UnknownInteractionsProtocolFlexibleTwoWayResponder {
2118    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
2119    tx_id: u32,
2120}
2121
2122/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
2123/// if the responder is dropped without sending a response, so that the client
2124/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2125impl std::ops::Drop for UnknownInteractionsProtocolFlexibleTwoWayResponder {
2126    fn drop(&mut self) {
2127        self.control_handle.shutdown();
2128        // Safety: drops once, never accessed again
2129        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2130    }
2131}
2132
2133impl fidl::endpoints::Responder for UnknownInteractionsProtocolFlexibleTwoWayResponder {
2134    type ControlHandle = UnknownInteractionsProtocolControlHandle;
2135
2136    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
2137        &self.control_handle
2138    }
2139
2140    fn drop_without_shutdown(mut self) {
2141        // Safety: drops once, never accessed again due to mem::forget
2142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2143        // Prevent Drop from running (which would shut down the channel)
2144        std::mem::forget(self);
2145    }
2146}
2147
2148impl UnknownInteractionsProtocolFlexibleTwoWayResponder {
2149    /// Sends a response to the FIDL transaction.
2150    ///
2151    /// Sets the channel to shutdown if an error occurs.
2152    pub fn send(self) -> Result<(), fidl::Error> {
2153        let _result = self.send_raw();
2154        if _result.is_err() {
2155            self.control_handle.shutdown();
2156        }
2157        self.drop_without_shutdown();
2158        _result
2159    }
2160
2161    /// Similar to "send" but does not shutdown the channel if an error occurs.
2162    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2163        let _result = self.send_raw();
2164        self.drop_without_shutdown();
2165        _result
2166    }
2167
2168    fn send_raw(&self) -> Result<(), fidl::Error> {
2169        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2170            fidl::encoding::Flexible::new(()),
2171            self.tx_id,
2172            0x1f33517a0395609d,
2173            fidl::encoding::DynamicFlags::FLEXIBLE,
2174        )
2175    }
2176}
2177
2178#[must_use = "FIDL methods require a response to be sent"]
2179#[derive(Debug)]
2180pub struct UnknownInteractionsProtocolFlexibleTwoWayFieldsResponder {
2181    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
2182    tx_id: u32,
2183}
2184
2185/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
2186/// if the responder is dropped without sending a response, so that the client
2187/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2188impl std::ops::Drop for UnknownInteractionsProtocolFlexibleTwoWayFieldsResponder {
2189    fn drop(&mut self) {
2190        self.control_handle.shutdown();
2191        // Safety: drops once, never accessed again
2192        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2193    }
2194}
2195
2196impl fidl::endpoints::Responder for UnknownInteractionsProtocolFlexibleTwoWayFieldsResponder {
2197    type ControlHandle = UnknownInteractionsProtocolControlHandle;
2198
2199    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
2200        &self.control_handle
2201    }
2202
2203    fn drop_without_shutdown(mut self) {
2204        // Safety: drops once, never accessed again due to mem::forget
2205        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2206        // Prevent Drop from running (which would shut down the channel)
2207        std::mem::forget(self);
2208    }
2209}
2210
2211impl UnknownInteractionsProtocolFlexibleTwoWayFieldsResponder {
2212    /// Sends a response to the FIDL transaction.
2213    ///
2214    /// Sets the channel to shutdown if an error occurs.
2215    pub fn send(self, mut some_field: i32) -> Result<(), fidl::Error> {
2216        let _result = self.send_raw(some_field);
2217        if _result.is_err() {
2218            self.control_handle.shutdown();
2219        }
2220        self.drop_without_shutdown();
2221        _result
2222    }
2223
2224    /// Similar to "send" but does not shutdown the channel if an error occurs.
2225    pub fn send_no_shutdown_on_err(self, mut some_field: i32) -> Result<(), fidl::Error> {
2226        let _result = self.send_raw(some_field);
2227        self.drop_without_shutdown();
2228        _result
2229    }
2230
2231    fn send_raw(&self, mut some_field: i32) -> Result<(), fidl::Error> {
2232        self.control_handle.inner.send::<fidl::encoding::FlexibleType<
2233            UnknownInteractionsProtocolFlexibleTwoWayFieldsResponse,
2234        >>(
2235            fidl::encoding::Flexible::new((some_field,)),
2236            self.tx_id,
2237            0x58ed18873e28b84d,
2238            fidl::encoding::DynamicFlags::FLEXIBLE,
2239        )
2240    }
2241}
2242
2243#[must_use = "FIDL methods require a response to be sent"]
2244#[derive(Debug)]
2245pub struct UnknownInteractionsProtocolFlexibleTwoWayErrResponder {
2246    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
2247    tx_id: u32,
2248}
2249
2250/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
2251/// if the responder is dropped without sending a response, so that the client
2252/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2253impl std::ops::Drop for UnknownInteractionsProtocolFlexibleTwoWayErrResponder {
2254    fn drop(&mut self) {
2255        self.control_handle.shutdown();
2256        // Safety: drops once, never accessed again
2257        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2258    }
2259}
2260
2261impl fidl::endpoints::Responder for UnknownInteractionsProtocolFlexibleTwoWayErrResponder {
2262    type ControlHandle = UnknownInteractionsProtocolControlHandle;
2263
2264    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
2265        &self.control_handle
2266    }
2267
2268    fn drop_without_shutdown(mut self) {
2269        // Safety: drops once, never accessed again due to mem::forget
2270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2271        // Prevent Drop from running (which would shut down the channel)
2272        std::mem::forget(self);
2273    }
2274}
2275
2276impl UnknownInteractionsProtocolFlexibleTwoWayErrResponder {
2277    /// Sends a response to the FIDL transaction.
2278    ///
2279    /// Sets the channel to shutdown if an error occurs.
2280    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2281        let _result = self.send_raw(result);
2282        if _result.is_err() {
2283            self.control_handle.shutdown();
2284        }
2285        self.drop_without_shutdown();
2286        _result
2287    }
2288
2289    /// Similar to "send" but does not shutdown the channel if an error occurs.
2290    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2291        let _result = self.send_raw(result);
2292        self.drop_without_shutdown();
2293        _result
2294    }
2295
2296    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2297        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2298            fidl::encoding::EmptyStruct,
2299            i32,
2300        >>(
2301            fidl::encoding::FlexibleResult::new(result),
2302            self.tx_id,
2303            0x706905decb20bd62,
2304            fidl::encoding::DynamicFlags::FLEXIBLE,
2305        )
2306    }
2307}
2308
2309#[must_use = "FIDL methods require a response to be sent"]
2310#[derive(Debug)]
2311pub struct UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponder {
2312    control_handle: std::mem::ManuallyDrop<UnknownInteractionsProtocolControlHandle>,
2313    tx_id: u32,
2314}
2315
2316/// Set the the channel to be shutdown (see [`UnknownInteractionsProtocolControlHandle::shutdown`])
2317/// if the responder is dropped without sending a response, so that the client
2318/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2319impl std::ops::Drop for UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponder {
2320    fn drop(&mut self) {
2321        self.control_handle.shutdown();
2322        // Safety: drops once, never accessed again
2323        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2324    }
2325}
2326
2327impl fidl::endpoints::Responder for UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponder {
2328    type ControlHandle = UnknownInteractionsProtocolControlHandle;
2329
2330    fn control_handle(&self) -> &UnknownInteractionsProtocolControlHandle {
2331        &self.control_handle
2332    }
2333
2334    fn drop_without_shutdown(mut self) {
2335        // Safety: drops once, never accessed again due to mem::forget
2336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2337        // Prevent Drop from running (which would shut down the channel)
2338        std::mem::forget(self);
2339    }
2340}
2341
2342impl UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponder {
2343    /// Sends a response to the FIDL transaction.
2344    ///
2345    /// Sets the channel to shutdown if an error occurs.
2346    pub fn send(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
2347        let _result = self.send_raw(result);
2348        if _result.is_err() {
2349            self.control_handle.shutdown();
2350        }
2351        self.drop_without_shutdown();
2352        _result
2353    }
2354
2355    /// Similar to "send" but does not shutdown the channel if an error occurs.
2356    pub fn send_no_shutdown_on_err(self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
2357        let _result = self.send_raw(result);
2358        self.drop_without_shutdown();
2359        _result
2360    }
2361
2362    fn send_raw(&self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
2363        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2364            UnknownInteractionsProtocolFlexibleTwoWayFieldsErrResponse,
2365            i32,
2366        >>(
2367            fidl::encoding::FlexibleResult::new(result.map(|some_field| (some_field,))),
2368            self.tx_id,
2369            0x681fcbbead668390,
2370            fidl::encoding::DynamicFlags::FLEXIBLE,
2371        )
2372    }
2373}
2374
2375mod internal {
2376    use super::*;
2377}