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