1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(Debug)]
6#[repr(C)]
7pub struct CloneableCloneRequest {
8 pub request: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Cloneable>,
9}
10
11impl ::fidl_next::Encodable for CloneableCloneRequest {
12 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
13 ::fidl_next::CopyOptimization::enable_if(
14 true
15
16 && <
17 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Cloneable,
18 > as ::fidl_next::Encodable
19 >::COPY_OPTIMIZATION.is_enabled()
20
21 )
22 };
23
24 type Encoded = WireCloneableCloneRequest;
25}
26
27unsafe impl<___E> ::fidl_next::Encode<___E> for CloneableCloneRequest
28where
29 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
30
31 ___E: ::fidl_next::fuchsia::HandleEncoder,
32{
33 #[inline]
34 fn encode(
35 &mut self,
36 encoder: &mut ___E,
37 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
38 ) -> Result<(), ::fidl_next::EncodeError> {
39 ::fidl_next::munge! {
40 let Self::Encoded {
41 request,
42
43 } = out;
44 }
45
46 ::fidl_next::Encode::encode(&mut self.request, encoder, request)?;
47
48 Ok(())
49 }
50}
51
52impl ::fidl_next::EncodableOption for Box<CloneableCloneRequest> {
53 type EncodedOption = ::fidl_next::WireBox<WireCloneableCloneRequest>;
54}
55
56unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<CloneableCloneRequest>
57where
58 ___E: ::fidl_next::Encoder + ?Sized,
59 CloneableCloneRequest: ::fidl_next::Encode<___E>,
60{
61 #[inline]
62 fn encode_option(
63 this: Option<&mut Self>,
64 encoder: &mut ___E,
65 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
66 ) -> Result<(), ::fidl_next::EncodeError> {
67 if let Some(inner) = this {
68 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
69 ::fidl_next::WireBox::encode_present(out);
70 } else {
71 ::fidl_next::WireBox::encode_absent(out);
72 }
73
74 Ok(())
75 }
76}
77
78impl ::fidl_next::TakeFrom<WireCloneableCloneRequest> for CloneableCloneRequest {
79 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
80 ::fidl_next::CopyOptimization::enable_if(
81 true
82
83 && <
84 ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel,crate::Cloneable,
85 > as ::fidl_next::Encodable
86 >::COPY_OPTIMIZATION.is_enabled()
87
88 )
89 };
90
91 #[inline]
92 fn take_from(from: &WireCloneableCloneRequest) -> Self {
93 Self { request: ::fidl_next::TakeFrom::take_from(&from.request) }
94 }
95}
96
97#[derive(Debug)]
99#[repr(C)]
100pub struct WireCloneableCloneRequest {
101 pub request: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Cloneable>,
102}
103
104unsafe impl ::fidl_next::ZeroPadding for WireCloneableCloneRequest {
105 #[inline]
106 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
107}
108
109unsafe impl<___D> ::fidl_next::Decode<___D> for WireCloneableCloneRequest
110where
111 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
112
113 ___D: ::fidl_next::fuchsia::HandleDecoder,
114{
115 fn decode(
116 slot: ::fidl_next::Slot<'_, Self>,
117 decoder: &mut ___D,
118 ) -> Result<(), ::fidl_next::DecodeError> {
119 ::fidl_next::munge! {
120 let Self {
121 mut request,
122
123 } = slot;
124 }
125
126 ::fidl_next::Decode::decode(request.as_mut(), decoder)?;
127
128 Ok(())
129 }
130}
131
132#[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"]
134#[derive(Debug)]
135pub struct Cloneable;
136
137pub mod cloneable {
138 pub mod prelude {
139 pub use crate::{
140 cloneable, Cloneable, CloneableClientHandler, CloneableClientSender,
141 CloneableServerHandler, CloneableServerSender,
142 };
143
144 pub use crate::CloneableCloneRequest;
145 }
146
147 pub struct Clone;
148
149 impl ::fidl_next::Method for Clone {
150 const ORDINAL: u64 = 2366825959783828089;
151
152 type Protocol = crate::Cloneable;
153
154 type Request = crate::WireCloneableCloneRequest;
155
156 type Response = ::fidl_next::Never;
157 }
158}
159
160pub trait CloneableClientSender {
162 type Transport: ::fidl_next::Transport;
163
164 fn clone<___R>(
165 &self,
166 request: &mut ___R,
167 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
168 where
169 ___R: ::fidl_next::Encode<
170 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
171 Encoded = crate::WireCloneableCloneRequest,
172 >;
173}
174
175impl<___T> CloneableClientSender for ::fidl_next::ClientSender<___T, Cloneable>
176where
177 ___T: ::fidl_next::Transport,
178{
179 type Transport = ___T;
180
181 fn clone<___R>(
182 &self,
183 request: &mut ___R,
184 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
185 where
186 ___R: ::fidl_next::Encode<
187 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
188 Encoded = crate::WireCloneableCloneRequest,
189 >,
190 {
191 self.as_untyped().send_one_way(2366825959783828089, request)
192 }
193}
194
195pub trait CloneableClientHandler<___T: ::fidl_next::Transport> {}
199
200impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Cloneable
201where
202 ___T: ::fidl_next::Transport,
203 ___H: CloneableClientHandler<___T>,
204{
205 fn on_event(
206 handler: &mut ___H,
207 sender: &::fidl_next::ClientSender<___T, Self>,
208 ordinal: u64,
209 buffer: ___T::RecvBuffer,
210 ) {
211 match ordinal {
212 ordinal => {
213 sender.close();
214 }
215 }
216 }
217}
218
219pub trait CloneableServerSender {
221 type Transport: ::fidl_next::Transport;
222}
223
224impl<___T> CloneableServerSender for ::fidl_next::ServerSender<___T, Cloneable>
225where
226 ___T: ::fidl_next::Transport,
227{
228 type Transport = ___T;
229}
230
231pub trait CloneableServerHandler<___T: ::fidl_next::Transport> {
235 fn clone(
236 &mut self,
237 sender: &::fidl_next::ServerSender<___T, Cloneable>,
238
239 request: ::fidl_next::RequestBuffer<___T, cloneable::Clone>,
240 );
241}
242
243impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Cloneable
244where
245 ___T: ::fidl_next::Transport,
246 ___H: CloneableServerHandler<___T>,
247
248 crate::WireCloneableCloneRequest:
249 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
250{
251 fn on_one_way(
252 handler: &mut ___H,
253 sender: &::fidl_next::ServerSender<___T, Self>,
254 ordinal: u64,
255 buffer: ___T::RecvBuffer,
256 ) {
257 match ordinal {
258 2366825959783828089 => {
259 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
260 handler.clone(sender, buffer);
261 }
262
263 ordinal => {
264 sender.close();
265 }
266 }
267 }
268
269 fn on_two_way(
270 handler: &mut ___H,
271 sender: &::fidl_next::ServerSender<___T, Self>,
272 ordinal: u64,
273 buffer: ___T::RecvBuffer,
274 responder: ::fidl_next::protocol::Responder,
275 ) {
276 match ordinal {
277 ordinal => {
278 sender.close();
279 }
280 }
281 }
282}
283
284pub type CloseableCloseResponse = ();
285
286pub type WireCloseableCloseResponse = ();
288
289#[doc = " Provides a means of synchronously closing a connection.\n"]
291#[derive(Debug)]
292pub struct Closeable;
293
294pub mod closeable {
295 pub mod prelude {
296 pub use crate::{
297 closeable, Closeable, CloseableClientHandler, CloseableClientSender,
298 CloseableServerHandler, CloseableServerSender,
299 };
300
301 pub use crate::CloseableCloseResponse;
302 }
303
304 pub struct Close;
305
306 impl ::fidl_next::Method for Close {
307 const ORDINAL: u64 = 6540867515453498750;
308
309 type Protocol = crate::Closeable;
310
311 type Request = ();
312
313 type Response =
314 ::fidl_next::WireResult<crate::WireCloseableCloseResponse, ::fidl_next::WireI32>;
315 }
316}
317
318pub trait CloseableClientSender {
320 type Transport: ::fidl_next::Transport;
321
322 #[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"]
323 fn close(
324 &self,
325 ) -> Result<
326 ::fidl_next::ResponseFuture<'_, Self::Transport, closeable::Close>,
327 ::fidl_next::EncodeError,
328 >;
329}
330
331impl<___T> CloseableClientSender for ::fidl_next::ClientSender<___T, Closeable>
332where
333 ___T: ::fidl_next::Transport,
334{
335 type Transport = ___T;
336
337 #[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"]
338 fn close(
339 &self,
340 ) -> Result<
341 ::fidl_next::ResponseFuture<'_, Self::Transport, closeable::Close>,
342 ::fidl_next::EncodeError,
343 > {
344 self.as_untyped()
345 .send_two_way(6540867515453498750, &mut ())
346 .map(::fidl_next::ResponseFuture::from_untyped)
347 }
348}
349
350pub trait CloseableClientHandler<___T: ::fidl_next::Transport> {}
354
355impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Closeable
356where
357 ___T: ::fidl_next::Transport,
358 ___H: CloseableClientHandler<___T>,
359
360 <closeable::Close as ::fidl_next::Method>::Response:
361 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
362{
363 fn on_event(
364 handler: &mut ___H,
365 sender: &::fidl_next::ClientSender<___T, Self>,
366 ordinal: u64,
367 buffer: ___T::RecvBuffer,
368 ) {
369 match ordinal {
370 ordinal => {
371 sender.close();
372 }
373 }
374 }
375}
376
377pub trait CloseableServerSender {
379 type Transport: ::fidl_next::Transport;
380}
381
382impl<___T> CloseableServerSender for ::fidl_next::ServerSender<___T, Closeable>
383where
384 ___T: ::fidl_next::Transport,
385{
386 type Transport = ___T;
387}
388
389pub trait CloseableServerHandler<___T: ::fidl_next::Transport> {
393 #[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"]
394 fn close(
395 &mut self,
396 sender: &::fidl_next::ServerSender<___T, Closeable>,
397
398 responder: ::fidl_next::Responder<closeable::Close>,
399 );
400}
401
402impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Closeable
403where
404 ___T: ::fidl_next::Transport,
405 ___H: CloseableServerHandler<___T>,
406{
407 fn on_one_way(
408 handler: &mut ___H,
409 sender: &::fidl_next::ServerSender<___T, Self>,
410 ordinal: u64,
411 buffer: ___T::RecvBuffer,
412 ) {
413 match ordinal {
414 ordinal => {
415 sender.close();
416 }
417 }
418 }
419
420 fn on_two_way(
421 handler: &mut ___H,
422 sender: &::fidl_next::ServerSender<___T, Self>,
423 ordinal: u64,
424 buffer: ___T::RecvBuffer,
425 responder: ::fidl_next::protocol::Responder,
426 ) {
427 match ordinal {
428 6540867515453498750 => {
429 let responder = ::fidl_next::Responder::from_untyped(responder);
430
431 handler.close(sender, responder);
432 }
433
434 ordinal => {
435 sender.close();
436 }
437 }
438 }
439}
440
441#[derive(Clone, Debug)]
442pub struct QueryableQueryResponse {
443 pub protocol: Vec<u8>,
444}
445
446impl ::fidl_next::Encodable for QueryableQueryResponse {
447 type Encoded = WireQueryableQueryResponse;
448}
449
450unsafe impl<___E> ::fidl_next::Encode<___E> for QueryableQueryResponse
451where
452 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
453
454 ___E: ::fidl_next::Encoder,
455{
456 #[inline]
457 fn encode(
458 &mut self,
459 encoder: &mut ___E,
460 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
461 ) -> Result<(), ::fidl_next::EncodeError> {
462 ::fidl_next::munge! {
463 let Self::Encoded {
464 protocol,
465
466 } = out;
467 }
468
469 ::fidl_next::Encode::encode(&mut self.protocol, encoder, protocol)?;
470
471 Ok(())
472 }
473}
474
475impl ::fidl_next::EncodableOption for Box<QueryableQueryResponse> {
476 type EncodedOption = ::fidl_next::WireBox<WireQueryableQueryResponse>;
477}
478
479unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<QueryableQueryResponse>
480where
481 ___E: ::fidl_next::Encoder + ?Sized,
482 QueryableQueryResponse: ::fidl_next::Encode<___E>,
483{
484 #[inline]
485 fn encode_option(
486 this: Option<&mut Self>,
487 encoder: &mut ___E,
488 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
489 ) -> Result<(), ::fidl_next::EncodeError> {
490 if let Some(inner) = this {
491 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
492 ::fidl_next::WireBox::encode_present(out);
493 } else {
494 ::fidl_next::WireBox::encode_absent(out);
495 }
496
497 Ok(())
498 }
499}
500
501impl ::fidl_next::TakeFrom<WireQueryableQueryResponse> for QueryableQueryResponse {
502 #[inline]
503 fn take_from(from: &WireQueryableQueryResponse) -> Self {
504 Self { protocol: ::fidl_next::TakeFrom::take_from(&from.protocol) }
505 }
506}
507
508#[derive(Debug)]
510#[repr(C)]
511pub struct WireQueryableQueryResponse {
512 pub protocol: ::fidl_next::WireVector<u8>,
513}
514
515unsafe impl ::fidl_next::ZeroPadding for WireQueryableQueryResponse {
516 #[inline]
517 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
518}
519
520unsafe impl<___D> ::fidl_next::Decode<___D> for WireQueryableQueryResponse
521where
522 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
523
524 ___D: ::fidl_next::Decoder,
525{
526 fn decode(
527 slot: ::fidl_next::Slot<'_, Self>,
528 decoder: &mut ___D,
529 ) -> Result<(), ::fidl_next::DecodeError> {
530 ::fidl_next::munge! {
531 let Self {
532 mut protocol,
533
534 } = slot;
535 }
536
537 ::fidl_next::Decode::decode(protocol.as_mut(), decoder)?;
538
539 Ok(())
540 }
541}
542
543#[doc = " Provides a means of identifying a type-erased protocol.\n"]
545#[derive(Debug)]
546pub struct Queryable;
547
548pub mod queryable {
549 pub mod prelude {
550 pub use crate::{
551 queryable, Queryable, QueryableClientHandler, QueryableClientSender,
552 QueryableServerHandler, QueryableServerSender,
553 };
554
555 pub use crate::QueryableQueryResponse;
556 }
557
558 pub struct Query;
559
560 impl ::fidl_next::Method for Query {
561 const ORDINAL: u64 = 2763219980499352582;
562
563 type Protocol = crate::Queryable;
564
565 type Request = ();
566
567 type Response = crate::WireQueryableQueryResponse;
568 }
569}
570
571pub trait QueryableClientSender {
573 type Transport: ::fidl_next::Transport;
574
575 fn query(
576 &self,
577 ) -> Result<
578 ::fidl_next::ResponseFuture<'_, Self::Transport, queryable::Query>,
579 ::fidl_next::EncodeError,
580 >;
581}
582
583impl<___T> QueryableClientSender for ::fidl_next::ClientSender<___T, Queryable>
584where
585 ___T: ::fidl_next::Transport,
586{
587 type Transport = ___T;
588
589 fn query(
590 &self,
591 ) -> Result<
592 ::fidl_next::ResponseFuture<'_, Self::Transport, queryable::Query>,
593 ::fidl_next::EncodeError,
594 > {
595 self.as_untyped()
596 .send_two_way(2763219980499352582, &mut ())
597 .map(::fidl_next::ResponseFuture::from_untyped)
598 }
599}
600
601pub trait QueryableClientHandler<___T: ::fidl_next::Transport> {}
605
606impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Queryable
607where
608 ___T: ::fidl_next::Transport,
609 ___H: QueryableClientHandler<___T>,
610
611 <queryable::Query as ::fidl_next::Method>::Response:
612 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
613{
614 fn on_event(
615 handler: &mut ___H,
616 sender: &::fidl_next::ClientSender<___T, Self>,
617 ordinal: u64,
618 buffer: ___T::RecvBuffer,
619 ) {
620 match ordinal {
621 ordinal => {
622 sender.close();
623 }
624 }
625 }
626}
627
628pub trait QueryableServerSender {
630 type Transport: ::fidl_next::Transport;
631}
632
633impl<___T> QueryableServerSender for ::fidl_next::ServerSender<___T, Queryable>
634where
635 ___T: ::fidl_next::Transport,
636{
637 type Transport = ___T;
638}
639
640pub trait QueryableServerHandler<___T: ::fidl_next::Transport> {
644 fn query(
645 &mut self,
646 sender: &::fidl_next::ServerSender<___T, Queryable>,
647
648 responder: ::fidl_next::Responder<queryable::Query>,
649 );
650}
651
652impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Queryable
653where
654 ___T: ::fidl_next::Transport,
655 ___H: QueryableServerHandler<___T>,
656{
657 fn on_one_way(
658 handler: &mut ___H,
659 sender: &::fidl_next::ServerSender<___T, Self>,
660 ordinal: u64,
661 buffer: ___T::RecvBuffer,
662 ) {
663 match ordinal {
664 ordinal => {
665 sender.close();
666 }
667 }
668 }
669
670 fn on_two_way(
671 handler: &mut ___H,
672 sender: &::fidl_next::ServerSender<___T, Self>,
673 ordinal: u64,
674 buffer: ___T::RecvBuffer,
675 responder: ::fidl_next::protocol::Responder,
676 ) {
677 match ordinal {
678 2763219980499352582 => {
679 let responder = ::fidl_next::Responder::from_untyped(responder);
680
681 handler.query(sender, responder);
682 }
683
684 ordinal => {
685 sender.close();
686 }
687 }
688 }
689}
690
691pub mod compat {
693
694 impl ::fidl_next::TakeFrom<crate::WireCloneableCloneRequest>
695 for ::fidl_fuchsia_unknown::CloneableCloneRequest
696 {
697 #[inline]
698 fn take_from(from: &crate::WireCloneableCloneRequest) -> Self {
699 Self { request: ::fidl_next::TakeFrom::take_from(&from.request) }
700 }
701 }
702
703 #[cfg(target_os = "fuchsia")]
704 pub type CloneableProxy =
707 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Cloneable>;
708
709 impl ::fidl_next::TakeFrom<crate::Cloneable> for ::fidl_fuchsia_unknown::CloneableMarker {
710 #[inline]
711 fn take_from(from: &crate::Cloneable) -> Self {
712 Self
713 }
714 }
715
716 #[cfg(target_os = "fuchsia")]
717 pub type CloseableProxy =
720 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Closeable>;
721
722 impl ::fidl_next::TakeFrom<crate::Closeable> for ::fidl_fuchsia_unknown::CloseableMarker {
723 #[inline]
724 fn take_from(from: &crate::Closeable) -> Self {
725 Self
726 }
727 }
728
729 impl ::fidl_next::TakeFrom<crate::WireQueryableQueryResponse>
730 for ::fidl_fuchsia_unknown::QueryableQueryResponse
731 {
732 #[inline]
733 fn take_from(from: &crate::WireQueryableQueryResponse) -> Self {
734 Self { protocol: ::fidl_next::TakeFrom::take_from(&from.protocol) }
735 }
736 }
737
738 #[cfg(target_os = "fuchsia")]
739 pub type QueryableProxy =
742 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Queryable>;
743
744 impl ::fidl_next::TakeFrom<crate::Queryable> for ::fidl_fuchsia_unknown::QueryableMarker {
745 #[inline]
746 fn take_from(from: &crate::Queryable) -> Self {
747 Self
748 }
749 }
750}