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