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