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