Skip to main content

fidl_next_common_fuchsia_examples/
fidl_next_common_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 type AvailableFromApiLevelNext = i32;
8
9    pub type AvailableUntilApiLevelNext = i32;
10
11    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12    pub struct Color {
13        pub id: u32,
14
15        pub name: ::std::string::String,
16    }
17
18    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Color<'static>, ___E> for Color
19    where
20        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21        ___E: ::fidl_next::Encoder,
22    {
23        #[inline]
24        fn encode(
25            self,
26            encoder_: &mut ___E,
27            out_: &mut ::core::mem::MaybeUninit<crate::wire::Color<'static>>,
28            _: (),
29        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30            ::fidl_next::munge! {
31                let crate::wire::Color {
32                    id,
33                    name,
34
35                } = out_;
36            }
37
38            ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
39
40            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(id.as_mut_ptr()) };
41
42            ::fidl_next::Encode::encode(self.name, encoder_, name, 32)?;
43
44            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
45            ::fidl_next::Constrained::validate(_field, 32)?;
46
47            Ok(())
48        }
49    }
50
51    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Color<'static>, ___E> for &'a Color
52    where
53        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
54        ___E: ::fidl_next::Encoder,
55    {
56        #[inline]
57        fn encode(
58            self,
59            encoder_: &mut ___E,
60            out_: &mut ::core::mem::MaybeUninit<crate::wire::Color<'static>>,
61            _: (),
62        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
63            ::fidl_next::munge! {
64                let crate::wire::Color {
65                    id,
66                    name,
67
68                } = out_;
69            }
70
71            ::fidl_next::Encode::encode(&self.id, encoder_, id, ())?;
72
73            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(id.as_mut_ptr()) };
74
75            ::fidl_next::Encode::encode(&self.name, encoder_, name, 32)?;
76
77            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
78            ::fidl_next::Constrained::validate(_field, 32)?;
79
80            Ok(())
81        }
82    }
83
84    unsafe impl<___E>
85        ::fidl_next::EncodeOption<
86            ::fidl_next::wire::Box<'static, crate::wire::Color<'static>>,
87            ___E,
88        > for Color
89    where
90        ___E: ::fidl_next::Encoder + ?Sized,
91        Color: ::fidl_next::Encode<crate::wire::Color<'static>, ___E>,
92    {
93        #[inline]
94        fn encode_option(
95            this: ::core::option::Option<Self>,
96            encoder: &mut ___E,
97            out: &mut ::core::mem::MaybeUninit<
98                ::fidl_next::wire::Box<'static, crate::wire::Color<'static>>,
99            >,
100            _: (),
101        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
102            if let Some(inner) = this {
103                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
104                ::fidl_next::wire::Box::encode_present(out);
105            } else {
106                ::fidl_next::wire::Box::encode_absent(out);
107            }
108
109            Ok(())
110        }
111    }
112
113    unsafe impl<'a, ___E>
114        ::fidl_next::EncodeOption<
115            ::fidl_next::wire::Box<'static, crate::wire::Color<'static>>,
116            ___E,
117        > for &'a Color
118    where
119        ___E: ::fidl_next::Encoder + ?Sized,
120        &'a Color: ::fidl_next::Encode<crate::wire::Color<'static>, ___E>,
121    {
122        #[inline]
123        fn encode_option(
124            this: ::core::option::Option<Self>,
125            encoder: &mut ___E,
126            out: &mut ::core::mem::MaybeUninit<
127                ::fidl_next::wire::Box<'static, crate::wire::Color<'static>>,
128            >,
129            _: (),
130        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
131            if let Some(inner) = this {
132                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
133                ::fidl_next::wire::Box::encode_present(out);
134            } else {
135                ::fidl_next::wire::Box::encode_absent(out);
136            }
137
138            Ok(())
139        }
140    }
141
142    impl<'de> ::fidl_next::FromWire<crate::wire::Color<'de>> for Color {
143        #[inline]
144        fn from_wire(wire: crate::wire::Color<'de>) -> Self {
145            Self {
146                id: ::fidl_next::FromWire::from_wire(wire.id),
147
148                name: ::fidl_next::FromWire::from_wire(wire.name),
149            }
150        }
151    }
152
153    impl<'de> ::fidl_next::FromWireRef<crate::wire::Color<'de>> for Color {
154        #[inline]
155        fn from_wire_ref(wire: &crate::wire::Color<'de>) -> Self {
156            Self {
157                id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
158
159                name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
160            }
161        }
162    }
163
164    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
165    pub struct EchoEchoStringRequest {
166        pub value: ::std::string::String,
167    }
168
169    unsafe impl<___E> ::fidl_next::Encode<crate::wire::EchoEchoStringRequest<'static>, ___E>
170        for EchoEchoStringRequest
171    where
172        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
173        ___E: ::fidl_next::Encoder,
174    {
175        #[inline]
176        fn encode(
177            self,
178            encoder_: &mut ___E,
179            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringRequest<'static>>,
180            _: (),
181        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
182            ::fidl_next::munge! {
183                let crate::wire::EchoEchoStringRequest {
184                    value,
185
186                } = out_;
187            }
188
189            ::fidl_next::Encode::encode(self.value, encoder_, value, 32)?;
190
191            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
192            ::fidl_next::Constrained::validate(_field, 32)?;
193
194            Ok(())
195        }
196    }
197
198    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EchoEchoStringRequest<'static>, ___E>
199        for &'a EchoEchoStringRequest
200    where
201        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
202        ___E: ::fidl_next::Encoder,
203    {
204        #[inline]
205        fn encode(
206            self,
207            encoder_: &mut ___E,
208            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringRequest<'static>>,
209            _: (),
210        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
211            ::fidl_next::munge! {
212                let crate::wire::EchoEchoStringRequest {
213                    value,
214
215                } = out_;
216            }
217
218            ::fidl_next::Encode::encode(&self.value, encoder_, value, 32)?;
219
220            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
221            ::fidl_next::Constrained::validate(_field, 32)?;
222
223            Ok(())
224        }
225    }
226
227    unsafe impl<___E>
228        ::fidl_next::EncodeOption<
229            ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringRequest<'static>>,
230            ___E,
231        > for EchoEchoStringRequest
232    where
233        ___E: ::fidl_next::Encoder + ?Sized,
234        EchoEchoStringRequest:
235            ::fidl_next::Encode<crate::wire::EchoEchoStringRequest<'static>, ___E>,
236    {
237        #[inline]
238        fn encode_option(
239            this: ::core::option::Option<Self>,
240            encoder: &mut ___E,
241            out: &mut ::core::mem::MaybeUninit<
242                ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringRequest<'static>>,
243            >,
244            _: (),
245        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
246            if let Some(inner) = this {
247                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
248                ::fidl_next::wire::Box::encode_present(out);
249            } else {
250                ::fidl_next::wire::Box::encode_absent(out);
251            }
252
253            Ok(())
254        }
255    }
256
257    unsafe impl<'a, ___E>
258        ::fidl_next::EncodeOption<
259            ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringRequest<'static>>,
260            ___E,
261        > for &'a EchoEchoStringRequest
262    where
263        ___E: ::fidl_next::Encoder + ?Sized,
264        &'a EchoEchoStringRequest:
265            ::fidl_next::Encode<crate::wire::EchoEchoStringRequest<'static>, ___E>,
266    {
267        #[inline]
268        fn encode_option(
269            this: ::core::option::Option<Self>,
270            encoder: &mut ___E,
271            out: &mut ::core::mem::MaybeUninit<
272                ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringRequest<'static>>,
273            >,
274            _: (),
275        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
276            if let Some(inner) = this {
277                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
278                ::fidl_next::wire::Box::encode_present(out);
279            } else {
280                ::fidl_next::wire::Box::encode_absent(out);
281            }
282
283            Ok(())
284        }
285    }
286
287    impl<'de> ::fidl_next::FromWire<crate::wire::EchoEchoStringRequest<'de>> for EchoEchoStringRequest {
288        #[inline]
289        fn from_wire(wire: crate::wire::EchoEchoStringRequest<'de>) -> Self {
290            Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
291        }
292    }
293
294    impl<'de> ::fidl_next::FromWireRef<crate::wire::EchoEchoStringRequest<'de>>
295        for EchoEchoStringRequest
296    {
297        #[inline]
298        fn from_wire_ref(wire: &crate::wire::EchoEchoStringRequest<'de>) -> Self {
299            Self { value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value) }
300        }
301    }
302
303    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
304    pub struct EchoEchoStringResponse {
305        pub response: ::std::string::String,
306    }
307
308    unsafe impl<___E> ::fidl_next::Encode<crate::wire::EchoEchoStringResponse<'static>, ___E>
309        for EchoEchoStringResponse
310    where
311        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
312        ___E: ::fidl_next::Encoder,
313    {
314        #[inline]
315        fn encode(
316            self,
317            encoder_: &mut ___E,
318            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringResponse<'static>>,
319            _: (),
320        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
321            ::fidl_next::munge! {
322                let crate::wire::EchoEchoStringResponse {
323                    response,
324
325                } = out_;
326            }
327
328            ::fidl_next::Encode::encode(self.response, encoder_, response, 32)?;
329
330            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
331            ::fidl_next::Constrained::validate(_field, 32)?;
332
333            Ok(())
334        }
335    }
336
337    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EchoEchoStringResponse<'static>, ___E>
338        for &'a EchoEchoStringResponse
339    where
340        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
341        ___E: ::fidl_next::Encoder,
342    {
343        #[inline]
344        fn encode(
345            self,
346            encoder_: &mut ___E,
347            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringResponse<'static>>,
348            _: (),
349        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
350            ::fidl_next::munge! {
351                let crate::wire::EchoEchoStringResponse {
352                    response,
353
354                } = out_;
355            }
356
357            ::fidl_next::Encode::encode(&self.response, encoder_, response, 32)?;
358
359            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
360            ::fidl_next::Constrained::validate(_field, 32)?;
361
362            Ok(())
363        }
364    }
365
366    unsafe impl<___E>
367        ::fidl_next::EncodeOption<
368            ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringResponse<'static>>,
369            ___E,
370        > for EchoEchoStringResponse
371    where
372        ___E: ::fidl_next::Encoder + ?Sized,
373        EchoEchoStringResponse:
374            ::fidl_next::Encode<crate::wire::EchoEchoStringResponse<'static>, ___E>,
375    {
376        #[inline]
377        fn encode_option(
378            this: ::core::option::Option<Self>,
379            encoder: &mut ___E,
380            out: &mut ::core::mem::MaybeUninit<
381                ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringResponse<'static>>,
382            >,
383            _: (),
384        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
385            if let Some(inner) = this {
386                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
387                ::fidl_next::wire::Box::encode_present(out);
388            } else {
389                ::fidl_next::wire::Box::encode_absent(out);
390            }
391
392            Ok(())
393        }
394    }
395
396    unsafe impl<'a, ___E>
397        ::fidl_next::EncodeOption<
398            ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringResponse<'static>>,
399            ___E,
400        > for &'a EchoEchoStringResponse
401    where
402        ___E: ::fidl_next::Encoder + ?Sized,
403        &'a EchoEchoStringResponse:
404            ::fidl_next::Encode<crate::wire::EchoEchoStringResponse<'static>, ___E>,
405    {
406        #[inline]
407        fn encode_option(
408            this: ::core::option::Option<Self>,
409            encoder: &mut ___E,
410            out: &mut ::core::mem::MaybeUninit<
411                ::fidl_next::wire::Box<'static, crate::wire::EchoEchoStringResponse<'static>>,
412            >,
413            _: (),
414        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
415            if let Some(inner) = this {
416                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
417                ::fidl_next::wire::Box::encode_present(out);
418            } else {
419                ::fidl_next::wire::Box::encode_absent(out);
420            }
421
422            Ok(())
423        }
424    }
425
426    impl<'de> ::fidl_next::FromWire<crate::wire::EchoEchoStringResponse<'de>>
427        for EchoEchoStringResponse
428    {
429        #[inline]
430        fn from_wire(wire: crate::wire::EchoEchoStringResponse<'de>) -> Self {
431            Self { response: ::fidl_next::FromWire::from_wire(wire.response) }
432        }
433    }
434
435    impl<'de> ::fidl_next::FromWireRef<crate::wire::EchoEchoStringResponse<'de>>
436        for EchoEchoStringResponse
437    {
438        #[inline]
439        fn from_wire_ref(wire: &crate::wire::EchoEchoStringResponse<'de>) -> Self {
440            Self { response: ::fidl_next::FromWireRef::from_wire_ref(&wire.response) }
441        }
442    }
443
444    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
445    pub struct EchoSendStringRequest {
446        pub value: ::std::string::String,
447    }
448
449    unsafe impl<___E> ::fidl_next::Encode<crate::wire::EchoSendStringRequest<'static>, ___E>
450        for EchoSendStringRequest
451    where
452        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
453        ___E: ::fidl_next::Encoder,
454    {
455        #[inline]
456        fn encode(
457            self,
458            encoder_: &mut ___E,
459            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoSendStringRequest<'static>>,
460            _: (),
461        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
462            ::fidl_next::munge! {
463                let crate::wire::EchoSendStringRequest {
464                    value,
465
466                } = out_;
467            }
468
469            ::fidl_next::Encode::encode(self.value, encoder_, value, 32)?;
470
471            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
472            ::fidl_next::Constrained::validate(_field, 32)?;
473
474            Ok(())
475        }
476    }
477
478    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EchoSendStringRequest<'static>, ___E>
479        for &'a EchoSendStringRequest
480    where
481        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
482        ___E: ::fidl_next::Encoder,
483    {
484        #[inline]
485        fn encode(
486            self,
487            encoder_: &mut ___E,
488            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoSendStringRequest<'static>>,
489            _: (),
490        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
491            ::fidl_next::munge! {
492                let crate::wire::EchoSendStringRequest {
493                    value,
494
495                } = out_;
496            }
497
498            ::fidl_next::Encode::encode(&self.value, encoder_, value, 32)?;
499
500            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
501            ::fidl_next::Constrained::validate(_field, 32)?;
502
503            Ok(())
504        }
505    }
506
507    unsafe impl<___E>
508        ::fidl_next::EncodeOption<
509            ::fidl_next::wire::Box<'static, crate::wire::EchoSendStringRequest<'static>>,
510            ___E,
511        > for EchoSendStringRequest
512    where
513        ___E: ::fidl_next::Encoder + ?Sized,
514        EchoSendStringRequest:
515            ::fidl_next::Encode<crate::wire::EchoSendStringRequest<'static>, ___E>,
516    {
517        #[inline]
518        fn encode_option(
519            this: ::core::option::Option<Self>,
520            encoder: &mut ___E,
521            out: &mut ::core::mem::MaybeUninit<
522                ::fidl_next::wire::Box<'static, crate::wire::EchoSendStringRequest<'static>>,
523            >,
524            _: (),
525        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
526            if let Some(inner) = this {
527                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
528                ::fidl_next::wire::Box::encode_present(out);
529            } else {
530                ::fidl_next::wire::Box::encode_absent(out);
531            }
532
533            Ok(())
534        }
535    }
536
537    unsafe impl<'a, ___E>
538        ::fidl_next::EncodeOption<
539            ::fidl_next::wire::Box<'static, crate::wire::EchoSendStringRequest<'static>>,
540            ___E,
541        > for &'a EchoSendStringRequest
542    where
543        ___E: ::fidl_next::Encoder + ?Sized,
544        &'a EchoSendStringRequest:
545            ::fidl_next::Encode<crate::wire::EchoSendStringRequest<'static>, ___E>,
546    {
547        #[inline]
548        fn encode_option(
549            this: ::core::option::Option<Self>,
550            encoder: &mut ___E,
551            out: &mut ::core::mem::MaybeUninit<
552                ::fidl_next::wire::Box<'static, crate::wire::EchoSendStringRequest<'static>>,
553            >,
554            _: (),
555        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
556            if let Some(inner) = this {
557                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
558                ::fidl_next::wire::Box::encode_present(out);
559            } else {
560                ::fidl_next::wire::Box::encode_absent(out);
561            }
562
563            Ok(())
564        }
565    }
566
567    impl<'de> ::fidl_next::FromWire<crate::wire::EchoSendStringRequest<'de>> for EchoSendStringRequest {
568        #[inline]
569        fn from_wire(wire: crate::wire::EchoSendStringRequest<'de>) -> Self {
570            Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
571        }
572    }
573
574    impl<'de> ::fidl_next::FromWireRef<crate::wire::EchoSendStringRequest<'de>>
575        for EchoSendStringRequest
576    {
577        #[inline]
578        fn from_wire_ref(wire: &crate::wire::EchoSendStringRequest<'de>) -> Self {
579            Self { value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value) }
580        }
581    }
582
583    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
584    pub struct EchoOnStringRequest {
585        pub response: ::std::string::String,
586    }
587
588    unsafe impl<___E> ::fidl_next::Encode<crate::wire::EchoOnStringRequest<'static>, ___E>
589        for EchoOnStringRequest
590    where
591        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
592        ___E: ::fidl_next::Encoder,
593    {
594        #[inline]
595        fn encode(
596            self,
597            encoder_: &mut ___E,
598            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoOnStringRequest<'static>>,
599            _: (),
600        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
601            ::fidl_next::munge! {
602                let crate::wire::EchoOnStringRequest {
603                    response,
604
605                } = out_;
606            }
607
608            ::fidl_next::Encode::encode(self.response, encoder_, response, 32)?;
609
610            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
611            ::fidl_next::Constrained::validate(_field, 32)?;
612
613            Ok(())
614        }
615    }
616
617    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EchoOnStringRequest<'static>, ___E>
618        for &'a EchoOnStringRequest
619    where
620        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
621        ___E: ::fidl_next::Encoder,
622    {
623        #[inline]
624        fn encode(
625            self,
626            encoder_: &mut ___E,
627            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoOnStringRequest<'static>>,
628            _: (),
629        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
630            ::fidl_next::munge! {
631                let crate::wire::EchoOnStringRequest {
632                    response,
633
634                } = out_;
635            }
636
637            ::fidl_next::Encode::encode(&self.response, encoder_, response, 32)?;
638
639            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(response.as_mut_ptr()) };
640            ::fidl_next::Constrained::validate(_field, 32)?;
641
642            Ok(())
643        }
644    }
645
646    unsafe impl<___E>
647        ::fidl_next::EncodeOption<
648            ::fidl_next::wire::Box<'static, crate::wire::EchoOnStringRequest<'static>>,
649            ___E,
650        > for EchoOnStringRequest
651    where
652        ___E: ::fidl_next::Encoder + ?Sized,
653        EchoOnStringRequest: ::fidl_next::Encode<crate::wire::EchoOnStringRequest<'static>, ___E>,
654    {
655        #[inline]
656        fn encode_option(
657            this: ::core::option::Option<Self>,
658            encoder: &mut ___E,
659            out: &mut ::core::mem::MaybeUninit<
660                ::fidl_next::wire::Box<'static, crate::wire::EchoOnStringRequest<'static>>,
661            >,
662            _: (),
663        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
664            if let Some(inner) = this {
665                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
666                ::fidl_next::wire::Box::encode_present(out);
667            } else {
668                ::fidl_next::wire::Box::encode_absent(out);
669            }
670
671            Ok(())
672        }
673    }
674
675    unsafe impl<'a, ___E>
676        ::fidl_next::EncodeOption<
677            ::fidl_next::wire::Box<'static, crate::wire::EchoOnStringRequest<'static>>,
678            ___E,
679        > for &'a EchoOnStringRequest
680    where
681        ___E: ::fidl_next::Encoder + ?Sized,
682        &'a EchoOnStringRequest:
683            ::fidl_next::Encode<crate::wire::EchoOnStringRequest<'static>, ___E>,
684    {
685        #[inline]
686        fn encode_option(
687            this: ::core::option::Option<Self>,
688            encoder: &mut ___E,
689            out: &mut ::core::mem::MaybeUninit<
690                ::fidl_next::wire::Box<'static, crate::wire::EchoOnStringRequest<'static>>,
691            >,
692            _: (),
693        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
694            if let Some(inner) = this {
695                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
696                ::fidl_next::wire::Box::encode_present(out);
697            } else {
698                ::fidl_next::wire::Box::encode_absent(out);
699            }
700
701            Ok(())
702        }
703    }
704
705    impl<'de> ::fidl_next::FromWire<crate::wire::EchoOnStringRequest<'de>> for EchoOnStringRequest {
706        #[inline]
707        fn from_wire(wire: crate::wire::EchoOnStringRequest<'de>) -> Self {
708            Self { response: ::fidl_next::FromWire::from_wire(wire.response) }
709        }
710    }
711
712    impl<'de> ::fidl_next::FromWireRef<crate::wire::EchoOnStringRequest<'de>> for EchoOnStringRequest {
713        #[inline]
714        fn from_wire_ref(wire: &crate::wire::EchoOnStringRequest<'de>) -> Self {
715            Self { response: ::fidl_next::FromWireRef::from_wire_ref(&wire.response) }
716        }
717    }
718
719    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
720    pub struct EchoLauncherGetEchoRequest {
721        pub echo_prefix: ::std::string::String,
722    }
723
724    unsafe impl<___E> ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoRequest<'static>, ___E>
725        for EchoLauncherGetEchoRequest
726    where
727        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
728        ___E: ::fidl_next::Encoder,
729    {
730        #[inline]
731        fn encode(
732            self,
733            encoder_: &mut ___E,
734            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoRequest<'static>>,
735            _: (),
736        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
737            ::fidl_next::munge! {
738                let crate::wire::EchoLauncherGetEchoRequest {
739                    echo_prefix,
740
741                } = out_;
742            }
743
744            ::fidl_next::Encode::encode(self.echo_prefix, encoder_, echo_prefix, 32)?;
745
746            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(echo_prefix.as_mut_ptr()) };
747            ::fidl_next::Constrained::validate(_field, 32)?;
748
749            Ok(())
750        }
751    }
752
753    unsafe impl<'a, ___E>
754        ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoRequest<'static>, ___E>
755        for &'a EchoLauncherGetEchoRequest
756    where
757        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
758        ___E: ::fidl_next::Encoder,
759    {
760        #[inline]
761        fn encode(
762            self,
763            encoder_: &mut ___E,
764            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoRequest<'static>>,
765            _: (),
766        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
767            ::fidl_next::munge! {
768                let crate::wire::EchoLauncherGetEchoRequest {
769                    echo_prefix,
770
771                } = out_;
772            }
773
774            ::fidl_next::Encode::encode(&self.echo_prefix, encoder_, echo_prefix, 32)?;
775
776            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(echo_prefix.as_mut_ptr()) };
777            ::fidl_next::Constrained::validate(_field, 32)?;
778
779            Ok(())
780        }
781    }
782
783    unsafe impl<___E>
784        ::fidl_next::EncodeOption<
785            ::fidl_next::wire::Box<'static, crate::wire::EchoLauncherGetEchoRequest<'static>>,
786            ___E,
787        > for EchoLauncherGetEchoRequest
788    where
789        ___E: ::fidl_next::Encoder + ?Sized,
790        EchoLauncherGetEchoRequest:
791            ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoRequest<'static>, ___E>,
792    {
793        #[inline]
794        fn encode_option(
795            this: ::core::option::Option<Self>,
796            encoder: &mut ___E,
797            out: &mut ::core::mem::MaybeUninit<
798                ::fidl_next::wire::Box<'static, crate::wire::EchoLauncherGetEchoRequest<'static>>,
799            >,
800            _: (),
801        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
802            if let Some(inner) = this {
803                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
804                ::fidl_next::wire::Box::encode_present(out);
805            } else {
806                ::fidl_next::wire::Box::encode_absent(out);
807            }
808
809            Ok(())
810        }
811    }
812
813    unsafe impl<'a, ___E>
814        ::fidl_next::EncodeOption<
815            ::fidl_next::wire::Box<'static, crate::wire::EchoLauncherGetEchoRequest<'static>>,
816            ___E,
817        > for &'a EchoLauncherGetEchoRequest
818    where
819        ___E: ::fidl_next::Encoder + ?Sized,
820        &'a EchoLauncherGetEchoRequest:
821            ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoRequest<'static>, ___E>,
822    {
823        #[inline]
824        fn encode_option(
825            this: ::core::option::Option<Self>,
826            encoder: &mut ___E,
827            out: &mut ::core::mem::MaybeUninit<
828                ::fidl_next::wire::Box<'static, crate::wire::EchoLauncherGetEchoRequest<'static>>,
829            >,
830            _: (),
831        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
832            if let Some(inner) = this {
833                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
834                ::fidl_next::wire::Box::encode_present(out);
835            } else {
836                ::fidl_next::wire::Box::encode_absent(out);
837            }
838
839            Ok(())
840        }
841    }
842
843    impl<'de> ::fidl_next::FromWire<crate::wire::EchoLauncherGetEchoRequest<'de>>
844        for EchoLauncherGetEchoRequest
845    {
846        #[inline]
847        fn from_wire(wire: crate::wire::EchoLauncherGetEchoRequest<'de>) -> Self {
848            Self { echo_prefix: ::fidl_next::FromWire::from_wire(wire.echo_prefix) }
849        }
850    }
851
852    impl<'de> ::fidl_next::FromWireRef<crate::wire::EchoLauncherGetEchoRequest<'de>>
853        for EchoLauncherGetEchoRequest
854    {
855        #[inline]
856        fn from_wire_ref(wire: &crate::wire::EchoLauncherGetEchoRequest<'de>) -> Self {
857            Self { echo_prefix: ::fidl_next::FromWireRef::from_wire_ref(&wire.echo_prefix) }
858        }
859    }
860
861    ::fidl_next::bitflags::bitflags! {
862        #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct FileMode: u16 {
863            const READ = 1;
864            const WRITE = 2;
865            const EXECUTE = 4;
866
867        }
868    }
869
870    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FileMode, ___E> for FileMode
871    where
872        ___E: ?Sized,
873    {
874        #[inline]
875        fn encode(
876            self,
877            encoder: &mut ___E,
878            out: &mut ::core::mem::MaybeUninit<crate::wire::FileMode>,
879            _: (),
880        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
881            ::fidl_next::Encode::encode(&self, encoder, out, ())
882        }
883    }
884
885    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FileMode, ___E> for &'a FileMode
886    where
887        ___E: ?Sized,
888    {
889        #[inline]
890        fn encode(
891            self,
892            _: &mut ___E,
893            out: &mut ::core::mem::MaybeUninit<crate::wire::FileMode>,
894            _: (),
895        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
896            ::fidl_next::munge!(let crate::wire::FileMode { value } = out);
897
898            if ::fidl_next::bitflags::Flags::contains_unknown_bits(self) {
899                return Err(::fidl_next::EncodeError::InvalidStrictBits);
900            }
901
902            let _ = value.write(::fidl_next::wire::Uint16::from(self.bits()));
903            Ok(())
904        }
905    }
906
907    impl ::core::convert::From<crate::wire::FileMode> for FileMode {
908        fn from(wire: crate::wire::FileMode) -> Self {
909            Self::from_bits_retain(u16::from(wire.value))
910        }
911    }
912
913    impl ::fidl_next::FromWire<crate::wire::FileMode> for FileMode {
914        #[inline]
915        fn from_wire(wire: crate::wire::FileMode) -> Self {
916            Self::from(wire)
917        }
918    }
919
920    impl ::fidl_next::FromWireRef<crate::wire::FileMode> for FileMode {
921        #[inline]
922        fn from_wire_ref(wire: &crate::wire::FileMode) -> Self {
923            Self::from(*wire)
924        }
925    }
926
927    ::fidl_next::bitflags::bitflags! {
928        #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct FlexibleFileMode: u16 {
929            const READ = 1;
930            const WRITE = 2;
931            const EXECUTE = 4;
932            const _ = !0;
933        }
934    }
935
936    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FlexibleFileMode, ___E> for FlexibleFileMode
937    where
938        ___E: ?Sized,
939    {
940        #[inline]
941        fn encode(
942            self,
943            encoder: &mut ___E,
944            out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleFileMode>,
945            _: (),
946        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
947            ::fidl_next::Encode::encode(&self, encoder, out, ())
948        }
949    }
950
951    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FlexibleFileMode, ___E>
952        for &'a FlexibleFileMode
953    where
954        ___E: ?Sized,
955    {
956        #[inline]
957        fn encode(
958            self,
959            _: &mut ___E,
960            out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleFileMode>,
961            _: (),
962        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
963            ::fidl_next::munge!(let crate::wire::FlexibleFileMode { value } = out);
964
965            let _ = value.write(::fidl_next::wire::Uint16::from(self.bits()));
966            Ok(())
967        }
968    }
969
970    impl ::core::convert::From<crate::wire::FlexibleFileMode> for FlexibleFileMode {
971        fn from(wire: crate::wire::FlexibleFileMode) -> Self {
972            Self::from_bits_retain(u16::from(wire.value))
973        }
974    }
975
976    impl ::fidl_next::FromWire<crate::wire::FlexibleFileMode> for FlexibleFileMode {
977        #[inline]
978        fn from_wire(wire: crate::wire::FlexibleFileMode) -> Self {
979            Self::from(wire)
980        }
981    }
982
983    impl ::fidl_next::FromWireRef<crate::wire::FlexibleFileMode> for FlexibleFileMode {
984        #[inline]
985        fn from_wire_ref(wire: &crate::wire::FlexibleFileMode) -> Self {
986            Self::from(*wire)
987        }
988    }
989
990    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
991    pub enum FlexibleJsonValue {
992        IntValue(i32),
993
994        StringValue(::std::string::String),
995
996        UnknownOrdinal_(u64),
997    }
998
999    impl FlexibleJsonValue {
1000        pub fn is_unknown(&self) -> bool {
1001            #[allow(unreachable_patterns)]
1002            match self {
1003                Self::UnknownOrdinal_(_) => true,
1004                _ => false,
1005            }
1006        }
1007    }
1008
1009    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FlexibleJsonValue<'static>, ___E>
1010        for FlexibleJsonValue
1011    where
1012        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1013        ___E: ::fidl_next::Encoder,
1014    {
1015        #[inline]
1016        fn encode(
1017            self,
1018            encoder: &mut ___E,
1019            out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleJsonValue<'static>>,
1020            _: (),
1021        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1022            ::fidl_next::munge!(let crate::wire::FlexibleJsonValue { raw, _phantom: _ } = out);
1023
1024            match self {
1025                Self::IntValue(value) => ::fidl_next::wire::Union::encode_as::<
1026                    ___E,
1027                    ::fidl_next::wire::Int32,
1028                >(value, 1, encoder, raw, ())?,
1029
1030                Self::StringValue(value) => ::fidl_next::wire::Union::encode_as::<
1031                    ___E,
1032                    ::fidl_next::wire::String<'static>,
1033                >(value, 2, encoder, raw, 32)?,
1034
1035                Self::UnknownOrdinal_(ordinal) => {
1036                    return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
1037                }
1038            }
1039
1040            Ok(())
1041        }
1042    }
1043
1044    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FlexibleJsonValue<'static>, ___E>
1045        for &'a FlexibleJsonValue
1046    where
1047        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1048        ___E: ::fidl_next::Encoder,
1049    {
1050        #[inline]
1051        fn encode(
1052            self,
1053            encoder: &mut ___E,
1054            out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleJsonValue<'static>>,
1055            _: (),
1056        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1057            ::fidl_next::munge!(let crate::wire::FlexibleJsonValue { raw, _phantom: _ } = out);
1058
1059            match self {
1060                FlexibleJsonValue::IntValue(value) => ::fidl_next::wire::Union::encode_as::<
1061                    ___E,
1062                    ::fidl_next::wire::Int32,
1063                >(value, 1, encoder, raw, ())?,
1064
1065                FlexibleJsonValue::StringValue(value) => {
1066                    ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
1067                        value, 2, encoder, raw, 32,
1068                    )?
1069                }
1070
1071                FlexibleJsonValue::UnknownOrdinal_(ordinal) => {
1072                    return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
1073                }
1074            }
1075
1076            Ok(())
1077        }
1078    }
1079
1080    unsafe impl<___E>
1081        ::fidl_next::EncodeOption<crate::wire_optional::FlexibleJsonValue<'static>, ___E>
1082        for FlexibleJsonValue
1083    where
1084        ___E: ?Sized,
1085        FlexibleJsonValue: ::fidl_next::Encode<crate::wire::FlexibleJsonValue<'static>, ___E>,
1086    {
1087        #[inline]
1088        fn encode_option(
1089            this: ::core::option::Option<Self>,
1090            encoder: &mut ___E,
1091            out: &mut ::core::mem::MaybeUninit<crate::wire_optional::FlexibleJsonValue<'static>>,
1092            _: (),
1093        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1094            ::fidl_next::munge!(let crate::wire_optional::FlexibleJsonValue { raw, _phantom: _ } = &mut *out);
1095
1096            if let Some(inner) = this {
1097                let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1098                ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1099            } else {
1100                ::fidl_next::wire::Union::encode_absent(raw);
1101            }
1102
1103            Ok(())
1104        }
1105    }
1106
1107    unsafe impl<'a, ___E>
1108        ::fidl_next::EncodeOption<crate::wire_optional::FlexibleJsonValue<'static>, ___E>
1109        for &'a FlexibleJsonValue
1110    where
1111        ___E: ?Sized,
1112        &'a FlexibleJsonValue: ::fidl_next::Encode<crate::wire::FlexibleJsonValue<'static>, ___E>,
1113    {
1114        #[inline]
1115        fn encode_option(
1116            this: ::core::option::Option<Self>,
1117            encoder: &mut ___E,
1118            out: &mut ::core::mem::MaybeUninit<crate::wire_optional::FlexibleJsonValue<'static>>,
1119            _: (),
1120        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1121            ::fidl_next::munge!(let crate::wire_optional::FlexibleJsonValue { raw, _phantom: _ } = &mut *out);
1122
1123            if let Some(inner) = this {
1124                let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1125                ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1126            } else {
1127                ::fidl_next::wire::Union::encode_absent(raw);
1128            }
1129
1130            Ok(())
1131        }
1132    }
1133
1134    impl<'de> ::fidl_next::FromWire<crate::wire::FlexibleJsonValue<'de>> for FlexibleJsonValue {
1135        #[inline]
1136        fn from_wire(wire: crate::wire::FlexibleJsonValue<'de>) -> Self {
1137            let wire = ::core::mem::ManuallyDrop::new(wire);
1138            match wire.raw.ordinal() {
1139                1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
1140                    wire.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
1141                })),
1142
1143                2 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
1144                    wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
1145                })),
1146
1147                ord => return Self::UnknownOrdinal_(ord as u64),
1148            }
1149        }
1150    }
1151
1152    impl<'de> ::fidl_next::FromWireRef<crate::wire::FlexibleJsonValue<'de>> for FlexibleJsonValue {
1153        #[inline]
1154        fn from_wire_ref(wire: &crate::wire::FlexibleJsonValue<'de>) -> Self {
1155            match wire.raw.ordinal() {
1156                1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1157                    wire.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
1158                })),
1159
1160                2 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1161                    wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
1162                })),
1163
1164                ord => return Self::UnknownOrdinal_(ord as u64),
1165            }
1166        }
1167    }
1168
1169    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::FlexibleJsonValue<'de>>
1170        for FlexibleJsonValue
1171    {
1172        #[inline]
1173        fn from_wire_option(
1174            wire: crate::wire_optional::FlexibleJsonValue<'de>,
1175        ) -> ::core::option::Option<Self> {
1176            if let Some(inner) = wire.into_option() {
1177                Some(::fidl_next::FromWire::from_wire(inner))
1178            } else {
1179                None
1180            }
1181        }
1182    }
1183
1184    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::FlexibleJsonValue<'de>>
1185        for Box<FlexibleJsonValue>
1186    {
1187        #[inline]
1188        fn from_wire_option(
1189            wire: crate::wire_optional::FlexibleJsonValue<'de>,
1190        ) -> ::core::option::Option<Self> {
1191            <FlexibleJsonValue as ::fidl_next::FromWireOption<
1192                crate::wire_optional::FlexibleJsonValue<'de>,
1193            >>::from_wire_option(wire)
1194            .map(Box::new)
1195        }
1196    }
1197
1198    impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::FlexibleJsonValue<'de>>
1199        for Box<FlexibleJsonValue>
1200    {
1201        #[inline]
1202        fn from_wire_option_ref(
1203            wire: &crate::wire_optional::FlexibleJsonValue<'de>,
1204        ) -> ::core::option::Option<Self> {
1205            if let Some(inner) = wire.as_ref() {
1206                Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1207            } else {
1208                None
1209            }
1210        }
1211    }
1212
1213    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1214    #[repr(u32)]
1215    pub enum FlexibleLocationType {
1216        Museum = 1,
1217        Airport = 2,
1218        Restaurant = 3,
1219        UnknownOrdinal_(u32) = 4,
1220    }
1221    impl ::std::convert::From<u32> for FlexibleLocationType {
1222        fn from(value: u32) -> Self {
1223            match value {
1224                1 => Self::Museum,
1225                2 => Self::Airport,
1226                3 => Self::Restaurant,
1227
1228                _ => Self::UnknownOrdinal_(value),
1229            }
1230        }
1231    }
1232
1233    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FlexibleLocationType, ___E>
1234        for FlexibleLocationType
1235    where
1236        ___E: ?Sized,
1237    {
1238        #[inline]
1239        fn encode(
1240            self,
1241            encoder: &mut ___E,
1242            out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleLocationType>,
1243            _: (),
1244        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1245            ::fidl_next::Encode::encode(&self, encoder, out, ())
1246        }
1247    }
1248
1249    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FlexibleLocationType, ___E>
1250        for &'a FlexibleLocationType
1251    where
1252        ___E: ?Sized,
1253    {
1254        #[inline]
1255        fn encode(
1256            self,
1257            encoder: &mut ___E,
1258            out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleLocationType>,
1259            _: (),
1260        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1261            ::fidl_next::munge!(let crate::wire::FlexibleLocationType { value } = out);
1262            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1263                FlexibleLocationType::Museum => 1,
1264
1265                FlexibleLocationType::Airport => 2,
1266
1267                FlexibleLocationType::Restaurant => 3,
1268
1269                FlexibleLocationType::UnknownOrdinal_(value) => value,
1270            }));
1271
1272            Ok(())
1273        }
1274    }
1275
1276    impl ::core::convert::From<crate::wire::FlexibleLocationType> for FlexibleLocationType {
1277        fn from(wire: crate::wire::FlexibleLocationType) -> Self {
1278            match u32::from(wire.value) {
1279                1 => Self::Museum,
1280
1281                2 => Self::Airport,
1282
1283                3 => Self::Restaurant,
1284
1285                value => Self::UnknownOrdinal_(value),
1286            }
1287        }
1288    }
1289
1290    impl ::fidl_next::FromWire<crate::wire::FlexibleLocationType> for FlexibleLocationType {
1291        #[inline]
1292        fn from_wire(wire: crate::wire::FlexibleLocationType) -> Self {
1293            Self::from(wire)
1294        }
1295    }
1296
1297    impl ::fidl_next::FromWireRef<crate::wire::FlexibleLocationType> for FlexibleLocationType {
1298        #[inline]
1299        fn from_wire_ref(wire: &crate::wire::FlexibleLocationType) -> Self {
1300            Self::from(*wire)
1301        }
1302    }
1303
1304    pub type GameState = ();
1305
1306    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1307    pub enum JsonValue {
1308        IntValue(i32),
1309
1310        StringValue(::std::string::String),
1311    }
1312
1313    unsafe impl<___E> ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E> for JsonValue
1314    where
1315        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1316        ___E: ::fidl_next::Encoder,
1317    {
1318        #[inline]
1319        fn encode(
1320            self,
1321            encoder: &mut ___E,
1322            out: &mut ::core::mem::MaybeUninit<crate::wire::JsonValue<'static>>,
1323            _: (),
1324        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1325            ::fidl_next::munge!(let crate::wire::JsonValue { raw, _phantom: _ } = out);
1326
1327            match self {
1328                Self::IntValue(value) => ::fidl_next::wire::Union::encode_as::<
1329                    ___E,
1330                    ::fidl_next::wire::Int32,
1331                >(value, 1, encoder, raw, ())?,
1332
1333                Self::StringValue(value) => ::fidl_next::wire::Union::encode_as::<
1334                    ___E,
1335                    ::fidl_next::wire::String<'static>,
1336                >(value, 2, encoder, raw, 32)?,
1337            }
1338
1339            Ok(())
1340        }
1341    }
1342
1343    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E> for &'a JsonValue
1344    where
1345        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1346        ___E: ::fidl_next::Encoder,
1347    {
1348        #[inline]
1349        fn encode(
1350            self,
1351            encoder: &mut ___E,
1352            out: &mut ::core::mem::MaybeUninit<crate::wire::JsonValue<'static>>,
1353            _: (),
1354        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1355            ::fidl_next::munge!(let crate::wire::JsonValue { raw, _phantom: _ } = out);
1356
1357            match self {
1358                JsonValue::IntValue(value) => ::fidl_next::wire::Union::encode_as::<
1359                    ___E,
1360                    ::fidl_next::wire::Int32,
1361                >(value, 1, encoder, raw, ())?,
1362
1363                JsonValue::StringValue(value) => ::fidl_next::wire::Union::encode_as::<
1364                    ___E,
1365                    ::fidl_next::wire::String<'static>,
1366                >(value, 2, encoder, raw, 32)?,
1367            }
1368
1369            Ok(())
1370        }
1371    }
1372
1373    unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::JsonValue<'static>, ___E>
1374        for JsonValue
1375    where
1376        ___E: ?Sized,
1377        JsonValue: ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E>,
1378    {
1379        #[inline]
1380        fn encode_option(
1381            this: ::core::option::Option<Self>,
1382            encoder: &mut ___E,
1383            out: &mut ::core::mem::MaybeUninit<crate::wire_optional::JsonValue<'static>>,
1384            _: (),
1385        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1386            ::fidl_next::munge!(let crate::wire_optional::JsonValue { raw, _phantom: _ } = &mut *out);
1387
1388            if let Some(inner) = this {
1389                let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1390                ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1391            } else {
1392                ::fidl_next::wire::Union::encode_absent(raw);
1393            }
1394
1395            Ok(())
1396        }
1397    }
1398
1399    unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::JsonValue<'static>, ___E>
1400        for &'a JsonValue
1401    where
1402        ___E: ?Sized,
1403        &'a JsonValue: ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E>,
1404    {
1405        #[inline]
1406        fn encode_option(
1407            this: ::core::option::Option<Self>,
1408            encoder: &mut ___E,
1409            out: &mut ::core::mem::MaybeUninit<crate::wire_optional::JsonValue<'static>>,
1410            _: (),
1411        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1412            ::fidl_next::munge!(let crate::wire_optional::JsonValue { raw, _phantom: _ } = &mut *out);
1413
1414            if let Some(inner) = this {
1415                let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1416                ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1417            } else {
1418                ::fidl_next::wire::Union::encode_absent(raw);
1419            }
1420
1421            Ok(())
1422        }
1423    }
1424
1425    impl<'de> ::fidl_next::FromWire<crate::wire::JsonValue<'de>> for JsonValue {
1426        #[inline]
1427        fn from_wire(wire: crate::wire::JsonValue<'de>) -> Self {
1428            let wire = ::core::mem::ManuallyDrop::new(wire);
1429            match wire.raw.ordinal() {
1430                1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
1431                    wire.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
1432                })),
1433
1434                2 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
1435                    wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
1436                })),
1437
1438                _ => unsafe { ::core::hint::unreachable_unchecked() },
1439            }
1440        }
1441    }
1442
1443    impl<'de> ::fidl_next::FromWireRef<crate::wire::JsonValue<'de>> for JsonValue {
1444        #[inline]
1445        fn from_wire_ref(wire: &crate::wire::JsonValue<'de>) -> Self {
1446            match wire.raw.ordinal() {
1447                1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1448                    wire.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
1449                })),
1450
1451                2 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1452                    wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
1453                })),
1454
1455                _ => unsafe { ::core::hint::unreachable_unchecked() },
1456            }
1457        }
1458    }
1459
1460    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::JsonValue<'de>> for JsonValue {
1461        #[inline]
1462        fn from_wire_option(
1463            wire: crate::wire_optional::JsonValue<'de>,
1464        ) -> ::core::option::Option<Self> {
1465            if let Some(inner) = wire.into_option() {
1466                Some(::fidl_next::FromWire::from_wire(inner))
1467            } else {
1468                None
1469            }
1470        }
1471    }
1472
1473    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::JsonValue<'de>> for Box<JsonValue> {
1474        #[inline]
1475        fn from_wire_option(
1476            wire: crate::wire_optional::JsonValue<'de>,
1477        ) -> ::core::option::Option<Self> {
1478            <
1479            JsonValue as ::fidl_next::FromWireOption<crate::wire_optional::JsonValue<'de>>
1480        >::from_wire_option(wire).map(Box::new)
1481        }
1482    }
1483
1484    impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::JsonValue<'de>> for Box<JsonValue> {
1485        #[inline]
1486        fn from_wire_option_ref(
1487            wire: &crate::wire_optional::JsonValue<'de>,
1488        ) -> ::core::option::Option<Self> {
1489            if let Some(inner) = wire.as_ref() {
1490                Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1491            } else {
1492                None
1493            }
1494        }
1495    }
1496
1497    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1498    #[repr(u32)]
1499    pub enum LocationType {
1500        Museum = 1,
1501        Airport = 2,
1502        Restaurant = 3,
1503    }
1504    impl ::core::convert::TryFrom<u32> for LocationType {
1505        type Error = ::fidl_next::UnknownStrictEnumMemberError;
1506        fn try_from(
1507            value: u32,
1508        ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
1509            match value {
1510                1 => Ok(Self::Museum),
1511                2 => Ok(Self::Airport),
1512                3 => Ok(Self::Restaurant),
1513
1514                _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
1515            }
1516        }
1517    }
1518
1519    unsafe impl<___E> ::fidl_next::Encode<crate::wire::LocationType, ___E> for LocationType
1520    where
1521        ___E: ?Sized,
1522    {
1523        #[inline]
1524        fn encode(
1525            self,
1526            encoder: &mut ___E,
1527            out: &mut ::core::mem::MaybeUninit<crate::wire::LocationType>,
1528            _: (),
1529        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1530            ::fidl_next::Encode::encode(&self, encoder, out, ())
1531        }
1532    }
1533
1534    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LocationType, ___E> for &'a LocationType
1535    where
1536        ___E: ?Sized,
1537    {
1538        #[inline]
1539        fn encode(
1540            self,
1541            encoder: &mut ___E,
1542            out: &mut ::core::mem::MaybeUninit<crate::wire::LocationType>,
1543            _: (),
1544        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1545            ::fidl_next::munge!(let crate::wire::LocationType { value } = out);
1546            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1547                LocationType::Museum => 1,
1548
1549                LocationType::Airport => 2,
1550
1551                LocationType::Restaurant => 3,
1552            }));
1553
1554            Ok(())
1555        }
1556    }
1557
1558    impl ::core::convert::From<crate::wire::LocationType> for LocationType {
1559        fn from(wire: crate::wire::LocationType) -> Self {
1560            match u32::from(wire.value) {
1561                1 => Self::Museum,
1562
1563                2 => Self::Airport,
1564
1565                3 => Self::Restaurant,
1566
1567                _ => unsafe { ::core::hint::unreachable_unchecked() },
1568            }
1569        }
1570    }
1571
1572    impl ::fidl_next::FromWire<crate::wire::LocationType> for LocationType {
1573        #[inline]
1574        fn from_wire(wire: crate::wire::LocationType) -> Self {
1575            Self::from(wire)
1576        }
1577    }
1578
1579    impl ::fidl_next::FromWireRef<crate::wire::LocationType> for LocationType {
1580        #[inline]
1581        fn from_wire_ref(wire: &crate::wire::LocationType) -> Self {
1582            Self::from(*wire)
1583        }
1584    }
1585
1586    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1587    #[repr(C)]
1588    pub struct TicTacToeStartGameRequest {
1589        pub start_first: bool,
1590    }
1591
1592    unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>
1593        for TicTacToeStartGameRequest
1594    where
1595        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1596    {
1597        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1598            Self,
1599            crate::wire::TicTacToeStartGameRequest,
1600        > = unsafe {
1601            ::fidl_next::CopyOptimization::enable_if(
1602                true && <bool as ::fidl_next::Encode<bool, ___E>>::COPY_OPTIMIZATION.is_enabled(),
1603            )
1604        };
1605
1606        #[inline]
1607        fn encode(
1608            self,
1609            encoder_: &mut ___E,
1610            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeStartGameRequest>,
1611            _: (),
1612        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1613            ::fidl_next::munge! {
1614                let crate::wire::TicTacToeStartGameRequest {
1615                    start_first,
1616
1617                } = out_;
1618            }
1619
1620            ::fidl_next::Encode::encode(self.start_first, encoder_, start_first, ())?;
1621
1622            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(start_first.as_mut_ptr()) };
1623
1624            Ok(())
1625        }
1626    }
1627
1628    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>
1629        for &'a TicTacToeStartGameRequest
1630    where
1631        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1632    {
1633        #[inline]
1634        fn encode(
1635            self,
1636            encoder_: &mut ___E,
1637            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeStartGameRequest>,
1638            _: (),
1639        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1640            ::fidl_next::munge! {
1641                let crate::wire::TicTacToeStartGameRequest {
1642                    start_first,
1643
1644                } = out_;
1645            }
1646
1647            ::fidl_next::Encode::encode(&self.start_first, encoder_, start_first, ())?;
1648
1649            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(start_first.as_mut_ptr()) };
1650
1651            Ok(())
1652        }
1653    }
1654
1655    unsafe impl<___E>
1656        ::fidl_next::EncodeOption<
1657            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1658            ___E,
1659        > for TicTacToeStartGameRequest
1660    where
1661        ___E: ::fidl_next::Encoder + ?Sized,
1662        TicTacToeStartGameRequest:
1663            ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>,
1664    {
1665        #[inline]
1666        fn encode_option(
1667            this: ::core::option::Option<Self>,
1668            encoder: &mut ___E,
1669            out: &mut ::core::mem::MaybeUninit<
1670                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1671            >,
1672            _: (),
1673        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1674            if let Some(inner) = this {
1675                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1676                ::fidl_next::wire::Box::encode_present(out);
1677            } else {
1678                ::fidl_next::wire::Box::encode_absent(out);
1679            }
1680
1681            Ok(())
1682        }
1683    }
1684
1685    unsafe impl<'a, ___E>
1686        ::fidl_next::EncodeOption<
1687            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1688            ___E,
1689        > for &'a TicTacToeStartGameRequest
1690    where
1691        ___E: ::fidl_next::Encoder + ?Sized,
1692        &'a TicTacToeStartGameRequest:
1693            ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>,
1694    {
1695        #[inline]
1696        fn encode_option(
1697            this: ::core::option::Option<Self>,
1698            encoder: &mut ___E,
1699            out: &mut ::core::mem::MaybeUninit<
1700                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1701            >,
1702            _: (),
1703        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1704            if let Some(inner) = this {
1705                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1706                ::fidl_next::wire::Box::encode_present(out);
1707            } else {
1708                ::fidl_next::wire::Box::encode_absent(out);
1709            }
1710
1711            Ok(())
1712        }
1713    }
1714
1715    impl ::fidl_next::FromWire<crate::wire::TicTacToeStartGameRequest> for TicTacToeStartGameRequest {
1716        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1717            crate::wire::TicTacToeStartGameRequest,
1718            Self,
1719        > = unsafe {
1720            ::fidl_next::CopyOptimization::enable_if(
1721                true && <bool as ::fidl_next::FromWire<bool>>::COPY_OPTIMIZATION.is_enabled(),
1722            )
1723        };
1724
1725        #[inline]
1726        fn from_wire(wire: crate::wire::TicTacToeStartGameRequest) -> Self {
1727            Self { start_first: ::fidl_next::FromWire::from_wire(wire.start_first) }
1728        }
1729    }
1730
1731    impl ::fidl_next::FromWireRef<crate::wire::TicTacToeStartGameRequest>
1732        for TicTacToeStartGameRequest
1733    {
1734        #[inline]
1735        fn from_wire_ref(wire: &crate::wire::TicTacToeStartGameRequest) -> Self {
1736            Self { start_first: ::fidl_next::FromWireRef::from_wire_ref(&wire.start_first) }
1737        }
1738    }
1739
1740    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1741    #[repr(C)]
1742    pub struct TicTacToeMakeMoveRequest {
1743        pub row: u8,
1744
1745        pub col: u8,
1746    }
1747
1748    unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>
1749        for TicTacToeMakeMoveRequest
1750    where
1751        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1752    {
1753        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1754            Self,
1755            crate::wire::TicTacToeMakeMoveRequest,
1756        > = unsafe {
1757            ::fidl_next::CopyOptimization::enable_if(
1758                true && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled()
1759                    && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(),
1760            )
1761        };
1762
1763        #[inline]
1764        fn encode(
1765            self,
1766            encoder_: &mut ___E,
1767            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveRequest>,
1768            _: (),
1769        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1770            ::fidl_next::munge! {
1771                let crate::wire::TicTacToeMakeMoveRequest {
1772                    row,
1773                    col,
1774
1775                } = out_;
1776            }
1777
1778            ::fidl_next::Encode::encode(self.row, encoder_, row, ())?;
1779
1780            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(row.as_mut_ptr()) };
1781
1782            ::fidl_next::Encode::encode(self.col, encoder_, col, ())?;
1783
1784            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(col.as_mut_ptr()) };
1785
1786            Ok(())
1787        }
1788    }
1789
1790    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>
1791        for &'a TicTacToeMakeMoveRequest
1792    where
1793        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1794    {
1795        #[inline]
1796        fn encode(
1797            self,
1798            encoder_: &mut ___E,
1799            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveRequest>,
1800            _: (),
1801        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1802            ::fidl_next::munge! {
1803                let crate::wire::TicTacToeMakeMoveRequest {
1804                    row,
1805                    col,
1806
1807                } = out_;
1808            }
1809
1810            ::fidl_next::Encode::encode(&self.row, encoder_, row, ())?;
1811
1812            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(row.as_mut_ptr()) };
1813
1814            ::fidl_next::Encode::encode(&self.col, encoder_, col, ())?;
1815
1816            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(col.as_mut_ptr()) };
1817
1818            Ok(())
1819        }
1820    }
1821
1822    unsafe impl<___E>
1823        ::fidl_next::EncodeOption<
1824            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1825            ___E,
1826        > for TicTacToeMakeMoveRequest
1827    where
1828        ___E: ::fidl_next::Encoder + ?Sized,
1829        TicTacToeMakeMoveRequest: ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>,
1830    {
1831        #[inline]
1832        fn encode_option(
1833            this: ::core::option::Option<Self>,
1834            encoder: &mut ___E,
1835            out: &mut ::core::mem::MaybeUninit<
1836                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1837            >,
1838            _: (),
1839        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1840            if let Some(inner) = this {
1841                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1842                ::fidl_next::wire::Box::encode_present(out);
1843            } else {
1844                ::fidl_next::wire::Box::encode_absent(out);
1845            }
1846
1847            Ok(())
1848        }
1849    }
1850
1851    unsafe impl<'a, ___E>
1852        ::fidl_next::EncodeOption<
1853            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1854            ___E,
1855        > for &'a TicTacToeMakeMoveRequest
1856    where
1857        ___E: ::fidl_next::Encoder + ?Sized,
1858        &'a TicTacToeMakeMoveRequest:
1859            ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>,
1860    {
1861        #[inline]
1862        fn encode_option(
1863            this: ::core::option::Option<Self>,
1864            encoder: &mut ___E,
1865            out: &mut ::core::mem::MaybeUninit<
1866                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1867            >,
1868            _: (),
1869        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1870            if let Some(inner) = this {
1871                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1872                ::fidl_next::wire::Box::encode_present(out);
1873            } else {
1874                ::fidl_next::wire::Box::encode_absent(out);
1875            }
1876
1877            Ok(())
1878        }
1879    }
1880
1881    impl ::fidl_next::FromWire<crate::wire::TicTacToeMakeMoveRequest> for TicTacToeMakeMoveRequest {
1882        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1883            crate::wire::TicTacToeMakeMoveRequest,
1884            Self,
1885        > = unsafe {
1886            ::fidl_next::CopyOptimization::enable_if(
1887                true && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled()
1888                    && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(),
1889            )
1890        };
1891
1892        #[inline]
1893        fn from_wire(wire: crate::wire::TicTacToeMakeMoveRequest) -> Self {
1894            Self {
1895                row: ::fidl_next::FromWire::from_wire(wire.row),
1896
1897                col: ::fidl_next::FromWire::from_wire(wire.col),
1898            }
1899        }
1900    }
1901
1902    impl ::fidl_next::FromWireRef<crate::wire::TicTacToeMakeMoveRequest> for TicTacToeMakeMoveRequest {
1903        #[inline]
1904        fn from_wire_ref(wire: &crate::wire::TicTacToeMakeMoveRequest) -> Self {
1905            Self {
1906                row: ::fidl_next::FromWireRef::from_wire_ref(&wire.row),
1907
1908                col: ::fidl_next::FromWireRef::from_wire_ref(&wire.col),
1909            }
1910        }
1911    }
1912
1913    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1914    pub struct TicTacToeMakeMoveResponse {
1915        pub success: bool,
1916
1917        pub new_state: ::core::option::Option<::std::boxed::Box<crate::natural::GameState>>,
1918    }
1919
1920    unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>
1921        for TicTacToeMakeMoveResponse
1922    where
1923        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1924        ___E: ::fidl_next::Encoder,
1925    {
1926        #[inline]
1927        fn encode(
1928            self,
1929            encoder_: &mut ___E,
1930            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveResponse<'static>>,
1931            _: (),
1932        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1933            ::fidl_next::munge! {
1934                let crate::wire::TicTacToeMakeMoveResponse {
1935                    success,
1936                    new_state,
1937
1938                } = out_;
1939            }
1940
1941            ::fidl_next::Encode::encode(self.success, encoder_, success, ())?;
1942
1943            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(success.as_mut_ptr()) };
1944
1945            ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
1946
1947            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
1948
1949            Ok(())
1950        }
1951    }
1952
1953    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>
1954        for &'a TicTacToeMakeMoveResponse
1955    where
1956        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1957        ___E: ::fidl_next::Encoder,
1958    {
1959        #[inline]
1960        fn encode(
1961            self,
1962            encoder_: &mut ___E,
1963            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveResponse<'static>>,
1964            _: (),
1965        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1966            ::fidl_next::munge! {
1967                let crate::wire::TicTacToeMakeMoveResponse {
1968                    success,
1969                    new_state,
1970
1971                } = out_;
1972            }
1973
1974            ::fidl_next::Encode::encode(&self.success, encoder_, success, ())?;
1975
1976            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(success.as_mut_ptr()) };
1977
1978            ::fidl_next::Encode::encode(&self.new_state, encoder_, new_state, ())?;
1979
1980            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
1981
1982            Ok(())
1983        }
1984    }
1985
1986    unsafe impl<___E>
1987        ::fidl_next::EncodeOption<
1988            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
1989            ___E,
1990        > for TicTacToeMakeMoveResponse
1991    where
1992        ___E: ::fidl_next::Encoder + ?Sized,
1993        TicTacToeMakeMoveResponse:
1994            ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>,
1995    {
1996        #[inline]
1997        fn encode_option(
1998            this: ::core::option::Option<Self>,
1999            encoder: &mut ___E,
2000            out: &mut ::core::mem::MaybeUninit<
2001                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
2002            >,
2003            _: (),
2004        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2005            if let Some(inner) = this {
2006                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2007                ::fidl_next::wire::Box::encode_present(out);
2008            } else {
2009                ::fidl_next::wire::Box::encode_absent(out);
2010            }
2011
2012            Ok(())
2013        }
2014    }
2015
2016    unsafe impl<'a, ___E>
2017        ::fidl_next::EncodeOption<
2018            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
2019            ___E,
2020        > for &'a TicTacToeMakeMoveResponse
2021    where
2022        ___E: ::fidl_next::Encoder + ?Sized,
2023        &'a TicTacToeMakeMoveResponse:
2024            ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>,
2025    {
2026        #[inline]
2027        fn encode_option(
2028            this: ::core::option::Option<Self>,
2029            encoder: &mut ___E,
2030            out: &mut ::core::mem::MaybeUninit<
2031                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
2032            >,
2033            _: (),
2034        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2035            if let Some(inner) = this {
2036                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2037                ::fidl_next::wire::Box::encode_present(out);
2038            } else {
2039                ::fidl_next::wire::Box::encode_absent(out);
2040            }
2041
2042            Ok(())
2043        }
2044    }
2045
2046    impl<'de> ::fidl_next::FromWire<crate::wire::TicTacToeMakeMoveResponse<'de>>
2047        for TicTacToeMakeMoveResponse
2048    {
2049        #[inline]
2050        fn from_wire(wire: crate::wire::TicTacToeMakeMoveResponse<'de>) -> Self {
2051            Self {
2052                success: ::fidl_next::FromWire::from_wire(wire.success),
2053
2054                new_state: ::fidl_next::FromWire::from_wire(wire.new_state),
2055            }
2056        }
2057    }
2058
2059    impl<'de> ::fidl_next::FromWireRef<crate::wire::TicTacToeMakeMoveResponse<'de>>
2060        for TicTacToeMakeMoveResponse
2061    {
2062        #[inline]
2063        fn from_wire_ref(wire: &crate::wire::TicTacToeMakeMoveResponse<'de>) -> Self {
2064            Self {
2065                success: ::fidl_next::FromWireRef::from_wire_ref(&wire.success),
2066
2067                new_state: ::fidl_next::FromWireRef::from_wire_ref(&wire.new_state),
2068            }
2069        }
2070    }
2071
2072    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2073    #[repr(C)]
2074    pub struct TicTacToeOnOpponentMoveRequest {
2075        pub new_state: crate::natural::GameState,
2076    }
2077
2078    unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>
2079        for TicTacToeOnOpponentMoveRequest
2080    where
2081        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2082    {
2083        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2084            Self,
2085            crate::wire::TicTacToeOnOpponentMoveRequest,
2086        > = unsafe {
2087            ::fidl_next::CopyOptimization::enable_if(
2088                true && <crate::natural::GameState as ::fidl_next::Encode<
2089                    crate::wire::GameState,
2090                    ___E,
2091                >>::COPY_OPTIMIZATION
2092                    .is_enabled(),
2093            )
2094        };
2095
2096        #[inline]
2097        fn encode(
2098            self,
2099            encoder_: &mut ___E,
2100            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeOnOpponentMoveRequest>,
2101            _: (),
2102        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2103            ::fidl_next::munge! {
2104                let crate::wire::TicTacToeOnOpponentMoveRequest {
2105                    new_state,
2106
2107                } = out_;
2108            }
2109
2110            ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
2111
2112            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
2113
2114            Ok(())
2115        }
2116    }
2117
2118    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>
2119        for &'a TicTacToeOnOpponentMoveRequest
2120    where
2121        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2122    {
2123        #[inline]
2124        fn encode(
2125            self,
2126            encoder_: &mut ___E,
2127            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeOnOpponentMoveRequest>,
2128            _: (),
2129        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2130            ::fidl_next::munge! {
2131                let crate::wire::TicTacToeOnOpponentMoveRequest {
2132                    new_state,
2133
2134                } = out_;
2135            }
2136
2137            ::fidl_next::Encode::encode(&self.new_state, encoder_, new_state, ())?;
2138
2139            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
2140
2141            Ok(())
2142        }
2143    }
2144
2145    unsafe impl<___E>
2146        ::fidl_next::EncodeOption<
2147            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2148            ___E,
2149        > for TicTacToeOnOpponentMoveRequest
2150    where
2151        ___E: ::fidl_next::Encoder + ?Sized,
2152        TicTacToeOnOpponentMoveRequest:
2153            ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>,
2154    {
2155        #[inline]
2156        fn encode_option(
2157            this: ::core::option::Option<Self>,
2158            encoder: &mut ___E,
2159            out: &mut ::core::mem::MaybeUninit<
2160                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2161            >,
2162            _: (),
2163        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2164            if let Some(inner) = this {
2165                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2166                ::fidl_next::wire::Box::encode_present(out);
2167            } else {
2168                ::fidl_next::wire::Box::encode_absent(out);
2169            }
2170
2171            Ok(())
2172        }
2173    }
2174
2175    unsafe impl<'a, ___E>
2176        ::fidl_next::EncodeOption<
2177            ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2178            ___E,
2179        > for &'a TicTacToeOnOpponentMoveRequest
2180    where
2181        ___E: ::fidl_next::Encoder + ?Sized,
2182        &'a TicTacToeOnOpponentMoveRequest:
2183            ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>,
2184    {
2185        #[inline]
2186        fn encode_option(
2187            this: ::core::option::Option<Self>,
2188            encoder: &mut ___E,
2189            out: &mut ::core::mem::MaybeUninit<
2190                ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2191            >,
2192            _: (),
2193        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2194            if let Some(inner) = this {
2195                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2196                ::fidl_next::wire::Box::encode_present(out);
2197            } else {
2198                ::fidl_next::wire::Box::encode_absent(out);
2199            }
2200
2201            Ok(())
2202        }
2203    }
2204
2205    impl ::fidl_next::FromWire<crate::wire::TicTacToeOnOpponentMoveRequest>
2206        for TicTacToeOnOpponentMoveRequest
2207    {
2208        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2209            crate::wire::TicTacToeOnOpponentMoveRequest,
2210            Self,
2211        > = unsafe {
2212            ::fidl_next::CopyOptimization::enable_if(
2213                true && <crate::natural::GameState as ::fidl_next::FromWire<
2214                    crate::wire::GameState,
2215                >>::COPY_OPTIMIZATION
2216                    .is_enabled(),
2217            )
2218        };
2219
2220        #[inline]
2221        fn from_wire(wire: crate::wire::TicTacToeOnOpponentMoveRequest) -> Self {
2222            Self { new_state: ::fidl_next::FromWire::from_wire(wire.new_state) }
2223        }
2224    }
2225
2226    impl ::fidl_next::FromWireRef<crate::wire::TicTacToeOnOpponentMoveRequest>
2227        for TicTacToeOnOpponentMoveRequest
2228    {
2229        #[inline]
2230        fn from_wire_ref(wire: &crate::wire::TicTacToeOnOpponentMoveRequest) -> Self {
2231            Self { new_state: ::fidl_next::FromWireRef::from_wire_ref(&wire.new_state) }
2232        }
2233    }
2234
2235    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2236    pub struct User {
2237        pub age: ::core::option::Option<u8>,
2238
2239        pub name: ::core::option::Option<::std::string::String>,
2240    }
2241
2242    impl User {
2243        fn __max_ordinal(&self) -> usize {
2244            if self.name.is_some() {
2245                return 2;
2246            }
2247
2248            if self.age.is_some() {
2249                return 1;
2250            }
2251
2252            0
2253        }
2254    }
2255
2256    unsafe impl<___E> ::fidl_next::Encode<crate::wire::User<'static>, ___E> for User
2257    where
2258        ___E: ::fidl_next::Encoder + ?Sized,
2259    {
2260        #[inline]
2261        fn encode(
2262            mut self,
2263            encoder: &mut ___E,
2264            out: &mut ::core::mem::MaybeUninit<crate::wire::User<'static>>,
2265            _: (),
2266        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2267            ::fidl_next::munge!(let crate::wire::User { table } = out);
2268
2269            let max_ord = self.__max_ordinal();
2270
2271            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2272            ::fidl_next::Wire::zero_padding(&mut out);
2273
2274            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2275                ::fidl_next::wire::Envelope,
2276            >(encoder, max_ord);
2277
2278            for i in 1..=max_ord {
2279                match i {
2280                    2 => {
2281                        if let Some(value) = self.name.take() {
2282                            ::fidl_next::wire::Envelope::encode_value::<
2283                                ::fidl_next::wire::String<'static>,
2284                                ___E,
2285                            >(
2286                                value, preallocated.encoder, &mut out, 32
2287                            )?;
2288                        } else {
2289                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2290                        }
2291                    }
2292
2293                    1 => {
2294                        if let Some(value) = self.age.take() {
2295                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
2296                                value,
2297                                preallocated.encoder,
2298                                &mut out,
2299                                (),
2300                            )?;
2301                        } else {
2302                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2303                        }
2304                    }
2305
2306                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2307                }
2308                unsafe {
2309                    preallocated.write_next(out.assume_init_ref());
2310                }
2311            }
2312
2313            ::fidl_next::wire::Table::encode_len(table, max_ord);
2314
2315            Ok(())
2316        }
2317    }
2318
2319    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::User<'static>, ___E> for &'a User
2320    where
2321        ___E: ::fidl_next::Encoder + ?Sized,
2322    {
2323        #[inline]
2324        fn encode(
2325            self,
2326            encoder: &mut ___E,
2327            out: &mut ::core::mem::MaybeUninit<crate::wire::User<'static>>,
2328            _: (),
2329        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2330            ::fidl_next::munge!(let crate::wire::User { table } = out);
2331
2332            let max_ord = self.__max_ordinal();
2333
2334            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2335            ::fidl_next::Wire::zero_padding(&mut out);
2336
2337            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2338                ::fidl_next::wire::Envelope,
2339            >(encoder, max_ord);
2340
2341            for i in 1..=max_ord {
2342                match i {
2343                    2 => {
2344                        if let Some(value) = &self.name {
2345                            ::fidl_next::wire::Envelope::encode_value::<
2346                                ::fidl_next::wire::String<'static>,
2347                                ___E,
2348                            >(
2349                                value, preallocated.encoder, &mut out, 32
2350                            )?;
2351                        } else {
2352                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2353                        }
2354                    }
2355
2356                    1 => {
2357                        if let Some(value) = &self.age {
2358                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
2359                                value,
2360                                preallocated.encoder,
2361                                &mut out,
2362                                (),
2363                            )?;
2364                        } else {
2365                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
2366                        }
2367                    }
2368
2369                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2370                }
2371                unsafe {
2372                    preallocated.write_next(out.assume_init_ref());
2373                }
2374            }
2375
2376            ::fidl_next::wire::Table::encode_len(table, max_ord);
2377
2378            Ok(())
2379        }
2380    }
2381
2382    impl<'de> ::fidl_next::FromWire<crate::wire::User<'de>> for User {
2383        #[inline]
2384        fn from_wire(wire_: crate::wire::User<'de>) -> Self {
2385            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2386
2387            let age = wire_.table.get(1);
2388
2389            let name = wire_.table.get(2);
2390
2391            Self {
2392                age: age.map(|envelope| {
2393                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
2394                }),
2395
2396                name: name.map(|envelope| {
2397                    ::fidl_next::FromWire::from_wire(unsafe {
2398                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2399                    })
2400                }),
2401            }
2402        }
2403    }
2404
2405    impl<'de> ::fidl_next::FromWireRef<crate::wire::User<'de>> for User {
2406        #[inline]
2407        fn from_wire_ref(wire: &crate::wire::User<'de>) -> Self {
2408            Self {
2409                age: wire.table.get(1).map(|envelope| {
2410                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2411                        envelope.deref_unchecked::<u8>()
2412                    })
2413                }),
2414
2415                name: wire.table.get(2).map(|envelope| {
2416                    ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2417                        envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2418                    })
2419                }),
2420            }
2421        }
2422    }
2423}
2424
2425pub mod wire {
2426
2427    /// The wire type corresponding to [`AvailableFromApiLevelNext`](crate::natural::AvailableFromApiLevelNext).
2428    pub type AvailableFromApiLevelNext = ::fidl_next::wire::Int32;
2429
2430    /// The wire type corresponding to [`AvailableUntilApiLevelNext`](crate::natural::AvailableUntilApiLevelNext).
2431    pub type AvailableUntilApiLevelNext = ::fidl_next::wire::Int32;
2432
2433    /// The wire type corresponding to [`Color`].
2434    #[derive(Debug)]
2435    #[repr(C)]
2436    pub struct Color<'de> {
2437        pub id: ::fidl_next::wire::Uint32,
2438
2439        pub name: ::fidl_next::wire::String<'de>,
2440    }
2441
2442    static_assertions::const_assert_eq!(std::mem::size_of::<Color<'_>>(), 24);
2443    static_assertions::const_assert_eq!(std::mem::align_of::<Color<'_>>(), 8);
2444
2445    static_assertions::const_assert_eq!(std::mem::offset_of!(Color<'_>, id), 0);
2446
2447    static_assertions::const_assert_eq!(std::mem::offset_of!(Color<'_>, name), 8);
2448
2449    impl ::fidl_next::Constrained for Color<'_> {
2450        type Constraint = ();
2451
2452        fn validate(
2453            _: ::fidl_next::Slot<'_, Self>,
2454            _: Self::Constraint,
2455        ) -> Result<(), ::fidl_next::ValidationError> {
2456            Ok(())
2457        }
2458    }
2459
2460    unsafe impl ::fidl_next::Wire for Color<'static> {
2461        type Narrowed<'de> = Color<'de>;
2462
2463        #[inline]
2464        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2465            ::fidl_next::munge! {
2466                let Self {
2467                    id,
2468                    name,
2469
2470                } = &mut *out_;
2471            }
2472
2473            ::fidl_next::Wire::zero_padding(id);
2474
2475            ::fidl_next::Wire::zero_padding(name);
2476
2477            unsafe {
2478                out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2479            }
2480        }
2481    }
2482
2483    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Color<'de>
2484    where
2485        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2486        ___D: ::fidl_next::Decoder<'de>,
2487    {
2488        fn decode(
2489            slot_: ::fidl_next::Slot<'_, Self>,
2490            decoder_: &mut ___D,
2491            _: (),
2492        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2493            if slot_.as_bytes()[4..8] != [0u8; 4] {
2494                return Err(::fidl_next::DecodeError::InvalidPadding);
2495            }
2496
2497            ::fidl_next::munge! {
2498                let Self {
2499                    mut id,
2500                    mut name,
2501
2502                } = slot_;
2503            }
2504
2505            let _field = id.as_mut();
2506
2507            ::fidl_next::Decode::decode(id.as_mut(), decoder_, ())?;
2508
2509            let _field = name.as_mut();
2510            ::fidl_next::Constrained::validate(_field, 32)?;
2511            ::fidl_next::Decode::decode(name.as_mut(), decoder_, 32)?;
2512
2513            let name = unsafe { name.deref_unchecked() };
2514
2515            if name.len() > 32 {
2516                return Err(::fidl_next::DecodeError::VectorTooLong {
2517                    size: name.len() as u64,
2518                    limit: 32,
2519                });
2520            }
2521
2522            Ok(())
2523        }
2524    }
2525
2526    impl<'de> ::fidl_next::IntoNatural for Color<'de> {
2527        type Natural = crate::natural::Color;
2528    }
2529
2530    /// The wire type corresponding to [`EchoEchoStringRequest`].
2531    #[derive(Debug)]
2532    #[repr(C)]
2533    pub struct EchoEchoStringRequest<'de> {
2534        pub value: ::fidl_next::wire::String<'de>,
2535    }
2536
2537    static_assertions::const_assert_eq!(std::mem::size_of::<EchoEchoStringRequest<'_>>(), 16);
2538    static_assertions::const_assert_eq!(std::mem::align_of::<EchoEchoStringRequest<'_>>(), 8);
2539
2540    static_assertions::const_assert_eq!(std::mem::offset_of!(EchoEchoStringRequest<'_>, value), 0);
2541
2542    impl ::fidl_next::Constrained for EchoEchoStringRequest<'_> {
2543        type Constraint = ();
2544
2545        fn validate(
2546            _: ::fidl_next::Slot<'_, Self>,
2547            _: Self::Constraint,
2548        ) -> Result<(), ::fidl_next::ValidationError> {
2549            Ok(())
2550        }
2551    }
2552
2553    unsafe impl ::fidl_next::Wire for EchoEchoStringRequest<'static> {
2554        type Narrowed<'de> = EchoEchoStringRequest<'de>;
2555
2556        #[inline]
2557        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2558            ::fidl_next::munge! {
2559                let Self {
2560                    value,
2561
2562                } = &mut *out_;
2563            }
2564
2565            ::fidl_next::Wire::zero_padding(value);
2566        }
2567    }
2568
2569    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoEchoStringRequest<'de>
2570    where
2571        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2572        ___D: ::fidl_next::Decoder<'de>,
2573    {
2574        fn decode(
2575            slot_: ::fidl_next::Slot<'_, Self>,
2576            decoder_: &mut ___D,
2577            _: (),
2578        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2579            ::fidl_next::munge! {
2580                let Self {
2581                    mut value,
2582
2583                } = slot_;
2584            }
2585
2586            let _field = value.as_mut();
2587            ::fidl_next::Constrained::validate(_field, 32)?;
2588            ::fidl_next::Decode::decode(value.as_mut(), decoder_, 32)?;
2589
2590            let value = unsafe { value.deref_unchecked() };
2591
2592            if value.len() > 32 {
2593                return Err(::fidl_next::DecodeError::VectorTooLong {
2594                    size: value.len() as u64,
2595                    limit: 32,
2596                });
2597            }
2598
2599            Ok(())
2600        }
2601    }
2602
2603    impl<'de> ::fidl_next::IntoNatural for EchoEchoStringRequest<'de> {
2604        type Natural = crate::natural::EchoEchoStringRequest;
2605    }
2606
2607    /// The wire type corresponding to [`EchoEchoStringResponse`].
2608    #[derive(Debug)]
2609    #[repr(C)]
2610    pub struct EchoEchoStringResponse<'de> {
2611        pub response: ::fidl_next::wire::String<'de>,
2612    }
2613
2614    static_assertions::const_assert_eq!(std::mem::size_of::<EchoEchoStringResponse<'_>>(), 16);
2615    static_assertions::const_assert_eq!(std::mem::align_of::<EchoEchoStringResponse<'_>>(), 8);
2616
2617    static_assertions::const_assert_eq!(
2618        std::mem::offset_of!(EchoEchoStringResponse<'_>, response),
2619        0
2620    );
2621
2622    impl ::fidl_next::Constrained for EchoEchoStringResponse<'_> {
2623        type Constraint = ();
2624
2625        fn validate(
2626            _: ::fidl_next::Slot<'_, Self>,
2627            _: Self::Constraint,
2628        ) -> Result<(), ::fidl_next::ValidationError> {
2629            Ok(())
2630        }
2631    }
2632
2633    unsafe impl ::fidl_next::Wire for EchoEchoStringResponse<'static> {
2634        type Narrowed<'de> = EchoEchoStringResponse<'de>;
2635
2636        #[inline]
2637        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2638            ::fidl_next::munge! {
2639                let Self {
2640                    response,
2641
2642                } = &mut *out_;
2643            }
2644
2645            ::fidl_next::Wire::zero_padding(response);
2646        }
2647    }
2648
2649    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoEchoStringResponse<'de>
2650    where
2651        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2652        ___D: ::fidl_next::Decoder<'de>,
2653    {
2654        fn decode(
2655            slot_: ::fidl_next::Slot<'_, Self>,
2656            decoder_: &mut ___D,
2657            _: (),
2658        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2659            ::fidl_next::munge! {
2660                let Self {
2661                    mut response,
2662
2663                } = slot_;
2664            }
2665
2666            let _field = response.as_mut();
2667            ::fidl_next::Constrained::validate(_field, 32)?;
2668            ::fidl_next::Decode::decode(response.as_mut(), decoder_, 32)?;
2669
2670            let response = unsafe { response.deref_unchecked() };
2671
2672            if response.len() > 32 {
2673                return Err(::fidl_next::DecodeError::VectorTooLong {
2674                    size: response.len() as u64,
2675                    limit: 32,
2676                });
2677            }
2678
2679            Ok(())
2680        }
2681    }
2682
2683    impl<'de> ::fidl_next::IntoNatural for EchoEchoStringResponse<'de> {
2684        type Natural = crate::natural::EchoEchoStringResponse;
2685    }
2686
2687    /// The wire type corresponding to [`EchoSendStringRequest`].
2688    #[derive(Debug)]
2689    #[repr(C)]
2690    pub struct EchoSendStringRequest<'de> {
2691        pub value: ::fidl_next::wire::String<'de>,
2692    }
2693
2694    static_assertions::const_assert_eq!(std::mem::size_of::<EchoSendStringRequest<'_>>(), 16);
2695    static_assertions::const_assert_eq!(std::mem::align_of::<EchoSendStringRequest<'_>>(), 8);
2696
2697    static_assertions::const_assert_eq!(std::mem::offset_of!(EchoSendStringRequest<'_>, value), 0);
2698
2699    impl ::fidl_next::Constrained for EchoSendStringRequest<'_> {
2700        type Constraint = ();
2701
2702        fn validate(
2703            _: ::fidl_next::Slot<'_, Self>,
2704            _: Self::Constraint,
2705        ) -> Result<(), ::fidl_next::ValidationError> {
2706            Ok(())
2707        }
2708    }
2709
2710    unsafe impl ::fidl_next::Wire for EchoSendStringRequest<'static> {
2711        type Narrowed<'de> = EchoSendStringRequest<'de>;
2712
2713        #[inline]
2714        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2715            ::fidl_next::munge! {
2716                let Self {
2717                    value,
2718
2719                } = &mut *out_;
2720            }
2721
2722            ::fidl_next::Wire::zero_padding(value);
2723        }
2724    }
2725
2726    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoSendStringRequest<'de>
2727    where
2728        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2729        ___D: ::fidl_next::Decoder<'de>,
2730    {
2731        fn decode(
2732            slot_: ::fidl_next::Slot<'_, Self>,
2733            decoder_: &mut ___D,
2734            _: (),
2735        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2736            ::fidl_next::munge! {
2737                let Self {
2738                    mut value,
2739
2740                } = slot_;
2741            }
2742
2743            let _field = value.as_mut();
2744            ::fidl_next::Constrained::validate(_field, 32)?;
2745            ::fidl_next::Decode::decode(value.as_mut(), decoder_, 32)?;
2746
2747            let value = unsafe { value.deref_unchecked() };
2748
2749            if value.len() > 32 {
2750                return Err(::fidl_next::DecodeError::VectorTooLong {
2751                    size: value.len() as u64,
2752                    limit: 32,
2753                });
2754            }
2755
2756            Ok(())
2757        }
2758    }
2759
2760    impl<'de> ::fidl_next::IntoNatural for EchoSendStringRequest<'de> {
2761        type Natural = crate::natural::EchoSendStringRequest;
2762    }
2763
2764    /// The wire type corresponding to [`EchoOnStringRequest`].
2765    #[derive(Debug)]
2766    #[repr(C)]
2767    pub struct EchoOnStringRequest<'de> {
2768        pub response: ::fidl_next::wire::String<'de>,
2769    }
2770
2771    static_assertions::const_assert_eq!(std::mem::size_of::<EchoOnStringRequest<'_>>(), 16);
2772    static_assertions::const_assert_eq!(std::mem::align_of::<EchoOnStringRequest<'_>>(), 8);
2773
2774    static_assertions::const_assert_eq!(std::mem::offset_of!(EchoOnStringRequest<'_>, response), 0);
2775
2776    impl ::fidl_next::Constrained for EchoOnStringRequest<'_> {
2777        type Constraint = ();
2778
2779        fn validate(
2780            _: ::fidl_next::Slot<'_, Self>,
2781            _: Self::Constraint,
2782        ) -> Result<(), ::fidl_next::ValidationError> {
2783            Ok(())
2784        }
2785    }
2786
2787    unsafe impl ::fidl_next::Wire for EchoOnStringRequest<'static> {
2788        type Narrowed<'de> = EchoOnStringRequest<'de>;
2789
2790        #[inline]
2791        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2792            ::fidl_next::munge! {
2793                let Self {
2794                    response,
2795
2796                } = &mut *out_;
2797            }
2798
2799            ::fidl_next::Wire::zero_padding(response);
2800        }
2801    }
2802
2803    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoOnStringRequest<'de>
2804    where
2805        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2806        ___D: ::fidl_next::Decoder<'de>,
2807    {
2808        fn decode(
2809            slot_: ::fidl_next::Slot<'_, Self>,
2810            decoder_: &mut ___D,
2811            _: (),
2812        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2813            ::fidl_next::munge! {
2814                let Self {
2815                    mut response,
2816
2817                } = slot_;
2818            }
2819
2820            let _field = response.as_mut();
2821            ::fidl_next::Constrained::validate(_field, 32)?;
2822            ::fidl_next::Decode::decode(response.as_mut(), decoder_, 32)?;
2823
2824            let response = unsafe { response.deref_unchecked() };
2825
2826            if response.len() > 32 {
2827                return Err(::fidl_next::DecodeError::VectorTooLong {
2828                    size: response.len() as u64,
2829                    limit: 32,
2830                });
2831            }
2832
2833            Ok(())
2834        }
2835    }
2836
2837    impl<'de> ::fidl_next::IntoNatural for EchoOnStringRequest<'de> {
2838        type Natural = crate::natural::EchoOnStringRequest;
2839    }
2840
2841    /// The wire type corresponding to [`EchoLauncherGetEchoRequest`].
2842    #[derive(Debug)]
2843    #[repr(C)]
2844    pub struct EchoLauncherGetEchoRequest<'de> {
2845        pub echo_prefix: ::fidl_next::wire::String<'de>,
2846    }
2847
2848    static_assertions::const_assert_eq!(std::mem::size_of::<EchoLauncherGetEchoRequest<'_>>(), 16);
2849    static_assertions::const_assert_eq!(std::mem::align_of::<EchoLauncherGetEchoRequest<'_>>(), 8);
2850
2851    static_assertions::const_assert_eq!(
2852        std::mem::offset_of!(EchoLauncherGetEchoRequest<'_>, echo_prefix),
2853        0
2854    );
2855
2856    impl ::fidl_next::Constrained for EchoLauncherGetEchoRequest<'_> {
2857        type Constraint = ();
2858
2859        fn validate(
2860            _: ::fidl_next::Slot<'_, Self>,
2861            _: Self::Constraint,
2862        ) -> Result<(), ::fidl_next::ValidationError> {
2863            Ok(())
2864        }
2865    }
2866
2867    unsafe impl ::fidl_next::Wire for EchoLauncherGetEchoRequest<'static> {
2868        type Narrowed<'de> = EchoLauncherGetEchoRequest<'de>;
2869
2870        #[inline]
2871        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2872            ::fidl_next::munge! {
2873                let Self {
2874                    echo_prefix,
2875
2876                } = &mut *out_;
2877            }
2878
2879            ::fidl_next::Wire::zero_padding(echo_prefix);
2880        }
2881    }
2882
2883    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoLauncherGetEchoRequest<'de>
2884    where
2885        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2886        ___D: ::fidl_next::Decoder<'de>,
2887    {
2888        fn decode(
2889            slot_: ::fidl_next::Slot<'_, Self>,
2890            decoder_: &mut ___D,
2891            _: (),
2892        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2893            ::fidl_next::munge! {
2894                let Self {
2895                    mut echo_prefix,
2896
2897                } = slot_;
2898            }
2899
2900            let _field = echo_prefix.as_mut();
2901            ::fidl_next::Constrained::validate(_field, 32)?;
2902            ::fidl_next::Decode::decode(echo_prefix.as_mut(), decoder_, 32)?;
2903
2904            let echo_prefix = unsafe { echo_prefix.deref_unchecked() };
2905
2906            if echo_prefix.len() > 32 {
2907                return Err(::fidl_next::DecodeError::VectorTooLong {
2908                    size: echo_prefix.len() as u64,
2909                    limit: 32,
2910                });
2911            }
2912
2913            Ok(())
2914        }
2915    }
2916
2917    impl<'de> ::fidl_next::IntoNatural for EchoLauncherGetEchoRequest<'de> {
2918        type Natural = crate::natural::EchoLauncherGetEchoRequest;
2919    }
2920
2921    /// The wire type corresponding to [`FileMode`](crate::natural::FileMode).
2922    #[derive(Clone, Copy, Debug)]
2923    #[repr(transparent)]
2924    pub struct FileMode {
2925        pub(crate) value: ::fidl_next::wire::Uint16,
2926    }
2927
2928    impl ::fidl_next::Constrained for FileMode {
2929        type Constraint = ();
2930
2931        fn validate(
2932            _: ::fidl_next::Slot<'_, Self>,
2933            _: Self::Constraint,
2934        ) -> Result<(), ::fidl_next::ValidationError> {
2935            Ok(())
2936        }
2937    }
2938
2939    unsafe impl ::fidl_next::Wire for FileMode {
2940        type Narrowed<'de> = Self;
2941
2942        #[inline]
2943        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2944            // Wire bits have no padding
2945        }
2946    }
2947
2948    unsafe impl<___D> ::fidl_next::Decode<___D> for FileMode
2949    where
2950        ___D: ?Sized,
2951    {
2952        fn decode(
2953            slot: ::fidl_next::Slot<'_, Self>,
2954            _: &mut ___D,
2955            _: (),
2956        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2957            ::fidl_next::munge!(let Self { value } = slot);
2958            let set = u16::from(*value);
2959            if set & !crate::natural::FileMode::all().bits() != 0 {
2960                return Err(::fidl_next::DecodeError::InvalidBits {
2961                    expected: crate::natural::FileMode::all().bits() as usize,
2962                    actual: set as usize,
2963                });
2964            }
2965
2966            Ok(())
2967        }
2968    }
2969
2970    impl ::core::convert::From<crate::natural::FileMode> for FileMode {
2971        fn from(natural: crate::natural::FileMode) -> Self {
2972            Self { value: ::fidl_next::wire::Uint16::from(natural.bits()) }
2973        }
2974    }
2975
2976    impl ::fidl_next::IntoNatural for FileMode {
2977        type Natural = crate::natural::FileMode;
2978    }
2979
2980    /// The wire type corresponding to [`FlexibleFileMode`](crate::natural::FlexibleFileMode).
2981    #[derive(Clone, Copy, Debug)]
2982    #[repr(transparent)]
2983    pub struct FlexibleFileMode {
2984        pub(crate) value: ::fidl_next::wire::Uint16,
2985    }
2986
2987    impl ::fidl_next::Constrained for FlexibleFileMode {
2988        type Constraint = ();
2989
2990        fn validate(
2991            _: ::fidl_next::Slot<'_, Self>,
2992            _: Self::Constraint,
2993        ) -> Result<(), ::fidl_next::ValidationError> {
2994            Ok(())
2995        }
2996    }
2997
2998    unsafe impl ::fidl_next::Wire for FlexibleFileMode {
2999        type Narrowed<'de> = Self;
3000
3001        #[inline]
3002        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3003            // Wire bits have no padding
3004        }
3005    }
3006
3007    unsafe impl<___D> ::fidl_next::Decode<___D> for FlexibleFileMode
3008    where
3009        ___D: ?Sized,
3010    {
3011        fn decode(
3012            slot: ::fidl_next::Slot<'_, Self>,
3013            _: &mut ___D,
3014            _: (),
3015        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3016            Ok(())
3017        }
3018    }
3019
3020    impl ::core::convert::From<crate::natural::FlexibleFileMode> for FlexibleFileMode {
3021        fn from(natural: crate::natural::FlexibleFileMode) -> Self {
3022            Self { value: ::fidl_next::wire::Uint16::from(natural.bits()) }
3023        }
3024    }
3025
3026    impl ::fidl_next::IntoNatural for FlexibleFileMode {
3027        type Natural = crate::natural::FlexibleFileMode;
3028    }
3029
3030    /// The wire type corresponding to [`FlexibleJsonValue`].
3031    #[repr(transparent)]
3032    pub struct FlexibleJsonValue<'de> {
3033        pub(crate) raw: ::fidl_next::wire::Union,
3034        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3035    }
3036
3037    impl<'de> Drop for FlexibleJsonValue<'de> {
3038        fn drop(&mut self) {
3039            match self.raw.ordinal() {
3040                1 => {
3041                    let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int32>() };
3042                }
3043
3044                2 => {
3045                    let _ = unsafe {
3046                        self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
3047                    };
3048                }
3049
3050                _ => (),
3051            }
3052        }
3053    }
3054
3055    impl ::fidl_next::Constrained for FlexibleJsonValue<'_> {
3056        type Constraint = ();
3057
3058        fn validate(
3059            _: ::fidl_next::Slot<'_, Self>,
3060            _: Self::Constraint,
3061        ) -> Result<(), ::fidl_next::ValidationError> {
3062            Ok(())
3063        }
3064    }
3065
3066    unsafe impl ::fidl_next::Wire for FlexibleJsonValue<'static> {
3067        type Narrowed<'de> = FlexibleJsonValue<'de>;
3068
3069        #[inline]
3070        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3071            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3072            ::fidl_next::wire::Union::zero_padding(raw);
3073        }
3074    }
3075
3076    pub mod flexible_json_value {
3077        pub enum Ref<'de> {
3078            IntValue(&'de ::fidl_next::wire::Int32),
3079
3080            StringValue(&'de ::fidl_next::wire::String<'de>),
3081
3082            UnknownOrdinal_(u64),
3083        }
3084    }
3085
3086    impl<'de> FlexibleJsonValue<'de> {
3087        pub fn as_ref(&self) -> crate::wire::flexible_json_value::Ref<'_> {
3088            match self.raw.ordinal() {
3089                1 => crate::wire::flexible_json_value::Ref::IntValue(unsafe {
3090                    self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
3091                }),
3092
3093                2 => crate::wire::flexible_json_value::Ref::StringValue(unsafe {
3094                    self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
3095                }),
3096
3097                unknown => crate::wire::flexible_json_value::Ref::UnknownOrdinal_(unknown),
3098            }
3099        }
3100    }
3101
3102    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FlexibleJsonValue<'de>
3103    where
3104        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3105        ___D: ::fidl_next::Decoder<'de>,
3106    {
3107        fn decode(
3108            mut slot: ::fidl_next::Slot<'_, Self>,
3109            decoder: &mut ___D,
3110            _: (),
3111        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3112            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3113            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3114                1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
3115                    raw,
3116                    decoder,
3117                    (),
3118                )?,
3119
3120                2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3121                    raw, decoder, 32,
3122                )?,
3123
3124                _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3125            }
3126
3127            Ok(())
3128        }
3129    }
3130
3131    impl<'de> ::core::fmt::Debug for FlexibleJsonValue<'de> {
3132        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3133            match self.raw.ordinal() {
3134                1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
3135                2 => unsafe {
3136                    self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
3137                },
3138                _ => unsafe { ::core::hint::unreachable_unchecked() },
3139            }
3140        }
3141    }
3142
3143    impl<'de> ::fidl_next::IntoNatural for FlexibleJsonValue<'de> {
3144        type Natural = crate::natural::FlexibleJsonValue;
3145    }
3146
3147    /// The wire type corresponding to [`FlexibleLocationType`].
3148    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3149    #[repr(transparent)]
3150    pub struct FlexibleLocationType {
3151        pub(crate) value: ::fidl_next::wire::Uint32,
3152    }
3153
3154    impl ::fidl_next::Constrained for FlexibleLocationType {
3155        type Constraint = ();
3156
3157        fn validate(
3158            _: ::fidl_next::Slot<'_, Self>,
3159            _: Self::Constraint,
3160        ) -> Result<(), ::fidl_next::ValidationError> {
3161            Ok(())
3162        }
3163    }
3164
3165    unsafe impl ::fidl_next::Wire for FlexibleLocationType {
3166        type Narrowed<'de> = Self;
3167
3168        #[inline]
3169        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3170            // Wire enums have no padding
3171        }
3172    }
3173
3174    impl FlexibleLocationType {
3175        pub const MUSEUM: FlexibleLocationType =
3176            FlexibleLocationType { value: ::fidl_next::wire::Uint32(1) };
3177
3178        pub const AIRPORT: FlexibleLocationType =
3179            FlexibleLocationType { value: ::fidl_next::wire::Uint32(2) };
3180
3181        pub const RESTAURANT: FlexibleLocationType =
3182            FlexibleLocationType { value: ::fidl_next::wire::Uint32(3) };
3183    }
3184
3185    unsafe impl<___D> ::fidl_next::Decode<___D> for FlexibleLocationType
3186    where
3187        ___D: ?Sized,
3188    {
3189        fn decode(
3190            slot: ::fidl_next::Slot<'_, Self>,
3191            _: &mut ___D,
3192            _: (),
3193        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3194            Ok(())
3195        }
3196    }
3197
3198    impl ::core::convert::From<crate::natural::FlexibleLocationType> for FlexibleLocationType {
3199        fn from(natural: crate::natural::FlexibleLocationType) -> Self {
3200            match natural {
3201                crate::natural::FlexibleLocationType::Museum => FlexibleLocationType::MUSEUM,
3202
3203                crate::natural::FlexibleLocationType::Airport => FlexibleLocationType::AIRPORT,
3204
3205                crate::natural::FlexibleLocationType::Restaurant => {
3206                    FlexibleLocationType::RESTAURANT
3207                }
3208
3209                crate::natural::FlexibleLocationType::UnknownOrdinal_(value) => {
3210                    FlexibleLocationType { value: ::fidl_next::wire::Uint32::from(value) }
3211                }
3212            }
3213        }
3214    }
3215
3216    impl ::fidl_next::IntoNatural for FlexibleLocationType {
3217        type Natural = crate::natural::FlexibleLocationType;
3218    }
3219
3220    /// The wire type corresponding to [`GameState`].
3221    pub type GameState = ::fidl_next::wire::Unit;
3222
3223    /// The wire type corresponding to [`JsonValue`].
3224    #[repr(transparent)]
3225    pub struct JsonValue<'de> {
3226        pub(crate) raw: ::fidl_next::wire::Union,
3227        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3228    }
3229
3230    impl<'de> Drop for JsonValue<'de> {
3231        fn drop(&mut self) {
3232            match self.raw.ordinal() {
3233                1 => {
3234                    let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int32>() };
3235                }
3236
3237                2 => {
3238                    let _ = unsafe {
3239                        self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
3240                    };
3241                }
3242
3243                _ => unsafe { ::core::hint::unreachable_unchecked() },
3244            }
3245        }
3246    }
3247
3248    impl ::fidl_next::Constrained for JsonValue<'_> {
3249        type Constraint = ();
3250
3251        fn validate(
3252            _: ::fidl_next::Slot<'_, Self>,
3253            _: Self::Constraint,
3254        ) -> Result<(), ::fidl_next::ValidationError> {
3255            Ok(())
3256        }
3257    }
3258
3259    unsafe impl ::fidl_next::Wire for JsonValue<'static> {
3260        type Narrowed<'de> = JsonValue<'de>;
3261
3262        #[inline]
3263        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3264            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3265            ::fidl_next::wire::Union::zero_padding(raw);
3266        }
3267    }
3268
3269    pub mod json_value {
3270        pub enum Ref<'de> {
3271            IntValue(&'de ::fidl_next::wire::Int32),
3272
3273            StringValue(&'de ::fidl_next::wire::String<'de>),
3274        }
3275    }
3276
3277    impl<'de> JsonValue<'de> {
3278        pub fn as_ref(&self) -> crate::wire::json_value::Ref<'_> {
3279            match self.raw.ordinal() {
3280                1 => crate::wire::json_value::Ref::IntValue(unsafe {
3281                    self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
3282                }),
3283
3284                2 => crate::wire::json_value::Ref::StringValue(unsafe {
3285                    self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
3286                }),
3287
3288                _ => unsafe { ::core::hint::unreachable_unchecked() },
3289            }
3290        }
3291    }
3292
3293    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for JsonValue<'de>
3294    where
3295        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3296        ___D: ::fidl_next::Decoder<'de>,
3297    {
3298        fn decode(
3299            mut slot: ::fidl_next::Slot<'_, Self>,
3300            decoder: &mut ___D,
3301            _: (),
3302        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3303            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3304            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3305                1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
3306                    raw,
3307                    decoder,
3308                    (),
3309                )?,
3310
3311                2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3312                    raw, decoder, 32,
3313                )?,
3314
3315                ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
3316            }
3317
3318            Ok(())
3319        }
3320    }
3321
3322    impl<'de> ::core::fmt::Debug for JsonValue<'de> {
3323        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3324            match self.raw.ordinal() {
3325                1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
3326                2 => unsafe {
3327                    self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
3328                },
3329                _ => unsafe { ::core::hint::unreachable_unchecked() },
3330            }
3331        }
3332    }
3333
3334    impl<'de> ::fidl_next::IntoNatural for JsonValue<'de> {
3335        type Natural = crate::natural::JsonValue;
3336    }
3337
3338    /// The wire type corresponding to [`LocationType`].
3339    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3340    #[repr(transparent)]
3341    pub struct LocationType {
3342        pub(crate) value: ::fidl_next::wire::Uint32,
3343    }
3344
3345    impl ::fidl_next::Constrained for LocationType {
3346        type Constraint = ();
3347
3348        fn validate(
3349            _: ::fidl_next::Slot<'_, Self>,
3350            _: Self::Constraint,
3351        ) -> Result<(), ::fidl_next::ValidationError> {
3352            Ok(())
3353        }
3354    }
3355
3356    unsafe impl ::fidl_next::Wire for LocationType {
3357        type Narrowed<'de> = Self;
3358
3359        #[inline]
3360        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3361            // Wire enums have no padding
3362        }
3363    }
3364
3365    impl LocationType {
3366        pub const MUSEUM: LocationType = LocationType { value: ::fidl_next::wire::Uint32(1) };
3367
3368        pub const AIRPORT: LocationType = LocationType { value: ::fidl_next::wire::Uint32(2) };
3369
3370        pub const RESTAURANT: LocationType = LocationType { value: ::fidl_next::wire::Uint32(3) };
3371    }
3372
3373    unsafe impl<___D> ::fidl_next::Decode<___D> for LocationType
3374    where
3375        ___D: ?Sized,
3376    {
3377        fn decode(
3378            slot: ::fidl_next::Slot<'_, Self>,
3379            _: &mut ___D,
3380            _: (),
3381        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3382            ::fidl_next::munge!(let Self { value } = slot);
3383
3384            match u32::from(*value) {
3385                1 | 2 | 3 => (),
3386                unknown => {
3387                    return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
3388                }
3389            }
3390
3391            Ok(())
3392        }
3393    }
3394
3395    impl ::core::convert::From<crate::natural::LocationType> for LocationType {
3396        fn from(natural: crate::natural::LocationType) -> Self {
3397            match natural {
3398                crate::natural::LocationType::Museum => LocationType::MUSEUM,
3399
3400                crate::natural::LocationType::Airport => LocationType::AIRPORT,
3401
3402                crate::natural::LocationType::Restaurant => LocationType::RESTAURANT,
3403            }
3404        }
3405    }
3406
3407    impl ::fidl_next::IntoNatural for LocationType {
3408        type Natural = crate::natural::LocationType;
3409    }
3410
3411    /// The wire type corresponding to [`TicTacToeStartGameRequest`].
3412    #[derive(Clone, Debug)]
3413    #[repr(C)]
3414    pub struct TicTacToeStartGameRequest {
3415        pub start_first: bool,
3416    }
3417
3418    static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeStartGameRequest>(), 1);
3419    static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeStartGameRequest>(), 1);
3420
3421    static_assertions::const_assert_eq!(
3422        std::mem::offset_of!(TicTacToeStartGameRequest, start_first),
3423        0
3424    );
3425
3426    impl ::fidl_next::Constrained for TicTacToeStartGameRequest {
3427        type Constraint = ();
3428
3429        fn validate(
3430            _: ::fidl_next::Slot<'_, Self>,
3431            _: Self::Constraint,
3432        ) -> Result<(), ::fidl_next::ValidationError> {
3433            Ok(())
3434        }
3435    }
3436
3437    unsafe impl ::fidl_next::Wire for TicTacToeStartGameRequest {
3438        type Narrowed<'de> = TicTacToeStartGameRequest;
3439
3440        #[inline]
3441        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3442            ::fidl_next::munge! {
3443                let Self {
3444                    start_first,
3445
3446                } = &mut *out_;
3447            }
3448
3449            ::fidl_next::Wire::zero_padding(start_first);
3450        }
3451    }
3452
3453    unsafe impl<___D> ::fidl_next::Decode<___D> for TicTacToeStartGameRequest
3454    where
3455        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3456    {
3457        fn decode(
3458            slot_: ::fidl_next::Slot<'_, Self>,
3459            decoder_: &mut ___D,
3460            _: (),
3461        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3462            ::fidl_next::munge! {
3463                let Self {
3464                    mut start_first,
3465
3466                } = slot_;
3467            }
3468
3469            let _field = start_first.as_mut();
3470
3471            ::fidl_next::Decode::decode(start_first.as_mut(), decoder_, ())?;
3472
3473            Ok(())
3474        }
3475    }
3476
3477    impl ::fidl_next::IntoNatural for TicTacToeStartGameRequest {
3478        type Natural = crate::natural::TicTacToeStartGameRequest;
3479    }
3480
3481    /// The wire type corresponding to [`TicTacToeMakeMoveRequest`].
3482    #[derive(Clone, Debug)]
3483    #[repr(C)]
3484    pub struct TicTacToeMakeMoveRequest {
3485        pub row: u8,
3486
3487        pub col: u8,
3488    }
3489
3490    static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeMakeMoveRequest>(), 2);
3491    static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeMakeMoveRequest>(), 1);
3492
3493    static_assertions::const_assert_eq!(std::mem::offset_of!(TicTacToeMakeMoveRequest, row), 0);
3494
3495    static_assertions::const_assert_eq!(std::mem::offset_of!(TicTacToeMakeMoveRequest, col), 1);
3496
3497    impl ::fidl_next::Constrained for TicTacToeMakeMoveRequest {
3498        type Constraint = ();
3499
3500        fn validate(
3501            _: ::fidl_next::Slot<'_, Self>,
3502            _: Self::Constraint,
3503        ) -> Result<(), ::fidl_next::ValidationError> {
3504            Ok(())
3505        }
3506    }
3507
3508    unsafe impl ::fidl_next::Wire for TicTacToeMakeMoveRequest {
3509        type Narrowed<'de> = TicTacToeMakeMoveRequest;
3510
3511        #[inline]
3512        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3513            ::fidl_next::munge! {
3514                let Self {
3515                    row,
3516                    col,
3517
3518                } = &mut *out_;
3519            }
3520
3521            ::fidl_next::Wire::zero_padding(row);
3522
3523            ::fidl_next::Wire::zero_padding(col);
3524        }
3525    }
3526
3527    unsafe impl<___D> ::fidl_next::Decode<___D> for TicTacToeMakeMoveRequest
3528    where
3529        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3530    {
3531        fn decode(
3532            slot_: ::fidl_next::Slot<'_, Self>,
3533            decoder_: &mut ___D,
3534            _: (),
3535        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3536            ::fidl_next::munge! {
3537                let Self {
3538                    mut row,
3539                    mut col,
3540
3541                } = slot_;
3542            }
3543
3544            let _field = row.as_mut();
3545
3546            ::fidl_next::Decode::decode(row.as_mut(), decoder_, ())?;
3547
3548            let _field = col.as_mut();
3549
3550            ::fidl_next::Decode::decode(col.as_mut(), decoder_, ())?;
3551
3552            Ok(())
3553        }
3554    }
3555
3556    impl ::fidl_next::IntoNatural for TicTacToeMakeMoveRequest {
3557        type Natural = crate::natural::TicTacToeMakeMoveRequest;
3558    }
3559
3560    /// The wire type corresponding to [`TicTacToeMakeMoveResponse`].
3561    #[derive(Debug)]
3562    #[repr(C)]
3563    pub struct TicTacToeMakeMoveResponse<'de> {
3564        pub success: bool,
3565
3566        pub new_state: ::fidl_next::wire::Box<'de, crate::wire::GameState>,
3567    }
3568
3569    static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeMakeMoveResponse<'_>>(), 16);
3570    static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeMakeMoveResponse<'_>>(), 8);
3571
3572    static_assertions::const_assert_eq!(
3573        std::mem::offset_of!(TicTacToeMakeMoveResponse<'_>, success),
3574        0
3575    );
3576
3577    static_assertions::const_assert_eq!(
3578        std::mem::offset_of!(TicTacToeMakeMoveResponse<'_>, new_state),
3579        8
3580    );
3581
3582    impl ::fidl_next::Constrained for TicTacToeMakeMoveResponse<'_> {
3583        type Constraint = ();
3584
3585        fn validate(
3586            _: ::fidl_next::Slot<'_, Self>,
3587            _: Self::Constraint,
3588        ) -> Result<(), ::fidl_next::ValidationError> {
3589            Ok(())
3590        }
3591    }
3592
3593    unsafe impl ::fidl_next::Wire for TicTacToeMakeMoveResponse<'static> {
3594        type Narrowed<'de> = TicTacToeMakeMoveResponse<'de>;
3595
3596        #[inline]
3597        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3598            ::fidl_next::munge! {
3599                let Self {
3600                    success,
3601                    new_state,
3602
3603                } = &mut *out_;
3604            }
3605
3606            ::fidl_next::Wire::zero_padding(success);
3607
3608            ::fidl_next::Wire::zero_padding(new_state);
3609
3610            unsafe {
3611                out_.as_mut_ptr().cast::<u8>().add(1).write_bytes(0, 7);
3612            }
3613        }
3614    }
3615
3616    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TicTacToeMakeMoveResponse<'de>
3617    where
3618        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3619        ___D: ::fidl_next::Decoder<'de>,
3620    {
3621        fn decode(
3622            slot_: ::fidl_next::Slot<'_, Self>,
3623            decoder_: &mut ___D,
3624            _: (),
3625        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3626            if slot_.as_bytes()[1..8] != [0u8; 7] {
3627                return Err(::fidl_next::DecodeError::InvalidPadding);
3628            }
3629
3630            ::fidl_next::munge! {
3631                let Self {
3632                    mut success,
3633                    mut new_state,
3634
3635                } = slot_;
3636            }
3637
3638            let _field = success.as_mut();
3639
3640            ::fidl_next::Decode::decode(success.as_mut(), decoder_, ())?;
3641
3642            let _field = new_state.as_mut();
3643
3644            ::fidl_next::Decode::decode(new_state.as_mut(), decoder_, ())?;
3645
3646            Ok(())
3647        }
3648    }
3649
3650    impl<'de> ::fidl_next::IntoNatural for TicTacToeMakeMoveResponse<'de> {
3651        type Natural = crate::natural::TicTacToeMakeMoveResponse;
3652    }
3653
3654    /// The wire type corresponding to [`TicTacToeOnOpponentMoveRequest`].
3655    #[derive(Clone, Debug)]
3656    #[repr(C)]
3657    pub struct TicTacToeOnOpponentMoveRequest {
3658        pub new_state: crate::wire::GameState,
3659    }
3660
3661    static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeOnOpponentMoveRequest>(), 1);
3662    static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeOnOpponentMoveRequest>(), 1);
3663
3664    static_assertions::const_assert_eq!(
3665        std::mem::offset_of!(TicTacToeOnOpponentMoveRequest, new_state),
3666        0
3667    );
3668
3669    impl ::fidl_next::Constrained for TicTacToeOnOpponentMoveRequest {
3670        type Constraint = ();
3671
3672        fn validate(
3673            _: ::fidl_next::Slot<'_, Self>,
3674            _: Self::Constraint,
3675        ) -> Result<(), ::fidl_next::ValidationError> {
3676            Ok(())
3677        }
3678    }
3679
3680    unsafe impl ::fidl_next::Wire for TicTacToeOnOpponentMoveRequest {
3681        type Narrowed<'de> = TicTacToeOnOpponentMoveRequest;
3682
3683        #[inline]
3684        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3685            ::fidl_next::munge! {
3686                let Self {
3687                    new_state,
3688
3689                } = &mut *out_;
3690            }
3691
3692            ::fidl_next::Wire::zero_padding(new_state);
3693        }
3694    }
3695
3696    unsafe impl<___D> ::fidl_next::Decode<___D> for TicTacToeOnOpponentMoveRequest
3697    where
3698        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3699    {
3700        fn decode(
3701            slot_: ::fidl_next::Slot<'_, Self>,
3702            decoder_: &mut ___D,
3703            _: (),
3704        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3705            ::fidl_next::munge! {
3706                let Self {
3707                    mut new_state,
3708
3709                } = slot_;
3710            }
3711
3712            let _field = new_state.as_mut();
3713
3714            ::fidl_next::Decode::decode(new_state.as_mut(), decoder_, ())?;
3715
3716            Ok(())
3717        }
3718    }
3719
3720    impl ::fidl_next::IntoNatural for TicTacToeOnOpponentMoveRequest {
3721        type Natural = crate::natural::TicTacToeOnOpponentMoveRequest;
3722    }
3723
3724    /// The wire type corresponding to [`User`].
3725    #[repr(C)]
3726    pub struct User<'de> {
3727        pub(crate) table: ::fidl_next::wire::Table<'de>,
3728    }
3729
3730    impl<'de> Drop for User<'de> {
3731        fn drop(&mut self) {
3732            let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
3733
3734            let _ = self.table.get(2).map(|envelope| unsafe {
3735                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3736            });
3737        }
3738    }
3739
3740    impl ::fidl_next::Constrained for User<'_> {
3741        type Constraint = ();
3742
3743        fn validate(
3744            _: ::fidl_next::Slot<'_, Self>,
3745            _: Self::Constraint,
3746        ) -> Result<(), ::fidl_next::ValidationError> {
3747            Ok(())
3748        }
3749    }
3750
3751    unsafe impl ::fidl_next::Wire for User<'static> {
3752        type Narrowed<'de> = User<'de>;
3753
3754        #[inline]
3755        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3756            ::fidl_next::munge!(let Self { table } = out);
3757            ::fidl_next::wire::Table::zero_padding(table);
3758        }
3759    }
3760
3761    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for User<'de>
3762    where
3763        ___D: ::fidl_next::Decoder<'de> + ?Sized,
3764    {
3765        fn decode(
3766            slot: ::fidl_next::Slot<'_, Self>,
3767            decoder: &mut ___D,
3768            _: (),
3769        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3770            ::fidl_next::munge!(let Self { table } = slot);
3771
3772            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3773                match ordinal {
3774                    0 => unsafe { ::core::hint::unreachable_unchecked() },
3775
3776                    1 => {
3777                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
3778                            slot.as_mut(),
3779                            decoder,
3780                            (),
3781                        )?;
3782
3783                        Ok(())
3784                    }
3785
3786                    2 => {
3787                        ::fidl_next::wire::Envelope::decode_as::<
3788                            ___D,
3789                            ::fidl_next::wire::String<'de>,
3790                        >(slot.as_mut(), decoder, 32)?;
3791
3792                        let value = unsafe {
3793                            slot.deref_unchecked()
3794                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
3795                        };
3796
3797                        if value.len() > 32 {
3798                            return Err(::fidl_next::DecodeError::VectorTooLong {
3799                                size: value.len() as u64,
3800                                limit: 32,
3801                            });
3802                        }
3803
3804                        Ok(())
3805                    }
3806
3807                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3808                }
3809            })
3810        }
3811    }
3812
3813    impl<'de> User<'de> {
3814        pub fn age(&self) -> ::core::option::Option<&u8> {
3815            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3816        }
3817
3818        pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
3819            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3820        }
3821    }
3822
3823    impl<'de> ::core::fmt::Debug for User<'de> {
3824        fn fmt(
3825            &self,
3826            f: &mut ::core::fmt::Formatter<'_>,
3827        ) -> ::core::result::Result<(), ::core::fmt::Error> {
3828            f.debug_struct("User").field("age", &self.age()).field("name", &self.name()).finish()
3829        }
3830    }
3831
3832    impl<'de> ::fidl_next::IntoNatural for User<'de> {
3833        type Natural = crate::natural::User;
3834    }
3835}
3836
3837pub mod wire_optional {
3838
3839    #[repr(transparent)]
3840    pub struct FlexibleJsonValue<'de> {
3841        pub(crate) raw: ::fidl_next::wire::Union,
3842        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3843    }
3844
3845    impl ::fidl_next::Constrained for FlexibleJsonValue<'_> {
3846        type Constraint = ();
3847
3848        fn validate(
3849            _: ::fidl_next::Slot<'_, Self>,
3850            _: Self::Constraint,
3851        ) -> Result<(), ::fidl_next::ValidationError> {
3852            Ok(())
3853        }
3854    }
3855
3856    unsafe impl ::fidl_next::Wire for FlexibleJsonValue<'static> {
3857        type Narrowed<'de> = FlexibleJsonValue<'de>;
3858
3859        #[inline]
3860        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3861            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3862            ::fidl_next::wire::Union::zero_padding(raw);
3863        }
3864    }
3865
3866    impl<'de> FlexibleJsonValue<'de> {
3867        pub fn is_some(&self) -> bool {
3868            self.raw.is_some()
3869        }
3870
3871        pub fn is_none(&self) -> bool {
3872            self.raw.is_none()
3873        }
3874
3875        pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::FlexibleJsonValue<'de>> {
3876            if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3877        }
3878
3879        pub fn into_option(self) -> ::core::option::Option<crate::wire::FlexibleJsonValue<'de>> {
3880            if self.is_some() {
3881                Some(crate::wire::FlexibleJsonValue {
3882                    raw: self.raw,
3883                    _phantom: ::core::marker::PhantomData,
3884                })
3885            } else {
3886                None
3887            }
3888        }
3889    }
3890
3891    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FlexibleJsonValue<'de>
3892    where
3893        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3894        ___D: ::fidl_next::Decoder<'de>,
3895    {
3896        fn decode(
3897            mut slot: ::fidl_next::Slot<'_, Self>,
3898            decoder: &mut ___D,
3899            _: (),
3900        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3901            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3902            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3903                1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
3904                    raw,
3905                    decoder,
3906                    (),
3907                )?,
3908
3909                2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3910                    raw, decoder, 32,
3911                )?,
3912
3913                0 => ::fidl_next::wire::Union::decode_absent(raw)?,
3914                _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3915            }
3916
3917            Ok(())
3918        }
3919    }
3920
3921    impl<'de> ::core::fmt::Debug for FlexibleJsonValue<'de> {
3922        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3923            self.as_ref().fmt(f)
3924        }
3925    }
3926
3927    impl<'de> ::fidl_next::IntoNatural for FlexibleJsonValue<'de> {
3928        type Natural = ::core::option::Option<crate::natural::FlexibleJsonValue>;
3929    }
3930
3931    #[repr(transparent)]
3932    pub struct JsonValue<'de> {
3933        pub(crate) raw: ::fidl_next::wire::Union,
3934        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3935    }
3936
3937    impl ::fidl_next::Constrained for JsonValue<'_> {
3938        type Constraint = ();
3939
3940        fn validate(
3941            _: ::fidl_next::Slot<'_, Self>,
3942            _: Self::Constraint,
3943        ) -> Result<(), ::fidl_next::ValidationError> {
3944            Ok(())
3945        }
3946    }
3947
3948    unsafe impl ::fidl_next::Wire for JsonValue<'static> {
3949        type Narrowed<'de> = JsonValue<'de>;
3950
3951        #[inline]
3952        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3953            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3954            ::fidl_next::wire::Union::zero_padding(raw);
3955        }
3956    }
3957
3958    impl<'de> JsonValue<'de> {
3959        pub fn is_some(&self) -> bool {
3960            self.raw.is_some()
3961        }
3962
3963        pub fn is_none(&self) -> bool {
3964            self.raw.is_none()
3965        }
3966
3967        pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::JsonValue<'de>> {
3968            if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3969        }
3970
3971        pub fn into_option(self) -> ::core::option::Option<crate::wire::JsonValue<'de>> {
3972            if self.is_some() {
3973                Some(crate::wire::JsonValue {
3974                    raw: self.raw,
3975                    _phantom: ::core::marker::PhantomData,
3976                })
3977            } else {
3978                None
3979            }
3980        }
3981    }
3982
3983    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for JsonValue<'de>
3984    where
3985        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3986        ___D: ::fidl_next::Decoder<'de>,
3987    {
3988        fn decode(
3989            mut slot: ::fidl_next::Slot<'_, Self>,
3990            decoder: &mut ___D,
3991            _: (),
3992        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3993            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3994            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3995                1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
3996                    raw,
3997                    decoder,
3998                    (),
3999                )?,
4000
4001                2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
4002                    raw, decoder, 32,
4003                )?,
4004
4005                0 => ::fidl_next::wire::Union::decode_absent(raw)?,
4006                _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
4007            }
4008
4009            Ok(())
4010        }
4011    }
4012
4013    impl<'de> ::core::fmt::Debug for JsonValue<'de> {
4014        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4015            self.as_ref().fmt(f)
4016        }
4017    }
4018
4019    impl<'de> ::fidl_next::IntoNatural for JsonValue<'de> {
4020        type Natural = ::core::option::Option<crate::natural::JsonValue>;
4021    }
4022}
4023
4024pub mod generic {
4025
4026    /// The generic type corresponding to [`Color`].
4027    pub struct Color<T0, T1> {
4028        pub id: T0,
4029
4030        pub name: T1,
4031    }
4032
4033    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Color<'static>, ___E> for Color<T0, T1>
4034    where
4035        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4036        ___E: ::fidl_next::Encoder,
4037        T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
4038        T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4039    {
4040        #[inline]
4041        fn encode(
4042            self,
4043            encoder_: &mut ___E,
4044            out_: &mut ::core::mem::MaybeUninit<crate::wire::Color<'static>>,
4045            _: (),
4046        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4047            ::fidl_next::munge! {
4048                let crate::wire::Color {
4049                    id,
4050                    name,
4051
4052                } = out_;
4053            }
4054
4055            ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
4056
4057            ::fidl_next::Encode::encode(self.name, encoder_, name, 32)?;
4058
4059            Ok(())
4060        }
4061    }
4062
4063    /// The generic type corresponding to [`EchoEchoStringRequest`].
4064    pub struct EchoEchoStringRequest<T0> {
4065        pub value: T0,
4066    }
4067
4068    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoEchoStringRequest<'static>, ___E>
4069        for EchoEchoStringRequest<T0>
4070    where
4071        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4072        ___E: ::fidl_next::Encoder,
4073        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4074    {
4075        #[inline]
4076        fn encode(
4077            self,
4078            encoder_: &mut ___E,
4079            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringRequest<'static>>,
4080            _: (),
4081        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4082            ::fidl_next::munge! {
4083                let crate::wire::EchoEchoStringRequest {
4084                    value,
4085
4086                } = out_;
4087            }
4088
4089            ::fidl_next::Encode::encode(self.value, encoder_, value, 32)?;
4090
4091            Ok(())
4092        }
4093    }
4094
4095    /// The generic type corresponding to [`EchoEchoStringResponse`].
4096    pub struct EchoEchoStringResponse<T0> {
4097        pub response: T0,
4098    }
4099
4100    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoEchoStringResponse<'static>, ___E>
4101        for EchoEchoStringResponse<T0>
4102    where
4103        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4104        ___E: ::fidl_next::Encoder,
4105        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4106    {
4107        #[inline]
4108        fn encode(
4109            self,
4110            encoder_: &mut ___E,
4111            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringResponse<'static>>,
4112            _: (),
4113        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4114            ::fidl_next::munge! {
4115                let crate::wire::EchoEchoStringResponse {
4116                    response,
4117
4118                } = out_;
4119            }
4120
4121            ::fidl_next::Encode::encode(self.response, encoder_, response, 32)?;
4122
4123            Ok(())
4124        }
4125    }
4126
4127    /// The generic type corresponding to [`EchoSendStringRequest`].
4128    pub struct EchoSendStringRequest<T0> {
4129        pub value: T0,
4130    }
4131
4132    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoSendStringRequest<'static>, ___E>
4133        for EchoSendStringRequest<T0>
4134    where
4135        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4136        ___E: ::fidl_next::Encoder,
4137        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4138    {
4139        #[inline]
4140        fn encode(
4141            self,
4142            encoder_: &mut ___E,
4143            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoSendStringRequest<'static>>,
4144            _: (),
4145        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4146            ::fidl_next::munge! {
4147                let crate::wire::EchoSendStringRequest {
4148                    value,
4149
4150                } = out_;
4151            }
4152
4153            ::fidl_next::Encode::encode(self.value, encoder_, value, 32)?;
4154
4155            Ok(())
4156        }
4157    }
4158
4159    /// The generic type corresponding to [`EchoOnStringRequest`].
4160    pub struct EchoOnStringRequest<T0> {
4161        pub response: T0,
4162    }
4163
4164    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoOnStringRequest<'static>, ___E>
4165        for EchoOnStringRequest<T0>
4166    where
4167        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4168        ___E: ::fidl_next::Encoder,
4169        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4170    {
4171        #[inline]
4172        fn encode(
4173            self,
4174            encoder_: &mut ___E,
4175            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoOnStringRequest<'static>>,
4176            _: (),
4177        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4178            ::fidl_next::munge! {
4179                let crate::wire::EchoOnStringRequest {
4180                    response,
4181
4182                } = out_;
4183            }
4184
4185            ::fidl_next::Encode::encode(self.response, encoder_, response, 32)?;
4186
4187            Ok(())
4188        }
4189    }
4190
4191    /// The generic type corresponding to [`EchoLauncherGetEchoRequest`].
4192    pub struct EchoLauncherGetEchoRequest<T0> {
4193        pub echo_prefix: T0,
4194    }
4195
4196    unsafe impl<___E, T0>
4197        ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoRequest<'static>, ___E>
4198        for EchoLauncherGetEchoRequest<T0>
4199    where
4200        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4201        ___E: ::fidl_next::Encoder,
4202        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4203    {
4204        #[inline]
4205        fn encode(
4206            self,
4207            encoder_: &mut ___E,
4208            out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoRequest<'static>>,
4209            _: (),
4210        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4211            ::fidl_next::munge! {
4212                let crate::wire::EchoLauncherGetEchoRequest {
4213                    echo_prefix,
4214
4215                } = out_;
4216            }
4217
4218            ::fidl_next::Encode::encode(self.echo_prefix, encoder_, echo_prefix, 32)?;
4219
4220            Ok(())
4221        }
4222    }
4223
4224    /// The generic type corresponding to [`GameState`].
4225    pub type GameState = ();
4226
4227    /// The generic type corresponding to [`TicTacToeStartGameRequest`].
4228    pub struct TicTacToeStartGameRequest<T0> {
4229        pub start_first: T0,
4230    }
4231
4232    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>
4233        for TicTacToeStartGameRequest<T0>
4234    where
4235        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4236        T0: ::fidl_next::Encode<bool, ___E>,
4237    {
4238        #[inline]
4239        fn encode(
4240            self,
4241            encoder_: &mut ___E,
4242            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeStartGameRequest>,
4243            _: (),
4244        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4245            ::fidl_next::munge! {
4246                let crate::wire::TicTacToeStartGameRequest {
4247                    start_first,
4248
4249                } = out_;
4250            }
4251
4252            ::fidl_next::Encode::encode(self.start_first, encoder_, start_first, ())?;
4253
4254            Ok(())
4255        }
4256    }
4257
4258    /// The generic type corresponding to [`TicTacToeMakeMoveRequest`].
4259    pub struct TicTacToeMakeMoveRequest<T0, T1> {
4260        pub row: T0,
4261
4262        pub col: T1,
4263    }
4264
4265    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>
4266        for TicTacToeMakeMoveRequest<T0, T1>
4267    where
4268        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4269        T0: ::fidl_next::Encode<u8, ___E>,
4270        T1: ::fidl_next::Encode<u8, ___E>,
4271    {
4272        #[inline]
4273        fn encode(
4274            self,
4275            encoder_: &mut ___E,
4276            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveRequest>,
4277            _: (),
4278        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4279            ::fidl_next::munge! {
4280                let crate::wire::TicTacToeMakeMoveRequest {
4281                    row,
4282                    col,
4283
4284                } = out_;
4285            }
4286
4287            ::fidl_next::Encode::encode(self.row, encoder_, row, ())?;
4288
4289            ::fidl_next::Encode::encode(self.col, encoder_, col, ())?;
4290
4291            Ok(())
4292        }
4293    }
4294
4295    /// The generic type corresponding to [`TicTacToeMakeMoveResponse`].
4296    pub struct TicTacToeMakeMoveResponse<T0, T1> {
4297        pub success: T0,
4298
4299        pub new_state: T1,
4300    }
4301
4302    unsafe impl<___E, T0, T1>
4303        ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>
4304        for TicTacToeMakeMoveResponse<T0, T1>
4305    where
4306        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4307        ___E: ::fidl_next::Encoder,
4308        T0: ::fidl_next::Encode<bool, ___E>,
4309        T1: ::fidl_next::Encode<::fidl_next::wire::Box<'static, crate::wire::GameState>, ___E>,
4310    {
4311        #[inline]
4312        fn encode(
4313            self,
4314            encoder_: &mut ___E,
4315            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveResponse<'static>>,
4316            _: (),
4317        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4318            ::fidl_next::munge! {
4319                let crate::wire::TicTacToeMakeMoveResponse {
4320                    success,
4321                    new_state,
4322
4323                } = out_;
4324            }
4325
4326            ::fidl_next::Encode::encode(self.success, encoder_, success, ())?;
4327
4328            ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
4329
4330            Ok(())
4331        }
4332    }
4333
4334    /// The generic type corresponding to [`TicTacToeOnOpponentMoveRequest`].
4335    pub struct TicTacToeOnOpponentMoveRequest<T0> {
4336        pub new_state: T0,
4337    }
4338
4339    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>
4340        for TicTacToeOnOpponentMoveRequest<T0>
4341    where
4342        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4343        T0: ::fidl_next::Encode<crate::wire::GameState, ___E>,
4344    {
4345        #[inline]
4346        fn encode(
4347            self,
4348            encoder_: &mut ___E,
4349            out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeOnOpponentMoveRequest>,
4350            _: (),
4351        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4352            ::fidl_next::munge! {
4353                let crate::wire::TicTacToeOnOpponentMoveRequest {
4354                    new_state,
4355
4356                } = out_;
4357            }
4358
4359            ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
4360
4361            Ok(())
4362        }
4363    }
4364}
4365
4366pub use self::natural::*;
4367
4368pub const BOARD_SIZE: u8 = 9 as u8;
4369
4370pub const MAX_STRING_LENGTH: u64 = 32 as u64;
4371
4372/// The type corresponding to the Echo protocol.
4373#[derive(PartialEq, Debug)]
4374pub struct Echo;
4375
4376impl ::fidl_next::Discoverable for Echo {
4377    const PROTOCOL_NAME: &'static str = "fuchsia.examples.Echo";
4378}
4379
4380#[cfg(target_os = "fuchsia")]
4381impl ::fidl_next::HasTransport for Echo {
4382    type Transport = ::fidl_next::fuchsia::zx::Channel;
4383}
4384
4385pub mod echo {
4386    pub mod prelude {
4387        pub use crate::{
4388            Echo, EchoClientHandler, EchoLocalClientHandler, EchoLocalServerHandler,
4389            EchoServerHandler, echo,
4390        };
4391
4392        pub use crate::natural::EchoEchoStringRequest;
4393
4394        pub use crate::natural::EchoEchoStringResponse;
4395
4396        pub use crate::natural::EchoOnStringRequest;
4397
4398        pub use crate::natural::EchoSendStringRequest;
4399    }
4400
4401    pub struct EchoString;
4402
4403    impl ::fidl_next::Method for EchoString {
4404        const ORDINAL: u64 = 8482573115503257110;
4405        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4406            ::fidl_next::protocol::Flexibility::Strict;
4407
4408        type Protocol = crate::Echo;
4409
4410        type Request = crate::wire::EchoEchoStringRequest<'static>;
4411    }
4412
4413    impl ::fidl_next::TwoWayMethod for EchoString {
4414        type Response = crate::wire::EchoEchoStringResponse<'static>;
4415    }
4416
4417    impl<___R> ::fidl_next::Respond<___R> for EchoString {
4418        type Output = crate::generic::EchoEchoStringResponse<___R>;
4419
4420        fn respond(response: ___R) -> Self::Output {
4421            crate::generic::EchoEchoStringResponse { response: response }
4422        }
4423    }
4424
4425    pub struct SendString;
4426
4427    impl ::fidl_next::Method for SendString {
4428        const ORDINAL: u64 = 6693688511394337905;
4429        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4430            ::fidl_next::protocol::Flexibility::Strict;
4431
4432        type Protocol = crate::Echo;
4433
4434        type Request = crate::wire::EchoSendStringRequest<'static>;
4435    }
4436
4437    pub struct OnString;
4438
4439    impl ::fidl_next::Method for OnString {
4440        const ORDINAL: u64 = 1382143211280629483;
4441        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4442            ::fidl_next::protocol::Flexibility::Strict;
4443
4444        type Protocol = crate::Echo;
4445
4446        type Request = crate::wire::EchoOnStringRequest<'static>;
4447    }
4448
4449    mod ___detail {
4450        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Echo
4451        where
4452            ___T: ::fidl_next::Transport,
4453        {
4454            type Client = EchoClient<___T>;
4455            type Server = EchoServer<___T>;
4456        }
4457
4458        /// The client for the `Echo` protocol.
4459        #[repr(transparent)]
4460        pub struct EchoClient<___T: ::fidl_next::Transport> {
4461            #[allow(dead_code)]
4462            client: ::fidl_next::protocol::Client<___T>,
4463        }
4464
4465        impl<___T> EchoClient<___T>
4466        where
4467            ___T: ::fidl_next::Transport,
4468        {
4469            pub fn echo_string(
4470                &self,
4471
4472                value: impl ::fidl_next::Encode<
4473                    ::fidl_next::wire::String<'static>,
4474                    <___T as ::fidl_next::Transport>::SendBuffer,
4475                >,
4476            ) -> ::fidl_next::TwoWayFuture<'_, super::EchoString, ___T>
4477            where
4478                <___T as ::fidl_next::Transport>::SendBuffer:
4479                    ::fidl_next::encoder::InternalHandleEncoder,
4480                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4481            {
4482                self.echo_string_with(crate::generic::EchoEchoStringRequest { value })
4483            }
4484
4485            pub fn echo_string_with<___R>(
4486                &self,
4487                request: ___R,
4488            ) -> ::fidl_next::TwoWayFuture<'_, super::EchoString, ___T>
4489            where
4490                ___R: ::fidl_next::Encode<
4491                        crate::wire::EchoEchoStringRequest<'static>,
4492                        <___T as ::fidl_next::Transport>::SendBuffer,
4493                    >,
4494            {
4495                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4496                    8482573115503257110,
4497                    <super::EchoString as ::fidl_next::Method>::FLEXIBILITY,
4498                    request,
4499                ))
4500            }
4501
4502            pub fn send_string(
4503                &self,
4504
4505                value: impl ::fidl_next::Encode<
4506                    ::fidl_next::wire::String<'static>,
4507                    <___T as ::fidl_next::Transport>::SendBuffer,
4508                >,
4509            ) -> ::fidl_next::SendFuture<'_, ___T>
4510            where
4511                <___T as ::fidl_next::Transport>::SendBuffer:
4512                    ::fidl_next::encoder::InternalHandleEncoder,
4513                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4514            {
4515                self.send_string_with(crate::generic::EchoSendStringRequest { value })
4516            }
4517
4518            pub fn send_string_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
4519            where
4520                ___R: ::fidl_next::Encode<
4521                        crate::wire::EchoSendStringRequest<'static>,
4522                        <___T as ::fidl_next::Transport>::SendBuffer,
4523                    >,
4524            {
4525                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
4526                    6693688511394337905,
4527                    <super::SendString as ::fidl_next::Method>::FLEXIBILITY,
4528                    request,
4529                ))
4530            }
4531        }
4532
4533        /// The server for the `Echo` protocol.
4534        #[repr(transparent)]
4535        pub struct EchoServer<___T: ::fidl_next::Transport> {
4536            server: ::fidl_next::protocol::Server<___T>,
4537        }
4538
4539        impl<___T> EchoServer<___T>
4540        where
4541            ___T: ::fidl_next::Transport,
4542        {
4543            pub fn on_string(
4544                &self,
4545
4546                response: impl ::fidl_next::Encode<
4547                    ::fidl_next::wire::String<'static>,
4548                    <___T as ::fidl_next::Transport>::SendBuffer,
4549                >,
4550            ) -> ::fidl_next::SendFuture<'_, ___T>
4551            where
4552                <___T as ::fidl_next::Transport>::SendBuffer:
4553                    ::fidl_next::encoder::InternalHandleEncoder,
4554                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4555            {
4556                self.on_string_with(crate::generic::EchoOnStringRequest { response })
4557            }
4558
4559            pub fn on_string_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
4560            where
4561                ___R: ::fidl_next::Encode<
4562                        <super::OnString as ::fidl_next::Method>::Request,
4563                        <___T as ::fidl_next::Transport>::SendBuffer,
4564                    >,
4565            {
4566                ::fidl_next::SendFuture::from_untyped(self.server.send_event(
4567                    1382143211280629483,
4568                    <super::OnString as ::fidl_next::Method>::FLEXIBILITY,
4569                    request,
4570                ))
4571            }
4572        }
4573    }
4574}
4575
4576#[diagnostic::on_unimplemented(
4577    note = "If {Self} implements the non-local EchoClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4578)]
4579
4580/// A client handler for the Echo protocol.
4581///
4582/// See [`Echo`] for more details.
4583pub trait EchoLocalClientHandler<
4584    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4585    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4586>
4587{
4588    fn on_string(
4589        &mut self,
4590
4591        request: ::fidl_next::Request<echo::OnString, ___T>,
4592    ) -> impl ::core::future::Future<Output = ()>;
4593}
4594
4595impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Echo
4596where
4597    ___H: EchoLocalClientHandler<___T>,
4598    ___T: ::fidl_next::Transport,
4599    for<'de> crate::wire::EchoOnStringRequest<'de>: ::fidl_next::Decode<
4600            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4601            Constraint = (),
4602        >,
4603{
4604    async fn on_event(
4605        handler: &mut ___H,
4606        ordinal: u64,
4607        flexibility: ::fidl_next::protocol::Flexibility,
4608        body: ::fidl_next::Body<___T>,
4609    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4610        match ordinal {
4611            1382143211280629483 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4612                Ok(decoded) => {
4613                    handler.on_string(::fidl_next::Request::from_decoded(decoded)).await;
4614                    Ok(())
4615                }
4616                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4617                    ordinal: 1382143211280629483,
4618                    error,
4619                }),
4620            },
4621
4622            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4623        }
4624    }
4625}
4626
4627#[diagnostic::on_unimplemented(
4628    note = "If {Self} implements the non-local EchoServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4629)]
4630
4631/// A server handler for the Echo protocol.
4632///
4633/// See [`Echo`] for more details.
4634pub trait EchoLocalServerHandler<
4635    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4636    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4637>
4638{
4639    fn echo_string(
4640        &mut self,
4641
4642        request: ::fidl_next::Request<echo::EchoString, ___T>,
4643
4644        responder: ::fidl_next::Responder<echo::EchoString, ___T>,
4645    ) -> impl ::core::future::Future<Output = ()>;
4646
4647    fn send_string(
4648        &mut self,
4649
4650        request: ::fidl_next::Request<echo::SendString, ___T>,
4651    ) -> impl ::core::future::Future<Output = ()>;
4652}
4653
4654impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Echo
4655where
4656    ___H: EchoLocalServerHandler<___T>,
4657    ___T: ::fidl_next::Transport,
4658    for<'de> crate::wire::EchoEchoStringRequest<'de>: ::fidl_next::Decode<
4659            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4660            Constraint = (),
4661        >,
4662    for<'de> crate::wire::EchoSendStringRequest<'de>: ::fidl_next::Decode<
4663            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4664            Constraint = (),
4665        >,
4666{
4667    async fn on_one_way(
4668        handler: &mut ___H,
4669        ordinal: u64,
4670        flexibility: ::fidl_next::protocol::Flexibility,
4671        body: ::fidl_next::Body<___T>,
4672    ) -> ::core::result::Result<
4673        (),
4674        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4675    > {
4676        match ordinal {
4677            6693688511394337905 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4678                Ok(decoded) => {
4679                    handler.send_string(::fidl_next::Request::from_decoded(decoded)).await;
4680                    Ok(())
4681                }
4682                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4683                    ordinal: 6693688511394337905,
4684                    error,
4685                }),
4686            },
4687
4688            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4689        }
4690    }
4691
4692    async fn on_two_way(
4693        handler: &mut ___H,
4694        ordinal: u64,
4695        flexibility: ::fidl_next::protocol::Flexibility,
4696        body: ::fidl_next::Body<___T>,
4697        responder: ::fidl_next::protocol::Responder<___T>,
4698    ) -> ::core::result::Result<
4699        (),
4700        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4701    > {
4702        match ordinal {
4703            8482573115503257110 => {
4704                let responder = ::fidl_next::Responder::from_untyped(responder);
4705
4706                match ::fidl_next::AsDecoderExt::into_decoded(body) {
4707                    Ok(decoded) => {
4708                        handler
4709                            .echo_string(::fidl_next::Request::from_decoded(decoded), responder)
4710                            .await;
4711                        Ok(())
4712                    }
4713                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4714                        ordinal: 8482573115503257110,
4715                        error,
4716                    }),
4717                }
4718            }
4719
4720            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4721        }
4722    }
4723}
4724
4725/// A client handler for the Echo protocol.
4726///
4727/// See [`Echo`] for more details.
4728pub trait EchoClientHandler<
4729    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4730    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4731>
4732{
4733    fn on_string(
4734        &mut self,
4735
4736        request: ::fidl_next::Request<echo::OnString, ___T>,
4737    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4738}
4739
4740impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Echo
4741where
4742    ___H: EchoClientHandler<___T> + ::core::marker::Send,
4743    ___T: ::fidl_next::Transport,
4744    for<'de> crate::wire::EchoOnStringRequest<'de>: ::fidl_next::Decode<
4745            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4746            Constraint = (),
4747        >,
4748{
4749    async fn on_event(
4750        handler: &mut ___H,
4751        ordinal: u64,
4752        flexibility: ::fidl_next::protocol::Flexibility,
4753        body: ::fidl_next::Body<___T>,
4754    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4755        match ordinal {
4756            1382143211280629483 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4757                Ok(decoded) => {
4758                    handler.on_string(::fidl_next::Request::from_decoded(decoded)).await;
4759                    Ok(())
4760                }
4761                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4762                    ordinal: 1382143211280629483,
4763                    error,
4764                }),
4765            },
4766
4767            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4768        }
4769    }
4770}
4771
4772/// A server handler for the Echo protocol.
4773///
4774/// See [`Echo`] for more details.
4775pub trait EchoServerHandler<
4776    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4777    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4778>
4779{
4780    fn echo_string(
4781        &mut self,
4782
4783        request: ::fidl_next::Request<echo::EchoString, ___T>,
4784
4785        responder: ::fidl_next::Responder<echo::EchoString, ___T>,
4786    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4787
4788    fn send_string(
4789        &mut self,
4790
4791        request: ::fidl_next::Request<echo::SendString, ___T>,
4792    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4793}
4794
4795impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Echo
4796where
4797    ___H: EchoServerHandler<___T> + ::core::marker::Send,
4798    ___T: ::fidl_next::Transport,
4799    for<'de> crate::wire::EchoEchoStringRequest<'de>: ::fidl_next::Decode<
4800            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4801            Constraint = (),
4802        >,
4803    for<'de> crate::wire::EchoSendStringRequest<'de>: ::fidl_next::Decode<
4804            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4805            Constraint = (),
4806        >,
4807{
4808    async fn on_one_way(
4809        handler: &mut ___H,
4810        ordinal: u64,
4811        flexibility: ::fidl_next::protocol::Flexibility,
4812        body: ::fidl_next::Body<___T>,
4813    ) -> ::core::result::Result<
4814        (),
4815        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4816    > {
4817        match ordinal {
4818            6693688511394337905 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4819                Ok(decoded) => {
4820                    handler.send_string(::fidl_next::Request::from_decoded(decoded)).await;
4821                    Ok(())
4822                }
4823                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4824                    ordinal: 6693688511394337905,
4825                    error,
4826                }),
4827            },
4828
4829            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4830        }
4831    }
4832
4833    async fn on_two_way(
4834        handler: &mut ___H,
4835        ordinal: u64,
4836        flexibility: ::fidl_next::protocol::Flexibility,
4837        body: ::fidl_next::Body<___T>,
4838        responder: ::fidl_next::protocol::Responder<___T>,
4839    ) -> ::core::result::Result<
4840        (),
4841        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4842    > {
4843        match ordinal {
4844            8482573115503257110 => {
4845                let responder = ::fidl_next::Responder::from_untyped(responder);
4846
4847                match ::fidl_next::AsDecoderExt::into_decoded(body) {
4848                    Ok(decoded) => {
4849                        handler
4850                            .echo_string(::fidl_next::Request::from_decoded(decoded), responder)
4851                            .await;
4852                        Ok(())
4853                    }
4854                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4855                        ordinal: 8482573115503257110,
4856                        error,
4857                    }),
4858                }
4859            }
4860
4861            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4862        }
4863    }
4864}
4865
4866impl<___T> EchoClientHandler<___T> for ::fidl_next::IgnoreEvents
4867where
4868    ___T: ::fidl_next::Transport,
4869{
4870    async fn on_string(&mut self, _: ::fidl_next::Request<echo::OnString, ___T>) {}
4871}
4872
4873impl<___H, ___T> EchoLocalClientHandler<___T> for ::fidl_next::Local<___H>
4874where
4875    ___H: EchoClientHandler<___T>,
4876    ___T: ::fidl_next::Transport,
4877{
4878    async fn on_string(&mut self, request: ::fidl_next::Request<echo::OnString, ___T>) {
4879        ___H::on_string(&mut self.0, request).await
4880    }
4881}
4882
4883impl<___H, ___T> EchoLocalServerHandler<___T> for ::fidl_next::Local<___H>
4884where
4885    ___H: EchoServerHandler<___T>,
4886    ___T: ::fidl_next::Transport,
4887{
4888    async fn echo_string(
4889        &mut self,
4890
4891        request: ::fidl_next::Request<echo::EchoString, ___T>,
4892
4893        responder: ::fidl_next::Responder<echo::EchoString, ___T>,
4894    ) {
4895        ___H::echo_string(&mut self.0, request, responder).await
4896    }
4897
4898    async fn send_string(&mut self, request: ::fidl_next::Request<echo::SendString, ___T>) {
4899        ___H::send_string(&mut self.0, request).await
4900    }
4901}
4902
4903pub const NAME: &str = "Tic-Tac-Toe";
4904
4905/// The type corresponding to the TicTacToe protocol.
4906#[derive(PartialEq, Debug)]
4907pub struct TicTacToe;
4908
4909#[cfg(target_os = "fuchsia")]
4910impl ::fidl_next::HasTransport for TicTacToe {
4911    type Transport = ::fidl_next::fuchsia::zx::Channel;
4912}
4913
4914pub mod tic_tac_toe {
4915    pub mod prelude {
4916        pub use crate::{
4917            TicTacToe, TicTacToeClientHandler, TicTacToeLocalClientHandler,
4918            TicTacToeLocalServerHandler, TicTacToeServerHandler, tic_tac_toe,
4919        };
4920
4921        pub use crate::natural::TicTacToeMakeMoveRequest;
4922
4923        pub use crate::natural::TicTacToeMakeMoveResponse;
4924
4925        pub use crate::natural::TicTacToeOnOpponentMoveRequest;
4926
4927        pub use crate::natural::TicTacToeStartGameRequest;
4928    }
4929
4930    pub struct StartGame;
4931
4932    impl ::fidl_next::Method for StartGame {
4933        const ORDINAL: u64 = 1597785876893992537;
4934        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4935            ::fidl_next::protocol::Flexibility::Strict;
4936
4937        type Protocol = crate::TicTacToe;
4938
4939        type Request = crate::wire::TicTacToeStartGameRequest;
4940    }
4941
4942    pub struct MakeMove;
4943
4944    impl ::fidl_next::Method for MakeMove {
4945        const ORDINAL: u64 = 9215857243616535889;
4946        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4947            ::fidl_next::protocol::Flexibility::Strict;
4948
4949        type Protocol = crate::TicTacToe;
4950
4951        type Request = crate::wire::TicTacToeMakeMoveRequest;
4952    }
4953
4954    impl ::fidl_next::TwoWayMethod for MakeMove {
4955        type Response = crate::wire::TicTacToeMakeMoveResponse<'static>;
4956    }
4957
4958    impl<___R> ::fidl_next::Respond<___R> for MakeMove {
4959        type Output = ___R;
4960
4961        fn respond(response: ___R) -> Self::Output {
4962            response
4963        }
4964    }
4965
4966    pub struct OnOpponentMove;
4967
4968    impl ::fidl_next::Method for OnOpponentMove {
4969        const ORDINAL: u64 = 6020456714778822440;
4970        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4971            ::fidl_next::protocol::Flexibility::Strict;
4972
4973        type Protocol = crate::TicTacToe;
4974
4975        type Request = crate::wire::TicTacToeOnOpponentMoveRequest;
4976    }
4977
4978    mod ___detail {
4979        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::TicTacToe
4980        where
4981            ___T: ::fidl_next::Transport,
4982        {
4983            type Client = TicTacToeClient<___T>;
4984            type Server = TicTacToeServer<___T>;
4985        }
4986
4987        /// The client for the `TicTacToe` protocol.
4988        #[repr(transparent)]
4989        pub struct TicTacToeClient<___T: ::fidl_next::Transport> {
4990            #[allow(dead_code)]
4991            client: ::fidl_next::protocol::Client<___T>,
4992        }
4993
4994        impl<___T> TicTacToeClient<___T>
4995        where
4996            ___T: ::fidl_next::Transport,
4997        {
4998            pub fn start_game(
4999                &self,
5000
5001                start_first: impl ::fidl_next::Encode<
5002                    bool,
5003                    <___T as ::fidl_next::Transport>::SendBuffer,
5004                >,
5005            ) -> ::fidl_next::SendFuture<'_, ___T>
5006            where
5007                <___T as ::fidl_next::Transport>::SendBuffer:
5008                    ::fidl_next::encoder::InternalHandleEncoder,
5009            {
5010                self.start_game_with(crate::generic::TicTacToeStartGameRequest { start_first })
5011            }
5012
5013            pub fn start_game_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
5014            where
5015                ___R: ::fidl_next::Encode<
5016                        crate::wire::TicTacToeStartGameRequest,
5017                        <___T as ::fidl_next::Transport>::SendBuffer,
5018                    >,
5019            {
5020                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
5021                    1597785876893992537,
5022                    <super::StartGame as ::fidl_next::Method>::FLEXIBILITY,
5023                    request,
5024                ))
5025            }
5026
5027            pub fn make_move(
5028                &self,
5029
5030                row: impl ::fidl_next::Encode<u8, <___T as ::fidl_next::Transport>::SendBuffer>,
5031
5032                col: impl ::fidl_next::Encode<u8, <___T as ::fidl_next::Transport>::SendBuffer>,
5033            ) -> ::fidl_next::TwoWayFuture<'_, super::MakeMove, ___T>
5034            where
5035                <___T as ::fidl_next::Transport>::SendBuffer:
5036                    ::fidl_next::encoder::InternalHandleEncoder,
5037            {
5038                self.make_move_with(crate::generic::TicTacToeMakeMoveRequest { row, col })
5039            }
5040
5041            pub fn make_move_with<___R>(
5042                &self,
5043                request: ___R,
5044            ) -> ::fidl_next::TwoWayFuture<'_, super::MakeMove, ___T>
5045            where
5046                ___R: ::fidl_next::Encode<
5047                        crate::wire::TicTacToeMakeMoveRequest,
5048                        <___T as ::fidl_next::Transport>::SendBuffer,
5049                    >,
5050            {
5051                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
5052                    9215857243616535889,
5053                    <super::MakeMove as ::fidl_next::Method>::FLEXIBILITY,
5054                    request,
5055                ))
5056            }
5057        }
5058
5059        /// The server for the `TicTacToe` protocol.
5060        #[repr(transparent)]
5061        pub struct TicTacToeServer<___T: ::fidl_next::Transport> {
5062            server: ::fidl_next::protocol::Server<___T>,
5063        }
5064
5065        impl<___T> TicTacToeServer<___T>
5066        where
5067            ___T: ::fidl_next::Transport,
5068        {
5069            pub fn on_opponent_move(
5070                &self,
5071
5072                new_state: impl ::fidl_next::Encode<
5073                    crate::wire::GameState,
5074                    <___T as ::fidl_next::Transport>::SendBuffer,
5075                >,
5076            ) -> ::fidl_next::SendFuture<'_, ___T>
5077            where
5078                <___T as ::fidl_next::Transport>::SendBuffer:
5079                    ::fidl_next::encoder::InternalHandleEncoder,
5080            {
5081                self.on_opponent_move_with(crate::generic::TicTacToeOnOpponentMoveRequest {
5082                    new_state,
5083                })
5084            }
5085
5086            pub fn on_opponent_move_with<___R>(
5087                &self,
5088                request: ___R,
5089            ) -> ::fidl_next::SendFuture<'_, ___T>
5090            where
5091                ___R: ::fidl_next::Encode<
5092                        <super::OnOpponentMove as ::fidl_next::Method>::Request,
5093                        <___T as ::fidl_next::Transport>::SendBuffer,
5094                    >,
5095            {
5096                ::fidl_next::SendFuture::from_untyped(self.server.send_event(
5097                    6020456714778822440,
5098                    <super::OnOpponentMove as ::fidl_next::Method>::FLEXIBILITY,
5099                    request,
5100                ))
5101            }
5102        }
5103    }
5104}
5105
5106#[diagnostic::on_unimplemented(
5107    note = "If {Self} implements the non-local TicTacToeClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
5108)]
5109
5110/// A client handler for the TicTacToe protocol.
5111///
5112/// See [`TicTacToe`] for more details.
5113pub trait TicTacToeLocalClientHandler<
5114    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5115    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5116>
5117{
5118    fn on_opponent_move(
5119        &mut self,
5120
5121        request: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5122    ) -> impl ::core::future::Future<Output = ()>;
5123}
5124
5125impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for TicTacToe
5126where
5127    ___H: TicTacToeLocalClientHandler<___T>,
5128    ___T: ::fidl_next::Transport,
5129    for<'de> crate::wire::TicTacToeOnOpponentMoveRequest: ::fidl_next::Decode<
5130            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5131            Constraint = (),
5132        >,
5133{
5134    async fn on_event(
5135        handler: &mut ___H,
5136        ordinal: u64,
5137        flexibility: ::fidl_next::protocol::Flexibility,
5138        body: ::fidl_next::Body<___T>,
5139    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5140        match ordinal {
5141            6020456714778822440 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
5142                Ok(decoded) => {
5143                    handler.on_opponent_move(::fidl_next::Request::from_decoded(decoded)).await;
5144                    Ok(())
5145                }
5146                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5147                    ordinal: 6020456714778822440,
5148                    error,
5149                }),
5150            },
5151
5152            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5153        }
5154    }
5155}
5156
5157#[diagnostic::on_unimplemented(
5158    note = "If {Self} implements the non-local TicTacToeServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
5159)]
5160
5161/// A server handler for the TicTacToe protocol.
5162///
5163/// See [`TicTacToe`] for more details.
5164pub trait TicTacToeLocalServerHandler<
5165    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5166    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5167>
5168{
5169    fn start_game(
5170        &mut self,
5171
5172        request: ::fidl_next::Request<tic_tac_toe::StartGame, ___T>,
5173    ) -> impl ::core::future::Future<Output = ()>;
5174
5175    fn make_move(
5176        &mut self,
5177
5178        request: ::fidl_next::Request<tic_tac_toe::MakeMove, ___T>,
5179
5180        responder: ::fidl_next::Responder<tic_tac_toe::MakeMove, ___T>,
5181    ) -> impl ::core::future::Future<Output = ()>;
5182}
5183
5184impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for TicTacToe
5185where
5186    ___H: TicTacToeLocalServerHandler<___T>,
5187    ___T: ::fidl_next::Transport,
5188    for<'de> crate::wire::TicTacToeStartGameRequest: ::fidl_next::Decode<
5189            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5190            Constraint = (),
5191        >,
5192    for<'de> crate::wire::TicTacToeMakeMoveRequest: ::fidl_next::Decode<
5193            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5194            Constraint = (),
5195        >,
5196{
5197    async fn on_one_way(
5198        handler: &mut ___H,
5199        ordinal: u64,
5200        flexibility: ::fidl_next::protocol::Flexibility,
5201        body: ::fidl_next::Body<___T>,
5202    ) -> ::core::result::Result<
5203        (),
5204        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5205    > {
5206        match ordinal {
5207            1597785876893992537 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
5208                Ok(decoded) => {
5209                    handler.start_game(::fidl_next::Request::from_decoded(decoded)).await;
5210                    Ok(())
5211                }
5212                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5213                    ordinal: 1597785876893992537,
5214                    error,
5215                }),
5216            },
5217
5218            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5219        }
5220    }
5221
5222    async fn on_two_way(
5223        handler: &mut ___H,
5224        ordinal: u64,
5225        flexibility: ::fidl_next::protocol::Flexibility,
5226        body: ::fidl_next::Body<___T>,
5227        responder: ::fidl_next::protocol::Responder<___T>,
5228    ) -> ::core::result::Result<
5229        (),
5230        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5231    > {
5232        match ordinal {
5233            9215857243616535889 => {
5234                let responder = ::fidl_next::Responder::from_untyped(responder);
5235
5236                match ::fidl_next::AsDecoderExt::into_decoded(body) {
5237                    Ok(decoded) => {
5238                        handler
5239                            .make_move(::fidl_next::Request::from_decoded(decoded), responder)
5240                            .await;
5241                        Ok(())
5242                    }
5243                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5244                        ordinal: 9215857243616535889,
5245                        error,
5246                    }),
5247                }
5248            }
5249
5250            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5251        }
5252    }
5253}
5254
5255/// A client handler for the TicTacToe protocol.
5256///
5257/// See [`TicTacToe`] for more details.
5258pub trait TicTacToeClientHandler<
5259    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5260    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5261>
5262{
5263    fn on_opponent_move(
5264        &mut self,
5265
5266        request: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5267    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5268}
5269
5270impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for TicTacToe
5271where
5272    ___H: TicTacToeClientHandler<___T> + ::core::marker::Send,
5273    ___T: ::fidl_next::Transport,
5274    for<'de> crate::wire::TicTacToeOnOpponentMoveRequest: ::fidl_next::Decode<
5275            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5276            Constraint = (),
5277        >,
5278{
5279    async fn on_event(
5280        handler: &mut ___H,
5281        ordinal: u64,
5282        flexibility: ::fidl_next::protocol::Flexibility,
5283        body: ::fidl_next::Body<___T>,
5284    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5285        match ordinal {
5286            6020456714778822440 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
5287                Ok(decoded) => {
5288                    handler.on_opponent_move(::fidl_next::Request::from_decoded(decoded)).await;
5289                    Ok(())
5290                }
5291                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5292                    ordinal: 6020456714778822440,
5293                    error,
5294                }),
5295            },
5296
5297            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5298        }
5299    }
5300}
5301
5302/// A server handler for the TicTacToe protocol.
5303///
5304/// See [`TicTacToe`] for more details.
5305pub trait TicTacToeServerHandler<
5306    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5307    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5308>
5309{
5310    fn start_game(
5311        &mut self,
5312
5313        request: ::fidl_next::Request<tic_tac_toe::StartGame, ___T>,
5314    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5315
5316    fn make_move(
5317        &mut self,
5318
5319        request: ::fidl_next::Request<tic_tac_toe::MakeMove, ___T>,
5320
5321        responder: ::fidl_next::Responder<tic_tac_toe::MakeMove, ___T>,
5322    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5323}
5324
5325impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for TicTacToe
5326where
5327    ___H: TicTacToeServerHandler<___T> + ::core::marker::Send,
5328    ___T: ::fidl_next::Transport,
5329    for<'de> crate::wire::TicTacToeStartGameRequest: ::fidl_next::Decode<
5330            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5331            Constraint = (),
5332        >,
5333    for<'de> crate::wire::TicTacToeMakeMoveRequest: ::fidl_next::Decode<
5334            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5335            Constraint = (),
5336        >,
5337{
5338    async fn on_one_way(
5339        handler: &mut ___H,
5340        ordinal: u64,
5341        flexibility: ::fidl_next::protocol::Flexibility,
5342        body: ::fidl_next::Body<___T>,
5343    ) -> ::core::result::Result<
5344        (),
5345        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5346    > {
5347        match ordinal {
5348            1597785876893992537 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
5349                Ok(decoded) => {
5350                    handler.start_game(::fidl_next::Request::from_decoded(decoded)).await;
5351                    Ok(())
5352                }
5353                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5354                    ordinal: 1597785876893992537,
5355                    error,
5356                }),
5357            },
5358
5359            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5360        }
5361    }
5362
5363    async fn on_two_way(
5364        handler: &mut ___H,
5365        ordinal: u64,
5366        flexibility: ::fidl_next::protocol::Flexibility,
5367        body: ::fidl_next::Body<___T>,
5368        responder: ::fidl_next::protocol::Responder<___T>,
5369    ) -> ::core::result::Result<
5370        (),
5371        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5372    > {
5373        match ordinal {
5374            9215857243616535889 => {
5375                let responder = ::fidl_next::Responder::from_untyped(responder);
5376
5377                match ::fidl_next::AsDecoderExt::into_decoded(body) {
5378                    Ok(decoded) => {
5379                        handler
5380                            .make_move(::fidl_next::Request::from_decoded(decoded), responder)
5381                            .await;
5382                        Ok(())
5383                    }
5384                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5385                        ordinal: 9215857243616535889,
5386                        error,
5387                    }),
5388                }
5389            }
5390
5391            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5392        }
5393    }
5394}
5395
5396impl<___T> TicTacToeClientHandler<___T> for ::fidl_next::IgnoreEvents
5397where
5398    ___T: ::fidl_next::Transport,
5399{
5400    async fn on_opponent_move(
5401        &mut self,
5402
5403        _: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5404    ) {
5405    }
5406}
5407
5408impl<___H, ___T> TicTacToeLocalClientHandler<___T> for ::fidl_next::Local<___H>
5409where
5410    ___H: TicTacToeClientHandler<___T>,
5411    ___T: ::fidl_next::Transport,
5412{
5413    async fn on_opponent_move(
5414        &mut self,
5415
5416        request: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5417    ) {
5418        ___H::on_opponent_move(&mut self.0, request).await
5419    }
5420}
5421
5422impl<___H, ___T> TicTacToeLocalServerHandler<___T> for ::fidl_next::Local<___H>
5423where
5424    ___H: TicTacToeServerHandler<___T>,
5425    ___T: ::fidl_next::Transport,
5426{
5427    async fn start_game(&mut self, request: ::fidl_next::Request<tic_tac_toe::StartGame, ___T>) {
5428        ___H::start_game(&mut self.0, request).await
5429    }
5430
5431    async fn make_move(
5432        &mut self,
5433
5434        request: ::fidl_next::Request<tic_tac_toe::MakeMove, ___T>,
5435
5436        responder: ::fidl_next::Responder<tic_tac_toe::MakeMove, ___T>,
5437    ) {
5438        ___H::make_move(&mut self.0, request, responder).await
5439    }
5440}