Skip to main content

fdomain_next_fuchsia_examples/
fdomain_next_fuchsia_examples.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![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    /// The wire type corresponding to [`EchoLauncherGetEchoResponse`].
297    #[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
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: ::fdomain_client::fidl_next::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
353                    mut response,
354
355                } = slot_;
356            }
357
358            let _field = response.as_mut();
359
360            ::fidl_next::Decode::decode(response.as_mut(), decoder_, ())?;
361
362            Ok(())
363        }
364    }
365
366    impl ::fidl_next::IntoNatural for EchoLauncherGetEchoResponse {
367        type Natural = crate::natural::EchoLauncherGetEchoResponse;
368    }
369
370    /// The wire type corresponding to [`EchoLauncherGetEchoPipelinedRequest`].
371    #[derive(Debug)]
372    #[repr(C)]
373    pub struct EchoLauncherGetEchoPipelinedRequest<'de> {
374        pub echo_prefix: ::fidl_next::wire::String<'de>,
375
376        pub request: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
377    }
378
379    static_assertions::const_assert_eq!(
380        std::mem::size_of::<EchoLauncherGetEchoPipelinedRequest<'_>>(),
381        24
382    );
383    static_assertions::const_assert_eq!(
384        std::mem::align_of::<EchoLauncherGetEchoPipelinedRequest<'_>>(),
385        8
386    );
387
388    static_assertions::const_assert_eq!(
389        std::mem::offset_of!(EchoLauncherGetEchoPipelinedRequest<'_>, echo_prefix),
390        0
391    );
392
393    static_assertions::const_assert_eq!(
394        std::mem::offset_of!(EchoLauncherGetEchoPipelinedRequest<'_>, request),
395        16
396    );
397
398    impl ::fidl_next::Constrained for EchoLauncherGetEchoPipelinedRequest<'_> {
399        type Constraint = ();
400
401        fn validate(
402            _: ::fidl_next::Slot<'_, Self>,
403            _: Self::Constraint,
404        ) -> Result<(), ::fidl_next::ValidationError> {
405            Ok(())
406        }
407    }
408
409    unsafe impl ::fidl_next::Wire for EchoLauncherGetEchoPipelinedRequest<'static> {
410        type Narrowed<'de> = EchoLauncherGetEchoPipelinedRequest<'de>;
411
412        #[inline]
413        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
414            ::fidl_next::munge! {
415                let Self {
416
417                    echo_prefix,
418                    request,
419
420                } = &mut *out_;
421            }
422
423            ::fidl_next::Wire::zero_padding(echo_prefix);
424
425            ::fidl_next::Wire::zero_padding(request);
426
427            unsafe {
428                out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
429            }
430        }
431    }
432
433    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoLauncherGetEchoPipelinedRequest<'de>
434    where
435        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
436        ___D: ::fidl_next::Decoder<'de>,
437        ___D: ::fdomain_client::fidl_next::HandleDecoder,
438    {
439        fn decode(
440            slot_: ::fidl_next::Slot<'_, Self>,
441            decoder_: &mut ___D,
442            _: (),
443        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
444            if slot_.as_bytes()[20..24] != [0u8; 4] {
445                return Err(::fidl_next::DecodeError::InvalidPadding);
446            }
447
448            ::fidl_next::munge! {
449                let Self {
450
451                    mut echo_prefix,
452                    mut request,
453
454                } = slot_;
455            }
456
457            let _field = echo_prefix.as_mut();
458            ::fidl_next::Constrained::validate(_field, 32)?;
459            ::fidl_next::Decode::decode(echo_prefix.as_mut(), decoder_, 32)?;
460
461            let echo_prefix = unsafe { echo_prefix.deref_unchecked() };
462
463            if echo_prefix.len() > 32 {
464                return Err(::fidl_next::DecodeError::VectorTooLong {
465                    size: echo_prefix.len() as u64,
466                    limit: 32,
467                });
468            }
469
470            let _field = request.as_mut();
471
472            ::fidl_next::Decode::decode(request.as_mut(), decoder_, ())?;
473
474            Ok(())
475        }
476    }
477
478    impl<'de> ::fidl_next::IntoNatural for EchoLauncherGetEchoPipelinedRequest<'de> {
479        type Natural = crate::natural::EchoLauncherGetEchoPipelinedRequest;
480    }
481
482    /// The wire type corresponding to [`EventStruct`].
483    #[derive(Debug)]
484    #[repr(C)]
485    pub struct EventStruct {
486        pub event: ::fdomain_client::fidl_next::wire::OptionalHandle,
487    }
488
489    static_assertions::const_assert_eq!(std::mem::size_of::<EventStruct>(), 4);
490    static_assertions::const_assert_eq!(std::mem::align_of::<EventStruct>(), 4);
491
492    static_assertions::const_assert_eq!(std::mem::offset_of!(EventStruct, event), 0);
493
494    impl ::fidl_next::Constrained for EventStruct {
495        type Constraint = ();
496
497        fn validate(
498            _: ::fidl_next::Slot<'_, Self>,
499            _: Self::Constraint,
500        ) -> Result<(), ::fidl_next::ValidationError> {
501            Ok(())
502        }
503    }
504
505    unsafe impl ::fidl_next::Wire for EventStruct {
506        type Narrowed<'de> = EventStruct;
507
508        #[inline]
509        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
510            ::fidl_next::munge! {
511                let Self {
512
513                    event,
514
515                } = &mut *out_;
516            }
517
518            ::fidl_next::Wire::zero_padding(event);
519        }
520    }
521
522    unsafe impl<___D> ::fidl_next::Decode<___D> for EventStruct
523    where
524        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
525        ___D: ::fdomain_client::fidl_next::HandleDecoder,
526    {
527        fn decode(
528            slot_: ::fidl_next::Slot<'_, Self>,
529            decoder_: &mut ___D,
530            _: (),
531        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
532            ::fidl_next::munge! {
533                let Self {
534
535                    mut event,
536
537                } = slot_;
538            }
539
540            let _field = event.as_mut();
541
542            ::fidl_next::Decode::decode(event.as_mut(), decoder_, ())?;
543
544            Ok(())
545        }
546    }
547
548    impl ::fidl_next::IntoNatural for EventStruct {
549        type Natural = crate::natural::EventStruct;
550    }
551}
552
553pub mod wire_optional {
554
555    pub use fidl_next_common_fuchsia_examples::wire_optional::*;
556}
557
558pub mod generic {
559
560    pub use fidl_next_common_fuchsia_examples::generic::*;
561
562    pub struct EchoLauncherGetEchoResponse<T0> {
563        pub response: T0,
564    }
565
566    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoResponse, ___E>
567        for EchoLauncherGetEchoResponse<T0>
568    where
569        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
570        ___E: ::fdomain_client::fidl_next::HandleEncoder,
571        T0: ::fidl_next::Encode<
572                ::fidl_next::ClientEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
573                ___E,
574            >,
575    {
576        #[inline]
577        fn encode(
578            self,
579            encoder_: &mut ___E,
580            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoResponse>,
581            _: (),
582        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
583            ::fidl_next::munge! {
584                let crate::wire::EchoLauncherGetEchoResponse {
585
586                    response,
587
588                } = out_;
589            }
590
591            ::fidl_next::Encode::encode(self.response, encoder_, response, ())?;
592
593            Ok(())
594        }
595    }
596
597    pub struct EchoLauncherGetEchoPipelinedRequest<T0, T1> {
598        pub echo_prefix: T0,
599
600        pub request: T1,
601    }
602
603    unsafe impl<___E, T0, T1>
604        ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>, ___E>
605        for EchoLauncherGetEchoPipelinedRequest<T0, T1>
606    where
607        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
608        ___E: ::fidl_next::Encoder,
609        ___E: ::fdomain_client::fidl_next::HandleEncoder,
610        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
611        T1: ::fidl_next::Encode<
612                ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
613                ___E,
614            >,
615    {
616        #[inline]
617        fn encode(
618            self,
619            encoder_: &mut ___E,
620            out_: &mut ::core::mem::MaybeUninit<
621                crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>,
622            >,
623            _: (),
624        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
625            ::fidl_next::munge! {
626                let crate::wire::EchoLauncherGetEchoPipelinedRequest {
627
628                    echo_prefix,
629                    request,
630
631                } = out_;
632            }
633
634            ::fidl_next::Encode::encode(self.echo_prefix, encoder_, echo_prefix, 32)?;
635
636            ::fidl_next::Encode::encode(self.request, encoder_, request, ())?;
637
638            Ok(())
639        }
640    }
641
642    pub struct EventStruct<T0> {
643        pub event: T0,
644    }
645
646    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EventStruct, ___E> for EventStruct<T0>
647    where
648        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
649        ___E: ::fdomain_client::fidl_next::HandleEncoder,
650        T0: ::fidl_next::Encode<::fdomain_client::fidl_next::wire::OptionalHandle, ___E>,
651    {
652        #[inline]
653        fn encode(
654            self,
655            encoder_: &mut ___E,
656            out_: &mut ::core::mem::MaybeUninit<crate::wire::EventStruct>,
657            _: (),
658        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
659            ::fidl_next::munge! {
660                let crate::wire::EventStruct {
661
662                    event,
663
664                } = out_;
665            }
666
667            ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
668
669            Ok(())
670        }
671    }
672}
673
674pub use self::natural::*;
675
676/// The type corresponding to the EchoLauncher protocol.
677#[derive(PartialEq, Debug)]
678pub struct EchoLauncher;
679
680impl ::fidl_next::Discoverable for EchoLauncher {
681    const PROTOCOL_NAME: &'static str = "fuchsia.examples.EchoLauncher";
682}
683
684#[cfg(target_os = "fuchsia")]
685impl ::fidl_next::HasTransport for EchoLauncher {
686    type Transport = ::fdomain_client::Channel;
687}
688
689pub mod echo_launcher {
690    pub mod prelude {
691        pub use crate::{
692            EchoLauncher, EchoLauncherClientHandler, EchoLauncherServerHandler, echo_launcher,
693        };
694
695        pub use crate::natural::EchoLauncherGetEchoPipelinedRequest;
696
697        pub use crate::natural::EchoLauncherGetEchoRequest;
698
699        pub use crate::natural::EchoLauncherGetEchoResponse;
700    }
701
702    pub struct GetEcho;
703
704    impl ::fidl_next::Method for GetEcho {
705        const ORDINAL: u64 = 1213319469445758440;
706        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
707            ::fidl_next::protocol::Flexibility::Strict;
708
709        type Protocol = crate::EchoLauncher;
710
711        type Request = crate::wire::EchoLauncherGetEchoRequest<'static>;
712    }
713
714    impl ::fidl_next::TwoWayMethod for GetEcho {
715        type Response = crate::wire::EchoLauncherGetEchoResponse;
716    }
717
718    impl<___R> ::fidl_next::Respond<___R> for GetEcho {
719        type Output = crate::generic::EchoLauncherGetEchoResponse<___R>;
720
721        fn respond(response: ___R) -> Self::Output {
722            crate::generic::EchoLauncherGetEchoResponse { response: response }
723        }
724    }
725
726    pub struct GetEchoPipelined;
727
728    impl ::fidl_next::Method for GetEchoPipelined {
729        const ORDINAL: u64 = 2118769043708531827;
730        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
731            ::fidl_next::protocol::Flexibility::Strict;
732
733        type Protocol = crate::EchoLauncher;
734
735        type Request = crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>;
736    }
737
738    mod ___detail {
739        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::EchoLauncher
740        where
741            ___T: ::fidl_next::Transport,
742        {
743            type Client = EchoLauncherClient<___T>;
744            type Server = EchoLauncherServer<___T>;
745        }
746
747        /// The client for the `EchoLauncher` protocol.
748        #[repr(transparent)]
749        pub struct EchoLauncherClient<___T: ::fidl_next::Transport> {
750            #[allow(dead_code)]
751            client: ::fidl_next::protocol::Client<___T>,
752        }
753
754        impl<___T> EchoLauncherClient<___T>
755        where
756            ___T: ::fidl_next::Transport,
757        {
758            pub fn get_echo(
759                &self,
760
761                echo_prefix: impl ::fidl_next::Encode<
762                    ::fidl_next::wire::String<'static>,
763                    <___T as ::fidl_next::Transport>::SendBuffer,
764                >,
765            ) -> ::fidl_next::TwoWayFuture<'_, super::GetEcho, ___T>
766            where
767                <___T as ::fidl_next::Transport>::SendBuffer:
768                    ::fidl_next::encoder::InternalHandleEncoder,
769                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
770            {
771                self.get_echo_with(crate::generic::EchoLauncherGetEchoRequest { echo_prefix })
772            }
773
774            pub fn get_echo_with<___R>(
775                &self,
776                request: ___R,
777            ) -> ::fidl_next::TwoWayFuture<'_, super::GetEcho, ___T>
778            where
779                ___R: ::fidl_next::Encode<
780                        crate::wire::EchoLauncherGetEchoRequest<'static>,
781                        <___T as ::fidl_next::Transport>::SendBuffer,
782                    >,
783            {
784                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
785                    1213319469445758440,
786                    <super::GetEcho as ::fidl_next::Method>::FLEXIBILITY,
787                    request,
788                ))
789            }
790
791            pub fn get_echo_pipelined(
792                &self,
793
794                echo_prefix: impl ::fidl_next::Encode<
795                    ::fidl_next::wire::String<'static>,
796                    <___T as ::fidl_next::Transport>::SendBuffer,
797                >,
798
799                request: impl ::fidl_next::Encode<
800                    ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::fidl_next::wire::Handle>,
801                    <___T as ::fidl_next::Transport>::SendBuffer,
802                >,
803            ) -> ::fidl_next::SendFuture<'_, ___T>
804            where
805                <___T as ::fidl_next::Transport>::SendBuffer:
806                    ::fidl_next::encoder::InternalHandleEncoder,
807                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
808                <___T as ::fidl_next::Transport>::SendBuffer:
809                    ::fdomain_client::fidl_next::HandleEncoder,
810            {
811                self.get_echo_pipelined_with(crate::generic::EchoLauncherGetEchoPipelinedRequest {
812                    echo_prefix,
813
814                    request,
815                })
816            }
817
818            pub fn get_echo_pipelined_with<___R>(
819                &self,
820                request: ___R,
821            ) -> ::fidl_next::SendFuture<'_, ___T>
822            where
823                ___R: ::fidl_next::Encode<
824                        crate::wire::EchoLauncherGetEchoPipelinedRequest<'static>,
825                        <___T as ::fidl_next::Transport>::SendBuffer,
826                    >,
827            {
828                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
829                    2118769043708531827,
830                    <super::GetEchoPipelined as ::fidl_next::Method>::FLEXIBILITY,
831                    request,
832                ))
833            }
834        }
835
836        /// The server for the `EchoLauncher` protocol.
837        #[repr(transparent)]
838        pub struct EchoLauncherServer<___T: ::fidl_next::Transport> {
839            server: ::fidl_next::protocol::Server<___T>,
840        }
841
842        impl<___T> EchoLauncherServer<___T> where ___T: ::fidl_next::Transport {}
843    }
844}
845
846/// A client handler for the EchoLauncher protocol.
847///
848/// See [`EchoLauncher`] for more details.
849pub trait EchoLauncherClientHandler<
850    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fdomain_client::Channel,
851    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
852>
853{
854}
855
856impl<___T> EchoLauncherClientHandler<___T> for ::fidl_next::IgnoreEvents where
857    ___T: ::fidl_next::Transport
858{
859}
860
861impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for EchoLauncher
862where
863    ___H: EchoLauncherClientHandler<___T> + ::core::marker::Send,
864    ___T: ::fidl_next::Transport,
865{
866    async fn on_event(
867        handler: &mut ___H,
868        ordinal: u64,
869        flexibility: ::fidl_next::protocol::Flexibility,
870        body: ::fidl_next::Body<___T>,
871    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
872        match ordinal {
873            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
874        }
875    }
876}
877
878/// A server handler for the EchoLauncher protocol.
879///
880/// See [`EchoLauncher`] for more details.
881pub trait EchoLauncherServerHandler<
882    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fdomain_client::Channel,
883    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
884>
885{
886    fn get_echo(
887        &mut self,
888
889        request: ::fidl_next::Request<echo_launcher::GetEcho, ___T>,
890
891        responder: ::fidl_next::Responder<echo_launcher::GetEcho, ___T>,
892    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
893
894    fn get_echo_pipelined(
895        &mut self,
896
897        request: ::fidl_next::Request<echo_launcher::GetEchoPipelined, ___T>,
898    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
899}
900
901impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for EchoLauncher
902where
903    ___H: EchoLauncherServerHandler<___T> + ::core::marker::Send,
904    ___T: ::fidl_next::Transport,
905    for<'de> crate::wire::EchoLauncherGetEchoRequest<'de>: ::fidl_next::Decode<
906            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
907            Constraint = (),
908        >,
909    for<'de> crate::wire::EchoLauncherGetEchoPipelinedRequest<'de>: ::fidl_next::Decode<
910            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
911            Constraint = (),
912        >,
913{
914    async fn on_one_way(
915        handler: &mut ___H,
916        ordinal: u64,
917        flexibility: ::fidl_next::protocol::Flexibility,
918        body: ::fidl_next::Body<___T>,
919    ) -> ::core::result::Result<
920        (),
921        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
922    > {
923        match ordinal {
924            2118769043708531827 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
925                Ok(decoded) => {
926                    handler.get_echo_pipelined(::fidl_next::Request::from_decoded(decoded)).await;
927                    Ok(())
928                }
929                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
930                    ordinal: 2118769043708531827,
931                    error,
932                }),
933            },
934
935            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
936        }
937    }
938
939    async fn on_two_way(
940        handler: &mut ___H,
941        ordinal: u64,
942        flexibility: ::fidl_next::protocol::Flexibility,
943        body: ::fidl_next::Body<___T>,
944        responder: ::fidl_next::protocol::Responder<___T>,
945    ) -> ::core::result::Result<
946        (),
947        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
948    > {
949        match ordinal {
950            1213319469445758440 => {
951                let responder = ::fidl_next::Responder::from_untyped(responder);
952
953                match ::fidl_next::AsDecoderExt::into_decoded(body) {
954                    Ok(decoded) => {
955                        handler
956                            .get_echo(::fidl_next::Request::from_decoded(decoded), responder)
957                            .await;
958                        Ok(())
959                    }
960                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
961                        ordinal: 1213319469445758440,
962                        error,
963                    }),
964                }
965            }
966
967            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
968        }
969    }
970}
971
972/// The type corresponding to the EchoService service.
973#[derive(Debug)]
974pub struct EchoService;
975
976impl ::fidl_next::DiscoverableService for EchoService {
977    const SERVICE_NAME: &'static str = "fuchsia.examples.EchoService";
978    const MEMBER_NAMES: &'static [&'static str] = &["regular_echo", "reversed_echo"];
979}
980
981impl ::fidl_next::HasServiceRequest<::fdomain_client::Channel> for EchoService {}
982
983impl<___C> ::fidl_next::Service<___C> for EchoService
984where
985    ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
986    ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
987{
988    type Connector = EchoServiceConnector<___C>;
989}
990
991/// A strongly-typed service connector for the `EchoService` service.
992#[repr(transparent)]
993pub struct EchoServiceConnector<___C> {
994    #[allow(dead_code)]
995    connector: ___C,
996}
997
998impl<___C> EchoServiceConnector<___C>
999where
1000    ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
1001    ___C: ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>,
1002{
1003    /// Attempts to connect to the `regular_echo` service member.
1004    pub fn regular_echo(
1005        &self,
1006        server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1007    ) -> ::core::result::Result<
1008        (),
1009        <___C as ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>>::Error,
1010    > {
1011        ::fidl_next::protocol::ServiceConnector::<::fdomain_client::Channel>::connect_to_member(
1012            &self.connector,
1013            "regular_echo",
1014            server_end.into_untyped(),
1015        )
1016    }
1017
1018    /// Attempts to connect to the `reversed_echo` service member.
1019    pub fn reversed_echo(
1020        &self,
1021        server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1022    ) -> ::core::result::Result<
1023        (),
1024        <___C as ::fidl_next::protocol::ServiceConnector<::fdomain_client::Channel>>::Error,
1025    > {
1026        ::fidl_next::protocol::ServiceConnector::<::fdomain_client::Channel>::connect_to_member(
1027            &self.connector,
1028            "reversed_echo",
1029            server_end.into_untyped(),
1030        )
1031    }
1032}
1033
1034/// A service handler for the `EchoService` service.
1035pub trait EchoServiceHandler {
1036    /// Handles an attempt to connect to the `regular_echo` member.
1037    fn regular_echo(
1038        &self,
1039        server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1040    );
1041
1042    /// Handles an attempt to connect to the `reversed_echo` member.
1043    fn reversed_echo(
1044        &self,
1045        server_end: ::fidl_next::ServerEnd<crate::Echo, ::fdomain_client::Channel>,
1046    );
1047}
1048
1049impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for EchoService
1050where
1051    ___H: EchoServiceHandler,
1052    ::fdomain_client::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
1053    ::fdomain_client::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
1054{
1055    fn on_connection(handler: &___H, member: &str, server_end: ___T) {
1056        use ::fidl_next::InstanceFromServiceTransport;
1057        match member {
1058            "regular_echo" => handler.regular_echo(::fidl_next::ServerEnd::from_untyped(
1059                ::fdomain_client::Channel::from_service_transport(server_end),
1060            )),
1061
1062            "reversed_echo" => handler.reversed_echo(::fidl_next::ServerEnd::from_untyped(
1063                ::fdomain_client::Channel::from_service_transport(server_end),
1064            )),
1065
1066            _ => unreachable!(),
1067        }
1068    }
1069}
1070
1071pub use fidl_next_common_fuchsia_examples::*;