1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[derive(PartialEq, Debug)]
8 #[repr(C)]
9 pub struct CloneableCloneRequest {
10 pub request: ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::zx::Channel>,
11 }
12
13 impl ::fidl_next::Encodable for CloneableCloneRequest {
14 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
15 Self,
16 crate::wire::CloneableCloneRequest,
17 > = unsafe {
18 ::fidl_next::CopyOptimization::enable_if(
19 true
20
21 && <
22 ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encodable
23 >::COPY_OPTIMIZATION.is_enabled()
24
25 )
26 };
27
28 type Encoded = crate::wire::CloneableCloneRequest;
29 }
30
31 unsafe impl<___E> ::fidl_next::Encode<___E> for CloneableCloneRequest
32 where
33 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
34 ___E: ::fidl_next::fuchsia::HandleEncoder,
35 {
36 #[inline]
37 fn encode(
38 self,
39 encoder_: &mut ___E,
40 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
41 _: (),
42 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
43 ::fidl_next::munge! {
44 let Self::Encoded {
45 request,
46
47 } = out_;
48 }
49
50 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
51
52 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(request.as_mut_ptr()) };
53
54 Ok(())
55 }
56 }
57
58 impl ::fidl_next::EncodableOption for CloneableCloneRequest {
59 type EncodedOption = ::fidl_next::WireBox<'static, crate::wire::CloneableCloneRequest>;
60 }
61
62 unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CloneableCloneRequest
63 where
64 ___E: ::fidl_next::Encoder + ?Sized,
65 CloneableCloneRequest: ::fidl_next::Encode<___E>,
66 {
67 #[inline]
68 fn encode_option(
69 this: ::core::option::Option<Self>,
70 encoder: &mut ___E,
71 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
72 _: (),
73 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
74 if let Some(inner) = this {
75 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
76 ::fidl_next::WireBox::encode_present(out);
77 } else {
78 ::fidl_next::WireBox::encode_absent(out);
79 }
80
81 Ok(())
82 }
83 }
84
85 impl ::fidl_next::FromWire<crate::wire::CloneableCloneRequest> for CloneableCloneRequest {
86 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
87 crate::wire::CloneableCloneRequest,
88 Self,
89 > = unsafe {
90 ::fidl_next::CopyOptimization::enable_if(
91 true
92
93 && <
94 ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::WireChannel>>
95 >::COPY_OPTIMIZATION.is_enabled()
96
97 )
98 };
99
100 #[inline]
101 fn from_wire(wire: crate::wire::CloneableCloneRequest) -> Self {
102 Self { request: ::fidl_next::FromWire::from_wire(wire.request) }
103 }
104 }
105
106 #[derive(PartialEq, Clone, Debug)]
107 #[repr(C)]
108 pub struct CloseableCloseResponse {}
109
110 impl ::fidl_next::Encodable for CloseableCloseResponse {
111 type Encoded = crate::wire::CloseableCloseResponse;
112 }
113
114 unsafe impl<___E> ::fidl_next::Encode<___E> for CloseableCloseResponse
115 where
116 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
117 {
118 #[inline]
119 fn encode(
120 self,
121 encoder_: &mut ___E,
122 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
123 _: (),
124 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
125 *out_ = ::core::mem::MaybeUninit::zeroed();
126
127 Ok(())
128 }
129 }
130
131 unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CloseableCloseResponse
132 where
133 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
134 {
135 #[inline]
136 fn encode_ref(
137 &self,
138 encoder_: &mut ___E,
139 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
140 _: (),
141 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
142 ::fidl_next::munge! {
143 let Self::Encoded {
144
145 _empty,
146
147
148 } = out_;
149 }
150
151 Ok(())
152 }
153 }
154
155 impl ::fidl_next::EncodableOption for CloseableCloseResponse {
156 type EncodedOption = ::fidl_next::WireBox<'static, crate::wire::CloseableCloseResponse>;
157 }
158
159 unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CloseableCloseResponse
160 where
161 ___E: ::fidl_next::Encoder + ?Sized,
162 CloseableCloseResponse: ::fidl_next::Encode<___E>,
163 {
164 #[inline]
165 fn encode_option(
166 this: ::core::option::Option<Self>,
167 encoder: &mut ___E,
168 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
169 _: (),
170 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
171 if let Some(inner) = this {
172 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
173 ::fidl_next::WireBox::encode_present(out);
174 } else {
175 ::fidl_next::WireBox::encode_absent(out);
176 }
177
178 Ok(())
179 }
180 }
181
182 unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CloseableCloseResponse
183 where
184 ___E: ::fidl_next::Encoder + ?Sized,
185 CloseableCloseResponse: ::fidl_next::EncodeRef<___E>,
186 {
187 #[inline]
188 fn encode_option_ref(
189 this: ::core::option::Option<&Self>,
190 encoder: &mut ___E,
191 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
192 _: (),
193 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
194 if let Some(inner) = this {
195 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
196 ::fidl_next::WireBox::encode_present(out);
197 } else {
198 ::fidl_next::WireBox::encode_absent(out);
199 }
200
201 Ok(())
202 }
203 }
204
205 impl ::fidl_next::FromWire<crate::wire::CloseableCloseResponse> for CloseableCloseResponse {
206 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
207 crate::wire::CloseableCloseResponse,
208 Self,
209 > = unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
210
211 #[inline]
212 fn from_wire(wire: crate::wire::CloseableCloseResponse) -> Self {
213 Self {}
214 }
215 }
216
217 impl ::fidl_next::FromWireRef<crate::wire::CloseableCloseResponse> for CloseableCloseResponse {
218 #[inline]
219 fn from_wire_ref(wire: &crate::wire::CloseableCloseResponse) -> Self {
220 Self {}
221 }
222 }
223
224 #[derive(PartialEq, Clone, Debug)]
225 pub struct QueryableQueryResponse {
226 pub protocol: ::std::vec::Vec<u8>,
227 }
228
229 impl ::fidl_next::Encodable for QueryableQueryResponse {
230 type Encoded = crate::wire::QueryableQueryResponse<'static>;
231 }
232
233 unsafe impl<___E> ::fidl_next::Encode<___E> for QueryableQueryResponse
234 where
235 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
236 ___E: ::fidl_next::Encoder,
237 {
238 #[inline]
239 fn encode(
240 self,
241 encoder_: &mut ___E,
242 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
243 _: (),
244 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
245 ::fidl_next::munge! {
246 let Self::Encoded {
247 protocol,
248
249 } = out_;
250 }
251
252 ::fidl_next::Encode::encode(self.protocol, encoder_, protocol, (4294967295, ()))?;
253
254 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(protocol.as_mut_ptr()) };
255 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
256
257 Ok(())
258 }
259 }
260
261 unsafe impl<___E> ::fidl_next::EncodeRef<___E> for QueryableQueryResponse
262 where
263 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
264 ___E: ::fidl_next::Encoder,
265 {
266 #[inline]
267 fn encode_ref(
268 &self,
269 encoder_: &mut ___E,
270 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
271 _: (),
272 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
273 ::fidl_next::munge! {
274 let Self::Encoded {
275
276 protocol,
277
278 } = out_;
279 }
280
281 ::fidl_next::EncodeRef::encode_ref(
282 &self.protocol,
283 encoder_,
284 protocol,
285 (4294967295, ()),
286 )?;
287
288 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(protocol.as_mut_ptr()) };
289 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
290
291 Ok(())
292 }
293 }
294
295 impl ::fidl_next::EncodableOption for QueryableQueryResponse {
296 type EncodedOption =
297 ::fidl_next::WireBox<'static, crate::wire::QueryableQueryResponse<'static>>;
298 }
299
300 unsafe impl<___E> ::fidl_next::EncodeOption<___E> for QueryableQueryResponse
301 where
302 ___E: ::fidl_next::Encoder + ?Sized,
303 QueryableQueryResponse: ::fidl_next::Encode<___E>,
304 {
305 #[inline]
306 fn encode_option(
307 this: ::core::option::Option<Self>,
308 encoder: &mut ___E,
309 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
310 _: (),
311 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
312 if let Some(inner) = this {
313 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
314 ::fidl_next::WireBox::encode_present(out);
315 } else {
316 ::fidl_next::WireBox::encode_absent(out);
317 }
318
319 Ok(())
320 }
321 }
322
323 unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for QueryableQueryResponse
324 where
325 ___E: ::fidl_next::Encoder + ?Sized,
326 QueryableQueryResponse: ::fidl_next::EncodeRef<___E>,
327 {
328 #[inline]
329 fn encode_option_ref(
330 this: ::core::option::Option<&Self>,
331 encoder: &mut ___E,
332 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
333 _: (),
334 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
335 if let Some(inner) = this {
336 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
337 ::fidl_next::WireBox::encode_present(out);
338 } else {
339 ::fidl_next::WireBox::encode_absent(out);
340 }
341
342 Ok(())
343 }
344 }
345
346 impl<'de> ::fidl_next::FromWire<crate::wire::QueryableQueryResponse<'de>>
347 for QueryableQueryResponse
348 {
349 #[inline]
350 fn from_wire(wire: crate::wire::QueryableQueryResponse<'de>) -> Self {
351 Self { protocol: ::fidl_next::FromWire::from_wire(wire.protocol) }
352 }
353 }
354
355 impl<'de> ::fidl_next::FromWireRef<crate::wire::QueryableQueryResponse<'de>>
356 for QueryableQueryResponse
357 {
358 #[inline]
359 fn from_wire_ref(wire: &crate::wire::QueryableQueryResponse<'de>) -> Self {
360 Self { protocol: ::fidl_next::FromWireRef::from_wire_ref(&wire.protocol) }
361 }
362 }
363}
364
365pub mod wire {
366
367 #[derive(Debug)]
369 #[repr(C)]
370 pub struct CloneableCloneRequest {
371 pub request: ::fidl_next::ServerEnd<crate::Cloneable, ::fidl_next::fuchsia::WireChannel>,
372 }
373
374 static_assertions::const_assert_eq!(std::mem::size_of::<CloneableCloneRequest>(), 4);
375 static_assertions::const_assert_eq!(std::mem::align_of::<CloneableCloneRequest>(), 4);
376
377 static_assertions::const_assert_eq!(std::mem::offset_of!(CloneableCloneRequest, request), 0);
378
379 unsafe impl ::fidl_next::Wire for CloneableCloneRequest {
380 type Decoded<'de> = CloneableCloneRequest;
381
382 #[inline]
383 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
384 ::fidl_next::munge! {
385 let Self {
386
387 request,
388
389 } = &mut *out_;
390 }
391
392 ::fidl_next::Wire::zero_padding(request);
393 }
394 }
395
396 unsafe impl<___D> ::fidl_next::Decode<___D> for CloneableCloneRequest
397 where
398 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
399 ___D: ::fidl_next::fuchsia::HandleDecoder,
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 request,
410
411 } = slot_;
412 }
413
414 let _field = request.as_mut();
415
416 ::fidl_next::Decode::decode(request.as_mut(), decoder_, ())?;
417
418 Ok(())
419 }
420 }
421
422 impl ::fidl_next::IntoNatural for CloneableCloneRequest {
423 type Natural = crate::natural::CloneableCloneRequest;
424 }
425
426 impl ::fidl_next::Unconstrained for CloneableCloneRequest {}
427
428 #[derive(Clone, Debug)]
430 #[repr(C)]
431 pub struct CloseableCloseResponse {
432 pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder,
433 }
434
435 static_assertions::const_assert_eq!(std::mem::size_of::<CloseableCloseResponse>(), 1);
436 static_assertions::const_assert_eq!(std::mem::align_of::<CloseableCloseResponse>(), 1);
437
438 unsafe impl ::fidl_next::Wire for CloseableCloseResponse {
439 type Decoded<'de> = CloseableCloseResponse;
440
441 #[inline]
442 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
443 ::fidl_next::munge! {
444 let Self {
445
446 _empty,
447
448
449 } = &mut *out_;
450 }
451 }
452 }
453
454 unsafe impl<___D> ::fidl_next::Decode<___D> for CloseableCloseResponse
455 where
456 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
457 {
458 fn decode(
459 slot_: ::fidl_next::Slot<'_, Self>,
460 decoder_: &mut ___D,
461 _: (),
462 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
463 ::fidl_next::munge! {
464 let Self {
465
466 mut _empty,
467
468
469 } = slot_;
470 }
471
472 if _empty.as_bytes() != &[0u8] {
473 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
474 }
475
476 Ok(())
477 }
478 }
479
480 impl ::fidl_next::IntoNatural for CloseableCloseResponse {
481 type Natural = crate::natural::CloseableCloseResponse;
482 }
483
484 impl ::fidl_next::Unconstrained for CloseableCloseResponse {}
485
486 #[derive(Debug)]
488 #[repr(C)]
489 pub struct QueryableQueryResponse<'de> {
490 pub protocol: ::fidl_next::WireVector<'de, u8>,
491 }
492
493 static_assertions::const_assert_eq!(std::mem::size_of::<QueryableQueryResponse<'_>>(), 16);
494 static_assertions::const_assert_eq!(std::mem::align_of::<QueryableQueryResponse<'_>>(), 8);
495
496 static_assertions::const_assert_eq!(
497 std::mem::offset_of!(QueryableQueryResponse<'_>, protocol),
498 0
499 );
500
501 unsafe impl ::fidl_next::Wire for QueryableQueryResponse<'static> {
502 type Decoded<'de> = QueryableQueryResponse<'de>;
503
504 #[inline]
505 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
506 ::fidl_next::munge! {
507 let Self {
508
509 protocol,
510
511 } = &mut *out_;
512 }
513
514 ::fidl_next::Wire::zero_padding(protocol);
515 }
516 }
517
518 unsafe impl<___D> ::fidl_next::Decode<___D> for QueryableQueryResponse<'static>
519 where
520 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
521 ___D: ::fidl_next::Decoder,
522 {
523 fn decode(
524 slot_: ::fidl_next::Slot<'_, Self>,
525 decoder_: &mut ___D,
526 _: (),
527 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
528 ::fidl_next::munge! {
529 let Self {
530
531 mut protocol,
532
533 } = slot_;
534 }
535
536 let _field = protocol.as_mut();
537 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
538 ::fidl_next::Decode::decode(protocol.as_mut(), decoder_, (4294967295, ()))?;
539
540 Ok(())
541 }
542 }
543
544 impl<'de> ::fidl_next::IntoNatural for QueryableQueryResponse<'de> {
545 type Natural = crate::natural::QueryableQueryResponse;
546 }
547
548 impl ::fidl_next::Unconstrained for QueryableQueryResponse<'static> {}
549}
550
551pub mod wire_optional {}
552
553pub use self::natural::*;
554
555#[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"]
557#[derive(PartialEq, Debug)]
558pub struct Cloneable;
559
560pub mod cloneable {
561 pub mod prelude {
562 pub use crate::{Cloneable, CloneableClientHandler, CloneableServerHandler, cloneable};
563
564 pub use crate::natural::CloneableCloneRequest;
565 }
566
567 pub struct Clone;
568
569 impl ::fidl_next::Method for Clone {
570 const ORDINAL: u64 = 2366825959783828089;
571
572 type Protocol = crate::Cloneable;
573
574 type Request = crate::wire::CloneableCloneRequest;
575
576 type Response = ::fidl_next::Never;
577 }
578
579 mod ___detail {
580
581 pub struct Clone<T0> {
582 request: T0,
583 }
584
585 impl<T0> ::fidl_next::Encodable for Clone<T0>
586 where
587 T0: ::fidl_next::Encodable<
588 Encoded = ::fidl_next::ServerEnd<
589 crate::Cloneable,
590 ::fidl_next::fuchsia::WireChannel,
591 >,
592 >,
593 {
594 type Encoded = crate::wire::CloneableCloneRequest;
595 }
596
597 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Clone<T0>
598 where
599 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
600 ___E: ::fidl_next::fuchsia::HandleEncoder,
601 T0: ::fidl_next::Encode<
602 ___E,
603 Encoded = ::fidl_next::ServerEnd<
604 crate::Cloneable,
605 ::fidl_next::fuchsia::WireChannel,
606 >,
607 >,
608 {
609 #[inline]
610 fn encode(
611 self,
612 encoder_: &mut ___E,
613 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
614 _: (),
615 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
616 ::fidl_next::munge! {
617 let Self::Encoded {
618 request,
619
620 } = out_;
621 }
622
623 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
624
625 Ok(())
626 }
627 }
628
629 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Cloneable
630 where
631 ___T: ::fidl_next::Transport,
632 {
633 type Client = CloneableClient<___T>;
634 type Server = CloneableServer<___T>;
635 }
636
637 #[repr(transparent)]
639 pub struct CloneableClient<___T: ::fidl_next::Transport> {
640 #[allow(dead_code)]
641 client: ::fidl_next::protocol::Client<___T>,
642 }
643
644 impl<___T> CloneableClient<___T>
645 where
646 ___T: ::fidl_next::Transport,
647 {
648 pub fn clone(
649 &self,
650
651 request: impl ::fidl_next::Encode<
652 <___T as ::fidl_next::Transport>::SendBuffer,
653 Encoded = ::fidl_next::ServerEnd<
654 crate::Cloneable,
655 ::fidl_next::fuchsia::WireChannel,
656 >,
657 >,
658 ) -> ::fidl_next::SendFuture<'_, ___T>
659 where
660 <___T as ::fidl_next::Transport>::SendBuffer:
661 ::fidl_next::encoder::InternalHandleEncoder,
662 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
663 {
664 self.clone_with(Clone { request })
665 }
666
667 pub fn clone_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
668 where
669 ___R: ::fidl_next::Encode<
670 <___T as ::fidl_next::Transport>::SendBuffer,
671 Encoded = crate::wire::CloneableCloneRequest,
672 >,
673 {
674 ::fidl_next::SendFuture::from_untyped(
675 self.client.send_one_way(2366825959783828089, request),
676 )
677 }
678 }
679
680 #[repr(transparent)]
682 pub struct CloneableServer<___T: ::fidl_next::Transport> {
683 server: ::fidl_next::protocol::Server<___T>,
684 }
685
686 impl<___T> CloneableServer<___T> where ___T: ::fidl_next::Transport {}
687 }
688}
689
690pub trait CloneableClientHandler<
694 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
695 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
696>
697{
698}
699
700impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Cloneable
701where
702 ___H: CloneableClientHandler<___T> + ::core::marker::Send,
703 ___T: ::fidl_next::Transport,
704{
705 async fn on_event(
706 handler: &mut ___H,
707 ordinal: u64,
708 buffer: ___T::RecvBuffer,
709 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
710 match ordinal {
711 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
712 }
713 }
714}
715
716pub trait CloneableServerHandler<
720 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
721 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
722>
723{
724 fn clone(
725 &mut self,
726
727 request: ::fidl_next::Request<cloneable::Clone, ___T>,
728 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
729}
730
731impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Cloneable
732where
733 ___H: CloneableServerHandler<___T> + ::core::marker::Send,
734 ___T: ::fidl_next::Transport,
735 <cloneable::Clone as ::fidl_next::Method>::Request:
736 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
737{
738 async fn on_one_way(
739 handler: &mut ___H,
740 ordinal: u64,
741 buffer: ___T::RecvBuffer,
742 ) -> ::core::result::Result<
743 (),
744 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
745 > {
746 match ordinal {
747 2366825959783828089 => match ::fidl_next::DecoderExt::decode(buffer) {
748 Ok(decoded) => {
749 handler.clone(decoded).await;
750 Ok(())
751 }
752 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
753 ordinal: 2366825959783828089,
754 error,
755 }),
756 },
757
758 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
759 }
760 }
761
762 async fn on_two_way(
763 handler: &mut ___H,
764 ordinal: u64,
765 buffer: ___T::RecvBuffer,
766 responder: ::fidl_next::protocol::Responder<___T>,
767 ) -> ::core::result::Result<
768 (),
769 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
770 > {
771 match ordinal {
772 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
773 }
774 }
775}
776
777#[doc = " Provides a means of synchronously closing a connection.\n"]
779#[derive(PartialEq, Debug)]
780pub struct Closeable;
781
782pub mod closeable {
783 pub mod prelude {
784 pub use crate::{Closeable, CloseableClientHandler, CloseableServerHandler, closeable};
785
786 pub use crate::natural::CloseableCloseResponse;
787 }
788
789 pub struct Close;
790
791 impl ::fidl_next::Method for Close {
792 const ORDINAL: u64 = 6540867515453498750;
793
794 type Protocol = crate::Closeable;
795
796 type Request = ();
797
798 type Response = ::fidl_next::WireResult<
799 'static,
800 crate::wire::CloseableCloseResponse,
801 ::fidl_next::WireI32,
802 >;
803 }
804
805 mod ___detail {
806
807 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Closeable
808 where
809 ___T: ::fidl_next::Transport,
810 {
811 type Client = CloseableClient<___T>;
812 type Server = CloseableServer<___T>;
813 }
814
815 #[repr(transparent)]
817 pub struct CloseableClient<___T: ::fidl_next::Transport> {
818 #[allow(dead_code)]
819 client: ::fidl_next::protocol::Client<___T>,
820 }
821
822 impl<___T> CloseableClient<___T>
823 where
824 ___T: ::fidl_next::Transport,
825 {
826 #[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"]
827 pub fn close(&self) -> ::fidl_next::TwoWayFuture<'_, super::Close, ___T> {
828 ::fidl_next::TwoWayFuture::from_untyped(
829 self.client.send_two_way(6540867515453498750, ()),
830 )
831 }
832 }
833
834 #[repr(transparent)]
836 pub struct CloseableServer<___T: ::fidl_next::Transport> {
837 server: ::fidl_next::protocol::Server<___T>,
838 }
839
840 impl<___T> CloseableServer<___T> where ___T: ::fidl_next::Transport {}
841 }
842}
843
844pub trait CloseableClientHandler<
848 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
849 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
850>
851{
852}
853
854impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Closeable
855where
856 ___H: CloseableClientHandler<___T> + ::core::marker::Send,
857 ___T: ::fidl_next::Transport,
858 <closeable::Close as ::fidl_next::Method>::Response:
859 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
860{
861 async fn on_event(
862 handler: &mut ___H,
863 ordinal: u64,
864 buffer: ___T::RecvBuffer,
865 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
866 match ordinal {
867 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
868 }
869 }
870}
871
872pub trait CloseableServerHandler<
876 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
877 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
878>
879{
880 #[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"]
881 fn close(
882 &mut self,
883
884 responder: ::fidl_next::Responder<closeable::Close, ___T>,
885 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
886}
887
888impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Closeable
889where
890 ___H: CloseableServerHandler<___T> + ::core::marker::Send,
891 ___T: ::fidl_next::Transport,
892{
893 async fn on_one_way(
894 handler: &mut ___H,
895 ordinal: u64,
896 buffer: ___T::RecvBuffer,
897 ) -> ::core::result::Result<
898 (),
899 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
900 > {
901 match ordinal {
902 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
903 }
904 }
905
906 async fn on_two_way(
907 handler: &mut ___H,
908 ordinal: u64,
909 buffer: ___T::RecvBuffer,
910 responder: ::fidl_next::protocol::Responder<___T>,
911 ) -> ::core::result::Result<
912 (),
913 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
914 > {
915 match ordinal {
916 6540867515453498750 => {
917 let responder = ::fidl_next::Responder::from_untyped(responder);
918
919 handler.close(responder).await;
920 Ok(())
921 }
922
923 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
924 }
925 }
926}
927
928#[doc = " Provides a means of identifying a type-erased protocol.\n"]
930#[derive(PartialEq, Debug)]
931pub struct Queryable;
932
933pub mod queryable {
934 pub mod prelude {
935 pub use crate::{Queryable, QueryableClientHandler, QueryableServerHandler, queryable};
936
937 pub use crate::natural::QueryableQueryResponse;
938 }
939
940 pub struct Query;
941
942 impl ::fidl_next::Method for Query {
943 const ORDINAL: u64 = 2763219980499352582;
944
945 type Protocol = crate::Queryable;
946
947 type Request = ();
948
949 type Response = crate::wire::QueryableQueryResponse<'static>;
950 }
951
952 mod ___detail {
953
954 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Queryable
955 where
956 ___T: ::fidl_next::Transport,
957 {
958 type Client = QueryableClient<___T>;
959 type Server = QueryableServer<___T>;
960 }
961
962 #[repr(transparent)]
964 pub struct QueryableClient<___T: ::fidl_next::Transport> {
965 #[allow(dead_code)]
966 client: ::fidl_next::protocol::Client<___T>,
967 }
968
969 impl<___T> QueryableClient<___T>
970 where
971 ___T: ::fidl_next::Transport,
972 {
973 pub fn query(&self) -> ::fidl_next::TwoWayFuture<'_, super::Query, ___T> {
974 ::fidl_next::TwoWayFuture::from_untyped(
975 self.client.send_two_way(2763219980499352582, ()),
976 )
977 }
978 }
979
980 #[repr(transparent)]
982 pub struct QueryableServer<___T: ::fidl_next::Transport> {
983 server: ::fidl_next::protocol::Server<___T>,
984 }
985
986 impl<___T> QueryableServer<___T> where ___T: ::fidl_next::Transport {}
987 }
988}
989
990pub trait QueryableClientHandler<
994 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
995 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
996>
997{
998}
999
1000impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Queryable
1001where
1002 ___H: QueryableClientHandler<___T> + ::core::marker::Send,
1003 ___T: ::fidl_next::Transport,
1004 <queryable::Query as ::fidl_next::Method>::Response:
1005 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1006{
1007 async fn on_event(
1008 handler: &mut ___H,
1009 ordinal: u64,
1010 buffer: ___T::RecvBuffer,
1011 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1012 match ordinal {
1013 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1014 }
1015 }
1016}
1017
1018pub trait QueryableServerHandler<
1022 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1023 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1024>
1025{
1026 fn query(
1027 &mut self,
1028
1029 responder: ::fidl_next::Responder<queryable::Query, ___T>,
1030 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1031}
1032
1033impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Queryable
1034where
1035 ___H: QueryableServerHandler<___T> + ::core::marker::Send,
1036 ___T: ::fidl_next::Transport,
1037{
1038 async fn on_one_way(
1039 handler: &mut ___H,
1040 ordinal: u64,
1041 buffer: ___T::RecvBuffer,
1042 ) -> ::core::result::Result<
1043 (),
1044 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1045 > {
1046 match ordinal {
1047 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1048 }
1049 }
1050
1051 async fn on_two_way(
1052 handler: &mut ___H,
1053 ordinal: u64,
1054 buffer: ___T::RecvBuffer,
1055 responder: ::fidl_next::protocol::Responder<___T>,
1056 ) -> ::core::result::Result<
1057 (),
1058 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1059 > {
1060 match ordinal {
1061 2763219980499352582 => {
1062 let responder = ::fidl_next::Responder::from_untyped(responder);
1063
1064 handler.query(responder).await;
1065 Ok(())
1066 }
1067
1068 ordinal => Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)),
1069 }
1070 }
1071}
1072
1073pub mod compat {
1075
1076 impl ::fidl_next::CompatFrom<crate::CloneableCloneRequest>
1077 for ::fidl_fuchsia_unknown::CloneableCloneRequest
1078 {
1079 #[inline]
1080 fn compat_from(value: crate::CloneableCloneRequest) -> Self {
1081 Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
1082 }
1083 }
1084
1085 impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::CloneableCloneRequest>
1086 for crate::CloneableCloneRequest
1087 {
1088 #[inline]
1089 fn compat_from(value: ::fidl_fuchsia_unknown::CloneableCloneRequest) -> Self {
1090 Self { request: ::fidl_next::CompatFrom::compat_from(value.request) }
1091 }
1092 }
1093
1094 #[cfg(target_os = "fuchsia")]
1095 pub type CloneableProxy = ::fidl_next::Client<crate::Cloneable>;
1098
1099 impl ::fidl_next::CompatFrom<crate::Cloneable> for ::fidl_fuchsia_unknown::CloneableMarker {
1100 fn compat_from(_: crate::Cloneable) -> Self {
1101 Self
1102 }
1103 }
1104
1105 impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::CloneableMarker> for crate::Cloneable {
1106 fn compat_from(_: ::fidl_fuchsia_unknown::CloneableMarker) -> Self {
1107 Self
1108 }
1109 }
1110
1111 #[cfg(target_os = "fuchsia")]
1112
1113 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_unknown::CloneableProxy> for crate::Cloneable {
1114 fn client_compat_from(
1115 proxy: ::fidl_fuchsia_unknown::CloneableProxy,
1116 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
1117 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
1118 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
1119 ::fidl_next::ClientDispatcher::new(client_end)
1120 }
1121 }
1122
1123 #[cfg(target_os = "fuchsia")]
1124 pub type CloseableProxy = ::fidl_next::Client<crate::Closeable>;
1127
1128 impl ::fidl_next::CompatFrom<crate::Closeable> for ::fidl_fuchsia_unknown::CloseableMarker {
1129 fn compat_from(_: crate::Closeable) -> Self {
1130 Self
1131 }
1132 }
1133
1134 impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::CloseableMarker> for crate::Closeable {
1135 fn compat_from(_: ::fidl_fuchsia_unknown::CloseableMarker) -> Self {
1136 Self
1137 }
1138 }
1139
1140 #[cfg(target_os = "fuchsia")]
1141
1142 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_unknown::CloseableProxy> for crate::Closeable {
1143 fn client_compat_from(
1144 proxy: ::fidl_fuchsia_unknown::CloseableProxy,
1145 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
1146 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
1147 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
1148 ::fidl_next::ClientDispatcher::new(client_end)
1149 }
1150 }
1151
1152 impl ::fidl_next::CompatFrom<crate::QueryableQueryResponse>
1153 for ::fidl_fuchsia_unknown::QueryableQueryResponse
1154 {
1155 #[inline]
1156 fn compat_from(value: crate::QueryableQueryResponse) -> Self {
1157 Self { protocol: ::fidl_next::CompatFrom::compat_from(value.protocol) }
1158 }
1159 }
1160
1161 impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::QueryableQueryResponse>
1162 for crate::QueryableQueryResponse
1163 {
1164 #[inline]
1165 fn compat_from(value: ::fidl_fuchsia_unknown::QueryableQueryResponse) -> Self {
1166 Self { protocol: ::fidl_next::CompatFrom::compat_from(value.protocol) }
1167 }
1168 }
1169
1170 #[cfg(target_os = "fuchsia")]
1171 pub type QueryableProxy = ::fidl_next::Client<crate::Queryable>;
1174
1175 impl ::fidl_next::CompatFrom<crate::Queryable> for ::fidl_fuchsia_unknown::QueryableMarker {
1176 fn compat_from(_: crate::Queryable) -> Self {
1177 Self
1178 }
1179 }
1180
1181 impl ::fidl_next::CompatFrom<::fidl_fuchsia_unknown::QueryableMarker> for crate::Queryable {
1182 fn compat_from(_: ::fidl_fuchsia_unknown::QueryableMarker) -> Self {
1183 Self
1184 }
1185 }
1186
1187 #[cfg(target_os = "fuchsia")]
1188
1189 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_unknown::QueryableProxy> for crate::Queryable {
1190 fn client_compat_from(
1191 proxy: ::fidl_fuchsia_unknown::QueryableProxy,
1192 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
1193 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
1194 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
1195 ::fidl_next::ClientDispatcher::new(client_end)
1196 }
1197 }
1198}