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