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