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 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FlexibleLocationType, ___E>
1234 for FlexibleLocationType
1235 where
1236 ___E: ?Sized,
1237 {
1238 #[inline]
1239 fn encode(
1240 self,
1241 encoder: &mut ___E,
1242 out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleLocationType>,
1243 _: (),
1244 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1245 ::fidl_next::Encode::encode(&self, encoder, out, ())
1246 }
1247 }
1248
1249 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FlexibleLocationType, ___E>
1250 for &'a FlexibleLocationType
1251 where
1252 ___E: ?Sized,
1253 {
1254 #[inline]
1255 fn encode(
1256 self,
1257 encoder: &mut ___E,
1258 out: &mut ::core::mem::MaybeUninit<crate::wire::FlexibleLocationType>,
1259 _: (),
1260 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1261 ::fidl_next::munge!(let crate::wire::FlexibleLocationType { value } = out);
1262 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1263 FlexibleLocationType::Museum => 1,
1264
1265 FlexibleLocationType::Airport => 2,
1266
1267 FlexibleLocationType::Restaurant => 3,
1268
1269 FlexibleLocationType::UnknownOrdinal_(value) => value,
1270 }));
1271
1272 Ok(())
1273 }
1274 }
1275
1276 impl ::core::convert::From<crate::wire::FlexibleLocationType> for FlexibleLocationType {
1277 fn from(wire: crate::wire::FlexibleLocationType) -> Self {
1278 match u32::from(wire.value) {
1279 1 => Self::Museum,
1280
1281 2 => Self::Airport,
1282
1283 3 => Self::Restaurant,
1284
1285 value => Self::UnknownOrdinal_(value),
1286 }
1287 }
1288 }
1289
1290 impl ::fidl_next::FromWire<crate::wire::FlexibleLocationType> for FlexibleLocationType {
1291 #[inline]
1292 fn from_wire(wire: crate::wire::FlexibleLocationType) -> Self {
1293 Self::from(wire)
1294 }
1295 }
1296
1297 impl ::fidl_next::FromWireRef<crate::wire::FlexibleLocationType> for FlexibleLocationType {
1298 #[inline]
1299 fn from_wire_ref(wire: &crate::wire::FlexibleLocationType) -> Self {
1300 Self::from(*wire)
1301 }
1302 }
1303
1304 pub type GameState = ();
1305
1306 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1307 pub enum JsonValue {
1308 IntValue(i32),
1309
1310 StringValue(::std::string::String),
1311 }
1312
1313 unsafe impl<___E> ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E> for JsonValue
1314 where
1315 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1316 ___E: ::fidl_next::Encoder,
1317 {
1318 #[inline]
1319 fn encode(
1320 self,
1321 encoder: &mut ___E,
1322 out: &mut ::core::mem::MaybeUninit<crate::wire::JsonValue<'static>>,
1323 _: (),
1324 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1325 ::fidl_next::munge!(let crate::wire::JsonValue { raw, _phantom: _ } = out);
1326
1327 match self {
1328 Self::IntValue(value) => ::fidl_next::wire::Union::encode_as::<
1329 ___E,
1330 ::fidl_next::wire::Int32,
1331 >(value, 1, encoder, raw, ())?,
1332
1333 Self::StringValue(value) => ::fidl_next::wire::Union::encode_as::<
1334 ___E,
1335 ::fidl_next::wire::String<'static>,
1336 >(value, 2, encoder, raw, 32)?,
1337 }
1338
1339 Ok(())
1340 }
1341 }
1342
1343 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E> for &'a JsonValue
1344 where
1345 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1346 ___E: ::fidl_next::Encoder,
1347 {
1348 #[inline]
1349 fn encode(
1350 self,
1351 encoder: &mut ___E,
1352 out: &mut ::core::mem::MaybeUninit<crate::wire::JsonValue<'static>>,
1353 _: (),
1354 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1355 ::fidl_next::munge!(let crate::wire::JsonValue { raw, _phantom: _ } = out);
1356
1357 match self {
1358 JsonValue::IntValue(value) => ::fidl_next::wire::Union::encode_as::<
1359 ___E,
1360 ::fidl_next::wire::Int32,
1361 >(value, 1, encoder, raw, ())?,
1362
1363 JsonValue::StringValue(value) => ::fidl_next::wire::Union::encode_as::<
1364 ___E,
1365 ::fidl_next::wire::String<'static>,
1366 >(value, 2, encoder, raw, 32)?,
1367 }
1368
1369 Ok(())
1370 }
1371 }
1372
1373 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::JsonValue<'static>, ___E>
1374 for JsonValue
1375 where
1376 ___E: ?Sized,
1377 JsonValue: ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E>,
1378 {
1379 #[inline]
1380 fn encode_option(
1381 this: ::core::option::Option<Self>,
1382 encoder: &mut ___E,
1383 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::JsonValue<'static>>,
1384 _: (),
1385 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1386 ::fidl_next::munge!(let crate::wire_optional::JsonValue { raw, _phantom: _ } = &mut *out);
1387
1388 if let Some(inner) = this {
1389 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1390 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1391 } else {
1392 ::fidl_next::wire::Union::encode_absent(raw);
1393 }
1394
1395 Ok(())
1396 }
1397 }
1398
1399 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::JsonValue<'static>, ___E>
1400 for &'a JsonValue
1401 where
1402 ___E: ?Sized,
1403 &'a JsonValue: ::fidl_next::Encode<crate::wire::JsonValue<'static>, ___E>,
1404 {
1405 #[inline]
1406 fn encode_option(
1407 this: ::core::option::Option<Self>,
1408 encoder: &mut ___E,
1409 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::JsonValue<'static>>,
1410 _: (),
1411 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1412 ::fidl_next::munge!(let crate::wire_optional::JsonValue { raw, _phantom: _ } = &mut *out);
1413
1414 if let Some(inner) = this {
1415 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1416 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1417 } else {
1418 ::fidl_next::wire::Union::encode_absent(raw);
1419 }
1420
1421 Ok(())
1422 }
1423 }
1424
1425 impl<'de> ::fidl_next::FromWire<crate::wire::JsonValue<'de>> for JsonValue {
1426 #[inline]
1427 fn from_wire(wire: crate::wire::JsonValue<'de>) -> Self {
1428 let wire = ::core::mem::ManuallyDrop::new(wire);
1429 match wire.raw.ordinal() {
1430 1 => Self::IntValue(::fidl_next::FromWire::from_wire(unsafe {
1431 wire.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
1432 })),
1433
1434 2 => Self::StringValue(::fidl_next::FromWire::from_wire(unsafe {
1435 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
1436 })),
1437
1438 _ => unsafe { ::core::hint::unreachable_unchecked() },
1439 }
1440 }
1441 }
1442
1443 impl<'de> ::fidl_next::FromWireRef<crate::wire::JsonValue<'de>> for JsonValue {
1444 #[inline]
1445 fn from_wire_ref(wire: &crate::wire::JsonValue<'de>) -> Self {
1446 match wire.raw.ordinal() {
1447 1 => Self::IntValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1448 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
1449 })),
1450
1451 2 => Self::StringValue(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1452 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
1453 })),
1454
1455 _ => unsafe { ::core::hint::unreachable_unchecked() },
1456 }
1457 }
1458 }
1459
1460 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::JsonValue<'de>> for JsonValue {
1461 #[inline]
1462 fn from_wire_option(
1463 wire: crate::wire_optional::JsonValue<'de>,
1464 ) -> ::core::option::Option<Self> {
1465 if let Some(inner) = wire.into_option() {
1466 Some(::fidl_next::FromWire::from_wire(inner))
1467 } else {
1468 None
1469 }
1470 }
1471 }
1472
1473 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::JsonValue<'de>> for Box<JsonValue> {
1474 #[inline]
1475 fn from_wire_option(
1476 wire: crate::wire_optional::JsonValue<'de>,
1477 ) -> ::core::option::Option<Self> {
1478 <
1479 JsonValue as ::fidl_next::FromWireOption<crate::wire_optional::JsonValue<'de>>
1480 >::from_wire_option(wire).map(Box::new)
1481 }
1482 }
1483
1484 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::JsonValue<'de>> for Box<JsonValue> {
1485 #[inline]
1486 fn from_wire_option_ref(
1487 wire: &crate::wire_optional::JsonValue<'de>,
1488 ) -> ::core::option::Option<Self> {
1489 if let Some(inner) = wire.as_ref() {
1490 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1491 } else {
1492 None
1493 }
1494 }
1495 }
1496
1497 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1498 #[repr(u32)]
1499 pub enum LocationType {
1500 Museum = 1,
1501 Airport = 2,
1502 Restaurant = 3,
1503 }
1504 impl ::core::convert::TryFrom<u32> for LocationType {
1505 type Error = ::fidl_next::UnknownStrictEnumMemberError;
1506 fn try_from(
1507 value: u32,
1508 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
1509 match value {
1510 1 => Ok(Self::Museum),
1511 2 => Ok(Self::Airport),
1512 3 => Ok(Self::Restaurant),
1513
1514 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
1515 }
1516 }
1517 }
1518
1519 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LocationType, ___E> for LocationType
1520 where
1521 ___E: ?Sized,
1522 {
1523 #[inline]
1524 fn encode(
1525 self,
1526 encoder: &mut ___E,
1527 out: &mut ::core::mem::MaybeUninit<crate::wire::LocationType>,
1528 _: (),
1529 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1530 ::fidl_next::Encode::encode(&self, encoder, out, ())
1531 }
1532 }
1533
1534 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LocationType, ___E> for &'a LocationType
1535 where
1536 ___E: ?Sized,
1537 {
1538 #[inline]
1539 fn encode(
1540 self,
1541 encoder: &mut ___E,
1542 out: &mut ::core::mem::MaybeUninit<crate::wire::LocationType>,
1543 _: (),
1544 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1545 ::fidl_next::munge!(let crate::wire::LocationType { value } = out);
1546 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1547 LocationType::Museum => 1,
1548
1549 LocationType::Airport => 2,
1550
1551 LocationType::Restaurant => 3,
1552 }));
1553
1554 Ok(())
1555 }
1556 }
1557
1558 impl ::core::convert::From<crate::wire::LocationType> for LocationType {
1559 fn from(wire: crate::wire::LocationType) -> Self {
1560 match u32::from(wire.value) {
1561 1 => Self::Museum,
1562
1563 2 => Self::Airport,
1564
1565 3 => Self::Restaurant,
1566
1567 _ => unsafe { ::core::hint::unreachable_unchecked() },
1568 }
1569 }
1570 }
1571
1572 impl ::fidl_next::FromWire<crate::wire::LocationType> for LocationType {
1573 #[inline]
1574 fn from_wire(wire: crate::wire::LocationType) -> Self {
1575 Self::from(wire)
1576 }
1577 }
1578
1579 impl ::fidl_next::FromWireRef<crate::wire::LocationType> for LocationType {
1580 #[inline]
1581 fn from_wire_ref(wire: &crate::wire::LocationType) -> Self {
1582 Self::from(*wire)
1583 }
1584 }
1585
1586 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1587 #[repr(C)]
1588 pub struct TicTacToeStartGameRequest {
1589 pub start_first: bool,
1590 }
1591
1592 unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>
1593 for TicTacToeStartGameRequest
1594 where
1595 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1596 {
1597 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1598 Self,
1599 crate::wire::TicTacToeStartGameRequest,
1600 > = unsafe {
1601 ::fidl_next::CopyOptimization::enable_if(
1602 true && <bool as ::fidl_next::Encode<bool, ___E>>::COPY_OPTIMIZATION.is_enabled(),
1603 )
1604 };
1605
1606 #[inline]
1607 fn encode(
1608 self,
1609 encoder_: &mut ___E,
1610 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeStartGameRequest>,
1611 _: (),
1612 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1613 ::fidl_next::munge! {
1614 let crate::wire::TicTacToeStartGameRequest {
1615 start_first,
1616
1617 } = out_;
1618 }
1619
1620 ::fidl_next::Encode::encode(self.start_first, encoder_, start_first, ())?;
1621
1622 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(start_first.as_mut_ptr()) };
1623
1624 Ok(())
1625 }
1626 }
1627
1628 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>
1629 for &'a TicTacToeStartGameRequest
1630 where
1631 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1632 {
1633 #[inline]
1634 fn encode(
1635 self,
1636 encoder_: &mut ___E,
1637 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeStartGameRequest>,
1638 _: (),
1639 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1640 ::fidl_next::munge! {
1641 let crate::wire::TicTacToeStartGameRequest {
1642 start_first,
1643
1644 } = out_;
1645 }
1646
1647 ::fidl_next::Encode::encode(&self.start_first, encoder_, start_first, ())?;
1648
1649 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(start_first.as_mut_ptr()) };
1650
1651 Ok(())
1652 }
1653 }
1654
1655 unsafe impl<___E>
1656 ::fidl_next::EncodeOption<
1657 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1658 ___E,
1659 > for TicTacToeStartGameRequest
1660 where
1661 ___E: ::fidl_next::Encoder + ?Sized,
1662 TicTacToeStartGameRequest:
1663 ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>,
1664 {
1665 #[inline]
1666 fn encode_option(
1667 this: ::core::option::Option<Self>,
1668 encoder: &mut ___E,
1669 out: &mut ::core::mem::MaybeUninit<
1670 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1671 >,
1672 _: (),
1673 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1674 if let Some(inner) = this {
1675 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1676 ::fidl_next::wire::Box::encode_present(out);
1677 } else {
1678 ::fidl_next::wire::Box::encode_absent(out);
1679 }
1680
1681 Ok(())
1682 }
1683 }
1684
1685 unsafe impl<'a, ___E>
1686 ::fidl_next::EncodeOption<
1687 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1688 ___E,
1689 > for &'a TicTacToeStartGameRequest
1690 where
1691 ___E: ::fidl_next::Encoder + ?Sized,
1692 &'a TicTacToeStartGameRequest:
1693 ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>,
1694 {
1695 #[inline]
1696 fn encode_option(
1697 this: ::core::option::Option<Self>,
1698 encoder: &mut ___E,
1699 out: &mut ::core::mem::MaybeUninit<
1700 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeStartGameRequest>,
1701 >,
1702 _: (),
1703 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1704 if let Some(inner) = this {
1705 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1706 ::fidl_next::wire::Box::encode_present(out);
1707 } else {
1708 ::fidl_next::wire::Box::encode_absent(out);
1709 }
1710
1711 Ok(())
1712 }
1713 }
1714
1715 impl ::fidl_next::FromWire<crate::wire::TicTacToeStartGameRequest> for TicTacToeStartGameRequest {
1716 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1717 crate::wire::TicTacToeStartGameRequest,
1718 Self,
1719 > = unsafe {
1720 ::fidl_next::CopyOptimization::enable_if(
1721 true && <bool as ::fidl_next::FromWire<bool>>::COPY_OPTIMIZATION.is_enabled(),
1722 )
1723 };
1724
1725 #[inline]
1726 fn from_wire(wire: crate::wire::TicTacToeStartGameRequest) -> Self {
1727 Self { start_first: ::fidl_next::FromWire::from_wire(wire.start_first) }
1728 }
1729 }
1730
1731 impl ::fidl_next::FromWireRef<crate::wire::TicTacToeStartGameRequest>
1732 for TicTacToeStartGameRequest
1733 {
1734 #[inline]
1735 fn from_wire_ref(wire: &crate::wire::TicTacToeStartGameRequest) -> Self {
1736 Self { start_first: ::fidl_next::FromWireRef::from_wire_ref(&wire.start_first) }
1737 }
1738 }
1739
1740 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1741 #[repr(C)]
1742 pub struct TicTacToeMakeMoveRequest {
1743 pub row: u8,
1744
1745 pub col: u8,
1746 }
1747
1748 unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>
1749 for TicTacToeMakeMoveRequest
1750 where
1751 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1752 {
1753 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1754 Self,
1755 crate::wire::TicTacToeMakeMoveRequest,
1756 > = unsafe {
1757 ::fidl_next::CopyOptimization::enable_if(
1758 true && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled()
1759 && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(),
1760 )
1761 };
1762
1763 #[inline]
1764 fn encode(
1765 self,
1766 encoder_: &mut ___E,
1767 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveRequest>,
1768 _: (),
1769 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1770 ::fidl_next::munge! {
1771 let crate::wire::TicTacToeMakeMoveRequest {
1772 row,
1773 col,
1774
1775 } = out_;
1776 }
1777
1778 ::fidl_next::Encode::encode(self.row, encoder_, row, ())?;
1779
1780 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(row.as_mut_ptr()) };
1781
1782 ::fidl_next::Encode::encode(self.col, encoder_, col, ())?;
1783
1784 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(col.as_mut_ptr()) };
1785
1786 Ok(())
1787 }
1788 }
1789
1790 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>
1791 for &'a TicTacToeMakeMoveRequest
1792 where
1793 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1794 {
1795 #[inline]
1796 fn encode(
1797 self,
1798 encoder_: &mut ___E,
1799 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveRequest>,
1800 _: (),
1801 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1802 ::fidl_next::munge! {
1803 let crate::wire::TicTacToeMakeMoveRequest {
1804 row,
1805 col,
1806
1807 } = out_;
1808 }
1809
1810 ::fidl_next::Encode::encode(&self.row, encoder_, row, ())?;
1811
1812 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(row.as_mut_ptr()) };
1813
1814 ::fidl_next::Encode::encode(&self.col, encoder_, col, ())?;
1815
1816 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(col.as_mut_ptr()) };
1817
1818 Ok(())
1819 }
1820 }
1821
1822 unsafe impl<___E>
1823 ::fidl_next::EncodeOption<
1824 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1825 ___E,
1826 > for TicTacToeMakeMoveRequest
1827 where
1828 ___E: ::fidl_next::Encoder + ?Sized,
1829 TicTacToeMakeMoveRequest: ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>,
1830 {
1831 #[inline]
1832 fn encode_option(
1833 this: ::core::option::Option<Self>,
1834 encoder: &mut ___E,
1835 out: &mut ::core::mem::MaybeUninit<
1836 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1837 >,
1838 _: (),
1839 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1840 if let Some(inner) = this {
1841 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1842 ::fidl_next::wire::Box::encode_present(out);
1843 } else {
1844 ::fidl_next::wire::Box::encode_absent(out);
1845 }
1846
1847 Ok(())
1848 }
1849 }
1850
1851 unsafe impl<'a, ___E>
1852 ::fidl_next::EncodeOption<
1853 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1854 ___E,
1855 > for &'a TicTacToeMakeMoveRequest
1856 where
1857 ___E: ::fidl_next::Encoder + ?Sized,
1858 &'a TicTacToeMakeMoveRequest:
1859 ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>,
1860 {
1861 #[inline]
1862 fn encode_option(
1863 this: ::core::option::Option<Self>,
1864 encoder: &mut ___E,
1865 out: &mut ::core::mem::MaybeUninit<
1866 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveRequest>,
1867 >,
1868 _: (),
1869 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1870 if let Some(inner) = this {
1871 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1872 ::fidl_next::wire::Box::encode_present(out);
1873 } else {
1874 ::fidl_next::wire::Box::encode_absent(out);
1875 }
1876
1877 Ok(())
1878 }
1879 }
1880
1881 impl ::fidl_next::FromWire<crate::wire::TicTacToeMakeMoveRequest> for TicTacToeMakeMoveRequest {
1882 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1883 crate::wire::TicTacToeMakeMoveRequest,
1884 Self,
1885 > = unsafe {
1886 ::fidl_next::CopyOptimization::enable_if(
1887 true && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled()
1888 && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(),
1889 )
1890 };
1891
1892 #[inline]
1893 fn from_wire(wire: crate::wire::TicTacToeMakeMoveRequest) -> Self {
1894 Self {
1895 row: ::fidl_next::FromWire::from_wire(wire.row),
1896
1897 col: ::fidl_next::FromWire::from_wire(wire.col),
1898 }
1899 }
1900 }
1901
1902 impl ::fidl_next::FromWireRef<crate::wire::TicTacToeMakeMoveRequest> for TicTacToeMakeMoveRequest {
1903 #[inline]
1904 fn from_wire_ref(wire: &crate::wire::TicTacToeMakeMoveRequest) -> Self {
1905 Self {
1906 row: ::fidl_next::FromWireRef::from_wire_ref(&wire.row),
1907
1908 col: ::fidl_next::FromWireRef::from_wire_ref(&wire.col),
1909 }
1910 }
1911 }
1912
1913 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1914 pub struct TicTacToeMakeMoveResponse {
1915 pub success: bool,
1916
1917 pub new_state: ::core::option::Option<::std::boxed::Box<crate::natural::GameState>>,
1918 }
1919
1920 unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>
1921 for TicTacToeMakeMoveResponse
1922 where
1923 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1924 ___E: ::fidl_next::Encoder,
1925 {
1926 #[inline]
1927 fn encode(
1928 self,
1929 encoder_: &mut ___E,
1930 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveResponse<'static>>,
1931 _: (),
1932 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1933 ::fidl_next::munge! {
1934 let crate::wire::TicTacToeMakeMoveResponse {
1935 success,
1936 new_state,
1937
1938 } = out_;
1939 }
1940
1941 ::fidl_next::Encode::encode(self.success, encoder_, success, ())?;
1942
1943 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(success.as_mut_ptr()) };
1944
1945 ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
1946
1947 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
1948
1949 Ok(())
1950 }
1951 }
1952
1953 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>
1954 for &'a TicTacToeMakeMoveResponse
1955 where
1956 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1957 ___E: ::fidl_next::Encoder,
1958 {
1959 #[inline]
1960 fn encode(
1961 self,
1962 encoder_: &mut ___E,
1963 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveResponse<'static>>,
1964 _: (),
1965 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1966 ::fidl_next::munge! {
1967 let crate::wire::TicTacToeMakeMoveResponse {
1968 success,
1969 new_state,
1970
1971 } = out_;
1972 }
1973
1974 ::fidl_next::Encode::encode(&self.success, encoder_, success, ())?;
1975
1976 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(success.as_mut_ptr()) };
1977
1978 ::fidl_next::Encode::encode(&self.new_state, encoder_, new_state, ())?;
1979
1980 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
1981
1982 Ok(())
1983 }
1984 }
1985
1986 unsafe impl<___E>
1987 ::fidl_next::EncodeOption<
1988 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
1989 ___E,
1990 > for TicTacToeMakeMoveResponse
1991 where
1992 ___E: ::fidl_next::Encoder + ?Sized,
1993 TicTacToeMakeMoveResponse:
1994 ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>,
1995 {
1996 #[inline]
1997 fn encode_option(
1998 this: ::core::option::Option<Self>,
1999 encoder: &mut ___E,
2000 out: &mut ::core::mem::MaybeUninit<
2001 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
2002 >,
2003 _: (),
2004 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2005 if let Some(inner) = this {
2006 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2007 ::fidl_next::wire::Box::encode_present(out);
2008 } else {
2009 ::fidl_next::wire::Box::encode_absent(out);
2010 }
2011
2012 Ok(())
2013 }
2014 }
2015
2016 unsafe impl<'a, ___E>
2017 ::fidl_next::EncodeOption<
2018 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
2019 ___E,
2020 > for &'a TicTacToeMakeMoveResponse
2021 where
2022 ___E: ::fidl_next::Encoder + ?Sized,
2023 &'a TicTacToeMakeMoveResponse:
2024 ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>,
2025 {
2026 #[inline]
2027 fn encode_option(
2028 this: ::core::option::Option<Self>,
2029 encoder: &mut ___E,
2030 out: &mut ::core::mem::MaybeUninit<
2031 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeMakeMoveResponse<'static>>,
2032 >,
2033 _: (),
2034 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2035 if let Some(inner) = this {
2036 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2037 ::fidl_next::wire::Box::encode_present(out);
2038 } else {
2039 ::fidl_next::wire::Box::encode_absent(out);
2040 }
2041
2042 Ok(())
2043 }
2044 }
2045
2046 impl<'de> ::fidl_next::FromWire<crate::wire::TicTacToeMakeMoveResponse<'de>>
2047 for TicTacToeMakeMoveResponse
2048 {
2049 #[inline]
2050 fn from_wire(wire: crate::wire::TicTacToeMakeMoveResponse<'de>) -> Self {
2051 Self {
2052 success: ::fidl_next::FromWire::from_wire(wire.success),
2053
2054 new_state: ::fidl_next::FromWire::from_wire(wire.new_state),
2055 }
2056 }
2057 }
2058
2059 impl<'de> ::fidl_next::FromWireRef<crate::wire::TicTacToeMakeMoveResponse<'de>>
2060 for TicTacToeMakeMoveResponse
2061 {
2062 #[inline]
2063 fn from_wire_ref(wire: &crate::wire::TicTacToeMakeMoveResponse<'de>) -> Self {
2064 Self {
2065 success: ::fidl_next::FromWireRef::from_wire_ref(&wire.success),
2066
2067 new_state: ::fidl_next::FromWireRef::from_wire_ref(&wire.new_state),
2068 }
2069 }
2070 }
2071
2072 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2073 #[repr(C)]
2074 pub struct TicTacToeOnOpponentMoveRequest {
2075 pub new_state: crate::natural::GameState,
2076 }
2077
2078 unsafe impl<___E> ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>
2079 for TicTacToeOnOpponentMoveRequest
2080 where
2081 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2082 {
2083 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2084 Self,
2085 crate::wire::TicTacToeOnOpponentMoveRequest,
2086 > = unsafe {
2087 ::fidl_next::CopyOptimization::enable_if(
2088 true && <crate::natural::GameState as ::fidl_next::Encode<
2089 crate::wire::GameState,
2090 ___E,
2091 >>::COPY_OPTIMIZATION
2092 .is_enabled(),
2093 )
2094 };
2095
2096 #[inline]
2097 fn encode(
2098 self,
2099 encoder_: &mut ___E,
2100 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeOnOpponentMoveRequest>,
2101 _: (),
2102 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2103 ::fidl_next::munge! {
2104 let crate::wire::TicTacToeOnOpponentMoveRequest {
2105 new_state,
2106
2107 } = out_;
2108 }
2109
2110 ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
2111
2112 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
2113
2114 Ok(())
2115 }
2116 }
2117
2118 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>
2119 for &'a TicTacToeOnOpponentMoveRequest
2120 where
2121 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2122 {
2123 #[inline]
2124 fn encode(
2125 self,
2126 encoder_: &mut ___E,
2127 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeOnOpponentMoveRequest>,
2128 _: (),
2129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2130 ::fidl_next::munge! {
2131 let crate::wire::TicTacToeOnOpponentMoveRequest {
2132 new_state,
2133
2134 } = out_;
2135 }
2136
2137 ::fidl_next::Encode::encode(&self.new_state, encoder_, new_state, ())?;
2138
2139 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(new_state.as_mut_ptr()) };
2140
2141 Ok(())
2142 }
2143 }
2144
2145 unsafe impl<___E>
2146 ::fidl_next::EncodeOption<
2147 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2148 ___E,
2149 > for TicTacToeOnOpponentMoveRequest
2150 where
2151 ___E: ::fidl_next::Encoder + ?Sized,
2152 TicTacToeOnOpponentMoveRequest:
2153 ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>,
2154 {
2155 #[inline]
2156 fn encode_option(
2157 this: ::core::option::Option<Self>,
2158 encoder: &mut ___E,
2159 out: &mut ::core::mem::MaybeUninit<
2160 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2161 >,
2162 _: (),
2163 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2164 if let Some(inner) = this {
2165 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2166 ::fidl_next::wire::Box::encode_present(out);
2167 } else {
2168 ::fidl_next::wire::Box::encode_absent(out);
2169 }
2170
2171 Ok(())
2172 }
2173 }
2174
2175 unsafe impl<'a, ___E>
2176 ::fidl_next::EncodeOption<
2177 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2178 ___E,
2179 > for &'a TicTacToeOnOpponentMoveRequest
2180 where
2181 ___E: ::fidl_next::Encoder + ?Sized,
2182 &'a TicTacToeOnOpponentMoveRequest:
2183 ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>,
2184 {
2185 #[inline]
2186 fn encode_option(
2187 this: ::core::option::Option<Self>,
2188 encoder: &mut ___E,
2189 out: &mut ::core::mem::MaybeUninit<
2190 ::fidl_next::wire::Box<'static, crate::wire::TicTacToeOnOpponentMoveRequest>,
2191 >,
2192 _: (),
2193 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2194 if let Some(inner) = this {
2195 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2196 ::fidl_next::wire::Box::encode_present(out);
2197 } else {
2198 ::fidl_next::wire::Box::encode_absent(out);
2199 }
2200
2201 Ok(())
2202 }
2203 }
2204
2205 impl ::fidl_next::FromWire<crate::wire::TicTacToeOnOpponentMoveRequest>
2206 for TicTacToeOnOpponentMoveRequest
2207 {
2208 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2209 crate::wire::TicTacToeOnOpponentMoveRequest,
2210 Self,
2211 > = unsafe {
2212 ::fidl_next::CopyOptimization::enable_if(
2213 true && <crate::natural::GameState as ::fidl_next::FromWire<
2214 crate::wire::GameState,
2215 >>::COPY_OPTIMIZATION
2216 .is_enabled(),
2217 )
2218 };
2219
2220 #[inline]
2221 fn from_wire(wire: crate::wire::TicTacToeOnOpponentMoveRequest) -> Self {
2222 Self { new_state: ::fidl_next::FromWire::from_wire(wire.new_state) }
2223 }
2224 }
2225
2226 impl ::fidl_next::FromWireRef<crate::wire::TicTacToeOnOpponentMoveRequest>
2227 for TicTacToeOnOpponentMoveRequest
2228 {
2229 #[inline]
2230 fn from_wire_ref(wire: &crate::wire::TicTacToeOnOpponentMoveRequest) -> Self {
2231 Self { new_state: ::fidl_next::FromWireRef::from_wire_ref(&wire.new_state) }
2232 }
2233 }
2234
2235 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2236 pub struct User {
2237 pub age: ::core::option::Option<u8>,
2238
2239 pub name: ::core::option::Option<::std::string::String>,
2240 }
2241
2242 impl User {
2243 fn __max_ordinal(&self) -> usize {
2244 if self.name.is_some() {
2245 return 2;
2246 }
2247
2248 if self.age.is_some() {
2249 return 1;
2250 }
2251
2252 0
2253 }
2254 }
2255
2256 unsafe impl<___E> ::fidl_next::Encode<crate::wire::User<'static>, ___E> for User
2257 where
2258 ___E: ::fidl_next::Encoder + ?Sized,
2259 {
2260 #[inline]
2261 fn encode(
2262 mut self,
2263 encoder: &mut ___E,
2264 out: &mut ::core::mem::MaybeUninit<crate::wire::User<'static>>,
2265 _: (),
2266 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2267 ::fidl_next::munge!(let crate::wire::User { table } = out);
2268
2269 let max_ord = self.__max_ordinal();
2270
2271 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2272 ::fidl_next::Wire::zero_padding(&mut out);
2273
2274 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2275 ::fidl_next::wire::Envelope,
2276 >(encoder, max_ord);
2277
2278 for i in 1..=max_ord {
2279 match i {
2280 2 => {
2281 if let Some(value) = self.name.take() {
2282 ::fidl_next::wire::Envelope::encode_value::<
2283 ::fidl_next::wire::String<'static>,
2284 ___E,
2285 >(
2286 value, preallocated.encoder, &mut out, 32
2287 )?;
2288 } else {
2289 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2290 }
2291 }
2292
2293 1 => {
2294 if let Some(value) = self.age.take() {
2295 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
2296 value,
2297 preallocated.encoder,
2298 &mut out,
2299 (),
2300 )?;
2301 } else {
2302 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2303 }
2304 }
2305
2306 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2307 }
2308 unsafe {
2309 preallocated.write_next(out.assume_init_ref());
2310 }
2311 }
2312
2313 ::fidl_next::wire::Table::encode_len(table, max_ord);
2314
2315 Ok(())
2316 }
2317 }
2318
2319 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::User<'static>, ___E> for &'a User
2320 where
2321 ___E: ::fidl_next::Encoder + ?Sized,
2322 {
2323 #[inline]
2324 fn encode(
2325 self,
2326 encoder: &mut ___E,
2327 out: &mut ::core::mem::MaybeUninit<crate::wire::User<'static>>,
2328 _: (),
2329 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2330 ::fidl_next::munge!(let crate::wire::User { table } = out);
2331
2332 let max_ord = self.__max_ordinal();
2333
2334 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2335 ::fidl_next::Wire::zero_padding(&mut out);
2336
2337 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2338 ::fidl_next::wire::Envelope,
2339 >(encoder, max_ord);
2340
2341 for i in 1..=max_ord {
2342 match i {
2343 2 => {
2344 if let Some(value) = &self.name {
2345 ::fidl_next::wire::Envelope::encode_value::<
2346 ::fidl_next::wire::String<'static>,
2347 ___E,
2348 >(
2349 value, preallocated.encoder, &mut out, 32
2350 )?;
2351 } else {
2352 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2353 }
2354 }
2355
2356 1 => {
2357 if let Some(value) = &self.age {
2358 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
2359 value,
2360 preallocated.encoder,
2361 &mut out,
2362 (),
2363 )?;
2364 } else {
2365 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2366 }
2367 }
2368
2369 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2370 }
2371 unsafe {
2372 preallocated.write_next(out.assume_init_ref());
2373 }
2374 }
2375
2376 ::fidl_next::wire::Table::encode_len(table, max_ord);
2377
2378 Ok(())
2379 }
2380 }
2381
2382 impl<'de> ::fidl_next::FromWire<crate::wire::User<'de>> for User {
2383 #[inline]
2384 fn from_wire(wire_: crate::wire::User<'de>) -> Self {
2385 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2386
2387 let age = wire_.table.get(1);
2388
2389 let name = wire_.table.get(2);
2390
2391 Self {
2392 age: age.map(|envelope| {
2393 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
2394 }),
2395
2396 name: name.map(|envelope| {
2397 ::fidl_next::FromWire::from_wire(unsafe {
2398 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2399 })
2400 }),
2401 }
2402 }
2403 }
2404
2405 impl<'de> ::fidl_next::FromWireRef<crate::wire::User<'de>> for User {
2406 #[inline]
2407 fn from_wire_ref(wire: &crate::wire::User<'de>) -> Self {
2408 Self {
2409 age: wire.table.get(1).map(|envelope| {
2410 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2411 envelope.deref_unchecked::<u8>()
2412 })
2413 }),
2414
2415 name: wire.table.get(2).map(|envelope| {
2416 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2417 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2418 })
2419 }),
2420 }
2421 }
2422 }
2423}
2424
2425pub mod wire {
2426
2427 pub type AvailableFromApiLevelNext = ::fidl_next::wire::Int32;
2429
2430 pub type AvailableUntilApiLevelNext = ::fidl_next::wire::Int32;
2432
2433 #[derive(Debug)]
2435 #[repr(C)]
2436 pub struct Color<'de> {
2437 pub id: ::fidl_next::wire::Uint32,
2438
2439 pub name: ::fidl_next::wire::String<'de>,
2440 }
2441
2442 static_assertions::const_assert_eq!(std::mem::size_of::<Color<'_>>(), 24);
2443 static_assertions::const_assert_eq!(std::mem::align_of::<Color<'_>>(), 8);
2444
2445 static_assertions::const_assert_eq!(std::mem::offset_of!(Color<'_>, id), 0);
2446
2447 static_assertions::const_assert_eq!(std::mem::offset_of!(Color<'_>, name), 8);
2448
2449 impl ::fidl_next::Constrained for Color<'_> {
2450 type Constraint = ();
2451
2452 fn validate(
2453 _: ::fidl_next::Slot<'_, Self>,
2454 _: Self::Constraint,
2455 ) -> Result<(), ::fidl_next::ValidationError> {
2456 Ok(())
2457 }
2458 }
2459
2460 unsafe impl ::fidl_next::Wire for Color<'static> {
2461 type Narrowed<'de> = Color<'de>;
2462
2463 #[inline]
2464 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2465 ::fidl_next::munge! {
2466 let Self {
2467 id,
2468 name,
2469
2470 } = &mut *out_;
2471 }
2472
2473 ::fidl_next::Wire::zero_padding(id);
2474
2475 ::fidl_next::Wire::zero_padding(name);
2476
2477 unsafe {
2478 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2479 }
2480 }
2481 }
2482
2483 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Color<'de>
2484 where
2485 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2486 ___D: ::fidl_next::Decoder<'de>,
2487 {
2488 fn decode(
2489 slot_: ::fidl_next::Slot<'_, Self>,
2490 decoder_: &mut ___D,
2491 _: (),
2492 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2493 if slot_.as_bytes()[4..8] != [0u8; 4] {
2494 return Err(::fidl_next::DecodeError::InvalidPadding);
2495 }
2496
2497 ::fidl_next::munge! {
2498 let Self {
2499 mut id,
2500 mut name,
2501
2502 } = slot_;
2503 }
2504
2505 let _field = id.as_mut();
2506
2507 ::fidl_next::Decode::decode(id.as_mut(), decoder_, ())?;
2508
2509 let _field = name.as_mut();
2510 ::fidl_next::Constrained::validate(_field, 32)?;
2511 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 32)?;
2512
2513 let name = unsafe { name.deref_unchecked() };
2514
2515 if name.len() > 32 {
2516 return Err(::fidl_next::DecodeError::VectorTooLong {
2517 size: name.len() as u64,
2518 limit: 32,
2519 });
2520 }
2521
2522 Ok(())
2523 }
2524 }
2525
2526 impl<'de> ::fidl_next::IntoNatural for Color<'de> {
2527 type Natural = crate::natural::Color;
2528 }
2529
2530 #[derive(Debug)]
2532 #[repr(C)]
2533 pub struct EchoEchoStringRequest<'de> {
2534 pub value: ::fidl_next::wire::String<'de>,
2535 }
2536
2537 static_assertions::const_assert_eq!(std::mem::size_of::<EchoEchoStringRequest<'_>>(), 16);
2538 static_assertions::const_assert_eq!(std::mem::align_of::<EchoEchoStringRequest<'_>>(), 8);
2539
2540 static_assertions::const_assert_eq!(std::mem::offset_of!(EchoEchoStringRequest<'_>, value), 0);
2541
2542 impl ::fidl_next::Constrained for EchoEchoStringRequest<'_> {
2543 type Constraint = ();
2544
2545 fn validate(
2546 _: ::fidl_next::Slot<'_, Self>,
2547 _: Self::Constraint,
2548 ) -> Result<(), ::fidl_next::ValidationError> {
2549 Ok(())
2550 }
2551 }
2552
2553 unsafe impl ::fidl_next::Wire for EchoEchoStringRequest<'static> {
2554 type Narrowed<'de> = EchoEchoStringRequest<'de>;
2555
2556 #[inline]
2557 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2558 ::fidl_next::munge! {
2559 let Self {
2560 value,
2561
2562 } = &mut *out_;
2563 }
2564
2565 ::fidl_next::Wire::zero_padding(value);
2566 }
2567 }
2568
2569 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoEchoStringRequest<'de>
2570 where
2571 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2572 ___D: ::fidl_next::Decoder<'de>,
2573 {
2574 fn decode(
2575 slot_: ::fidl_next::Slot<'_, Self>,
2576 decoder_: &mut ___D,
2577 _: (),
2578 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2579 ::fidl_next::munge! {
2580 let Self {
2581 mut value,
2582
2583 } = slot_;
2584 }
2585
2586 let _field = value.as_mut();
2587 ::fidl_next::Constrained::validate(_field, 32)?;
2588 ::fidl_next::Decode::decode(value.as_mut(), decoder_, 32)?;
2589
2590 let value = unsafe { value.deref_unchecked() };
2591
2592 if value.len() > 32 {
2593 return Err(::fidl_next::DecodeError::VectorTooLong {
2594 size: value.len() as u64,
2595 limit: 32,
2596 });
2597 }
2598
2599 Ok(())
2600 }
2601 }
2602
2603 impl<'de> ::fidl_next::IntoNatural for EchoEchoStringRequest<'de> {
2604 type Natural = crate::natural::EchoEchoStringRequest;
2605 }
2606
2607 #[derive(Debug)]
2609 #[repr(C)]
2610 pub struct EchoEchoStringResponse<'de> {
2611 pub response: ::fidl_next::wire::String<'de>,
2612 }
2613
2614 static_assertions::const_assert_eq!(std::mem::size_of::<EchoEchoStringResponse<'_>>(), 16);
2615 static_assertions::const_assert_eq!(std::mem::align_of::<EchoEchoStringResponse<'_>>(), 8);
2616
2617 static_assertions::const_assert_eq!(
2618 std::mem::offset_of!(EchoEchoStringResponse<'_>, response),
2619 0
2620 );
2621
2622 impl ::fidl_next::Constrained for EchoEchoStringResponse<'_> {
2623 type Constraint = ();
2624
2625 fn validate(
2626 _: ::fidl_next::Slot<'_, Self>,
2627 _: Self::Constraint,
2628 ) -> Result<(), ::fidl_next::ValidationError> {
2629 Ok(())
2630 }
2631 }
2632
2633 unsafe impl ::fidl_next::Wire for EchoEchoStringResponse<'static> {
2634 type Narrowed<'de> = EchoEchoStringResponse<'de>;
2635
2636 #[inline]
2637 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2638 ::fidl_next::munge! {
2639 let Self {
2640 response,
2641
2642 } = &mut *out_;
2643 }
2644
2645 ::fidl_next::Wire::zero_padding(response);
2646 }
2647 }
2648
2649 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoEchoStringResponse<'de>
2650 where
2651 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2652 ___D: ::fidl_next::Decoder<'de>,
2653 {
2654 fn decode(
2655 slot_: ::fidl_next::Slot<'_, Self>,
2656 decoder_: &mut ___D,
2657 _: (),
2658 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2659 ::fidl_next::munge! {
2660 let Self {
2661 mut response,
2662
2663 } = slot_;
2664 }
2665
2666 let _field = response.as_mut();
2667 ::fidl_next::Constrained::validate(_field, 32)?;
2668 ::fidl_next::Decode::decode(response.as_mut(), decoder_, 32)?;
2669
2670 let response = unsafe { response.deref_unchecked() };
2671
2672 if response.len() > 32 {
2673 return Err(::fidl_next::DecodeError::VectorTooLong {
2674 size: response.len() as u64,
2675 limit: 32,
2676 });
2677 }
2678
2679 Ok(())
2680 }
2681 }
2682
2683 impl<'de> ::fidl_next::IntoNatural for EchoEchoStringResponse<'de> {
2684 type Natural = crate::natural::EchoEchoStringResponse;
2685 }
2686
2687 #[derive(Debug)]
2689 #[repr(C)]
2690 pub struct EchoSendStringRequest<'de> {
2691 pub value: ::fidl_next::wire::String<'de>,
2692 }
2693
2694 static_assertions::const_assert_eq!(std::mem::size_of::<EchoSendStringRequest<'_>>(), 16);
2695 static_assertions::const_assert_eq!(std::mem::align_of::<EchoSendStringRequest<'_>>(), 8);
2696
2697 static_assertions::const_assert_eq!(std::mem::offset_of!(EchoSendStringRequest<'_>, value), 0);
2698
2699 impl ::fidl_next::Constrained for EchoSendStringRequest<'_> {
2700 type Constraint = ();
2701
2702 fn validate(
2703 _: ::fidl_next::Slot<'_, Self>,
2704 _: Self::Constraint,
2705 ) -> Result<(), ::fidl_next::ValidationError> {
2706 Ok(())
2707 }
2708 }
2709
2710 unsafe impl ::fidl_next::Wire for EchoSendStringRequest<'static> {
2711 type Narrowed<'de> = EchoSendStringRequest<'de>;
2712
2713 #[inline]
2714 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2715 ::fidl_next::munge! {
2716 let Self {
2717 value,
2718
2719 } = &mut *out_;
2720 }
2721
2722 ::fidl_next::Wire::zero_padding(value);
2723 }
2724 }
2725
2726 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoSendStringRequest<'de>
2727 where
2728 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2729 ___D: ::fidl_next::Decoder<'de>,
2730 {
2731 fn decode(
2732 slot_: ::fidl_next::Slot<'_, Self>,
2733 decoder_: &mut ___D,
2734 _: (),
2735 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2736 ::fidl_next::munge! {
2737 let Self {
2738 mut value,
2739
2740 } = slot_;
2741 }
2742
2743 let _field = value.as_mut();
2744 ::fidl_next::Constrained::validate(_field, 32)?;
2745 ::fidl_next::Decode::decode(value.as_mut(), decoder_, 32)?;
2746
2747 let value = unsafe { value.deref_unchecked() };
2748
2749 if value.len() > 32 {
2750 return Err(::fidl_next::DecodeError::VectorTooLong {
2751 size: value.len() as u64,
2752 limit: 32,
2753 });
2754 }
2755
2756 Ok(())
2757 }
2758 }
2759
2760 impl<'de> ::fidl_next::IntoNatural for EchoSendStringRequest<'de> {
2761 type Natural = crate::natural::EchoSendStringRequest;
2762 }
2763
2764 #[derive(Debug)]
2766 #[repr(C)]
2767 pub struct EchoOnStringRequest<'de> {
2768 pub response: ::fidl_next::wire::String<'de>,
2769 }
2770
2771 static_assertions::const_assert_eq!(std::mem::size_of::<EchoOnStringRequest<'_>>(), 16);
2772 static_assertions::const_assert_eq!(std::mem::align_of::<EchoOnStringRequest<'_>>(), 8);
2773
2774 static_assertions::const_assert_eq!(std::mem::offset_of!(EchoOnStringRequest<'_>, response), 0);
2775
2776 impl ::fidl_next::Constrained for EchoOnStringRequest<'_> {
2777 type Constraint = ();
2778
2779 fn validate(
2780 _: ::fidl_next::Slot<'_, Self>,
2781 _: Self::Constraint,
2782 ) -> Result<(), ::fidl_next::ValidationError> {
2783 Ok(())
2784 }
2785 }
2786
2787 unsafe impl ::fidl_next::Wire for EchoOnStringRequest<'static> {
2788 type Narrowed<'de> = EchoOnStringRequest<'de>;
2789
2790 #[inline]
2791 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2792 ::fidl_next::munge! {
2793 let Self {
2794 response,
2795
2796 } = &mut *out_;
2797 }
2798
2799 ::fidl_next::Wire::zero_padding(response);
2800 }
2801 }
2802
2803 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoOnStringRequest<'de>
2804 where
2805 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2806 ___D: ::fidl_next::Decoder<'de>,
2807 {
2808 fn decode(
2809 slot_: ::fidl_next::Slot<'_, Self>,
2810 decoder_: &mut ___D,
2811 _: (),
2812 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2813 ::fidl_next::munge! {
2814 let Self {
2815 mut response,
2816
2817 } = slot_;
2818 }
2819
2820 let _field = response.as_mut();
2821 ::fidl_next::Constrained::validate(_field, 32)?;
2822 ::fidl_next::Decode::decode(response.as_mut(), decoder_, 32)?;
2823
2824 let response = unsafe { response.deref_unchecked() };
2825
2826 if response.len() > 32 {
2827 return Err(::fidl_next::DecodeError::VectorTooLong {
2828 size: response.len() as u64,
2829 limit: 32,
2830 });
2831 }
2832
2833 Ok(())
2834 }
2835 }
2836
2837 impl<'de> ::fidl_next::IntoNatural for EchoOnStringRequest<'de> {
2838 type Natural = crate::natural::EchoOnStringRequest;
2839 }
2840
2841 #[derive(Debug)]
2843 #[repr(C)]
2844 pub struct EchoLauncherGetEchoRequest<'de> {
2845 pub echo_prefix: ::fidl_next::wire::String<'de>,
2846 }
2847
2848 static_assertions::const_assert_eq!(std::mem::size_of::<EchoLauncherGetEchoRequest<'_>>(), 16);
2849 static_assertions::const_assert_eq!(std::mem::align_of::<EchoLauncherGetEchoRequest<'_>>(), 8);
2850
2851 static_assertions::const_assert_eq!(
2852 std::mem::offset_of!(EchoLauncherGetEchoRequest<'_>, echo_prefix),
2853 0
2854 );
2855
2856 impl ::fidl_next::Constrained for EchoLauncherGetEchoRequest<'_> {
2857 type Constraint = ();
2858
2859 fn validate(
2860 _: ::fidl_next::Slot<'_, Self>,
2861 _: Self::Constraint,
2862 ) -> Result<(), ::fidl_next::ValidationError> {
2863 Ok(())
2864 }
2865 }
2866
2867 unsafe impl ::fidl_next::Wire for EchoLauncherGetEchoRequest<'static> {
2868 type Narrowed<'de> = EchoLauncherGetEchoRequest<'de>;
2869
2870 #[inline]
2871 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2872 ::fidl_next::munge! {
2873 let Self {
2874 echo_prefix,
2875
2876 } = &mut *out_;
2877 }
2878
2879 ::fidl_next::Wire::zero_padding(echo_prefix);
2880 }
2881 }
2882
2883 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EchoLauncherGetEchoRequest<'de>
2884 where
2885 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2886 ___D: ::fidl_next::Decoder<'de>,
2887 {
2888 fn decode(
2889 slot_: ::fidl_next::Slot<'_, Self>,
2890 decoder_: &mut ___D,
2891 _: (),
2892 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2893 ::fidl_next::munge! {
2894 let Self {
2895 mut echo_prefix,
2896
2897 } = slot_;
2898 }
2899
2900 let _field = echo_prefix.as_mut();
2901 ::fidl_next::Constrained::validate(_field, 32)?;
2902 ::fidl_next::Decode::decode(echo_prefix.as_mut(), decoder_, 32)?;
2903
2904 let echo_prefix = unsafe { echo_prefix.deref_unchecked() };
2905
2906 if echo_prefix.len() > 32 {
2907 return Err(::fidl_next::DecodeError::VectorTooLong {
2908 size: echo_prefix.len() as u64,
2909 limit: 32,
2910 });
2911 }
2912
2913 Ok(())
2914 }
2915 }
2916
2917 impl<'de> ::fidl_next::IntoNatural for EchoLauncherGetEchoRequest<'de> {
2918 type Natural = crate::natural::EchoLauncherGetEchoRequest;
2919 }
2920
2921 #[derive(Clone, Copy, Debug)]
2923 #[repr(transparent)]
2924 pub struct FileMode {
2925 pub(crate) value: ::fidl_next::wire::Uint16,
2926 }
2927
2928 impl ::fidl_next::Constrained for FileMode {
2929 type Constraint = ();
2930
2931 fn validate(
2932 _: ::fidl_next::Slot<'_, Self>,
2933 _: Self::Constraint,
2934 ) -> Result<(), ::fidl_next::ValidationError> {
2935 Ok(())
2936 }
2937 }
2938
2939 unsafe impl ::fidl_next::Wire for FileMode {
2940 type Narrowed<'de> = Self;
2941
2942 #[inline]
2943 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2944 }
2946 }
2947
2948 unsafe impl<___D> ::fidl_next::Decode<___D> for FileMode
2949 where
2950 ___D: ?Sized,
2951 {
2952 fn decode(
2953 slot: ::fidl_next::Slot<'_, Self>,
2954 _: &mut ___D,
2955 _: (),
2956 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2957 ::fidl_next::munge!(let Self { value } = slot);
2958 let set = u16::from(*value);
2959 if set & !crate::natural::FileMode::all().bits() != 0 {
2960 return Err(::fidl_next::DecodeError::InvalidBits {
2961 expected: crate::natural::FileMode::all().bits() as usize,
2962 actual: set as usize,
2963 });
2964 }
2965
2966 Ok(())
2967 }
2968 }
2969
2970 impl ::core::convert::From<crate::natural::FileMode> for FileMode {
2971 fn from(natural: crate::natural::FileMode) -> Self {
2972 Self { value: ::fidl_next::wire::Uint16::from(natural.bits()) }
2973 }
2974 }
2975
2976 impl ::fidl_next::IntoNatural for FileMode {
2977 type Natural = crate::natural::FileMode;
2978 }
2979
2980 #[derive(Clone, Copy, Debug)]
2982 #[repr(transparent)]
2983 pub struct FlexibleFileMode {
2984 pub(crate) value: ::fidl_next::wire::Uint16,
2985 }
2986
2987 impl ::fidl_next::Constrained for FlexibleFileMode {
2988 type Constraint = ();
2989
2990 fn validate(
2991 _: ::fidl_next::Slot<'_, Self>,
2992 _: Self::Constraint,
2993 ) -> Result<(), ::fidl_next::ValidationError> {
2994 Ok(())
2995 }
2996 }
2997
2998 unsafe impl ::fidl_next::Wire for FlexibleFileMode {
2999 type Narrowed<'de> = Self;
3000
3001 #[inline]
3002 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3003 }
3005 }
3006
3007 unsafe impl<___D> ::fidl_next::Decode<___D> for FlexibleFileMode
3008 where
3009 ___D: ?Sized,
3010 {
3011 fn decode(
3012 slot: ::fidl_next::Slot<'_, Self>,
3013 _: &mut ___D,
3014 _: (),
3015 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3016 Ok(())
3017 }
3018 }
3019
3020 impl ::core::convert::From<crate::natural::FlexibleFileMode> for FlexibleFileMode {
3021 fn from(natural: crate::natural::FlexibleFileMode) -> Self {
3022 Self { value: ::fidl_next::wire::Uint16::from(natural.bits()) }
3023 }
3024 }
3025
3026 impl ::fidl_next::IntoNatural for FlexibleFileMode {
3027 type Natural = crate::natural::FlexibleFileMode;
3028 }
3029
3030 #[repr(transparent)]
3032 pub struct FlexibleJsonValue<'de> {
3033 pub(crate) raw: ::fidl_next::wire::Union,
3034 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3035 }
3036
3037 impl<'de> Drop for FlexibleJsonValue<'de> {
3038 fn drop(&mut self) {
3039 match self.raw.ordinal() {
3040 1 => {
3041 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int32>() };
3042 }
3043
3044 2 => {
3045 let _ = unsafe {
3046 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
3047 };
3048 }
3049
3050 _ => (),
3051 }
3052 }
3053 }
3054
3055 impl ::fidl_next::Constrained for FlexibleJsonValue<'_> {
3056 type Constraint = ();
3057
3058 fn validate(
3059 _: ::fidl_next::Slot<'_, Self>,
3060 _: Self::Constraint,
3061 ) -> Result<(), ::fidl_next::ValidationError> {
3062 Ok(())
3063 }
3064 }
3065
3066 unsafe impl ::fidl_next::Wire for FlexibleJsonValue<'static> {
3067 type Narrowed<'de> = FlexibleJsonValue<'de>;
3068
3069 #[inline]
3070 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3071 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3072 ::fidl_next::wire::Union::zero_padding(raw);
3073 }
3074 }
3075
3076 pub mod flexible_json_value {
3077 pub enum Ref<'de> {
3078 IntValue(&'de ::fidl_next::wire::Int32),
3079
3080 StringValue(&'de ::fidl_next::wire::String<'de>),
3081
3082 UnknownOrdinal_(u64),
3083 }
3084
3085 pub enum Value<'de> {
3086 IntValue(::fidl_next::wire::Int32),
3087
3088 StringValue(::fidl_next::wire::String<'de>),
3089
3090 UnknownOrdinal_(u64),
3091 }
3092 }
3093
3094 impl<'de> FlexibleJsonValue<'de> {
3095 pub fn as_ref(&self) -> crate::wire::flexible_json_value::Ref<'_> {
3096 match self.raw.ordinal() {
3097 1 => crate::wire::flexible_json_value::Ref::IntValue(unsafe {
3098 self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
3099 }),
3100
3101 2 => crate::wire::flexible_json_value::Ref::StringValue(unsafe {
3102 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
3103 }),
3104
3105 unknown => crate::wire::flexible_json_value::Ref::UnknownOrdinal_(unknown),
3106 }
3107 }
3108
3109 pub fn into_inner(self) -> crate::wire::flexible_json_value::Value<'de> {
3110 let this = ::core::mem::ManuallyDrop::new(self);
3111
3112 match this.raw.ordinal() {
3113 1 => crate::wire::flexible_json_value::Value::IntValue(unsafe {
3114 this.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
3115 }),
3116
3117 2 => crate::wire::flexible_json_value::Value::StringValue(unsafe {
3118 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
3119 }),
3120
3121 unknown => crate::wire::flexible_json_value::Value::UnknownOrdinal_(unknown),
3122 }
3123 }
3124 }
3125
3126 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FlexibleJsonValue<'de>
3127 where
3128 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3129 ___D: ::fidl_next::Decoder<'de>,
3130 {
3131 fn decode(
3132 mut slot: ::fidl_next::Slot<'_, Self>,
3133 decoder: &mut ___D,
3134 _: (),
3135 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3136 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3137 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3138 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
3139 raw,
3140 decoder,
3141 (),
3142 )?,
3143
3144 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3145 raw, decoder, 32,
3146 )?,
3147
3148 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3149 }
3150
3151 Ok(())
3152 }
3153 }
3154
3155 impl<'de> ::core::fmt::Debug for FlexibleJsonValue<'de> {
3156 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3157 match self.raw.ordinal() {
3158 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
3159 2 => unsafe {
3160 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
3161 },
3162 _ => unsafe { ::core::hint::unreachable_unchecked() },
3163 }
3164 }
3165 }
3166
3167 impl<'de> ::fidl_next::IntoNatural for FlexibleJsonValue<'de> {
3168 type Natural = crate::natural::FlexibleJsonValue;
3169 }
3170
3171 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3173 #[repr(transparent)]
3174 pub struct FlexibleLocationType {
3175 pub(crate) value: ::fidl_next::wire::Uint32,
3176 }
3177
3178 impl ::fidl_next::Constrained for FlexibleLocationType {
3179 type Constraint = ();
3180
3181 fn validate(
3182 _: ::fidl_next::Slot<'_, Self>,
3183 _: Self::Constraint,
3184 ) -> Result<(), ::fidl_next::ValidationError> {
3185 Ok(())
3186 }
3187 }
3188
3189 unsafe impl ::fidl_next::Wire for FlexibleLocationType {
3190 type Narrowed<'de> = Self;
3191
3192 #[inline]
3193 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3194 }
3196 }
3197
3198 impl FlexibleLocationType {
3199 pub const MUSEUM: FlexibleLocationType =
3200 FlexibleLocationType { value: ::fidl_next::wire::Uint32(1) };
3201
3202 pub const AIRPORT: FlexibleLocationType =
3203 FlexibleLocationType { value: ::fidl_next::wire::Uint32(2) };
3204
3205 pub const RESTAURANT: FlexibleLocationType =
3206 FlexibleLocationType { value: ::fidl_next::wire::Uint32(3) };
3207 }
3208
3209 unsafe impl<___D> ::fidl_next::Decode<___D> for FlexibleLocationType
3210 where
3211 ___D: ?Sized,
3212 {
3213 fn decode(
3214 slot: ::fidl_next::Slot<'_, Self>,
3215 _: &mut ___D,
3216 _: (),
3217 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3218 Ok(())
3219 }
3220 }
3221
3222 impl ::core::convert::From<crate::natural::FlexibleLocationType> for FlexibleLocationType {
3223 fn from(natural: crate::natural::FlexibleLocationType) -> Self {
3224 match natural {
3225 crate::natural::FlexibleLocationType::Museum => FlexibleLocationType::MUSEUM,
3226
3227 crate::natural::FlexibleLocationType::Airport => FlexibleLocationType::AIRPORT,
3228
3229 crate::natural::FlexibleLocationType::Restaurant => {
3230 FlexibleLocationType::RESTAURANT
3231 }
3232
3233 crate::natural::FlexibleLocationType::UnknownOrdinal_(value) => {
3234 FlexibleLocationType { value: ::fidl_next::wire::Uint32::from(value) }
3235 }
3236 }
3237 }
3238 }
3239
3240 impl ::fidl_next::IntoNatural for FlexibleLocationType {
3241 type Natural = crate::natural::FlexibleLocationType;
3242 }
3243
3244 pub type GameState = ::fidl_next::wire::Unit;
3246
3247 #[repr(transparent)]
3249 pub struct JsonValue<'de> {
3250 pub(crate) raw: ::fidl_next::wire::Union,
3251 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3252 }
3253
3254 impl<'de> Drop for JsonValue<'de> {
3255 fn drop(&mut self) {
3256 match self.raw.ordinal() {
3257 1 => {
3258 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int32>() };
3259 }
3260
3261 2 => {
3262 let _ = unsafe {
3263 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
3264 };
3265 }
3266
3267 _ => unsafe { ::core::hint::unreachable_unchecked() },
3268 }
3269 }
3270 }
3271
3272 impl ::fidl_next::Constrained for JsonValue<'_> {
3273 type Constraint = ();
3274
3275 fn validate(
3276 _: ::fidl_next::Slot<'_, Self>,
3277 _: Self::Constraint,
3278 ) -> Result<(), ::fidl_next::ValidationError> {
3279 Ok(())
3280 }
3281 }
3282
3283 unsafe impl ::fidl_next::Wire for JsonValue<'static> {
3284 type Narrowed<'de> = JsonValue<'de>;
3285
3286 #[inline]
3287 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3288 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3289 ::fidl_next::wire::Union::zero_padding(raw);
3290 }
3291 }
3292
3293 pub mod json_value {
3294 pub enum Ref<'de> {
3295 IntValue(&'de ::fidl_next::wire::Int32),
3296
3297 StringValue(&'de ::fidl_next::wire::String<'de>),
3298 }
3299
3300 pub enum Value<'de> {
3301 IntValue(::fidl_next::wire::Int32),
3302
3303 StringValue(::fidl_next::wire::String<'de>),
3304 }
3305 }
3306
3307 impl<'de> JsonValue<'de> {
3308 pub fn as_ref(&self) -> crate::wire::json_value::Ref<'_> {
3309 match self.raw.ordinal() {
3310 1 => crate::wire::json_value::Ref::IntValue(unsafe {
3311 self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
3312 }),
3313
3314 2 => crate::wire::json_value::Ref::StringValue(unsafe {
3315 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
3316 }),
3317
3318 _ => unsafe { ::core::hint::unreachable_unchecked() },
3319 }
3320 }
3321
3322 pub fn into_inner(self) -> crate::wire::json_value::Value<'de> {
3323 let this = ::core::mem::ManuallyDrop::new(self);
3324
3325 match this.raw.ordinal() {
3326 1 => crate::wire::json_value::Value::IntValue(unsafe {
3327 this.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
3328 }),
3329
3330 2 => crate::wire::json_value::Value::StringValue(unsafe {
3331 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
3332 }),
3333
3334 _ => unsafe { ::core::hint::unreachable_unchecked() },
3335 }
3336 }
3337 }
3338
3339 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for JsonValue<'de>
3340 where
3341 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3342 ___D: ::fidl_next::Decoder<'de>,
3343 {
3344 fn decode(
3345 mut slot: ::fidl_next::Slot<'_, Self>,
3346 decoder: &mut ___D,
3347 _: (),
3348 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3349 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3350 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3351 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
3352 raw,
3353 decoder,
3354 (),
3355 )?,
3356
3357 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3358 raw, decoder, 32,
3359 )?,
3360
3361 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
3362 }
3363
3364 Ok(())
3365 }
3366 }
3367
3368 impl<'de> ::core::fmt::Debug for JsonValue<'de> {
3369 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3370 match self.raw.ordinal() {
3371 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
3372 2 => unsafe {
3373 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
3374 },
3375 _ => unsafe { ::core::hint::unreachable_unchecked() },
3376 }
3377 }
3378 }
3379
3380 impl<'de> ::fidl_next::IntoNatural for JsonValue<'de> {
3381 type Natural = crate::natural::JsonValue;
3382 }
3383
3384 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3386 #[repr(transparent)]
3387 pub struct LocationType {
3388 pub(crate) value: ::fidl_next::wire::Uint32,
3389 }
3390
3391 impl ::fidl_next::Constrained for LocationType {
3392 type Constraint = ();
3393
3394 fn validate(
3395 _: ::fidl_next::Slot<'_, Self>,
3396 _: Self::Constraint,
3397 ) -> Result<(), ::fidl_next::ValidationError> {
3398 Ok(())
3399 }
3400 }
3401
3402 unsafe impl ::fidl_next::Wire for LocationType {
3403 type Narrowed<'de> = Self;
3404
3405 #[inline]
3406 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3407 }
3409 }
3410
3411 impl LocationType {
3412 pub const MUSEUM: LocationType = LocationType { value: ::fidl_next::wire::Uint32(1) };
3413
3414 pub const AIRPORT: LocationType = LocationType { value: ::fidl_next::wire::Uint32(2) };
3415
3416 pub const RESTAURANT: LocationType = LocationType { value: ::fidl_next::wire::Uint32(3) };
3417 }
3418
3419 unsafe impl<___D> ::fidl_next::Decode<___D> for LocationType
3420 where
3421 ___D: ?Sized,
3422 {
3423 fn decode(
3424 slot: ::fidl_next::Slot<'_, Self>,
3425 _: &mut ___D,
3426 _: (),
3427 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3428 ::fidl_next::munge!(let Self { value } = slot);
3429
3430 match u32::from(*value) {
3431 1 | 2 | 3 => (),
3432 unknown => {
3433 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
3434 }
3435 }
3436
3437 Ok(())
3438 }
3439 }
3440
3441 impl ::core::convert::From<crate::natural::LocationType> for LocationType {
3442 fn from(natural: crate::natural::LocationType) -> Self {
3443 match natural {
3444 crate::natural::LocationType::Museum => LocationType::MUSEUM,
3445
3446 crate::natural::LocationType::Airport => LocationType::AIRPORT,
3447
3448 crate::natural::LocationType::Restaurant => LocationType::RESTAURANT,
3449 }
3450 }
3451 }
3452
3453 impl ::fidl_next::IntoNatural for LocationType {
3454 type Natural = crate::natural::LocationType;
3455 }
3456
3457 #[derive(Clone, Debug)]
3459 #[repr(C)]
3460 pub struct TicTacToeStartGameRequest {
3461 pub start_first: bool,
3462 }
3463
3464 static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeStartGameRequest>(), 1);
3465 static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeStartGameRequest>(), 1);
3466
3467 static_assertions::const_assert_eq!(
3468 std::mem::offset_of!(TicTacToeStartGameRequest, start_first),
3469 0
3470 );
3471
3472 impl ::fidl_next::Constrained for TicTacToeStartGameRequest {
3473 type Constraint = ();
3474
3475 fn validate(
3476 _: ::fidl_next::Slot<'_, Self>,
3477 _: Self::Constraint,
3478 ) -> Result<(), ::fidl_next::ValidationError> {
3479 Ok(())
3480 }
3481 }
3482
3483 unsafe impl ::fidl_next::Wire for TicTacToeStartGameRequest {
3484 type Narrowed<'de> = TicTacToeStartGameRequest;
3485
3486 #[inline]
3487 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3488 ::fidl_next::munge! {
3489 let Self {
3490 start_first,
3491
3492 } = &mut *out_;
3493 }
3494
3495 ::fidl_next::Wire::zero_padding(start_first);
3496 }
3497 }
3498
3499 unsafe impl<___D> ::fidl_next::Decode<___D> for TicTacToeStartGameRequest
3500 where
3501 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3502 {
3503 fn decode(
3504 slot_: ::fidl_next::Slot<'_, Self>,
3505 decoder_: &mut ___D,
3506 _: (),
3507 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3508 ::fidl_next::munge! {
3509 let Self {
3510 mut start_first,
3511
3512 } = slot_;
3513 }
3514
3515 let _field = start_first.as_mut();
3516
3517 ::fidl_next::Decode::decode(start_first.as_mut(), decoder_, ())?;
3518
3519 Ok(())
3520 }
3521 }
3522
3523 impl ::fidl_next::IntoNatural for TicTacToeStartGameRequest {
3524 type Natural = crate::natural::TicTacToeStartGameRequest;
3525 }
3526
3527 #[derive(Clone, Debug)]
3529 #[repr(C)]
3530 pub struct TicTacToeMakeMoveRequest {
3531 pub row: u8,
3532
3533 pub col: u8,
3534 }
3535
3536 static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeMakeMoveRequest>(), 2);
3537 static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeMakeMoveRequest>(), 1);
3538
3539 static_assertions::const_assert_eq!(std::mem::offset_of!(TicTacToeMakeMoveRequest, row), 0);
3540
3541 static_assertions::const_assert_eq!(std::mem::offset_of!(TicTacToeMakeMoveRequest, col), 1);
3542
3543 impl ::fidl_next::Constrained for TicTacToeMakeMoveRequest {
3544 type Constraint = ();
3545
3546 fn validate(
3547 _: ::fidl_next::Slot<'_, Self>,
3548 _: Self::Constraint,
3549 ) -> Result<(), ::fidl_next::ValidationError> {
3550 Ok(())
3551 }
3552 }
3553
3554 unsafe impl ::fidl_next::Wire for TicTacToeMakeMoveRequest {
3555 type Narrowed<'de> = TicTacToeMakeMoveRequest;
3556
3557 #[inline]
3558 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3559 ::fidl_next::munge! {
3560 let Self {
3561 row,
3562 col,
3563
3564 } = &mut *out_;
3565 }
3566
3567 ::fidl_next::Wire::zero_padding(row);
3568
3569 ::fidl_next::Wire::zero_padding(col);
3570 }
3571 }
3572
3573 unsafe impl<___D> ::fidl_next::Decode<___D> for TicTacToeMakeMoveRequest
3574 where
3575 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3576 {
3577 fn decode(
3578 slot_: ::fidl_next::Slot<'_, Self>,
3579 decoder_: &mut ___D,
3580 _: (),
3581 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3582 ::fidl_next::munge! {
3583 let Self {
3584 mut row,
3585 mut col,
3586
3587 } = slot_;
3588 }
3589
3590 let _field = row.as_mut();
3591
3592 ::fidl_next::Decode::decode(row.as_mut(), decoder_, ())?;
3593
3594 let _field = col.as_mut();
3595
3596 ::fidl_next::Decode::decode(col.as_mut(), decoder_, ())?;
3597
3598 Ok(())
3599 }
3600 }
3601
3602 impl ::fidl_next::IntoNatural for TicTacToeMakeMoveRequest {
3603 type Natural = crate::natural::TicTacToeMakeMoveRequest;
3604 }
3605
3606 #[derive(Debug)]
3608 #[repr(C)]
3609 pub struct TicTacToeMakeMoveResponse<'de> {
3610 pub success: bool,
3611
3612 pub new_state: ::fidl_next::wire::Box<'de, crate::wire::GameState>,
3613 }
3614
3615 static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeMakeMoveResponse<'_>>(), 16);
3616 static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeMakeMoveResponse<'_>>(), 8);
3617
3618 static_assertions::const_assert_eq!(
3619 std::mem::offset_of!(TicTacToeMakeMoveResponse<'_>, success),
3620 0
3621 );
3622
3623 static_assertions::const_assert_eq!(
3624 std::mem::offset_of!(TicTacToeMakeMoveResponse<'_>, new_state),
3625 8
3626 );
3627
3628 impl ::fidl_next::Constrained for TicTacToeMakeMoveResponse<'_> {
3629 type Constraint = ();
3630
3631 fn validate(
3632 _: ::fidl_next::Slot<'_, Self>,
3633 _: Self::Constraint,
3634 ) -> Result<(), ::fidl_next::ValidationError> {
3635 Ok(())
3636 }
3637 }
3638
3639 unsafe impl ::fidl_next::Wire for TicTacToeMakeMoveResponse<'static> {
3640 type Narrowed<'de> = TicTacToeMakeMoveResponse<'de>;
3641
3642 #[inline]
3643 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3644 ::fidl_next::munge! {
3645 let Self {
3646 success,
3647 new_state,
3648
3649 } = &mut *out_;
3650 }
3651
3652 ::fidl_next::Wire::zero_padding(success);
3653
3654 ::fidl_next::Wire::zero_padding(new_state);
3655
3656 unsafe {
3657 out_.as_mut_ptr().cast::<u8>().add(1).write_bytes(0, 7);
3658 }
3659 }
3660 }
3661
3662 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TicTacToeMakeMoveResponse<'de>
3663 where
3664 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3665 ___D: ::fidl_next::Decoder<'de>,
3666 {
3667 fn decode(
3668 slot_: ::fidl_next::Slot<'_, Self>,
3669 decoder_: &mut ___D,
3670 _: (),
3671 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3672 if slot_.as_bytes()[1..8] != [0u8; 7] {
3673 return Err(::fidl_next::DecodeError::InvalidPadding);
3674 }
3675
3676 ::fidl_next::munge! {
3677 let Self {
3678 mut success,
3679 mut new_state,
3680
3681 } = slot_;
3682 }
3683
3684 let _field = success.as_mut();
3685
3686 ::fidl_next::Decode::decode(success.as_mut(), decoder_, ())?;
3687
3688 let _field = new_state.as_mut();
3689
3690 ::fidl_next::Decode::decode(new_state.as_mut(), decoder_, ())?;
3691
3692 Ok(())
3693 }
3694 }
3695
3696 impl<'de> ::fidl_next::IntoNatural for TicTacToeMakeMoveResponse<'de> {
3697 type Natural = crate::natural::TicTacToeMakeMoveResponse;
3698 }
3699
3700 #[derive(Clone, Debug)]
3702 #[repr(C)]
3703 pub struct TicTacToeOnOpponentMoveRequest {
3704 pub new_state: crate::wire::GameState,
3705 }
3706
3707 static_assertions::const_assert_eq!(std::mem::size_of::<TicTacToeOnOpponentMoveRequest>(), 1);
3708 static_assertions::const_assert_eq!(std::mem::align_of::<TicTacToeOnOpponentMoveRequest>(), 1);
3709
3710 static_assertions::const_assert_eq!(
3711 std::mem::offset_of!(TicTacToeOnOpponentMoveRequest, new_state),
3712 0
3713 );
3714
3715 impl ::fidl_next::Constrained for TicTacToeOnOpponentMoveRequest {
3716 type Constraint = ();
3717
3718 fn validate(
3719 _: ::fidl_next::Slot<'_, Self>,
3720 _: Self::Constraint,
3721 ) -> Result<(), ::fidl_next::ValidationError> {
3722 Ok(())
3723 }
3724 }
3725
3726 unsafe impl ::fidl_next::Wire for TicTacToeOnOpponentMoveRequest {
3727 type Narrowed<'de> = TicTacToeOnOpponentMoveRequest;
3728
3729 #[inline]
3730 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3731 ::fidl_next::munge! {
3732 let Self {
3733 new_state,
3734
3735 } = &mut *out_;
3736 }
3737
3738 ::fidl_next::Wire::zero_padding(new_state);
3739 }
3740 }
3741
3742 unsafe impl<___D> ::fidl_next::Decode<___D> for TicTacToeOnOpponentMoveRequest
3743 where
3744 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3745 {
3746 fn decode(
3747 slot_: ::fidl_next::Slot<'_, Self>,
3748 decoder_: &mut ___D,
3749 _: (),
3750 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3751 ::fidl_next::munge! {
3752 let Self {
3753 mut new_state,
3754
3755 } = slot_;
3756 }
3757
3758 let _field = new_state.as_mut();
3759
3760 ::fidl_next::Decode::decode(new_state.as_mut(), decoder_, ())?;
3761
3762 Ok(())
3763 }
3764 }
3765
3766 impl ::fidl_next::IntoNatural for TicTacToeOnOpponentMoveRequest {
3767 type Natural = crate::natural::TicTacToeOnOpponentMoveRequest;
3768 }
3769
3770 #[repr(C)]
3772 pub struct User<'de> {
3773 pub(crate) table: ::fidl_next::wire::Table<'de>,
3774 }
3775
3776 impl<'de> Drop for User<'de> {
3777 fn drop(&mut self) {
3778 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
3779
3780 let _ = self.table.get(2).map(|envelope| unsafe {
3781 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3782 });
3783 }
3784 }
3785
3786 impl ::fidl_next::Constrained for User<'_> {
3787 type Constraint = ();
3788
3789 fn validate(
3790 _: ::fidl_next::Slot<'_, Self>,
3791 _: Self::Constraint,
3792 ) -> Result<(), ::fidl_next::ValidationError> {
3793 Ok(())
3794 }
3795 }
3796
3797 unsafe impl ::fidl_next::Wire for User<'static> {
3798 type Narrowed<'de> = User<'de>;
3799
3800 #[inline]
3801 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3802 ::fidl_next::munge!(let Self { table } = out);
3803 ::fidl_next::wire::Table::zero_padding(table);
3804 }
3805 }
3806
3807 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for User<'de>
3808 where
3809 ___D: ::fidl_next::Decoder<'de> + ?Sized,
3810 {
3811 fn decode(
3812 slot: ::fidl_next::Slot<'_, Self>,
3813 decoder: &mut ___D,
3814 _: (),
3815 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3816 ::fidl_next::munge!(let Self { table } = slot);
3817
3818 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3819 match ordinal {
3820 0 => unsafe { ::core::hint::unreachable_unchecked() },
3821
3822 1 => {
3823 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
3824 slot.as_mut(),
3825 decoder,
3826 (),
3827 )?;
3828
3829 Ok(())
3830 }
3831
3832 2 => {
3833 ::fidl_next::wire::Envelope::decode_as::<
3834 ___D,
3835 ::fidl_next::wire::String<'de>,
3836 >(slot.as_mut(), decoder, 32)?;
3837
3838 let value = unsafe {
3839 slot.deref_unchecked()
3840 .deref_unchecked::<::fidl_next::wire::String<'_>>()
3841 };
3842
3843 if value.len() > 32 {
3844 return Err(::fidl_next::DecodeError::VectorTooLong {
3845 size: value.len() as u64,
3846 limit: 32,
3847 });
3848 }
3849
3850 Ok(())
3851 }
3852
3853 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
3854 }
3855 })
3856 }
3857 }
3858
3859 impl<'de> User<'de> {
3860 pub fn age(&self) -> ::core::option::Option<&u8> {
3861 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3862 }
3863
3864 pub fn take_age(&mut self) -> ::core::option::Option<u8> {
3865 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
3866 }
3867
3868 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
3869 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3870 }
3871
3872 pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
3873 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
3874 }
3875 }
3876
3877 impl<'de> ::core::fmt::Debug for User<'de> {
3878 fn fmt(
3879 &self,
3880 f: &mut ::core::fmt::Formatter<'_>,
3881 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3882 f.debug_struct("User").field("age", &self.age()).field("name", &self.name()).finish()
3883 }
3884 }
3885
3886 impl<'de> ::fidl_next::IntoNatural for User<'de> {
3887 type Natural = crate::natural::User;
3888 }
3889}
3890
3891pub mod wire_optional {
3892
3893 #[repr(transparent)]
3894 pub struct FlexibleJsonValue<'de> {
3895 pub(crate) raw: ::fidl_next::wire::Union,
3896 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3897 }
3898
3899 impl ::fidl_next::Constrained for FlexibleJsonValue<'_> {
3900 type Constraint = ();
3901
3902 fn validate(
3903 _: ::fidl_next::Slot<'_, Self>,
3904 _: Self::Constraint,
3905 ) -> Result<(), ::fidl_next::ValidationError> {
3906 Ok(())
3907 }
3908 }
3909
3910 unsafe impl ::fidl_next::Wire for FlexibleJsonValue<'static> {
3911 type Narrowed<'de> = FlexibleJsonValue<'de>;
3912
3913 #[inline]
3914 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3915 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3916 ::fidl_next::wire::Union::zero_padding(raw);
3917 }
3918 }
3919
3920 impl<'de> FlexibleJsonValue<'de> {
3921 pub fn is_some(&self) -> bool {
3922 self.raw.is_some()
3923 }
3924
3925 pub fn is_none(&self) -> bool {
3926 self.raw.is_none()
3927 }
3928
3929 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::FlexibleJsonValue<'de>> {
3930 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3931 }
3932
3933 pub fn into_option(self) -> ::core::option::Option<crate::wire::FlexibleJsonValue<'de>> {
3934 if self.is_some() {
3935 Some(crate::wire::FlexibleJsonValue {
3936 raw: self.raw,
3937 _phantom: ::core::marker::PhantomData,
3938 })
3939 } else {
3940 None
3941 }
3942 }
3943 }
3944
3945 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FlexibleJsonValue<'de>
3946 where
3947 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3948 ___D: ::fidl_next::Decoder<'de>,
3949 {
3950 fn decode(
3951 mut slot: ::fidl_next::Slot<'_, Self>,
3952 decoder: &mut ___D,
3953 _: (),
3954 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3955 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3956 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3957 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
3958 raw,
3959 decoder,
3960 (),
3961 )?,
3962
3963 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
3964 raw, decoder, 32,
3965 )?,
3966
3967 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
3968 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
3969 }
3970
3971 Ok(())
3972 }
3973 }
3974
3975 impl<'de> ::core::fmt::Debug for FlexibleJsonValue<'de> {
3976 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3977 self.as_ref().fmt(f)
3978 }
3979 }
3980
3981 impl<'de> ::fidl_next::IntoNatural for FlexibleJsonValue<'de> {
3982 type Natural = ::core::option::Option<crate::natural::FlexibleJsonValue>;
3983 }
3984
3985 #[repr(transparent)]
3986 pub struct JsonValue<'de> {
3987 pub(crate) raw: ::fidl_next::wire::Union,
3988 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3989 }
3990
3991 impl ::fidl_next::Constrained for JsonValue<'_> {
3992 type Constraint = ();
3993
3994 fn validate(
3995 _: ::fidl_next::Slot<'_, Self>,
3996 _: Self::Constraint,
3997 ) -> Result<(), ::fidl_next::ValidationError> {
3998 Ok(())
3999 }
4000 }
4001
4002 unsafe impl ::fidl_next::Wire for JsonValue<'static> {
4003 type Narrowed<'de> = JsonValue<'de>;
4004
4005 #[inline]
4006 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4007 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4008 ::fidl_next::wire::Union::zero_padding(raw);
4009 }
4010 }
4011
4012 impl<'de> JsonValue<'de> {
4013 pub fn is_some(&self) -> bool {
4014 self.raw.is_some()
4015 }
4016
4017 pub fn is_none(&self) -> bool {
4018 self.raw.is_none()
4019 }
4020
4021 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::JsonValue<'de>> {
4022 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
4023 }
4024
4025 pub fn into_option(self) -> ::core::option::Option<crate::wire::JsonValue<'de>> {
4026 if self.is_some() {
4027 Some(crate::wire::JsonValue {
4028 raw: self.raw,
4029 _phantom: ::core::marker::PhantomData,
4030 })
4031 } else {
4032 None
4033 }
4034 }
4035 }
4036
4037 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for JsonValue<'de>
4038 where
4039 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4040 ___D: ::fidl_next::Decoder<'de>,
4041 {
4042 fn decode(
4043 mut slot: ::fidl_next::Slot<'_, Self>,
4044 decoder: &mut ___D,
4045 _: (),
4046 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4047 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4048 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
4049 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
4050 raw,
4051 decoder,
4052 (),
4053 )?,
4054
4055 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
4056 raw, decoder, 32,
4057 )?,
4058
4059 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
4060 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
4061 }
4062
4063 Ok(())
4064 }
4065 }
4066
4067 impl<'de> ::core::fmt::Debug for JsonValue<'de> {
4068 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4069 self.as_ref().fmt(f)
4070 }
4071 }
4072
4073 impl<'de> ::fidl_next::IntoNatural for JsonValue<'de> {
4074 type Natural = ::core::option::Option<crate::natural::JsonValue>;
4075 }
4076}
4077
4078pub mod generic {
4079
4080 pub struct Color<T0, T1> {
4082 pub id: T0,
4083
4084 pub name: T1,
4085 }
4086
4087 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::Color<'static>, ___E> for Color<T0, T1>
4088 where
4089 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4090 ___E: ::fidl_next::Encoder,
4091 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
4092 T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4093 {
4094 #[inline]
4095 fn encode(
4096 self,
4097 encoder_: &mut ___E,
4098 out_: &mut ::core::mem::MaybeUninit<crate::wire::Color<'static>>,
4099 _: (),
4100 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4101 ::fidl_next::munge! {
4102 let crate::wire::Color {
4103 id,
4104 name,
4105
4106 } = out_;
4107 }
4108
4109 ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
4110
4111 ::fidl_next::Encode::encode(self.name, encoder_, name, 32)?;
4112
4113 Ok(())
4114 }
4115 }
4116
4117 pub struct EchoEchoStringRequest<T0> {
4119 pub value: T0,
4120 }
4121
4122 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoEchoStringRequest<'static>, ___E>
4123 for EchoEchoStringRequest<T0>
4124 where
4125 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4126 ___E: ::fidl_next::Encoder,
4127 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4128 {
4129 #[inline]
4130 fn encode(
4131 self,
4132 encoder_: &mut ___E,
4133 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringRequest<'static>>,
4134 _: (),
4135 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4136 ::fidl_next::munge! {
4137 let crate::wire::EchoEchoStringRequest {
4138 value,
4139
4140 } = out_;
4141 }
4142
4143 ::fidl_next::Encode::encode(self.value, encoder_, value, 32)?;
4144
4145 Ok(())
4146 }
4147 }
4148
4149 pub struct EchoEchoStringResponse<T0> {
4151 pub response: T0,
4152 }
4153
4154 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoEchoStringResponse<'static>, ___E>
4155 for EchoEchoStringResponse<T0>
4156 where
4157 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4158 ___E: ::fidl_next::Encoder,
4159 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4160 {
4161 #[inline]
4162 fn encode(
4163 self,
4164 encoder_: &mut ___E,
4165 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoEchoStringResponse<'static>>,
4166 _: (),
4167 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4168 ::fidl_next::munge! {
4169 let crate::wire::EchoEchoStringResponse {
4170 response,
4171
4172 } = out_;
4173 }
4174
4175 ::fidl_next::Encode::encode(self.response, encoder_, response, 32)?;
4176
4177 Ok(())
4178 }
4179 }
4180
4181 pub struct EchoSendStringRequest<T0> {
4183 pub value: T0,
4184 }
4185
4186 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoSendStringRequest<'static>, ___E>
4187 for EchoSendStringRequest<T0>
4188 where
4189 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4190 ___E: ::fidl_next::Encoder,
4191 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4192 {
4193 #[inline]
4194 fn encode(
4195 self,
4196 encoder_: &mut ___E,
4197 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoSendStringRequest<'static>>,
4198 _: (),
4199 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4200 ::fidl_next::munge! {
4201 let crate::wire::EchoSendStringRequest {
4202 value,
4203
4204 } = out_;
4205 }
4206
4207 ::fidl_next::Encode::encode(self.value, encoder_, value, 32)?;
4208
4209 Ok(())
4210 }
4211 }
4212
4213 pub struct EchoOnStringRequest<T0> {
4215 pub response: T0,
4216 }
4217
4218 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::EchoOnStringRequest<'static>, ___E>
4219 for EchoOnStringRequest<T0>
4220 where
4221 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4222 ___E: ::fidl_next::Encoder,
4223 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4224 {
4225 #[inline]
4226 fn encode(
4227 self,
4228 encoder_: &mut ___E,
4229 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoOnStringRequest<'static>>,
4230 _: (),
4231 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4232 ::fidl_next::munge! {
4233 let crate::wire::EchoOnStringRequest {
4234 response,
4235
4236 } = out_;
4237 }
4238
4239 ::fidl_next::Encode::encode(self.response, encoder_, response, 32)?;
4240
4241 Ok(())
4242 }
4243 }
4244
4245 pub struct EchoLauncherGetEchoRequest<T0> {
4247 pub echo_prefix: T0,
4248 }
4249
4250 unsafe impl<___E, T0>
4251 ::fidl_next::Encode<crate::wire::EchoLauncherGetEchoRequest<'static>, ___E>
4252 for EchoLauncherGetEchoRequest<T0>
4253 where
4254 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4255 ___E: ::fidl_next::Encoder,
4256 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
4257 {
4258 #[inline]
4259 fn encode(
4260 self,
4261 encoder_: &mut ___E,
4262 out_: &mut ::core::mem::MaybeUninit<crate::wire::EchoLauncherGetEchoRequest<'static>>,
4263 _: (),
4264 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4265 ::fidl_next::munge! {
4266 let crate::wire::EchoLauncherGetEchoRequest {
4267 echo_prefix,
4268
4269 } = out_;
4270 }
4271
4272 ::fidl_next::Encode::encode(self.echo_prefix, encoder_, echo_prefix, 32)?;
4273
4274 Ok(())
4275 }
4276 }
4277
4278 pub type GameState = ();
4280
4281 pub struct TicTacToeStartGameRequest<T0> {
4283 pub start_first: T0,
4284 }
4285
4286 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::TicTacToeStartGameRequest, ___E>
4287 for TicTacToeStartGameRequest<T0>
4288 where
4289 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4290 T0: ::fidl_next::Encode<bool, ___E>,
4291 {
4292 #[inline]
4293 fn encode(
4294 self,
4295 encoder_: &mut ___E,
4296 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeStartGameRequest>,
4297 _: (),
4298 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4299 ::fidl_next::munge! {
4300 let crate::wire::TicTacToeStartGameRequest {
4301 start_first,
4302
4303 } = out_;
4304 }
4305
4306 ::fidl_next::Encode::encode(self.start_first, encoder_, start_first, ())?;
4307
4308 Ok(())
4309 }
4310 }
4311
4312 pub struct TicTacToeMakeMoveRequest<T0, T1> {
4314 pub row: T0,
4315
4316 pub col: T1,
4317 }
4318
4319 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveRequest, ___E>
4320 for TicTacToeMakeMoveRequest<T0, T1>
4321 where
4322 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4323 T0: ::fidl_next::Encode<u8, ___E>,
4324 T1: ::fidl_next::Encode<u8, ___E>,
4325 {
4326 #[inline]
4327 fn encode(
4328 self,
4329 encoder_: &mut ___E,
4330 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveRequest>,
4331 _: (),
4332 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4333 ::fidl_next::munge! {
4334 let crate::wire::TicTacToeMakeMoveRequest {
4335 row,
4336 col,
4337
4338 } = out_;
4339 }
4340
4341 ::fidl_next::Encode::encode(self.row, encoder_, row, ())?;
4342
4343 ::fidl_next::Encode::encode(self.col, encoder_, col, ())?;
4344
4345 Ok(())
4346 }
4347 }
4348
4349 pub struct TicTacToeMakeMoveResponse<T0, T1> {
4351 pub success: T0,
4352
4353 pub new_state: T1,
4354 }
4355
4356 unsafe impl<___E, T0, T1>
4357 ::fidl_next::Encode<crate::wire::TicTacToeMakeMoveResponse<'static>, ___E>
4358 for TicTacToeMakeMoveResponse<T0, T1>
4359 where
4360 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4361 ___E: ::fidl_next::Encoder,
4362 T0: ::fidl_next::Encode<bool, ___E>,
4363 T1: ::fidl_next::Encode<::fidl_next::wire::Box<'static, crate::wire::GameState>, ___E>,
4364 {
4365 #[inline]
4366 fn encode(
4367 self,
4368 encoder_: &mut ___E,
4369 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeMakeMoveResponse<'static>>,
4370 _: (),
4371 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4372 ::fidl_next::munge! {
4373 let crate::wire::TicTacToeMakeMoveResponse {
4374 success,
4375 new_state,
4376
4377 } = out_;
4378 }
4379
4380 ::fidl_next::Encode::encode(self.success, encoder_, success, ())?;
4381
4382 ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
4383
4384 Ok(())
4385 }
4386 }
4387
4388 pub struct TicTacToeOnOpponentMoveRequest<T0> {
4390 pub new_state: T0,
4391 }
4392
4393 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::TicTacToeOnOpponentMoveRequest, ___E>
4394 for TicTacToeOnOpponentMoveRequest<T0>
4395 where
4396 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4397 T0: ::fidl_next::Encode<crate::wire::GameState, ___E>,
4398 {
4399 #[inline]
4400 fn encode(
4401 self,
4402 encoder_: &mut ___E,
4403 out_: &mut ::core::mem::MaybeUninit<crate::wire::TicTacToeOnOpponentMoveRequest>,
4404 _: (),
4405 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4406 ::fidl_next::munge! {
4407 let crate::wire::TicTacToeOnOpponentMoveRequest {
4408 new_state,
4409
4410 } = out_;
4411 }
4412
4413 ::fidl_next::Encode::encode(self.new_state, encoder_, new_state, ())?;
4414
4415 Ok(())
4416 }
4417 }
4418}
4419
4420pub use self::natural::*;
4421
4422pub const BOARD_SIZE: u8 = 9 as u8;
4423
4424pub const MAX_STRING_LENGTH: u64 = 32 as u64;
4425
4426#[derive(PartialEq, Debug)]
4428pub struct Echo;
4429
4430impl ::fidl_next::Discoverable for Echo {
4431 const PROTOCOL_NAME: &'static str = "fuchsia.examples.Echo";
4432}
4433
4434#[cfg(target_os = "fuchsia")]
4435impl ::fidl_next::HasTransport for Echo {
4436 type Transport = ::fidl_next::fuchsia::zx::Channel;
4437}
4438
4439pub mod echo {
4440 pub mod prelude {
4441 pub use crate::{
4442 Echo, EchoClientHandler, EchoLocalClientHandler, EchoLocalServerHandler,
4443 EchoServerHandler, echo,
4444 };
4445
4446 pub use crate::natural::EchoEchoStringRequest;
4447
4448 pub use crate::natural::EchoEchoStringResponse;
4449
4450 pub use crate::natural::EchoOnStringRequest;
4451
4452 pub use crate::natural::EchoSendStringRequest;
4453 }
4454
4455 pub struct EchoString;
4456
4457 impl ::fidl_next::Method for EchoString {
4458 const ORDINAL: u64 = 8482573115503257110;
4459 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4460 ::fidl_next::protocol::Flexibility::Strict;
4461
4462 type Protocol = crate::Echo;
4463
4464 type Request = crate::wire::EchoEchoStringRequest<'static>;
4465 }
4466
4467 impl ::fidl_next::TwoWayMethod for EchoString {
4468 type Response = ::fidl_next::wire::Strict<crate::wire::EchoEchoStringResponse<'static>>;
4469 }
4470
4471 impl<___R> ::fidl_next::Respond<___R> for EchoString {
4472 type Output = ::fidl_next::Strict<crate::generic::EchoEchoStringResponse<___R>>;
4473
4474 fn respond(response: ___R) -> Self::Output {
4475 ::fidl_next::Strict(crate::generic::EchoEchoStringResponse { response: response })
4476 }
4477 }
4478
4479 pub struct SendString;
4480
4481 impl ::fidl_next::Method for SendString {
4482 const ORDINAL: u64 = 6693688511394337905;
4483 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4484 ::fidl_next::protocol::Flexibility::Strict;
4485
4486 type Protocol = crate::Echo;
4487
4488 type Request = crate::wire::EchoSendStringRequest<'static>;
4489 }
4490
4491 pub struct OnString;
4492
4493 impl ::fidl_next::Method for OnString {
4494 const ORDINAL: u64 = 1382143211280629483;
4495 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4496 ::fidl_next::protocol::Flexibility::Strict;
4497
4498 type Protocol = crate::Echo;
4499
4500 type Request = crate::wire::EchoOnStringRequest<'static>;
4501 }
4502
4503 mod ___detail {
4504 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Echo
4505 where
4506 ___T: ::fidl_next::Transport,
4507 {
4508 type Client = EchoClient<___T>;
4509 type Server = EchoServer<___T>;
4510 }
4511
4512 #[repr(transparent)]
4514 pub struct EchoClient<___T: ::fidl_next::Transport> {
4515 #[allow(dead_code)]
4516 client: ::fidl_next::protocol::Client<___T>,
4517 }
4518
4519 impl<___T> EchoClient<___T>
4520 where
4521 ___T: ::fidl_next::Transport,
4522 {
4523 pub fn echo_string(
4524 &self,
4525
4526 value: impl ::fidl_next::Encode<
4527 ::fidl_next::wire::String<'static>,
4528 <___T as ::fidl_next::Transport>::SendBuffer,
4529 >,
4530 ) -> ::fidl_next::TwoWayFuture<'_, super::EchoString, ___T>
4531 where
4532 <___T as ::fidl_next::Transport>::SendBuffer:
4533 ::fidl_next::encoder::InternalHandleEncoder,
4534 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4535 {
4536 self.echo_string_with(crate::generic::EchoEchoStringRequest { value })
4537 }
4538
4539 pub fn echo_string_with<___R>(
4540 &self,
4541 request: ___R,
4542 ) -> ::fidl_next::TwoWayFuture<'_, super::EchoString, ___T>
4543 where
4544 ___R: ::fidl_next::Encode<
4545 crate::wire::EchoEchoStringRequest<'static>,
4546 <___T as ::fidl_next::Transport>::SendBuffer,
4547 >,
4548 {
4549 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4550 8482573115503257110,
4551 <super::EchoString as ::fidl_next::Method>::FLEXIBILITY,
4552 request,
4553 ))
4554 }
4555
4556 pub fn send_string(
4557 &self,
4558
4559 value: impl ::fidl_next::Encode<
4560 ::fidl_next::wire::String<'static>,
4561 <___T as ::fidl_next::Transport>::SendBuffer,
4562 >,
4563 ) -> ::fidl_next::SendFuture<'_, ___T>
4564 where
4565 <___T as ::fidl_next::Transport>::SendBuffer:
4566 ::fidl_next::encoder::InternalHandleEncoder,
4567 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4568 {
4569 self.send_string_with(crate::generic::EchoSendStringRequest { value })
4570 }
4571
4572 pub fn send_string_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
4573 where
4574 ___R: ::fidl_next::Encode<
4575 crate::wire::EchoSendStringRequest<'static>,
4576 <___T as ::fidl_next::Transport>::SendBuffer,
4577 >,
4578 {
4579 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
4580 6693688511394337905,
4581 <super::SendString as ::fidl_next::Method>::FLEXIBILITY,
4582 request,
4583 ))
4584 }
4585 }
4586
4587 #[repr(transparent)]
4589 pub struct EchoServer<___T: ::fidl_next::Transport> {
4590 server: ::fidl_next::protocol::Server<___T>,
4591 }
4592
4593 impl<___T> EchoServer<___T>
4594 where
4595 ___T: ::fidl_next::Transport,
4596 {
4597 pub fn on_string(
4598 &self,
4599
4600 response: impl ::fidl_next::Encode<
4601 ::fidl_next::wire::String<'static>,
4602 <___T as ::fidl_next::Transport>::SendBuffer,
4603 >,
4604 ) -> ::fidl_next::SendFuture<'_, ___T>
4605 where
4606 <___T as ::fidl_next::Transport>::SendBuffer:
4607 ::fidl_next::encoder::InternalHandleEncoder,
4608 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4609 {
4610 self.on_string_with(crate::generic::EchoOnStringRequest { response })
4611 }
4612
4613 pub fn on_string_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
4614 where
4615 ___R: ::fidl_next::Encode<
4616 <super::OnString as ::fidl_next::Method>::Request,
4617 <___T as ::fidl_next::Transport>::SendBuffer,
4618 >,
4619 {
4620 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
4621 1382143211280629483,
4622 <super::OnString as ::fidl_next::Method>::FLEXIBILITY,
4623 request,
4624 ))
4625 }
4626 }
4627 }
4628}
4629
4630#[diagnostic::on_unimplemented(
4631 note = "If {Self} implements the non-local EchoClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4632)]
4633
4634pub trait EchoLocalClientHandler<
4638 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4639 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4640>
4641{
4642 fn on_string(
4643 &mut self,
4644
4645 request: ::fidl_next::Request<echo::OnString, ___T>,
4646 ) -> impl ::core::future::Future<Output = ()>;
4647}
4648
4649impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Echo
4650where
4651 ___H: EchoLocalClientHandler<___T>,
4652 ___T: ::fidl_next::Transport,
4653 for<'de> crate::wire::EchoOnStringRequest<'de>: ::fidl_next::Decode<
4654 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4655 Constraint = (),
4656 >,
4657{
4658 async fn on_event(
4659 handler: &mut ___H,
4660 mut message: ::fidl_next::Message<___T>,
4661 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4662 match *message.header().ordinal {
4663 1382143211280629483 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4664 Ok(decoded) => {
4665 handler.on_string(::fidl_next::Request::from_decoded(decoded)).await;
4666 Ok(())
4667 }
4668 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4669 ordinal: 1382143211280629483,
4670 error,
4671 }),
4672 },
4673
4674 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4675 }
4676 }
4677}
4678
4679#[diagnostic::on_unimplemented(
4680 note = "If {Self} implements the non-local EchoServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4681)]
4682
4683pub trait EchoLocalServerHandler<
4687 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4688 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4689>
4690{
4691 fn echo_string(
4692 &mut self,
4693
4694 request: ::fidl_next::Request<echo::EchoString, ___T>,
4695
4696 responder: ::fidl_next::Responder<echo::EchoString, ___T>,
4697 ) -> impl ::core::future::Future<Output = ()>;
4698
4699 fn send_string(
4700 &mut self,
4701
4702 request: ::fidl_next::Request<echo::SendString, ___T>,
4703 ) -> impl ::core::future::Future<Output = ()>;
4704}
4705
4706impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Echo
4707where
4708 ___H: EchoLocalServerHandler<___T>,
4709 ___T: ::fidl_next::Transport,
4710 for<'de> crate::wire::EchoEchoStringRequest<'de>: ::fidl_next::Decode<
4711 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4712 Constraint = (),
4713 >,
4714 for<'de> crate::wire::EchoSendStringRequest<'de>: ::fidl_next::Decode<
4715 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4716 Constraint = (),
4717 >,
4718{
4719 async fn on_one_way(
4720 handler: &mut ___H,
4721 mut message: ::fidl_next::Message<___T>,
4722 ) -> ::core::result::Result<
4723 (),
4724 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4725 > {
4726 match *message.header().ordinal {
4727 6693688511394337905 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4728 Ok(decoded) => {
4729 handler.send_string(::fidl_next::Request::from_decoded(decoded)).await;
4730 Ok(())
4731 }
4732 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4733 ordinal: 6693688511394337905,
4734 error,
4735 }),
4736 },
4737
4738 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4739 }
4740 }
4741
4742 async fn on_two_way(
4743 handler: &mut ___H,
4744 mut message: ::fidl_next::Message<___T>,
4745 responder: ::fidl_next::protocol::Responder<___T>,
4746 ) -> ::core::result::Result<
4747 (),
4748 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4749 > {
4750 match *message.header().ordinal {
4751 8482573115503257110 => {
4752 let responder = ::fidl_next::Responder::from_untyped(responder);
4753
4754 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4755 Ok(decoded) => {
4756 handler
4757 .echo_string(::fidl_next::Request::from_decoded(decoded), responder)
4758 .await;
4759 Ok(())
4760 }
4761 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4762 ordinal: 8482573115503257110,
4763 error,
4764 }),
4765 }
4766 }
4767
4768 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4769 }
4770 }
4771}
4772
4773pub trait EchoClientHandler<
4777 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4778 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4779>
4780{
4781 fn on_string(
4782 &mut self,
4783
4784 request: ::fidl_next::Request<echo::OnString, ___T>,
4785 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4786}
4787
4788impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Echo
4789where
4790 ___H: EchoClientHandler<___T> + ::core::marker::Send,
4791 ___T: ::fidl_next::Transport,
4792 for<'de> crate::wire::EchoOnStringRequest<'de>: ::fidl_next::Decode<
4793 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4794 Constraint = (),
4795 >,
4796{
4797 async fn on_event(
4798 handler: &mut ___H,
4799 mut message: ::fidl_next::Message<___T>,
4800 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4801 match *message.header().ordinal {
4802 1382143211280629483 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4803 Ok(decoded) => {
4804 handler.on_string(::fidl_next::Request::from_decoded(decoded)).await;
4805 Ok(())
4806 }
4807 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4808 ordinal: 1382143211280629483,
4809 error,
4810 }),
4811 },
4812
4813 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4814 }
4815 }
4816}
4817
4818pub trait EchoServerHandler<
4822 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4823 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4824>
4825{
4826 fn echo_string(
4827 &mut self,
4828
4829 request: ::fidl_next::Request<echo::EchoString, ___T>,
4830
4831 responder: ::fidl_next::Responder<echo::EchoString, ___T>,
4832 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4833
4834 fn send_string(
4835 &mut self,
4836
4837 request: ::fidl_next::Request<echo::SendString, ___T>,
4838 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4839}
4840
4841impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Echo
4842where
4843 ___H: EchoServerHandler<___T> + ::core::marker::Send,
4844 ___T: ::fidl_next::Transport,
4845 for<'de> crate::wire::EchoEchoStringRequest<'de>: ::fidl_next::Decode<
4846 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4847 Constraint = (),
4848 >,
4849 for<'de> crate::wire::EchoSendStringRequest<'de>: ::fidl_next::Decode<
4850 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4851 Constraint = (),
4852 >,
4853{
4854 async fn on_one_way(
4855 handler: &mut ___H,
4856 mut message: ::fidl_next::Message<___T>,
4857 ) -> ::core::result::Result<
4858 (),
4859 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4860 > {
4861 match *message.header().ordinal {
4862 6693688511394337905 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4863 Ok(decoded) => {
4864 handler.send_string(::fidl_next::Request::from_decoded(decoded)).await;
4865 Ok(())
4866 }
4867 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4868 ordinal: 6693688511394337905,
4869 error,
4870 }),
4871 },
4872
4873 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4874 }
4875 }
4876
4877 async fn on_two_way(
4878 handler: &mut ___H,
4879 mut message: ::fidl_next::Message<___T>,
4880 responder: ::fidl_next::protocol::Responder<___T>,
4881 ) -> ::core::result::Result<
4882 (),
4883 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4884 > {
4885 match *message.header().ordinal {
4886 8482573115503257110 => {
4887 let responder = ::fidl_next::Responder::from_untyped(responder);
4888
4889 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4890 Ok(decoded) => {
4891 handler
4892 .echo_string(::fidl_next::Request::from_decoded(decoded), responder)
4893 .await;
4894 Ok(())
4895 }
4896 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4897 ordinal: 8482573115503257110,
4898 error,
4899 }),
4900 }
4901 }
4902
4903 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4904 }
4905 }
4906}
4907
4908impl<___T> EchoClientHandler<___T> for ::fidl_next::IgnoreEvents
4909where
4910 ___T: ::fidl_next::Transport,
4911{
4912 async fn on_string(&mut self, _: ::fidl_next::Request<echo::OnString, ___T>) {}
4913}
4914
4915impl<___H, ___T> EchoLocalClientHandler<___T> for ::fidl_next::Local<___H>
4916where
4917 ___H: EchoClientHandler<___T>,
4918 ___T: ::fidl_next::Transport,
4919{
4920 async fn on_string(&mut self, request: ::fidl_next::Request<echo::OnString, ___T>) {
4921 ___H::on_string(&mut self.0, request).await
4922 }
4923}
4924
4925impl<___H, ___T> EchoLocalServerHandler<___T> for ::fidl_next::Local<___H>
4926where
4927 ___H: EchoServerHandler<___T>,
4928 ___T: ::fidl_next::Transport,
4929{
4930 async fn echo_string(
4931 &mut self,
4932
4933 request: ::fidl_next::Request<echo::EchoString, ___T>,
4934
4935 responder: ::fidl_next::Responder<echo::EchoString, ___T>,
4936 ) {
4937 ___H::echo_string(&mut self.0, request, responder).await
4938 }
4939
4940 async fn send_string(&mut self, request: ::fidl_next::Request<echo::SendString, ___T>) {
4941 ___H::send_string(&mut self.0, request).await
4942 }
4943}
4944
4945pub const NAME: &str = "Tic-Tac-Toe";
4946
4947#[derive(PartialEq, Debug)]
4949pub struct TicTacToe;
4950
4951#[cfg(target_os = "fuchsia")]
4952impl ::fidl_next::HasTransport for TicTacToe {
4953 type Transport = ::fidl_next::fuchsia::zx::Channel;
4954}
4955
4956pub mod tic_tac_toe {
4957 pub mod prelude {
4958 pub use crate::{
4959 TicTacToe, TicTacToeClientHandler, TicTacToeLocalClientHandler,
4960 TicTacToeLocalServerHandler, TicTacToeServerHandler, tic_tac_toe,
4961 };
4962
4963 pub use crate::natural::TicTacToeMakeMoveRequest;
4964
4965 pub use crate::natural::TicTacToeMakeMoveResponse;
4966
4967 pub use crate::natural::TicTacToeOnOpponentMoveRequest;
4968
4969 pub use crate::natural::TicTacToeStartGameRequest;
4970 }
4971
4972 pub struct StartGame;
4973
4974 impl ::fidl_next::Method for StartGame {
4975 const ORDINAL: u64 = 1597785876893992537;
4976 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4977 ::fidl_next::protocol::Flexibility::Strict;
4978
4979 type Protocol = crate::TicTacToe;
4980
4981 type Request = crate::wire::TicTacToeStartGameRequest;
4982 }
4983
4984 pub struct MakeMove;
4985
4986 impl ::fidl_next::Method for MakeMove {
4987 const ORDINAL: u64 = 9215857243616535889;
4988 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4989 ::fidl_next::protocol::Flexibility::Strict;
4990
4991 type Protocol = crate::TicTacToe;
4992
4993 type Request = crate::wire::TicTacToeMakeMoveRequest;
4994 }
4995
4996 impl ::fidl_next::TwoWayMethod for MakeMove {
4997 type Response = ::fidl_next::wire::Strict<crate::wire::TicTacToeMakeMoveResponse<'static>>;
4998 }
4999
5000 impl<___R> ::fidl_next::Respond<___R> for MakeMove {
5001 type Output = ::fidl_next::Strict<___R>;
5002
5003 fn respond(response: ___R) -> Self::Output {
5004 ::fidl_next::Strict(response)
5005 }
5006 }
5007
5008 pub struct OnOpponentMove;
5009
5010 impl ::fidl_next::Method for OnOpponentMove {
5011 const ORDINAL: u64 = 6020456714778822440;
5012 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
5013 ::fidl_next::protocol::Flexibility::Strict;
5014
5015 type Protocol = crate::TicTacToe;
5016
5017 type Request = crate::wire::TicTacToeOnOpponentMoveRequest;
5018 }
5019
5020 mod ___detail {
5021 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::TicTacToe
5022 where
5023 ___T: ::fidl_next::Transport,
5024 {
5025 type Client = TicTacToeClient<___T>;
5026 type Server = TicTacToeServer<___T>;
5027 }
5028
5029 #[repr(transparent)]
5031 pub struct TicTacToeClient<___T: ::fidl_next::Transport> {
5032 #[allow(dead_code)]
5033 client: ::fidl_next::protocol::Client<___T>,
5034 }
5035
5036 impl<___T> TicTacToeClient<___T>
5037 where
5038 ___T: ::fidl_next::Transport,
5039 {
5040 pub fn start_game(
5041 &self,
5042
5043 start_first: impl ::fidl_next::Encode<
5044 bool,
5045 <___T as ::fidl_next::Transport>::SendBuffer,
5046 >,
5047 ) -> ::fidl_next::SendFuture<'_, ___T>
5048 where
5049 <___T as ::fidl_next::Transport>::SendBuffer:
5050 ::fidl_next::encoder::InternalHandleEncoder,
5051 {
5052 self.start_game_with(crate::generic::TicTacToeStartGameRequest { start_first })
5053 }
5054
5055 pub fn start_game_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
5056 where
5057 ___R: ::fidl_next::Encode<
5058 crate::wire::TicTacToeStartGameRequest,
5059 <___T as ::fidl_next::Transport>::SendBuffer,
5060 >,
5061 {
5062 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
5063 1597785876893992537,
5064 <super::StartGame as ::fidl_next::Method>::FLEXIBILITY,
5065 request,
5066 ))
5067 }
5068
5069 pub fn make_move(
5070 &self,
5071
5072 row: impl ::fidl_next::Encode<u8, <___T as ::fidl_next::Transport>::SendBuffer>,
5073
5074 col: impl ::fidl_next::Encode<u8, <___T as ::fidl_next::Transport>::SendBuffer>,
5075 ) -> ::fidl_next::TwoWayFuture<'_, super::MakeMove, ___T>
5076 where
5077 <___T as ::fidl_next::Transport>::SendBuffer:
5078 ::fidl_next::encoder::InternalHandleEncoder,
5079 {
5080 self.make_move_with(crate::generic::TicTacToeMakeMoveRequest { row, col })
5081 }
5082
5083 pub fn make_move_with<___R>(
5084 &self,
5085 request: ___R,
5086 ) -> ::fidl_next::TwoWayFuture<'_, super::MakeMove, ___T>
5087 where
5088 ___R: ::fidl_next::Encode<
5089 crate::wire::TicTacToeMakeMoveRequest,
5090 <___T as ::fidl_next::Transport>::SendBuffer,
5091 >,
5092 {
5093 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
5094 9215857243616535889,
5095 <super::MakeMove as ::fidl_next::Method>::FLEXIBILITY,
5096 request,
5097 ))
5098 }
5099 }
5100
5101 #[repr(transparent)]
5103 pub struct TicTacToeServer<___T: ::fidl_next::Transport> {
5104 server: ::fidl_next::protocol::Server<___T>,
5105 }
5106
5107 impl<___T> TicTacToeServer<___T>
5108 where
5109 ___T: ::fidl_next::Transport,
5110 {
5111 pub fn on_opponent_move(
5112 &self,
5113
5114 new_state: impl ::fidl_next::Encode<
5115 crate::wire::GameState,
5116 <___T as ::fidl_next::Transport>::SendBuffer,
5117 >,
5118 ) -> ::fidl_next::SendFuture<'_, ___T>
5119 where
5120 <___T as ::fidl_next::Transport>::SendBuffer:
5121 ::fidl_next::encoder::InternalHandleEncoder,
5122 {
5123 self.on_opponent_move_with(crate::generic::TicTacToeOnOpponentMoveRequest {
5124 new_state,
5125 })
5126 }
5127
5128 pub fn on_opponent_move_with<___R>(
5129 &self,
5130 request: ___R,
5131 ) -> ::fidl_next::SendFuture<'_, ___T>
5132 where
5133 ___R: ::fidl_next::Encode<
5134 <super::OnOpponentMove as ::fidl_next::Method>::Request,
5135 <___T as ::fidl_next::Transport>::SendBuffer,
5136 >,
5137 {
5138 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
5139 6020456714778822440,
5140 <super::OnOpponentMove as ::fidl_next::Method>::FLEXIBILITY,
5141 request,
5142 ))
5143 }
5144 }
5145 }
5146}
5147
5148#[diagnostic::on_unimplemented(
5149 note = "If {Self} implements the non-local TicTacToeClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
5150)]
5151
5152pub trait TicTacToeLocalClientHandler<
5156 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5157 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5158>
5159{
5160 fn on_opponent_move(
5161 &mut self,
5162
5163 request: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5164 ) -> impl ::core::future::Future<Output = ()>;
5165}
5166
5167impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for TicTacToe
5168where
5169 ___H: TicTacToeLocalClientHandler<___T>,
5170 ___T: ::fidl_next::Transport,
5171 for<'de> crate::wire::TicTacToeOnOpponentMoveRequest: ::fidl_next::Decode<
5172 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5173 Constraint = (),
5174 >,
5175{
5176 async fn on_event(
5177 handler: &mut ___H,
5178 mut message: ::fidl_next::Message<___T>,
5179 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5180 match *message.header().ordinal {
5181 6020456714778822440 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5182 Ok(decoded) => {
5183 handler.on_opponent_move(::fidl_next::Request::from_decoded(decoded)).await;
5184 Ok(())
5185 }
5186 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5187 ordinal: 6020456714778822440,
5188 error,
5189 }),
5190 },
5191
5192 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5193 }
5194 }
5195}
5196
5197#[diagnostic::on_unimplemented(
5198 note = "If {Self} implements the non-local TicTacToeServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
5199)]
5200
5201pub trait TicTacToeLocalServerHandler<
5205 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5206 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5207>
5208{
5209 fn start_game(
5210 &mut self,
5211
5212 request: ::fidl_next::Request<tic_tac_toe::StartGame, ___T>,
5213 ) -> impl ::core::future::Future<Output = ()>;
5214
5215 fn make_move(
5216 &mut self,
5217
5218 request: ::fidl_next::Request<tic_tac_toe::MakeMove, ___T>,
5219
5220 responder: ::fidl_next::Responder<tic_tac_toe::MakeMove, ___T>,
5221 ) -> impl ::core::future::Future<Output = ()>;
5222}
5223
5224impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for TicTacToe
5225where
5226 ___H: TicTacToeLocalServerHandler<___T>,
5227 ___T: ::fidl_next::Transport,
5228 for<'de> crate::wire::TicTacToeStartGameRequest: ::fidl_next::Decode<
5229 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5230 Constraint = (),
5231 >,
5232 for<'de> crate::wire::TicTacToeMakeMoveRequest: ::fidl_next::Decode<
5233 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5234 Constraint = (),
5235 >,
5236{
5237 async fn on_one_way(
5238 handler: &mut ___H,
5239 mut message: ::fidl_next::Message<___T>,
5240 ) -> ::core::result::Result<
5241 (),
5242 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5243 > {
5244 match *message.header().ordinal {
5245 1597785876893992537 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5246 Ok(decoded) => {
5247 handler.start_game(::fidl_next::Request::from_decoded(decoded)).await;
5248 Ok(())
5249 }
5250 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5251 ordinal: 1597785876893992537,
5252 error,
5253 }),
5254 },
5255
5256 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5257 }
5258 }
5259
5260 async fn on_two_way(
5261 handler: &mut ___H,
5262 mut message: ::fidl_next::Message<___T>,
5263 responder: ::fidl_next::protocol::Responder<___T>,
5264 ) -> ::core::result::Result<
5265 (),
5266 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5267 > {
5268 match *message.header().ordinal {
5269 9215857243616535889 => {
5270 let responder = ::fidl_next::Responder::from_untyped(responder);
5271
5272 match ::fidl_next::AsDecoderExt::into_decoded(message) {
5273 Ok(decoded) => {
5274 handler
5275 .make_move(::fidl_next::Request::from_decoded(decoded), responder)
5276 .await;
5277 Ok(())
5278 }
5279 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5280 ordinal: 9215857243616535889,
5281 error,
5282 }),
5283 }
5284 }
5285
5286 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5287 }
5288 }
5289}
5290
5291pub trait TicTacToeClientHandler<
5295 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5296 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5297>
5298{
5299 fn on_opponent_move(
5300 &mut self,
5301
5302 request: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5303 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5304}
5305
5306impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for TicTacToe
5307where
5308 ___H: TicTacToeClientHandler<___T> + ::core::marker::Send,
5309 ___T: ::fidl_next::Transport,
5310 for<'de> crate::wire::TicTacToeOnOpponentMoveRequest: ::fidl_next::Decode<
5311 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5312 Constraint = (),
5313 >,
5314{
5315 async fn on_event(
5316 handler: &mut ___H,
5317 mut message: ::fidl_next::Message<___T>,
5318 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5319 match *message.header().ordinal {
5320 6020456714778822440 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5321 Ok(decoded) => {
5322 handler.on_opponent_move(::fidl_next::Request::from_decoded(decoded)).await;
5323 Ok(())
5324 }
5325 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5326 ordinal: 6020456714778822440,
5327 error,
5328 }),
5329 },
5330
5331 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5332 }
5333 }
5334}
5335
5336pub trait TicTacToeServerHandler<
5340 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5341 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5342>
5343{
5344 fn start_game(
5345 &mut self,
5346
5347 request: ::fidl_next::Request<tic_tac_toe::StartGame, ___T>,
5348 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5349
5350 fn make_move(
5351 &mut self,
5352
5353 request: ::fidl_next::Request<tic_tac_toe::MakeMove, ___T>,
5354
5355 responder: ::fidl_next::Responder<tic_tac_toe::MakeMove, ___T>,
5356 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5357}
5358
5359impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for TicTacToe
5360where
5361 ___H: TicTacToeServerHandler<___T> + ::core::marker::Send,
5362 ___T: ::fidl_next::Transport,
5363 for<'de> crate::wire::TicTacToeStartGameRequest: ::fidl_next::Decode<
5364 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5365 Constraint = (),
5366 >,
5367 for<'de> crate::wire::TicTacToeMakeMoveRequest: ::fidl_next::Decode<
5368 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5369 Constraint = (),
5370 >,
5371{
5372 async fn on_one_way(
5373 handler: &mut ___H,
5374 mut message: ::fidl_next::Message<___T>,
5375 ) -> ::core::result::Result<
5376 (),
5377 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5378 > {
5379 match *message.header().ordinal {
5380 1597785876893992537 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
5381 Ok(decoded) => {
5382 handler.start_game(::fidl_next::Request::from_decoded(decoded)).await;
5383 Ok(())
5384 }
5385 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5386 ordinal: 1597785876893992537,
5387 error,
5388 }),
5389 },
5390
5391 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5392 }
5393 }
5394
5395 async fn on_two_way(
5396 handler: &mut ___H,
5397 mut message: ::fidl_next::Message<___T>,
5398 responder: ::fidl_next::protocol::Responder<___T>,
5399 ) -> ::core::result::Result<
5400 (),
5401 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
5402 > {
5403 match *message.header().ordinal {
5404 9215857243616535889 => {
5405 let responder = ::fidl_next::Responder::from_untyped(responder);
5406
5407 match ::fidl_next::AsDecoderExt::into_decoded(message) {
5408 Ok(decoded) => {
5409 handler
5410 .make_move(::fidl_next::Request::from_decoded(decoded), responder)
5411 .await;
5412 Ok(())
5413 }
5414 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5415 ordinal: 9215857243616535889,
5416 error,
5417 }),
5418 }
5419 }
5420
5421 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
5422 }
5423 }
5424}
5425
5426impl<___T> TicTacToeClientHandler<___T> for ::fidl_next::IgnoreEvents
5427where
5428 ___T: ::fidl_next::Transport,
5429{
5430 async fn on_opponent_move(
5431 &mut self,
5432
5433 _: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5434 ) {
5435 }
5436}
5437
5438impl<___H, ___T> TicTacToeLocalClientHandler<___T> for ::fidl_next::Local<___H>
5439where
5440 ___H: TicTacToeClientHandler<___T>,
5441 ___T: ::fidl_next::Transport,
5442{
5443 async fn on_opponent_move(
5444 &mut self,
5445
5446 request: ::fidl_next::Request<tic_tac_toe::OnOpponentMove, ___T>,
5447 ) {
5448 ___H::on_opponent_move(&mut self.0, request).await
5449 }
5450}
5451
5452impl<___H, ___T> TicTacToeLocalServerHandler<___T> for ::fidl_next::Local<___H>
5453where
5454 ___H: TicTacToeServerHandler<___T>,
5455 ___T: ::fidl_next::Transport,
5456{
5457 async fn start_game(&mut self, request: ::fidl_next::Request<tic_tac_toe::StartGame, ___T>) {
5458 ___H::start_game(&mut self.0, request).await
5459 }
5460
5461 async fn make_move(
5462 &mut self,
5463
5464 request: ::fidl_next::Request<tic_tac_toe::MakeMove, ___T>,
5465
5466 responder: ::fidl_next::Responder<tic_tac_toe::MakeMove, ___T>,
5467 ) {
5468 ___H::make_move(&mut self.0, request, responder).await
5469 }
5470}