Skip to main content

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