fidl_next_fuchsia_unknown/
fidl_next_fuchsia_unknown.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(Debug)]
6#[repr(C)]
7pub struct CloneableCloneRequest {
8    pub request: ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::zx::Channel>,
9}
10
11impl ::fidl_next::Encodable for CloneableCloneRequest {
12    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireCloneableCloneRequest> = unsafe {
13        ::fidl_next::CopyOptimization::enable_if(
14            true
15
16                && <
17                    ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable
18                >::COPY_OPTIMIZATION.is_enabled()
19
20        )
21    };
22
23    type Encoded = WireCloneableCloneRequest;
24}
25
26unsafe impl<___E> ::fidl_next::Encode<___E> for CloneableCloneRequest
27where
28    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
29    ___E: ::fidl_next::fuchsia::HandleEncoder,
30{
31    #[inline]
32    fn encode(
33        self,
34        encoder: &mut ___E,
35        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
36    ) -> Result<(), ::fidl_next::EncodeError> {
37        ::fidl_next::munge! {
38            let Self::Encoded {
39                request,
40
41            } = out;
42        }
43
44        ::fidl_next::Encode::encode(self.request, encoder, request)?;
45
46        Ok(())
47    }
48}
49
50impl ::fidl_next::EncodableOption for CloneableCloneRequest {
51    type EncodedOption = ::fidl_next::WireBox<'static, WireCloneableCloneRequest>;
52}
53
54unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CloneableCloneRequest
55where
56    ___E: ::fidl_next::Encoder + ?Sized,
57    CloneableCloneRequest: ::fidl_next::Encode<___E>,
58{
59    #[inline]
60    fn encode_option(
61        this: Option<Self>,
62        encoder: &mut ___E,
63        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
64    ) -> Result<(), ::fidl_next::EncodeError> {
65        if let Some(inner) = this {
66            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
67            ::fidl_next::WireBox::encode_present(out);
68        } else {
69            ::fidl_next::WireBox::encode_absent(out);
70        }
71
72        Ok(())
73    }
74}
75
76impl ::fidl_next::FromWire<WireCloneableCloneRequest> for CloneableCloneRequest {
77    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireCloneableCloneRequest, Self> = unsafe {
78        ::fidl_next::CopyOptimization::enable_if(
79            true
80
81                && <
82                    ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::WireChannel>>
83                >::COPY_OPTIMIZATION.is_enabled()
84
85        )
86    };
87
88    #[inline]
89    fn from_wire(wire: WireCloneableCloneRequest) -> Self {
90        Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
91    }
92}
93
94/// The wire type corresponding to [`CloneableCloneRequest`].
95#[derive(Debug)]
96#[repr(C)]
97pub struct WireCloneableCloneRequest {
98    pub request: ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::WireChannel>,
99}
100
101unsafe impl ::fidl_next::Wire for WireCloneableCloneRequest {
102    type Decoded<'de> = WireCloneableCloneRequest;
103
104    #[inline]
105    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
106}
107
108unsafe impl<___D> ::fidl_next::Decode<___D> for WireCloneableCloneRequest
109where
110    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
111    ___D: ::fidl_next::fuchsia::HandleDecoder,
112{
113    fn decode(
114        slot: ::fidl_next::Slot<'_, Self>,
115        decoder: &mut ___D,
116    ) -> Result<(), ::fidl_next::DecodeError> {
117        ::fidl_next::munge! {
118            let Self {
119                mut request,
120
121            } = slot;
122        }
123
124        ::fidl_next::Decode::decode(request.as_mut(), decoder)?;
125
126        Ok(())
127    }
128}
129
130/// The type corresponding to the Cloneable protocol.
131#[doc = " Provides a means of duplicating a connection.\n\n See the composing protocol\'s documentation for a description of\n connection-scoped state, if any.\n"]
132#[derive(Debug)]
133pub struct Cloneable;
134
135pub mod cloneable {
136    pub mod prelude {
137        pub use crate::{Cloneable, CloneableClientHandler, CloneableServerHandler, cloneable};
138
139        pub use crate::CloneableCloneRequest;
140    }
141
142    pub struct Clone;
143
144    impl ::fidl_next::Method for Clone {
145        const ORDINAL: u64 = 2366825959783828089;
146
147        type Protocol = crate::Cloneable;
148
149        type Request = crate::WireCloneableCloneRequest;
150
151        type Response = ::fidl_next::Never;
152    }
153
154    mod ___detail {
155
156        pub struct Clone<T0> {
157            request: T0,
158        }
159
160        impl<T0> ::fidl_next::Encodable for Clone<T0>
161        where
162            T0: ::fidl_next::Encodable<
163                    Encoded = ::fidl_next::ServerEnd<
164                        crate::Cloneable,
165                        ::fidl_next::fuchsia::WireChannel,
166                    >,
167                >,
168        {
169            type Encoded = crate::WireCloneableCloneRequest;
170        }
171
172        unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
173        where
174            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
175            ___E: ::fidl_next::fuchsia::HandleEncoder,
176            T0: ::fidl_next::Encode<
177                    ___E,
178                    Encoded = ::fidl_next::ServerEnd<
179                        crate::Cloneable,
180                        ::fidl_next::fuchsia::WireChannel,
181                    >,
182                >,
183        {
184            #[inline]
185            fn encode(
186                self,
187                encoder: &mut ___E,
188                out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
189            ) -> Result<(), ::fidl_next::EncodeError> {
190                ::fidl_next::munge! {
191                    let Self::Encoded {
192                        request,
193
194                    } = out;
195                }
196
197                ::fidl_next::Encode::encode(self.request, encoder, request)?;
198
199                Ok(())
200            }
201        }
202
203        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Cloneable
204        where
205            ___T: ::fidl_next::Transport,
206        {
207            type ClientSender = CloneableClientSender<___T>;
208            type ServerSender = CloneableServerSender<___T>;
209        }
210
211        /// The client sender for the `Cloneable` protocol.
212        #[repr(transparent)]
213        pub struct CloneableClientSender<___T: ::fidl_next::Transport> {
214            #[allow(dead_code)]
215            sender: ::fidl_next::protocol::ClientSender<___T>,
216        }
217
218        impl<___T> CloneableClientSender<___T>
219        where
220            ___T: ::fidl_next::Transport,
221        {
222            pub fn clone(
223                &self,
224
225                request: impl ::fidl_next::Encode<
226                    <___T as ::fidl_next::Transport>::SendBuffer,
227                    Encoded = ::fidl_next::ServerEnd<
228                        crate::Cloneable,
229                        ::fidl_next::fuchsia::WireChannel,
230                    >,
231                >,
232            ) -> ::fidl_next::SendFuture<'_, ___T>
233            where
234                <___T as ::fidl_next::Transport>::SendBuffer:
235                    ::fidl_next::encoder::InternalHandleEncoder,
236                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
237            {
238                self.clone_with(Clone { request })
239            }
240
241            pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
242            where
243                ___R: ::fidl_next::Encode<
244                        <___T as ::fidl_next::Transport>::SendBuffer,
245                        Encoded = crate::WireCloneableCloneRequest,
246                    >,
247            {
248                ::fidl_next::SendFuture::from_untyped(
249                    self.sender.send_one_way(2366825959783828089, request),
250                )
251            }
252        }
253
254        /// The server sender for the `Cloneable` protocol.
255        #[repr(transparent)]
256        pub struct CloneableServerSender<___T: ::fidl_next::Transport> {
257            sender: ::fidl_next::protocol::ServerSender<___T>,
258        }
259
260        impl<___T> CloneableServerSender<___T> where ___T: ::fidl_next::Transport {}
261    }
262}
263
264/// A client handler for the Cloneable protocol.
265///
266/// See [`Cloneable`] for more details.
267pub trait CloneableClientHandler<
268    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
269    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
270>
271{
272}
273
274impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Cloneable
275where
276    ___H: CloneableClientHandler<___T> + ::core::marker::Send,
277    ___T: ::fidl_next::Transport,
278{
279    async fn on_event(
280        handler: &mut ___H,
281        sender: &::fidl_next::ClientSender<Self, ___T>,
282        ordinal: u64,
283        buffer: ___T::RecvBuffer,
284    ) {
285        match ordinal {
286            ordinal => sender.close(),
287        }
288    }
289}
290
291/// A server handler for the Cloneable protocol.
292///
293/// See [`Cloneable`] for more details.
294pub trait CloneableServerHandler<
295    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
296    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
297>
298{
299    fn clone(
300        &mut self,
301        sender: &::fidl_next::ServerSender<Cloneable, ___T>,
302
303        request: ::fidl_next::Request<cloneable::Clone, ___T>,
304    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
305}
306
307impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Cloneable
308where
309    ___H: CloneableServerHandler<___T> + ::core::marker::Send,
310    ___T: ::fidl_next::Transport,
311    <cloneable::Clone as ::fidl_next::Method>::Request:
312        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
313{
314    async fn on_one_way(
315        handler: &mut ___H,
316        sender: &::fidl_next::ServerSender<Self, ___T>,
317        ordinal: u64,
318        buffer: ___T::RecvBuffer,
319    ) {
320        match ordinal {
321            2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
322                Ok(decoded) => handler.clone(sender, decoded).await,
323                Err(e) => sender.close(),
324            },
325
326            ordinal => sender.close(),
327        }
328    }
329
330    async fn on_two_way(
331        handler: &mut ___H,
332        sender: &::fidl_next::ServerSender<Self, ___T>,
333        ordinal: u64,
334        buffer: ___T::RecvBuffer,
335        responder: ::fidl_next::protocol::Responder,
336    ) {
337        match ordinal {
338            ordinal => sender.close(),
339        }
340    }
341}
342
343pub type CloseableCloseResponse = ();
344
345/// The wire type corresponding to [`CloseableCloseResponse`].
346pub type WireCloseableCloseResponse = ();
347
348/// The type corresponding to the Closeable protocol.
349#[doc = " Provides a means of synchronously closing a connection.\n"]
350#[derive(Debug)]
351pub struct Closeable;
352
353pub mod closeable {
354    pub mod prelude {
355        pub use crate::{Closeable, CloseableClientHandler, CloseableServerHandler, closeable};
356
357        pub use crate::CloseableCloseResponse;
358    }
359
360    pub struct Close;
361
362    impl ::fidl_next::Method for Close {
363        const ORDINAL: u64 = 6540867515453498750;
364
365        type Protocol = crate::Closeable;
366
367        type Request = ();
368
369        type Response = ::fidl_next::WireResult<
370            'static,
371            crate::WireCloseableCloseResponse,
372            ::fidl_next::WireI32,
373        >;
374    }
375
376    mod ___detail {
377
378        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Closeable
379        where
380            ___T: ::fidl_next::Transport,
381        {
382            type ClientSender = CloseableClientSender<___T>;
383            type ServerSender = CloseableServerSender<___T>;
384        }
385
386        /// The client sender for the `Closeable` protocol.
387        #[repr(transparent)]
388        pub struct CloseableClientSender<___T: ::fidl_next::Transport> {
389            #[allow(dead_code)]
390            sender: ::fidl_next::protocol::ClientSender<___T>,
391        }
392
393        impl<___T> CloseableClientSender<___T>
394        where
395            ___T: ::fidl_next::Transport,
396        {
397            #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
398            pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
399                ::fidl_next::TwoWayFuture::from_untyped(
400                    self.sender.send_two_way(6540867515453498750, ()),
401                )
402            }
403        }
404
405        /// The server sender for the `Closeable` protocol.
406        #[repr(transparent)]
407        pub struct CloseableServerSender<___T: ::fidl_next::Transport> {
408            sender: ::fidl_next::protocol::ServerSender<___T>,
409        }
410
411        impl<___T> CloseableServerSender<___T> where ___T: ::fidl_next::Transport {}
412    }
413}
414
415/// A client handler for the Closeable protocol.
416///
417/// See [`Closeable`] for more details.
418pub trait CloseableClientHandler<
419    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
420    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
421>
422{
423}
424
425impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Closeable
426where
427    ___H: CloseableClientHandler<___T> + ::core::marker::Send,
428    ___T: ::fidl_next::Transport,
429    <closeable::Close as ::fidl_next::Method>::Response:
430        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
431{
432    async fn on_event(
433        handler: &mut ___H,
434        sender: &::fidl_next::ClientSender<Self, ___T>,
435        ordinal: u64,
436        buffer: ___T::RecvBuffer,
437    ) {
438        match ordinal {
439            ordinal => sender.close(),
440        }
441    }
442}
443
444/// A server handler for the Closeable protocol.
445///
446/// See [`Closeable`] for more details.
447pub trait CloseableServerHandler<
448    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
449    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
450>
451{
452    #[doc = " Terminates the connection.\n\n After calling `Close`, the client must not send any other requests.\n\n Servers, after sending the status response, should close the connection\n regardless of status and without sending an epitaph.\n\n Closing the client end of the channel should be semantically equivalent\n to calling `Close` without knowing when the close has completed or its\n status.\n"]
453    fn close(
454        &mut self,
455        sender: &::fidl_next::ServerSender<Closeable, ___T>,
456
457        responder: ::fidl_next::Responder<closeable::Close>,
458    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
459}
460
461impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Closeable
462where
463    ___H: CloseableServerHandler<___T> + ::core::marker::Send,
464    ___T: ::fidl_next::Transport,
465{
466    async fn on_one_way(
467        handler: &mut ___H,
468        sender: &::fidl_next::ServerSender<Self, ___T>,
469        ordinal: u64,
470        buffer: ___T::RecvBuffer,
471    ) {
472        match ordinal {
473            ordinal => sender.close(),
474        }
475    }
476
477    async fn on_two_way(
478        handler: &mut ___H,
479        sender: &::fidl_next::ServerSender<Self, ___T>,
480        ordinal: u64,
481        buffer: ___T::RecvBuffer,
482        responder: ::fidl_next::protocol::Responder,
483    ) {
484        match ordinal {
485            6540867515453498750 => {
486                let responder = ::fidl_next::Responder::from_untyped(responder);
487
488                handler.close(sender, responder).await;
489            }
490
491            ordinal => sender.close(),
492        }
493    }
494}
495
496#[derive(Clone, Debug)]
497pub struct QueryableQueryResponse {
498    pub protocol: Vec<u8>,
499}
500
501impl ::fidl_next::Encodable for QueryableQueryResponse {
502    type Encoded = WireQueryableQueryResponse<'static>;
503}
504
505unsafe impl<___E> ::fidl_next::Encode<___E> for QueryableQueryResponse
506where
507    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
508    ___E: ::fidl_next::Encoder,
509{
510    #[inline]
511    fn encode(
512        self,
513        encoder: &mut ___E,
514        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
515    ) -> Result<(), ::fidl_next::EncodeError> {
516        ::fidl_next::munge! {
517            let Self::Encoded {
518                protocol,
519
520            } = out;
521        }
522
523        ::fidl_next::Encode::encode(self.protocol, encoder, protocol)?;
524
525        Ok(())
526    }
527}
528
529unsafe impl<___E> ::fidl_next::EncodeRef<___E> for QueryableQueryResponse
530where
531    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
532    ___E: ::fidl_next::Encoder,
533{
534    #[inline]
535    fn encode_ref(
536        &self,
537        encoder: &mut ___E,
538        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
539    ) -> Result<(), ::fidl_next::EncodeError> {
540        ::fidl_next::munge! {
541            let Self::Encoded {
542                protocol,
543
544            } = out;
545        }
546
547        ::fidl_next::EncodeRef::encode_ref(&self.protocol, encoder, protocol)?;
548
549        Ok(())
550    }
551}
552
553impl ::fidl_next::EncodableOption for QueryableQueryResponse {
554    type EncodedOption = ::fidl_next::WireBox<'static, WireQueryableQueryResponse<'static>>;
555}
556
557unsafe impl<___E> ::fidl_next::EncodeOption<___E> for QueryableQueryResponse
558where
559    ___E: ::fidl_next::Encoder + ?Sized,
560    QueryableQueryResponse: ::fidl_next::Encode<___E>,
561{
562    #[inline]
563    fn encode_option(
564        this: Option<Self>,
565        encoder: &mut ___E,
566        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
567    ) -> Result<(), ::fidl_next::EncodeError> {
568        if let Some(inner) = this {
569            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
570            ::fidl_next::WireBox::encode_present(out);
571        } else {
572            ::fidl_next::WireBox::encode_absent(out);
573        }
574
575        Ok(())
576    }
577}
578
579unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for QueryableQueryResponse
580where
581    ___E: ::fidl_next::Encoder + ?Sized,
582    QueryableQueryResponse: ::fidl_next::EncodeRef<___E>,
583{
584    #[inline]
585    fn encode_option_ref(
586        this: Option<&Self>,
587        encoder: &mut ___E,
588        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
589    ) -> Result<(), ::fidl_next::EncodeError> {
590        if let Some(inner) = this {
591            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
592            ::fidl_next::WireBox::encode_present(out);
593        } else {
594            ::fidl_next::WireBox::encode_absent(out);
595        }
596
597        Ok(())
598    }
599}
600
601impl<'de> ::fidl_next::FromWire<WireQueryableQueryResponse<'de>> for QueryableQueryResponse {
602    #[inline]
603    fn from_wire(wire: WireQueryableQueryResponse<'de>) -> Self {
604        Self { protocol: ::fidl_next::FromWire::from_wire(wire.protocol) }
605    }
606}
607
608impl<'de> ::fidl_next::FromWireRef<WireQueryableQueryResponse<'de>> for QueryableQueryResponse {
609    #[inline]
610    fn from_wire_ref(wire: &WireQueryableQueryResponse<'de>) -> Self {
611        Self { protocol: ::fidl_next::FromWireRef::from_wire_ref(&wire.protocol) }
612    }
613}
614
615/// The wire type corresponding to [`QueryableQueryResponse`].
616#[derive(Debug)]
617#[repr(C)]
618pub struct WireQueryableQueryResponse<'de> {
619    pub protocol: ::fidl_next::WireVector<'de, u8>,
620}
621
622unsafe impl ::fidl_next::Wire for WireQueryableQueryResponse<'static> {
623    type Decoded<'de> = WireQueryableQueryResponse<'de>;
624
625    #[inline]
626    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
627}
628
629unsafe impl<___D> ::fidl_next::Decode<___D> for WireQueryableQueryResponse<'static>
630where
631    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
632    ___D: ::fidl_next::Decoder,
633{
634    fn decode(
635        slot: ::fidl_next::Slot<'_, Self>,
636        decoder: &mut ___D,
637    ) -> Result<(), ::fidl_next::DecodeError> {
638        ::fidl_next::munge! {
639            let Self {
640                mut protocol,
641
642            } = slot;
643        }
644
645        ::fidl_next::Decode::decode(protocol.as_mut(), decoder)?;
646
647        Ok(())
648    }
649}
650
651/// The type corresponding to the Queryable protocol.
652#[doc = " Provides a means of identifying a type-erased protocol.\n"]
653#[derive(Debug)]
654pub struct Queryable;
655
656pub mod queryable {
657    pub mod prelude {
658        pub use crate::{Queryable, QueryableClientHandler, QueryableServerHandler, queryable};
659
660        pub use crate::QueryableQueryResponse;
661    }
662
663    pub struct Query;
664
665    impl ::fidl_next::Method for Query {
666        const ORDINAL: u64 = 2763219980499352582;
667
668        type Protocol = crate::Queryable;
669
670        type Request = ();
671
672        type Response = crate::WireQueryableQueryResponse<'static>;
673    }
674
675    mod ___detail {
676
677        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Queryable
678        where
679            ___T: ::fidl_next::Transport,
680        {
681            type ClientSender = QueryableClientSender<___T>;
682            type ServerSender = QueryableServerSender<___T>;
683        }
684
685        /// The client sender for the `Queryable` protocol.
686        #[repr(transparent)]
687        pub struct QueryableClientSender<___T: ::fidl_next::Transport> {
688            #[allow(dead_code)]
689            sender: ::fidl_next::protocol::ClientSender<___T>,
690        }
691
692        impl<___T> QueryableClientSender<___T>
693        where
694            ___T: ::fidl_next::Transport,
695        {
696            pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
697                ::fidl_next::TwoWayFuture::from_untyped(
698                    self.sender.send_two_way(2763219980499352582, ()),
699                )
700            }
701        }
702
703        /// The server sender for the `Queryable` protocol.
704        #[repr(transparent)]
705        pub struct QueryableServerSender<___T: ::fidl_next::Transport> {
706            sender: ::fidl_next::protocol::ServerSender<___T>,
707        }
708
709        impl<___T> QueryableServerSender<___T> where ___T: ::fidl_next::Transport {}
710    }
711}
712
713/// A client handler for the Queryable protocol.
714///
715/// See [`Queryable`] for more details.
716pub trait QueryableClientHandler<
717    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
718    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
719>
720{
721}
722
723impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Queryable
724where
725    ___H: QueryableClientHandler<___T> + ::core::marker::Send,
726    ___T: ::fidl_next::Transport,
727    <queryable::Query as ::fidl_next::Method>::Response:
728        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
729{
730    async fn on_event(
731        handler: &mut ___H,
732        sender: &::fidl_next::ClientSender<Self, ___T>,
733        ordinal: u64,
734        buffer: ___T::RecvBuffer,
735    ) {
736        match ordinal {
737            ordinal => sender.close(),
738        }
739    }
740}
741
742/// A server handler for the Queryable protocol.
743///
744/// See [`Queryable`] for more details.
745pub trait QueryableServerHandler<
746    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
747    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
748>
749{
750    fn query(
751        &mut self,
752        sender: &::fidl_next::ServerSender<Queryable, ___T>,
753
754        responder: ::fidl_next::Responder<queryable::Query>,
755    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
756}
757
758impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Queryable
759where
760    ___H: QueryableServerHandler<___T> + ::core::marker::Send,
761    ___T: ::fidl_next::Transport,
762{
763    async fn on_one_way(
764        handler: &mut ___H,
765        sender: &::fidl_next::ServerSender<Self, ___T>,
766        ordinal: u64,
767        buffer: ___T::RecvBuffer,
768    ) {
769        match ordinal {
770            ordinal => sender.close(),
771        }
772    }
773
774    async fn on_two_way(
775        handler: &mut ___H,
776        sender: &::fidl_next::ServerSender<Self, ___T>,
777        ordinal: u64,
778        buffer: ___T::RecvBuffer,
779        responder: ::fidl_next::protocol::Responder,
780    ) {
781        match ordinal {
782            2763219980499352582 => {
783                let responder = ::fidl_next::Responder::from_untyped(responder);
784
785                handler.query(sender, responder).await;
786            }
787
788            ordinal => sender.close(),
789        }
790    }
791}
792
793/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
794pub mod compat {
795
796    impl ::fidl_next::CompatFrom<crate::CloneableCloneRequest>
797        for ::fidl_fuchsia_unknown::CloneableCloneRequest
798    {
799        #[inline]
800        fn compat_from(value: crate::CloneableCloneRequest) -> Self {
801            Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
802        }
803    }
804
805    impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::CloneableCloneRequest>
806        for crate::CloneableCloneRequest
807    {
808        #[inline]
809        fn compat_from(value: ::fidl_fuchsia_unknown::CloneableCloneRequest) -> Self {
810            Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
811        }
812    }
813
814    #[cfg(target_os = "fuchsia")]
815    /// An alias for a client sender over `zx::Channel` for the `Cloneable`
816    /// protocol.
817    pub type CloneableProxy = ::fidl_next::ClientSender<crate::Cloneable>;
818
819    impl ::fidl_next::CompatFrom<crate::Cloneable> for ::fidl_fuchsia_unknown::CloneableMarker {
820        fn compat_from(_: crate::Cloneable) -> Self {
821            Self
822        }
823    }
824
825    impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::CloneableMarker> for crate::Cloneable {
826        fn compat_from(_: ::fidl_fuchsia_unknown::CloneableMarker) -> Self {
827            Self
828        }
829    }
830
831    #[cfg(target_os = "fuchsia")]
832
833    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_unknown::CloneableProxy> for crate::Cloneable {
834        fn client_compat_from(
835            proxy: ::fidl_fuchsia_unknown::CloneableProxy,
836        ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
837            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
838            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
839            ::fidl_next::Client::new(client_end)
840        }
841    }
842
843    #[cfg(target_os = "fuchsia")]
844    /// An alias for a client sender over `zx::Channel` for the `Closeable`
845    /// protocol.
846    pub type CloseableProxy = ::fidl_next::ClientSender<crate::Closeable>;
847
848    impl ::fidl_next::CompatFrom<crate::Closeable> for ::fidl_fuchsia_unknown::CloseableMarker {
849        fn compat_from(_: crate::Closeable) -> Self {
850            Self
851        }
852    }
853
854    impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::CloseableMarker> for crate::Closeable {
855        fn compat_from(_: ::fidl_fuchsia_unknown::CloseableMarker) -> Self {
856            Self
857        }
858    }
859
860    #[cfg(target_os = "fuchsia")]
861
862    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_unknown::CloseableProxy> for crate::Closeable {
863        fn client_compat_from(
864            proxy: ::fidl_fuchsia_unknown::CloseableProxy,
865        ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
866            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
867            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
868            ::fidl_next::Client::new(client_end)
869        }
870    }
871
872    impl ::fidl_next::CompatFrom<crate::QueryableQueryResponse>
873        for ::fidl_fuchsia_unknown::QueryableQueryResponse
874    {
875        #[inline]
876        fn compat_from(value: crate::QueryableQueryResponse) -> Self {
877            Self { protocol: ::fidl_next::CompatFrom::compat_from(value.protocol) }
878        }
879    }
880
881    impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::QueryableQueryResponse>
882        for crate::QueryableQueryResponse
883    {
884        #[inline]
885        fn compat_from(value: ::fidl_fuchsia_unknown::QueryableQueryResponse) -> Self {
886            Self { protocol: ::fidl_next::CompatFrom::compat_from(value.protocol) }
887        }
888    }
889
890    #[cfg(target_os = "fuchsia")]
891    /// An alias for a client sender over `zx::Channel` for the `Queryable`
892    /// protocol.
893    pub type QueryableProxy = ::fidl_next::ClientSender<crate::Queryable>;
894
895    impl ::fidl_next::CompatFrom<crate::Queryable> for ::fidl_fuchsia_unknown::QueryableMarker {
896        fn compat_from(_: crate::Queryable) -> Self {
897            Self
898        }
899    }
900
901    impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::QueryableMarker> for crate::Queryable {
902        fn compat_from(_: ::fidl_fuchsia_unknown::QueryableMarker) -> Self {
903            Self
904        }
905    }
906
907    #[cfg(target_os = "fuchsia")]
908
909    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_unknown::QueryableProxy> for crate::Queryable {
910        fn client_compat_from(
911            proxy: ::fidl_fuchsia_unknown::QueryableProxy,
912        ) -> ::fidl_next::Client<Self, ::fidl_next::fuchsia::zx::Channel> {
913            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
914            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
915            ::fidl_next::Client::new(client_end)
916        }
917    }
918}