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