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