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 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoResponse, ___E>
592 for &'a EchoLauncherGetEchoResponse<T0>
593 where
594 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
595 ___E: ::fdomain_client::fidl_next::HandleEncoder,
596 &'a T0: ::fidl_next::Encode<
597 ::fidl_next::ClientEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
598 ___E,
599 >,
600 {
601 #[inline]
602 fn encode(
603 self,
604 encoder_: &mut ___E,
605 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoResponse>,
606 _: (),
607 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
608 ::fidl_next::munge! {
609 let crate::wire::EchoLauncherGetEchoResponse {
610 response,
611
612 } = out_;
613 }
614
615 ::fidl_next::Encode::encode(&self.response, encoder_, response, ())?;
616
617 Ok(())
618 }
619 }
620
621 pub struct EchoLauncherGetEchoPipelinedRequest<T0, T1> {
623 pub echo_prefix: T0,
624
625 pub request: T1,
626 }
627
628 unsafe impl<___E, T0, T1>
629 ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>, ___E>
630 for EchoLauncherGetEchoPipelinedRequest<T0, T1>
631 where
632 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
633 ___E: ::fidl_next::Encoder,
634 ___E: ::fdomain_client::fidl_next::HandleEncoder,
635 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
636 T1: ::fidl_next::Encode<
637 ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
638 ___E,
639 >,
640 {
641 #[inline]
642 fn encode(
643 self,
644 encoder_: &mut ___E,
645 out_: &mut ::core::mem::MaybeUninit<
646 crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>,
647 >,
648 _: (),
649 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
650 ::fidl_next::munge! {
651 let crate::wire::EchoLauncherGetEchoPipelinedRequest {
652 echo_prefix,
653 request,
654
655 } = out_;
656 }
657
658 ::fidl_next::Encode::encode(self.echo_prefix, encoder_, echo_prefix, 32)?;
659
660 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
661
662 Ok(())
663 }
664 }
665
666 unsafe impl<'a, ___E, T0, T1>
667 ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>, ___E>
668 for &'a EchoLauncherGetEchoPipelinedRequest<T0, T1>
669 where
670 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
671 ___E: ::fidl_next::Encoder,
672 ___E: ::fdomain_client::fidl_next::HandleEncoder,
673 &'a T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
674 &'a T1: ::fidl_next::Encode<
675 ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
676 ___E,
677 >,
678 {
679 #[inline]
680 fn encode(
681 self,
682 encoder_: &mut ___E,
683 out_: &mut ::core::mem::MaybeUninit<
684 crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>,
685 >,
686 _: (),
687 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
688 ::fidl_next::munge! {
689 let crate::wire::EchoLauncherGetEchoPipelinedRequest {
690 echo_prefix,
691 request,
692
693 } = out_;
694 }
695
696 ::fidl_next::Encode::encode(&self.echo_prefix, encoder_, echo_prefix, 32)?;
697
698 ::fidl_next::Encode::encode(&self.request, encoder_, request, ())?;
699
700 Ok(())
701 }
702 }
703
704 pub struct EventStruct<T0> {
706 pub event: T0,
707 }
708
709 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EventStruct, ___E> for EventStruct<T0>
710 where
711 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
712 ___E: ::fdomain_client::fidl_next::HandleEncoder,
713 T0: ::fidl_next::Encode<::fdomain_client::fidl_next::wire::OptionalHandle, ___E>,
714 {
715 #[inline]
716 fn encode(
717 self,
718 encoder_: &mut ___E,
719 out_: &mut ::core::mem::MaybeUninit<crate::wire::EventStruct>,
720 _: (),
721 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
722 ::fidl_next::munge! {
723 let crate::wire::EventStruct {
724 event,
725
726 } = out_;
727 }
728
729 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
730
731 Ok(())
732 }
733 }
734
735 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::EventStruct, ___E>
736 for &'a EventStruct<T0>
737 where
738 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
739 ___E: ::fdomain_client::fidl_next::HandleEncoder,
740 &'a T0: ::fidl_next::Encode<::fdomain_client::fidl_next::wire::OptionalHandle, ___E>,
741 {
742 #[inline]
743 fn encode(
744 self,
745 encoder_: &mut ___E,
746 out_: &mut ::core::mem::MaybeUninit<crate::wire::EventStruct>,
747 _: (),
748 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
749 ::fidl_next::munge! {
750 let crate::wire::EventStruct {
751 event,
752
753 } = out_;
754 }
755
756 ::fidl_next::Encode::encode(&self.event, encoder_, event, ())?;
757
758 Ok(())
759 }
760 }
761}
762
763pub use self::natural::*;
764
765#[derive(PartialEq, Debug)]
767pub struct EchoLauncher;
768
769impl ::fidl_next::Discoverable for EchoLauncher {
770 const PROTOCOL_NAME: &'static str = "fuchsia.examples.EchoLauncher";
771}
772
773#[cfg(target_os = "fuchsia")]
774impl ::fidl_next::HasTransport for EchoLauncher {
775 type Transport = ::fdomain_client::Channel;
776}
777
778pub mod echo_launcher {
779 pub mod prelude {
780 pub use crate::{
781 EchoLauncher, EchoLauncherClientHandler, EchoLauncherLocalClientHandler,
782 EchoLauncherLocalServerHandler, EchoLauncherServerHandler, echo_launcher,
783 };
784
785 pub use crate::natural::EchoLauncherGetEchoPipelinedRequest;
786
787 pub use crate::natural::EchoLauncherGetEchoRequest;
788
789 pub use crate::natural::EchoLauncherGetEchoResponse;
790 }
791
792 pub struct GetEcho;
793
794 impl ::fidl_next::Method for GetEcho {
795 const ORDINAL: u64 = 1213319469445758440;
796 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
797 ::fidl_next::protocol::Flexibility::Strict;
798
799 type Protocol = crate::EchoLauncher;
800
801 type Request = crate::wire::EchoLauncherGetEchoRequest<'static>;
802 }
803
804 impl ::fidl_next::TwoWayMethod for GetEcho {
805 type Response = ::fidl_next::wire::Strict<crate::wire::EchoLauncherGetEchoResponse>;
806 }
807
808 impl<___R> ::fidl_next::Respond<___R> for GetEcho {
809 type Output = ::fidl_next::Strict<crate::generic::EchoLauncherGetEchoResponse<___R>>;
810
811 fn respond(response: ___R) -> Self::Output {
812 ::fidl_next::Strict(crate::generic::EchoLauncherGetEchoResponse { response: response })
813 }
814 }
815
816 pub struct GetEchoPipelined;
817
818 impl ::fidl_next::Method for GetEchoPipelined {
819 const ORDINAL: u64 = 2118769043708531827;
820 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
821 ::fidl_next::protocol::Flexibility::Strict;
822
823 type Protocol = crate::EchoLauncher;
824
825 type Request = crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>;
826 }
827
828 mod ___detail {
829 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::EchoLauncher
830 where
831 ___T: ::fidl_next::Transport,
832 {
833 type Client = EchoLauncherClient<___T>;
834 type Server = EchoLauncherServer<___T>;
835 }
836
837 #[repr(transparent)]
839 pub struct EchoLauncherClient<___T: ::fidl_next::Transport> {
840 #[allow(dead_code)]
841 client: ::fidl_next::protocol::Client<___T>,
842 }
843
844 impl<___T> EchoLauncherClient<___T>
845 where
846 ___T: ::fidl_next::Transport,
847 {
848 pub fn get_echo(
849 &self,
850
851 echo_prefix: impl ::fidl_next::Encode<
852 ::fidl_next::wire::String<'static>,
853 <___T as ::fidl_next::Transport>::SendBuffer,
854 >,
855 ) -> ::fidl_next::TwoWayFuture<'_, super::GetEcho, ___T>
856 where
857 <___T as ::fidl_next::Transport>::SendBuffer:
858 ::fidl_next::encoder::InternalHandleEncoder,
859 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
860 {
861 self.get_echo_with(crate::generic::EchoLauncherGetEchoRequest { echo_prefix })
862 }
863
864 pub fn get_echo_with<___R>(
865 &self,
866 request: ___R,
867 ) -> ::fidl_next::TwoWayFuture<'_, super::GetEcho, ___T>
868 where
869 ___R: ::fidl_next::Encode<
870 crate::wire::EchoLauncherGetEchoRequest<'static>,
871 <___T as ::fidl_next::Transport>::SendBuffer,
872 >,
873 {
874 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
875 1213319469445758440,
876 <super::GetEcho as ::fidl_next::Method>::FLEXIBILITY,
877 request,
878 ))
879 }
880
881 pub fn get_echo_pipelined(
882 &self,
883
884 echo_prefix: impl ::fidl_next::Encode<
885 ::fidl_next::wire::String<'static>,
886 <___T as ::fidl_next::Transport>::SendBuffer,
887 >,
888
889 request: impl ::fidl_next::Encode<
890 ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
891 <___T as ::fidl_next::Transport>::SendBuffer,
892 >,
893 ) -> ::fidl_next::SendFuture<'_, ___T>
894 where
895 <___T as ::fidl_next::Transport>::SendBuffer:
896 ::fidl_next::encoder::InternalHandleEncoder,
897 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
898 <___T as ::fidl_next::Transport>::SendBuffer:
899 ::fdomain_client::fidl_next::HandleEncoder,
900 {
901 self.get_echo_pipelined_with(crate::generic::EchoLauncherGetEchoPipelinedRequest {
902 echo_prefix,
903
904 request,
905 })
906 }
907
908 pub fn get_echo_pipelined_with<___R>(
909 &self,
910 request: ___R,
911 ) -> ::fidl_next::SendFuture<'_, ___T>
912 where
913 ___R: ::fidl_next::Encode<
914 crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>,
915 <___T as ::fidl_next::Transport>::SendBuffer,
916 >,
917 {
918 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
919 2118769043708531827,
920 <super::GetEchoPipelined as ::fidl_next::Method>::FLEXIBILITY,
921 request,
922 ))
923 }
924 }
925
926 #[repr(transparent)]
928 pub struct EchoLauncherServer<___T: ::fidl_next::Transport> {
929 server: ::fidl_next::protocol::Server<___T>,
930 }
931
932 impl<___T> EchoLauncherServer<___T> where ___T: ::fidl_next::Transport {}
933 }
934}
935
936#[diagnostic::on_unimplemented(
937 note = "If {Self} implements the non-local EchoLauncherClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
938)]
939
940pub trait EchoLauncherLocalClientHandler<
944 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fdomain_client::Channel,
945 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
946>
947{
948}
949
950impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for EchoLauncher
951where
952 ___H: EchoLauncherLocalClientHandler<___T>,
953 ___T: ::fidl_next::Transport,
954{
955 async fn on_event(
956 handler: &mut ___H,
957 mut message: ::fidl_next::Message<___T>,
958 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
959 match *message.header().ordinal {
960 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
961 }
962 }
963}
964
965#[diagnostic::on_unimplemented(
966 note = "If {Self} implements the non-local EchoLauncherServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
967)]
968
969pub trait EchoLauncherLocalServerHandler<
973 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fdomain_client::Channel,
974 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
975>
976{
977 fn get_echo(
978 &mut self,
979
980 request: ::fidl_next::Request<echo_launcher::GetEcho, ___T>,
981
982 responder: ::fidl_next::Responder<echo_launcher::GetEcho, ___T>,
983 ) -> impl ::core::future::Future<Output = ()>;
984
985 fn get_echo_pipelined(
986 &mut self,
987
988 request: ::fidl_next::Request<echo_launcher::GetEchoPipelined, ___T>,
989 ) -> impl ::core::future::Future<Output = ()>;
990}
991
992impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for EchoLauncher
993where
994 ___H: EchoLauncherLocalServerHandler<___T>,
995 ___T: ::fidl_next::Transport,
996 for<'de> crate::wire::EchoLauncherGetEchoRequest<'de>: ::fidl_next::Decode<
997 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
998 Constraint = (),
999 >,
1000 for<'de> crate::wire::EchoLauncherGetEchoPipelinedRequest<'de>: ::fidl_next::Decode<
1001 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1002 Constraint = (),
1003 >,
1004{
1005 async fn on_one_way(
1006 handler: &mut ___H,
1007 mut message: ::fidl_next::Message<___T>,
1008 ) -> ::core::result::Result<
1009 (),
1010 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1011 > {
1012 match *message.header().ordinal {
1013 2118769043708531827 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1014 Ok(decoded) => {
1015 handler.get_echo_pipelined(::fidl_next::Request::from_decoded(decoded)).await;
1016 Ok(())
1017 }
1018 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1019 ordinal: 2118769043708531827,
1020 error,
1021 }),
1022 },
1023
1024 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1025 }
1026 }
1027
1028 async fn on_two_way(
1029 handler: &mut ___H,
1030 mut message: ::fidl_next::Message<___T>,
1031 responder: ::fidl_next::protocol::Responder<___T>,
1032 ) -> ::core::result::Result<
1033 (),
1034 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1035 > {
1036 match *message.header().ordinal {
1037 1213319469445758440 => {
1038 let responder = ::fidl_next::Responder::from_untyped(responder);
1039
1040 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1041 Ok(decoded) => {
1042 handler
1043 .get_echo(::fidl_next::Request::from_decoded(decoded), responder)
1044 .await;
1045 Ok(())
1046 }
1047 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1048 ordinal: 1213319469445758440,
1049 error,
1050 }),
1051 }
1052 }
1053
1054 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1055 }
1056 }
1057}
1058
1059pub trait EchoLauncherClientHandler<
1063 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fdomain_client::Channel,
1064 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1065>
1066{
1067}
1068
1069impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for EchoLauncher
1070where
1071 ___H: EchoLauncherClientHandler<___T> + ::core::marker::Send,
1072 ___T: ::fidl_next::Transport,
1073{
1074 async fn on_event(
1075 handler: &mut ___H,
1076 mut message: ::fidl_next::Message<___T>,
1077 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1078 match *message.header().ordinal {
1079 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1080 }
1081 }
1082}
1083
1084pub trait EchoLauncherServerHandler<
1088 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fdomain_client::Channel,
1089 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1090>
1091{
1092 fn get_echo(
1093 &mut self,
1094
1095 request: ::fidl_next::Request<echo_launcher::GetEcho, ___T>,
1096
1097 responder: ::fidl_next::Responder<echo_launcher::GetEcho, ___T>,
1098 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1099
1100 fn get_echo_pipelined(
1101 &mut self,
1102
1103 request: ::fidl_next::Request<echo_launcher::GetEchoPipelined, ___T>,
1104 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1105}
1106
1107impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for EchoLauncher
1108where
1109 ___H: EchoLauncherServerHandler<___T> + ::core::marker::Send,
1110 ___T: ::fidl_next::Transport,
1111 for<'de> crate::wire::EchoLauncherGetEchoRequest<'de>: ::fidl_next::Decode<
1112 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1113 Constraint = (),
1114 >,
1115 for<'de> crate::wire::EchoLauncherGetEchoPipelinedRequest<'de>: ::fidl_next::Decode<
1116 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1117 Constraint = (),
1118 >,
1119{
1120 async fn on_one_way(
1121 handler: &mut ___H,
1122 mut message: ::fidl_next::Message<___T>,
1123 ) -> ::core::result::Result<
1124 (),
1125 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1126 > {
1127 match *message.header().ordinal {
1128 2118769043708531827 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1129 Ok(decoded) => {
1130 handler.get_echo_pipelined(::fidl_next::Request::from_decoded(decoded)).await;
1131 Ok(())
1132 }
1133 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1134 ordinal: 2118769043708531827,
1135 error,
1136 }),
1137 },
1138
1139 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1140 }
1141 }
1142
1143 async fn on_two_way(
1144 handler: &mut ___H,
1145 mut message: ::fidl_next::Message<___T>,
1146 responder: ::fidl_next::protocol::Responder<___T>,
1147 ) -> ::core::result::Result<
1148 (),
1149 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1150 > {
1151 match *message.header().ordinal {
1152 1213319469445758440 => {
1153 let responder = ::fidl_next::Responder::from_untyped(responder);
1154
1155 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1156 Ok(decoded) => {
1157 handler
1158 .get_echo(::fidl_next::Request::from_decoded(decoded), responder)
1159 .await;
1160 Ok(())
1161 }
1162 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1163 ordinal: 1213319469445758440,
1164 error,
1165 }),
1166 }
1167 }
1168
1169 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1170 }
1171 }
1172}
1173
1174impl<___T> EchoLauncherClientHandler<___T> for ::fidl_next::IgnoreEvents where
1175 ___T: ::fidl_next::Transport
1176{
1177}
1178
1179impl<___H, ___T> EchoLauncherLocalClientHandler<___T> for ::fidl_next::Local<___H>
1180where
1181 ___H: EchoLauncherClientHandler<___T>,
1182 ___T: ::fidl_next::Transport,
1183{
1184}
1185
1186impl<___H, ___T> EchoLauncherLocalServerHandler<___T> for ::fidl_next::Local<___H>
1187where
1188 ___H: EchoLauncherServerHandler<___T>,
1189 ___T: ::fidl_next::Transport,
1190{
1191 async fn get_echo(
1192 &mut self,
1193
1194 request: ::fidl_next::Request<echo_launcher::GetEcho, ___T>,
1195
1196 responder: ::fidl_next::Responder<echo_launcher::GetEcho, ___T>,
1197 ) {
1198 ___H::get_echo(&mut self.0, request, responder).await
1199 }
1200
1201 async fn get_echo_pipelined(
1202 &mut self,
1203
1204 request: ::fidl_next::Request<echo_launcher::GetEchoPipelined, ___T>,
1205 ) {
1206 ___H::get_echo_pipelined(&mut self.0, request).await
1207 }
1208}
1209
1210#[derive(Debug)]
1212pub struct EchoService;
1213
1214impl ::fidl_next::DiscoverableService for EchoService {
1215 const SERVICE_NAME: &'static str = "fuchsia.examples.EchoService";
1216 const MEMBER_NAMES: &'static [&'static str] = &["regular_echo", "reversed_echo"];
1217}
1218
1219impl ::fidl_next::HasServiceRequest<::fdomain_client::Channel> for EchoService {}
1220
1221impl<___C> ::fidl_next::Service<___C> for EchoService
1222where
1223 ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
1224 ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
1225{
1226 type Connector = EchoServiceConnector<___C>;
1227}
1228
1229#[repr(transparent)]
1231pub struct EchoServiceConnector<___C> {
1232 #[allow(dead_code)]
1233 connector: ___C,
1234}
1235
1236impl<___C> EchoServiceConnector<___C>
1237where
1238 ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
1239 ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
1240{
1241 pub fn regular_echo(
1243 &self,
1244 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1245 ) -> ::core::result::Result<
1246 (),
1247 <___C as ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>>::Error,
1248 > {
1249 ::fidl_next::protocol::ServiceConnector::<::fdomain_client::Channel>::connect_to_member(
1250 &self.connector,
1251 "regular_echo",
1252 server_end.into_untyped(),
1253 )
1254 }
1255
1256 pub fn reversed_echo(
1258 &self,
1259 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1260 ) -> ::core::result::Result<
1261 (),
1262 <___C as ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>>::Error,
1263 > {
1264 ::fidl_next::protocol::ServiceConnector::<::fdomain_client::Channel>::connect_to_member(
1265 &self.connector,
1266 "reversed_echo",
1267 server_end.into_untyped(),
1268 )
1269 }
1270}
1271
1272pub trait EchoServiceHandler {
1274 fn regular_echo(
1276 &self,
1277 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1278 );
1279
1280 fn reversed_echo(
1282 &self,
1283 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1284 );
1285}
1286
1287impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for EchoService
1288where
1289 ___H: EchoServiceHandler,
1290 ::fdomain_client::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
1291 ::fdomain_client::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
1292{
1293 fn on_connection(handler: &___H, member: &str, server_end: ___T) {
1294 use ::fidl_next::InstanceFromServiceTransport;
1295 match member {
1296 "regular_echo" => handler.regular_echo(::fidl_next::ServerEnd::from_untyped(
1297 ::fdomain_client::Channel::from_service_transport(server_end),
1298 )),
1299
1300 "reversed_echo" => handler.reversed_echo(::fidl_next::ServerEnd::from_untyped(
1301 ::fdomain_client::Channel::from_service_transport(server_end),
1302 )),
1303
1304 _ => unreachable!(),
1305 }
1306 }
1307}
1308
1309pub use fidl_next_common_fuchsia_examples::*;