1#![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 pub type CloseableCloseResponse = ::fidl_next::wire::Unit;
155
156 #[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 pub type CloseableCloseResponse = ();
234
235 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 unsafe impl<'a, ___E, T0>
268 ::fidl_next::Encode<crate::wire::QueryableQueryResponse<'static>, ___E>
269 for &'a QueryableQueryResponse<T0>
270 where
271 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
272 ___E: ::fidl_next::Encoder,
273 &'a T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
274 {
275 #[inline]
276 fn encode(
277 self,
278 encoder_: &mut ___E,
279 out_: &mut ::core::mem::MaybeUninit<crate::wire::QueryableQueryResponse<'static>>,
280 _: (),
281 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
282 ::fidl_next::munge! {
283 let crate::wire::QueryableQueryResponse {
284 protocol,
285
286 } = out_;
287 }
288
289 ::fidl_next::Encode::encode(&self.protocol, encoder_, protocol, (4294967295, ()))?;
290
291 Ok(())
292 }
293 }
294}
295
296pub use self::natural::*;
297
298#[doc = " Provides a means of synchronously closing a connection.\n"]
300#[derive(PartialEq, Debug)]
301pub struct Closeable;
302
303#[cfg(target_os = "fuchsia")]
304impl ::fidl_next::HasTransport for Closeable {
305 type Transport = ::fidl_next::fuchsia::zx::Channel;
306}
307
308pub mod closeable {
309 pub mod prelude {
310 pub use crate::{
311 Closeable, CloseableClientHandler, CloseableLocalClientHandler,
312 CloseableLocalServerHandler, CloseableServerHandler, closeable,
313 };
314
315 pub use crate::natural::CloseableCloseResponse;
316 }
317
318 pub struct Close;
319
320 impl ::fidl_next::Method for Close {
321 const ORDINAL: u64 = 6540867515453498750;
322 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
323 ::fidl_next::protocol::Flexibility::Strict;
324
325 type Protocol = crate::Closeable;
326
327 type Request = ::fidl_next::wire::EmptyMessageBody;
328 }
329
330 impl ::fidl_next::TwoWayMethod for Close {
331 type Response = ::fidl_next::wire::Result<
332 'static,
333 crate::wire::CloseableCloseResponse,
334 ::fidl_next::wire::fuchsia::Status,
335 >;
336 }
337
338 impl<___R> ::fidl_next::Respond<___R> for Close {
339 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
340
341 fn respond(response: ___R) -> Self::Output {
342 ::core::result::Result::Ok(response)
343 }
344 }
345
346 impl<___R> ::fidl_next::RespondErr<___R> for Close {
347 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
348
349 fn respond_err(response: ___R) -> Self::Output {
350 ::core::result::Result::Err(response)
351 }
352 }
353
354 mod ___detail {
355 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Closeable
356 where
357 ___T: ::fidl_next::Transport,
358 {
359 type Client = CloseableClient<___T>;
360 type Server = CloseableServer<___T>;
361 }
362
363 #[repr(transparent)]
365 pub struct CloseableClient<___T: ::fidl_next::Transport> {
366 #[allow(dead_code)]
367 client: ::fidl_next::protocol::Client<___T>,
368 }
369
370 impl<___T> CloseableClient<___T>
371 where
372 ___T: ::fidl_next::Transport,
373 {
374 #[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"]
375 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
376 ::fidl_next::TwoWayFuture::from_untyped(
377 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
378 6540867515453498750,
379 <super::Close as ::fidl_next::Method>::FLEXIBILITY,
380 (),
381 ),
382 )
383 }
384 }
385
386 #[repr(transparent)]
388 pub struct CloseableServer<___T: ::fidl_next::Transport> {
389 server: ::fidl_next::protocol::Server<___T>,
390 }
391
392 impl<___T> CloseableServer<___T> where ___T: ::fidl_next::Transport {}
393 }
394}
395
396#[diagnostic::on_unimplemented(
397 note = "If {Self} implements the non-local CloseableClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
398)]
399
400pub trait CloseableLocalClientHandler<
404 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
405 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
406>
407{
408}
409
410impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Closeable
411where
412 ___H: CloseableLocalClientHandler<___T>,
413 ___T: ::fidl_next::Transport,
414{
415 async fn on_event(
416 handler: &mut ___H,
417 mut message: ::fidl_next::Message<___T>,
418 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
419 match *message.header().ordinal {
420 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
421 }
422 }
423}
424
425#[diagnostic::on_unimplemented(
426 note = "If {Self} implements the non-local CloseableServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
427)]
428
429pub trait CloseableLocalServerHandler<
433 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
434 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
435>
436{
437 #[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"]
438 fn close(
439 &mut self,
440
441 responder: ::fidl_next::Responder<closeable::Close, ___T>,
442 ) -> impl ::core::future::Future<Output = ()>;
443}
444
445impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Closeable
446where
447 ___H: CloseableLocalServerHandler<___T>,
448 ___T: ::fidl_next::Transport,
449{
450 async fn on_one_way(
451 handler: &mut ___H,
452 mut message: ::fidl_next::Message<___T>,
453 ) -> ::core::result::Result<
454 (),
455 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
456 > {
457 match *message.header().ordinal {
458 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
459 }
460 }
461
462 async fn on_two_way(
463 handler: &mut ___H,
464 mut message: ::fidl_next::Message<___T>,
465 responder: ::fidl_next::protocol::Responder<___T>,
466 ) -> ::core::result::Result<
467 (),
468 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
469 > {
470 match *message.header().ordinal {
471 6540867515453498750 => {
472 let responder = ::fidl_next::Responder::from_untyped(responder);
473
474 handler.close(responder).await;
475 Ok(())
476 }
477
478 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
479 }
480 }
481}
482
483pub trait CloseableClientHandler<
487 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
488 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
489>
490{
491}
492
493impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Closeable
494where
495 ___H: CloseableClientHandler<___T> + ::core::marker::Send,
496 ___T: ::fidl_next::Transport,
497{
498 async fn on_event(
499 handler: &mut ___H,
500 mut message: ::fidl_next::Message<___T>,
501 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
502 match *message.header().ordinal {
503 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
504 }
505 }
506}
507
508pub trait CloseableServerHandler<
512 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
513 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
514>
515{
516 #[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"]
517 fn close(
518 &mut self,
519
520 responder: ::fidl_next::Responder<closeable::Close, ___T>,
521 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
522}
523
524impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Closeable
525where
526 ___H: CloseableServerHandler<___T> + ::core::marker::Send,
527 ___T: ::fidl_next::Transport,
528{
529 async fn on_one_way(
530 handler: &mut ___H,
531 mut message: ::fidl_next::Message<___T>,
532 ) -> ::core::result::Result<
533 (),
534 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
535 > {
536 match *message.header().ordinal {
537 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
538 }
539 }
540
541 async fn on_two_way(
542 handler: &mut ___H,
543 mut message: ::fidl_next::Message<___T>,
544 responder: ::fidl_next::protocol::Responder<___T>,
545 ) -> ::core::result::Result<
546 (),
547 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
548 > {
549 match *message.header().ordinal {
550 6540867515453498750 => {
551 let responder = ::fidl_next::Responder::from_untyped(responder);
552
553 handler.close(responder).await;
554 Ok(())
555 }
556
557 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
558 }
559 }
560}
561
562impl<___T> CloseableClientHandler<___T> for ::fidl_next::IgnoreEvents where
563 ___T: ::fidl_next::Transport
564{
565}
566
567impl<___H, ___T> CloseableLocalClientHandler<___T> for ::fidl_next::Local<___H>
568where
569 ___H: CloseableClientHandler<___T>,
570 ___T: ::fidl_next::Transport,
571{
572}
573
574impl<___H, ___T> CloseableLocalServerHandler<___T> for ::fidl_next::Local<___H>
575where
576 ___H: CloseableServerHandler<___T>,
577 ___T: ::fidl_next::Transport,
578{
579 async fn close(&mut self, responder: ::fidl_next::Responder<closeable::Close, ___T>) {
580 ___H::close(&mut self.0, responder).await
581 }
582}
583
584#[doc = " Provides a means of identifying a type-erased protocol.\n"]
586#[derive(PartialEq, Debug)]
587pub struct Queryable;
588
589#[cfg(target_os = "fuchsia")]
590impl ::fidl_next::HasTransport for Queryable {
591 type Transport = ::fidl_next::fuchsia::zx::Channel;
592}
593
594pub mod queryable {
595 pub mod prelude {
596 pub use crate::{
597 Queryable, QueryableClientHandler, QueryableLocalClientHandler,
598 QueryableLocalServerHandler, QueryableServerHandler, queryable,
599 };
600
601 pub use crate::natural::QueryableQueryResponse;
602 }
603
604 pub struct Query;
605
606 impl ::fidl_next::Method for Query {
607 const ORDINAL: u64 = 2763219980499352582;
608 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
609 ::fidl_next::protocol::Flexibility::Strict;
610
611 type Protocol = crate::Queryable;
612
613 type Request = ::fidl_next::wire::EmptyMessageBody;
614 }
615
616 impl ::fidl_next::TwoWayMethod for Query {
617 type Response = ::fidl_next::wire::Strict<crate::wire::QueryableQueryResponse<'static>>;
618 }
619
620 impl<___R> ::fidl_next::Respond<___R> for Query {
621 type Output = ::fidl_next::Strict<crate::generic::QueryableQueryResponse<___R>>;
622
623 fn respond(response: ___R) -> Self::Output {
624 ::fidl_next::Strict(crate::generic::QueryableQueryResponse { protocol: response })
625 }
626 }
627
628 mod ___detail {
629 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Queryable
630 where
631 ___T: ::fidl_next::Transport,
632 {
633 type Client = QueryableClient<___T>;
634 type Server = QueryableServer<___T>;
635 }
636
637 #[repr(transparent)]
639 pub struct QueryableClient<___T: ::fidl_next::Transport> {
640 #[allow(dead_code)]
641 client: ::fidl_next::protocol::Client<___T>,
642 }
643
644 impl<___T> QueryableClient<___T>
645 where
646 ___T: ::fidl_next::Transport,
647 {
648 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
649 ::fidl_next::TwoWayFuture::from_untyped(
650 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
651 2763219980499352582,
652 <super::Query as ::fidl_next::Method>::FLEXIBILITY,
653 (),
654 ),
655 )
656 }
657 }
658
659 #[repr(transparent)]
661 pub struct QueryableServer<___T: ::fidl_next::Transport> {
662 server: ::fidl_next::protocol::Server<___T>,
663 }
664
665 impl<___T> QueryableServer<___T> where ___T: ::fidl_next::Transport {}
666 }
667}
668
669#[diagnostic::on_unimplemented(
670 note = "If {Self} implements the non-local QueryableClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
671)]
672
673pub trait QueryableLocalClientHandler<
677 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
678 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
679>
680{
681}
682
683impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Queryable
684where
685 ___H: QueryableLocalClientHandler<___T>,
686 ___T: ::fidl_next::Transport,
687{
688 async fn on_event(
689 handler: &mut ___H,
690 mut message: ::fidl_next::Message<___T>,
691 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
692 match *message.header().ordinal {
693 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
694 }
695 }
696}
697
698#[diagnostic::on_unimplemented(
699 note = "If {Self} implements the non-local QueryableServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
700)]
701
702pub trait QueryableLocalServerHandler<
706 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
707 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
708>
709{
710 fn query(
711 &mut self,
712
713 responder: ::fidl_next::Responder<queryable::Query, ___T>,
714 ) -> impl ::core::future::Future<Output = ()>;
715}
716
717impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Queryable
718where
719 ___H: QueryableLocalServerHandler<___T>,
720 ___T: ::fidl_next::Transport,
721{
722 async fn on_one_way(
723 handler: &mut ___H,
724 mut message: ::fidl_next::Message<___T>,
725 ) -> ::core::result::Result<
726 (),
727 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
728 > {
729 match *message.header().ordinal {
730 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
731 }
732 }
733
734 async fn on_two_way(
735 handler: &mut ___H,
736 mut message: ::fidl_next::Message<___T>,
737 responder: ::fidl_next::protocol::Responder<___T>,
738 ) -> ::core::result::Result<
739 (),
740 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
741 > {
742 match *message.header().ordinal {
743 2763219980499352582 => {
744 let responder = ::fidl_next::Responder::from_untyped(responder);
745
746 handler.query(responder).await;
747 Ok(())
748 }
749
750 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
751 }
752 }
753}
754
755pub trait QueryableClientHandler<
759 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
760 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
761>
762{
763}
764
765impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Queryable
766where
767 ___H: QueryableClientHandler<___T> + ::core::marker::Send,
768 ___T: ::fidl_next::Transport,
769{
770 async fn on_event(
771 handler: &mut ___H,
772 mut message: ::fidl_next::Message<___T>,
773 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
774 match *message.header().ordinal {
775 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
776 }
777 }
778}
779
780pub trait QueryableServerHandler<
784 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
785 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
786>
787{
788 fn query(
789 &mut self,
790
791 responder: ::fidl_next::Responder<queryable::Query, ___T>,
792 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
793}
794
795impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Queryable
796where
797 ___H: QueryableServerHandler<___T> + ::core::marker::Send,
798 ___T: ::fidl_next::Transport,
799{
800 async fn on_one_way(
801 handler: &mut ___H,
802 mut message: ::fidl_next::Message<___T>,
803 ) -> ::core::result::Result<
804 (),
805 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
806 > {
807 match *message.header().ordinal {
808 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
809 }
810 }
811
812 async fn on_two_way(
813 handler: &mut ___H,
814 mut message: ::fidl_next::Message<___T>,
815 responder: ::fidl_next::protocol::Responder<___T>,
816 ) -> ::core::result::Result<
817 (),
818 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
819 > {
820 match *message.header().ordinal {
821 2763219980499352582 => {
822 let responder = ::fidl_next::Responder::from_untyped(responder);
823
824 handler.query(responder).await;
825 Ok(())
826 }
827
828 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
829 }
830 }
831}
832
833impl<___T> QueryableClientHandler<___T> for ::fidl_next::IgnoreEvents where
834 ___T: ::fidl_next::Transport
835{
836}
837
838impl<___H, ___T> QueryableLocalClientHandler<___T> for ::fidl_next::Local<___H>
839where
840 ___H: QueryableClientHandler<___T>,
841 ___T: ::fidl_next::Transport,
842{
843}
844
845impl<___H, ___T> QueryableLocalServerHandler<___T> for ::fidl_next::Local<___H>
846where
847 ___H: QueryableServerHandler<___T>,
848 ___T: ::fidl_next::Transport,
849{
850 async fn query(&mut self, responder: ::fidl_next::Responder<queryable::Query, ___T>) {
851 ___H::query(&mut self.0, responder).await
852 }
853}