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, ::fidl_next::fuchsia::zx::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: ::fidl_next::fuchsia::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, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::Encode<::fidl_next::ClientEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>, ___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, ::fidl_next::fuchsia::zx::Channel> as ::fidl_next::FromWire<::fidl_next::ClientEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>>
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, ::fidl_next::fuchsia::zx::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: ::fidl_next::fuchsia::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<::fidl_next::fuchsia::zx::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: ::fidl_next::fuchsia::HandleEncoder,
214 {
215 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::EventStruct> = unsafe {
216 ::fidl_next::CopyOptimization::enable_if(
217 true
218
219 && <
220 ::core::option::Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalEvent, ___E>
221 >::COPY_OPTIMIZATION.is_enabled()
222
223 )
224 };
225
226 #[inline]
227 fn encode(
228 self,
229 encoder_: &mut ___E,
230 out_: &mut ::core::mem::MaybeUninit<crate::wire::EventStruct>,
231 _: (),
232 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
233 ::fidl_next::munge! {
234 let crate::wire::EventStruct {
235 event,
236
237 } = out_;
238 }
239
240 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
241
242 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event.as_mut_ptr()) };
243
244 Ok(())
245 }
246 }
247
248 unsafe impl<___E>
249 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::EventStruct>, ___E>
250 for EventStruct
251 where
252 ___E: ::fidl_next::Encoder + ?Sized,
253 EventStruct: ::fidl_next::Encode<crate::wire::EventStruct, ___E>,
254 {
255 #[inline]
256 fn encode_option(
257 this: ::core::option::Option<Self>,
258 encoder: &mut ___E,
259 out: &mut ::core::mem::MaybeUninit<
260 ::fidl_next::wire::Box<'static, crate::wire::EventStruct>,
261 >,
262 _: (),
263 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
264 if let Some(inner) = this {
265 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
266 ::fidl_next::wire::Box::encode_present(out);
267 } else {
268 ::fidl_next::wire::Box::encode_absent(out);
269 }
270
271 Ok(())
272 }
273 }
274
275 impl ::fidl_next::FromWire<crate::wire::EventStruct> for EventStruct {
276 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::EventStruct, Self> = unsafe {
277 ::fidl_next::CopyOptimization::enable_if(
278 true
279
280 && <
281 ::core::option::Option<::fidl_next::fuchsia::zx::Event> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::OptionalEvent>
282 >::COPY_OPTIMIZATION.is_enabled()
283
284 )
285 };
286
287 #[inline]
288 fn from_wire(wire: crate::wire::EventStruct) -> Self {
289 Self { event: ::fidl_next::FromWire::from_wire(wire.event) }
290 }
291 }
292}
293
294pub mod wire {
295
296 pub use fidl_next_common_fuchsia_examples::wire::*;
297
298 #[derive(Debug)]
300 #[repr(C)]
301 pub struct EchoLauncherGetEchoResponse {
302 pub response: ::fidl_next::ClientEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>,
303 }
304
305 static_assertions::const_assert_eq!(std::mem::size_of::<EchoLauncherGetEchoResponse>(), 4);
306 static_assertions::const_assert_eq!(std::mem::align_of::<EchoLauncherGetEchoResponse>(), 4);
307
308 static_assertions::const_assert_eq!(
309 std::mem::offset_of!(EchoLauncherGetEchoResponse, response),
310 0
311 );
312
313 impl ::fidl_next::Constrained for EchoLauncherGetEchoResponse {
314 type Constraint = ();
315
316 fn validate(
317 _: ::fidl_next::Slot<'_, Self>,
318 _: Self::Constraint,
319 ) -> Result<(), ::fidl_next::ValidationError> {
320 Ok(())
321 }
322 }
323
324 unsafe impl ::fidl_next::Wire for EchoLauncherGetEchoResponse {
325 type Narrowed<'de> = EchoLauncherGetEchoResponse;
326
327 #[inline]
328 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
329 ::fidl_next::munge! {
330 let Self {
331 response,
332
333 } = &mut *out_;
334 }
335
336 ::fidl_next::Wire::zero_padding(response);
337 }
338 }
339
340 unsafe impl<___D> ::fidl_next::Decode<___D> for EchoLauncherGetEchoResponse
341 where
342 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
343 ___D: ::fidl_next::fuchsia::HandleDecoder,
344 {
345 fn decode(
346 slot_: ::fidl_next::Slot<'_, Self>,
347 decoder_: &mut ___D,
348 _: (),
349 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
350 ::fidl_next::munge! {
351 let Self {
352 mut response,
353
354 } = slot_;
355 }
356
357 let _field = response.as_mut();
358
359 ::fidl_next::Decode::decode(response.as_mut(), decoder_, ())?;
360
361 Ok(())
362 }
363 }
364
365 impl ::fidl_next::IntoNatural for EchoLauncherGetEchoResponse {
366 type Natural = crate::natural::EchoLauncherGetEchoResponse;
367 }
368
369 #[derive(Debug)]
371 #[repr(C)]
372 pub struct EchoLauncherGetEchoPipelinedRequest<'de> {
373 pub echo_prefix: ::fidl_next::wire::String<'de>,
374
375 pub request: ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>,
376 }
377
378 static_assertions::const_assert_eq!(
379 std::mem::size_of::<EchoLauncherGetEchoPipelinedRequest<'_>>(),
380 24
381 );
382 static_assertions::const_assert_eq!(
383 std::mem::align_of::<EchoLauncherGetEchoPipelinedRequest<'_>>(),
384 8
385 );
386
387 static_assertions::const_assert_eq!(
388 std::mem::offset_of!(EchoLauncherGetEchoPipelinedRequest<'_>, echo_prefix),
389 0
390 );
391
392 static_assertions::const_assert_eq!(
393 std::mem::offset_of!(EchoLauncherGetEchoPipelinedRequest<'_>, request),
394 16
395 );
396
397 impl ::fidl_next::Constrained for EchoLauncherGetEchoPipelinedRequest<'_> {
398 type Constraint = ();
399
400 fn validate(
401 _: ::fidl_next::Slot<'_, Self>,
402 _: Self::Constraint,
403 ) -> Result<(), ::fidl_next::ValidationError> {
404 Ok(())
405 }
406 }
407
408 unsafe impl ::fidl_next::Wire for EchoLauncherGetEchoPipelinedRequest<'static> {
409 type Narrowed<'de> = EchoLauncherGetEchoPipelinedRequest<'de>;
410
411 #[inline]
412 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
413 ::fidl_next::munge! {
414 let Self {
415 echo_prefix,
416 request,
417
418 } = &mut *out_;
419 }
420
421 ::fidl_next::Wire::zero_padding(echo_prefix);
422
423 ::fidl_next::Wire::zero_padding(request);
424
425 unsafe {
426 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
427 }
428 }
429 }
430
431 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoLauncherGetEchoPipelinedRequest<'de>
432 where
433 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
434 ___D: ::fidl_next::Decoder<'de>,
435 ___D: ::fidl_next::fuchsia::HandleDecoder,
436 {
437 fn decode(
438 slot_: ::fidl_next::Slot<'_, Self>,
439 decoder_: &mut ___D,
440 _: (),
441 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
442 if slot_.as_bytes()[20..24] != [0u8; 4] {
443 return Err(::fidl_next::DecodeError::InvalidPadding);
444 }
445
446 ::fidl_next::munge! {
447 let Self {
448 mut echo_prefix,
449 mut request,
450
451 } = slot_;
452 }
453
454 let _field = echo_prefix.as_mut();
455 ::fidl_next::Constrained::validate(_field, 32)?;
456 ::fidl_next::Decode::decode(echo_prefix.as_mut(), decoder_, 32)?;
457
458 let echo_prefix = unsafe { echo_prefix.deref_unchecked() };
459
460 if echo_prefix.len() > 32 {
461 return Err(::fidl_next::DecodeError::VectorTooLong {
462 size: echo_prefix.len() as u64,
463 limit: 32,
464 });
465 }
466
467 let _field = request.as_mut();
468
469 ::fidl_next::Decode::decode(request.as_mut(), decoder_, ())?;
470
471 Ok(())
472 }
473 }
474
475 impl<'de> ::fidl_next::IntoNatural for EchoLauncherGetEchoPipelinedRequest<'de> {
476 type Natural = crate::natural::EchoLauncherGetEchoPipelinedRequest;
477 }
478
479 #[derive(Debug)]
481 #[repr(C)]
482 pub struct EventStruct {
483 pub event: ::fidl_next::wire::fuchsia::OptionalEvent,
484 }
485
486 static_assertions::const_assert_eq!(std::mem::size_of::<EventStruct>(), 4);
487 static_assertions::const_assert_eq!(std::mem::align_of::<EventStruct>(), 4);
488
489 static_assertions::const_assert_eq!(std::mem::offset_of!(EventStruct, event), 0);
490
491 impl ::fidl_next::Constrained for EventStruct {
492 type Constraint = ();
493
494 fn validate(
495 _: ::fidl_next::Slot<'_, Self>,
496 _: Self::Constraint,
497 ) -> Result<(), ::fidl_next::ValidationError> {
498 Ok(())
499 }
500 }
501
502 unsafe impl ::fidl_next::Wire for EventStruct {
503 type Narrowed<'de> = EventStruct;
504
505 #[inline]
506 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
507 ::fidl_next::munge! {
508 let Self {
509 event,
510
511 } = &mut *out_;
512 }
513
514 ::fidl_next::Wire::zero_padding(event);
515 }
516 }
517
518 unsafe impl<___D> ::fidl_next::Decode<___D> for EventStruct
519 where
520 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
521 ___D: ::fidl_next::fuchsia::HandleDecoder,
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 mut event,
531
532 } = slot_;
533 }
534
535 let _field = event.as_mut();
536
537 ::fidl_next::Decode::decode(event.as_mut(), decoder_, ())?;
538
539 Ok(())
540 }
541 }
542
543 impl ::fidl_next::IntoNatural for EventStruct {
544 type Natural = crate::natural::EventStruct;
545 }
546}
547
548pub mod wire_optional {
549
550 pub use fidl_next_common_fuchsia_examples::wire_optional::*;
551}
552
553pub mod generic {
554
555 pub use fidl_next_common_fuchsia_examples::generic::*;
556
557 pub struct EchoLauncherGetEchoResponse<T0> {
559 pub response: T0,
560 }
561
562 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoResponse, ___E>
563 for EchoLauncherGetEchoResponse<T0>
564 where
565 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
566 ___E: ::fidl_next::fuchsia::HandleEncoder,
567 T0: ::fidl_next::Encode<
568 ::fidl_next::ClientEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>,
569 ___E,
570 >,
571 {
572 #[inline]
573 fn encode(
574 self,
575 encoder_: &mut ___E,
576 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoResponse>,
577 _: (),
578 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
579 ::fidl_next::munge! {
580 let crate::wire::EchoLauncherGetEchoResponse {
581 response,
582
583 } = out_;
584 }
585
586 ::fidl_next::Encode::encode(self.response, encoder_, response, ())?;
587
588 Ok(())
589 }
590 }
591
592 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoResponse, ___E>
593 for &'a EchoLauncherGetEchoResponse<T0>
594 where
595 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
596 ___E: ::fidl_next::fuchsia::HandleEncoder,
597 &'a T0: ::fidl_next::Encode<
598 ::fidl_next::ClientEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>,
599 ___E,
600 >,
601 {
602 #[inline]
603 fn encode(
604 self,
605 encoder_: &mut ___E,
606 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoResponse>,
607 _: (),
608 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
609 ::fidl_next::munge! {
610 let crate::wire::EchoLauncherGetEchoResponse {
611 response,
612
613 } = out_;
614 }
615
616 ::fidl_next::Encode::encode(&self.response, encoder_, response, ())?;
617
618 Ok(())
619 }
620 }
621
622 pub struct EchoLauncherGetEchoPipelinedRequest<T0, T1> {
624 pub echo_prefix: T0,
625
626 pub request: T1,
627 }
628
629 unsafe impl<___E, T0, T1>
630 ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>, ___E>
631 for EchoLauncherGetEchoPipelinedRequest<T0, T1>
632 where
633 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
634 ___E: ::fidl_next::Encoder,
635 ___E: ::fidl_next::fuchsia::HandleEncoder,
636 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
637 T1: ::fidl_next::Encode<
638 ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>,
639 ___E,
640 >,
641 {
642 #[inline]
643 fn encode(
644 self,
645 encoder_: &mut ___E,
646 out_: &mut ::core::mem::MaybeUninit<
647 crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>,
648 >,
649 _: (),
650 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
651 ::fidl_next::munge! {
652 let crate::wire::EchoLauncherGetEchoPipelinedRequest {
653 echo_prefix,
654 request,
655
656 } = out_;
657 }
658
659 ::fidl_next::Encode::encode(self.echo_prefix, encoder_, echo_prefix, 32)?;
660
661 ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
662
663 Ok(())
664 }
665 }
666
667 unsafe impl<'a, ___E, T0, T1>
668 ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>, ___E>
669 for &'a EchoLauncherGetEchoPipelinedRequest<T0, T1>
670 where
671 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
672 ___E: ::fidl_next::Encoder,
673 ___E: ::fidl_next::fuchsia::HandleEncoder,
674 &'a T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
675 &'a T1: ::fidl_next::Encode<
676 ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>,
677 ___E,
678 >,
679 {
680 #[inline]
681 fn encode(
682 self,
683 encoder_: &mut ___E,
684 out_: &mut ::core::mem::MaybeUninit<
685 crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>,
686 >,
687 _: (),
688 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
689 ::fidl_next::munge! {
690 let crate::wire::EchoLauncherGetEchoPipelinedRequest {
691 echo_prefix,
692 request,
693
694 } = out_;
695 }
696
697 ::fidl_next::Encode::encode(&self.echo_prefix, encoder_, echo_prefix, 32)?;
698
699 ::fidl_next::Encode::encode(&self.request, encoder_, request, ())?;
700
701 Ok(())
702 }
703 }
704
705 pub struct EventStruct<T0> {
707 pub event: T0,
708 }
709
710 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EventStruct, ___E> for EventStruct<T0>
711 where
712 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
713 ___E: ::fidl_next::fuchsia::HandleEncoder,
714 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalEvent, ___E>,
715 {
716 #[inline]
717 fn encode(
718 self,
719 encoder_: &mut ___E,
720 out_: &mut ::core::mem::MaybeUninit<crate::wire::EventStruct>,
721 _: (),
722 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
723 ::fidl_next::munge! {
724 let crate::wire::EventStruct {
725 event,
726
727 } = out_;
728 }
729
730 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
731
732 Ok(())
733 }
734 }
735
736 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::EventStruct, ___E>
737 for &'a EventStruct<T0>
738 where
739 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
740 ___E: ::fidl_next::fuchsia::HandleEncoder,
741 &'a T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::OptionalEvent, ___E>,
742 {
743 #[inline]
744 fn encode(
745 self,
746 encoder_: &mut ___E,
747 out_: &mut ::core::mem::MaybeUninit<crate::wire::EventStruct>,
748 _: (),
749 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
750 ::fidl_next::munge! {
751 let crate::wire::EventStruct {
752 event,
753
754 } = out_;
755 }
756
757 ::fidl_next::Encode::encode(&self.event, encoder_, event, ())?;
758
759 Ok(())
760 }
761 }
762}
763
764pub use self::natural::*;
765
766#[derive(PartialEq, Debug)]
768pub struct EchoLauncher;
769
770impl ::fidl_next::Discoverable for EchoLauncher {
771 const PROTOCOL_NAME: &'static str = "fuchsia.examples.EchoLauncher";
772}
773
774#[cfg(target_os = "fuchsia")]
775impl ::fidl_next::HasTransport for EchoLauncher {
776 type Transport = ::fidl_next::fuchsia::zx::Channel;
777}
778
779pub mod echo_launcher {
780 pub mod prelude {
781 pub use crate::{
782 EchoLauncher, EchoLauncherClientHandler, EchoLauncherLocalClientHandler,
783 EchoLauncherLocalServerHandler, EchoLauncherServerHandler, echo_launcher,
784 };
785
786 pub use crate::natural::EchoLauncherGetEchoPipelinedRequest;
787
788 pub use crate::natural::EchoLauncherGetEchoRequest;
789
790 pub use crate::natural::EchoLauncherGetEchoResponse;
791 }
792
793 pub struct GetEcho;
794
795 impl ::fidl_next::Method for GetEcho {
796 const ORDINAL: u64 = 1213319469445758440;
797 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
798 ::fidl_next::protocol::Flexibility::Strict;
799
800 type Protocol = crate::EchoLauncher;
801
802 type Request = crate::wire::EchoLauncherGetEchoRequest<'static>;
803 }
804
805 impl ::fidl_next::TwoWayMethod for GetEcho {
806 type Response = ::fidl_next::wire::Strict<crate::wire::EchoLauncherGetEchoResponse>;
807 }
808
809 impl<___R> ::fidl_next::Respond<___R> for GetEcho {
810 type Output = ::fidl_next::Strict<crate::generic::EchoLauncherGetEchoResponse<___R>>;
811
812 fn respond(response: ___R) -> Self::Output {
813 ::fidl_next::Strict(crate::generic::EchoLauncherGetEchoResponse { response: response })
814 }
815 }
816
817 pub struct GetEchoPipelined;
818
819 impl ::fidl_next::Method for GetEchoPipelined {
820 const ORDINAL: u64 = 2118769043708531827;
821 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
822 ::fidl_next::protocol::Flexibility::Strict;
823
824 type Protocol = crate::EchoLauncher;
825
826 type Request = crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>;
827 }
828
829 mod ___detail {
830 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::EchoLauncher
831 where
832 ___T: ::fidl_next::Transport,
833 {
834 type Client = EchoLauncherClient<___T>;
835 type Server = EchoLauncherServer<___T>;
836 }
837
838 #[repr(transparent)]
840 pub struct EchoLauncherClient<___T: ::fidl_next::Transport> {
841 #[allow(dead_code)]
842 client: ::fidl_next::protocol::Client<___T>,
843 }
844
845 impl<___T> EchoLauncherClient<___T>
846 where
847 ___T: ::fidl_next::Transport,
848 {
849 pub fn get_echo(
850 &self,
851
852 echo_prefix: impl ::fidl_next::Encode<
853 ::fidl_next::wire::String<'static>,
854 <___T as ::fidl_next::Transport>::SendBuffer,
855 >,
856 ) -> ::fidl_next::TwoWayFuture<'_, super::GetEcho, ___T>
857 where
858 <___T as ::fidl_next::Transport>::SendBuffer:
859 ::fidl_next::encoder::InternalHandleEncoder,
860 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
861 {
862 self.get_echo_with(crate::generic::EchoLauncherGetEchoRequest { echo_prefix })
863 }
864
865 pub fn get_echo_with<___R>(
866 &self,
867 request: ___R,
868 ) -> ::fidl_next::TwoWayFuture<'_, super::GetEcho, ___T>
869 where
870 ___R: ::fidl_next::Encode<
871 crate::wire::EchoLauncherGetEchoRequest<'static>,
872 <___T as ::fidl_next::Transport>::SendBuffer,
873 >,
874 {
875 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
876 1213319469445758440,
877 <super::GetEcho as ::fidl_next::Method>::FLEXIBILITY,
878 request,
879 ))
880 }
881
882 pub fn get_echo_pipelined(
883 &self,
884
885 echo_prefix: impl ::fidl_next::Encode<
886 ::fidl_next::wire::String<'static>,
887 <___T as ::fidl_next::Transport>::SendBuffer,
888 >,
889
890 request: impl ::fidl_next::Encode<
891 ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::wire::fuchsia::Channel>,
892 <___T as ::fidl_next::Transport>::SendBuffer,
893 >,
894 ) -> ::fidl_next::SendFuture<'_, ___T>
895 where
896 <___T as ::fidl_next::Transport>::SendBuffer:
897 ::fidl_next::encoder::InternalHandleEncoder,
898 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
899 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::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 = ::fidl_next::fuchsia::zx::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 = ::fidl_next::fuchsia::zx::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 = ::fidl_next::fuchsia::zx::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 = ::fidl_next::fuchsia::zx::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<::fidl_next::fuchsia::zx::Channel> for EchoService {}
1220
1221impl<___C> ::fidl_next::Service<___C> for EchoService
1222where
1223 ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
1224 ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::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<::fidl_next::fuchsia::zx::Channel>,
1239 ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
1240{
1241 pub fn regular_echo(
1243 &self,
1244 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::fuchsia::zx::Channel>,
1245 ) -> ::core::result::Result<
1246 (),
1247 <___C as ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>>::Error,
1248 > {
1249 ::fidl_next::protocol::ServiceConnector::<
1250 ::fidl_next::fuchsia::zx::Channel
1251 >::connect_to_member(
1252 &self.connector,
1253 "regular_echo",
1254 server_end.into_untyped(),
1255 )
1256 }
1257
1258 pub fn reversed_echo(
1260 &self,
1261 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::fuchsia::zx::Channel>,
1262 ) -> ::core::result::Result<
1263 (),
1264 <___C as ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>>::Error,
1265 > {
1266 ::fidl_next::protocol::ServiceConnector::<
1267 ::fidl_next::fuchsia::zx::Channel
1268 >::connect_to_member(
1269 &self.connector,
1270 "reversed_echo",
1271 server_end.into_untyped(),
1272 )
1273 }
1274}
1275
1276pub trait EchoServiceHandler {
1278 fn regular_echo(
1280 &self,
1281 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::fuchsia::zx::Channel>,
1282 );
1283
1284 fn reversed_echo(
1286 &self,
1287 server_end: ::fidl_next::ServerEnd<crate::Echo, ::fidl_next::fuchsia::zx::Channel>,
1288 );
1289}
1290
1291impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for EchoService
1292where
1293 ___H: EchoServiceHandler,
1294 ::fidl_next::fuchsia::zx::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
1295 ::fidl_next::fuchsia::zx::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
1296{
1297 fn on_connection(handler: &___H, member: &str, server_end: ___T) {
1298 use ::fidl_next::InstanceFromServiceTransport;
1299 match member {
1300 "regular_echo" => handler.regular_echo(::fidl_next::ServerEnd::from_untyped(
1301 ::fidl_next::fuchsia::zx::Channel::from_service_transport(server_end),
1302 )),
1303
1304 "reversed_echo" => handler.reversed_echo(::fidl_next::ServerEnd::from_untyped(
1305 ::fidl_next::fuchsia::zx::Channel::from_service_transport(server_end),
1306 )),
1307
1308 _ => unreachable!(),
1309 }
1310 }
1311}
1312
1313pub use fidl_next_common_fuchsia_examples::*;