1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " Number of bits per character\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(u8)]
10 pub enum CharacterWidth {
11 Bits5 = 1,
12 Bits6 = 2,
13 Bits7 = 3,
14 Bits8 = 4,
15 }
16 impl ::core::convert::TryFrom<u8> for CharacterWidth {
17 type Error = ::fidl_next::UnknownStrictEnumMemberError;
18 fn try_from(
19 value: u8,
20 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
21 match value {
22 1 => Ok(Self::Bits5),
23 2 => Ok(Self::Bits6),
24 3 => Ok(Self::Bits7),
25 4 => Ok(Self::Bits8),
26
27 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
28 }
29 }
30 }
31
32 impl ::std::convert::From<CharacterWidth> for u8 {
33 fn from(value: CharacterWidth) -> Self {
34 match value {
35 CharacterWidth::Bits5 => 1,
36 CharacterWidth::Bits6 => 2,
37 CharacterWidth::Bits7 => 3,
38 CharacterWidth::Bits8 => 4,
39 }
40 }
41 }
42
43 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CharacterWidth, ___E> for CharacterWidth
44 where
45 ___E: ?Sized,
46 {
47 #[inline]
48 fn encode(
49 self,
50 encoder: &mut ___E,
51 out: &mut ::core::mem::MaybeUninit<crate::wire::CharacterWidth>,
52 _: (),
53 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
54 ::fidl_next::Encode::encode(&self, encoder, out, ())
55 }
56 }
57
58 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CharacterWidth, ___E> for &'a CharacterWidth
59 where
60 ___E: ?Sized,
61 {
62 #[inline]
63 fn encode(
64 self,
65 encoder: &mut ___E,
66 out: &mut ::core::mem::MaybeUninit<crate::wire::CharacterWidth>,
67 _: (),
68 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
69 ::fidl_next::munge!(let crate::wire::CharacterWidth { value } = out);
70 let _ = value.write(u8::from(match *self {
71 CharacterWidth::Bits5 => 1,
72
73 CharacterWidth::Bits6 => 2,
74
75 CharacterWidth::Bits7 => 3,
76
77 CharacterWidth::Bits8 => 4,
78 }));
79
80 Ok(())
81 }
82 }
83
84 impl ::core::convert::From<crate::wire::CharacterWidth> for CharacterWidth {
85 fn from(wire: crate::wire::CharacterWidth) -> Self {
86 match u8::from(wire.value) {
87 1 => Self::Bits5,
88
89 2 => Self::Bits6,
90
91 3 => Self::Bits7,
92
93 4 => Self::Bits8,
94
95 _ => unsafe { ::core::hint::unreachable_unchecked() },
96 }
97 }
98 }
99
100 impl ::fidl_next::FromWire<crate::wire::CharacterWidth> for CharacterWidth {
101 #[inline]
102 fn from_wire(wire: crate::wire::CharacterWidth) -> Self {
103 Self::from(wire)
104 }
105 }
106
107 impl ::fidl_next::FromWireRef<crate::wire::CharacterWidth> for CharacterWidth {
108 #[inline]
109 fn from_wire_ref(wire: &crate::wire::CharacterWidth) -> Self {
110 Self::from(*wire)
111 }
112 }
113
114 #[doc = " Description of what type of serial device this is\n TODO(https://fxbug.dev/393643944): Consider replacing this enum.\n"]
115 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
116 #[repr(u8)]
117 pub enum Class {
118 Generic = 1,
119 BluetoothHci = 2,
120 Console = 3,
121 KernelDebug = 4,
122 Mcu = 5,
123 }
124 impl ::core::convert::TryFrom<u8> for Class {
125 type Error = ::fidl_next::UnknownStrictEnumMemberError;
126 fn try_from(
127 value: u8,
128 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
129 match value {
130 1 => Ok(Self::Generic),
131 2 => Ok(Self::BluetoothHci),
132 3 => Ok(Self::Console),
133 4 => Ok(Self::KernelDebug),
134 5 => Ok(Self::Mcu),
135
136 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
137 }
138 }
139 }
140
141 impl ::std::convert::From<Class> for u8 {
142 fn from(value: Class) -> Self {
143 match value {
144 Class::Generic => 1,
145 Class::BluetoothHci => 2,
146 Class::Console => 3,
147 Class::KernelDebug => 4,
148 Class::Mcu => 5,
149 }
150 }
151 }
152
153 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Class, ___E> for Class
154 where
155 ___E: ?Sized,
156 {
157 #[inline]
158 fn encode(
159 self,
160 encoder: &mut ___E,
161 out: &mut ::core::mem::MaybeUninit<crate::wire::Class>,
162 _: (),
163 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
164 ::fidl_next::Encode::encode(&self, encoder, out, ())
165 }
166 }
167
168 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Class, ___E> for &'a Class
169 where
170 ___E: ?Sized,
171 {
172 #[inline]
173 fn encode(
174 self,
175 encoder: &mut ___E,
176 out: &mut ::core::mem::MaybeUninit<crate::wire::Class>,
177 _: (),
178 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
179 ::fidl_next::munge!(let crate::wire::Class { value } = out);
180 let _ = value.write(u8::from(match *self {
181 Class::Generic => 1,
182
183 Class::BluetoothHci => 2,
184
185 Class::Console => 3,
186
187 Class::KernelDebug => 4,
188
189 Class::Mcu => 5,
190 }));
191
192 Ok(())
193 }
194 }
195
196 impl ::core::convert::From<crate::wire::Class> for Class {
197 fn from(wire: crate::wire::Class) -> Self {
198 match u8::from(wire.value) {
199 1 => Self::Generic,
200
201 2 => Self::BluetoothHci,
202
203 3 => Self::Console,
204
205 4 => Self::KernelDebug,
206
207 5 => Self::Mcu,
208
209 _ => unsafe { ::core::hint::unreachable_unchecked() },
210 }
211 }
212 }
213
214 impl ::fidl_next::FromWire<crate::wire::Class> for Class {
215 #[inline]
216 fn from_wire(wire: crate::wire::Class) -> Self {
217 Self::from(wire)
218 }
219 }
220
221 impl ::fidl_next::FromWireRef<crate::wire::Class> for Class {
222 #[inline]
223 fn from_wire_ref(wire: &crate::wire::Class) -> Self {
224 Self::from(*wire)
225 }
226 }
227
228 #[doc = " Number of stop bits\n"]
229 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
230 #[repr(u8)]
231 pub enum StopWidth {
232 Bits1 = 1,
233 Bits2 = 2,
234 }
235 impl ::core::convert::TryFrom<u8> for StopWidth {
236 type Error = ::fidl_next::UnknownStrictEnumMemberError;
237 fn try_from(
238 value: u8,
239 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
240 match value {
241 1 => Ok(Self::Bits1),
242 2 => Ok(Self::Bits2),
243
244 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
245 }
246 }
247 }
248
249 impl ::std::convert::From<StopWidth> for u8 {
250 fn from(value: StopWidth) -> Self {
251 match value {
252 StopWidth::Bits1 => 1,
253 StopWidth::Bits2 => 2,
254 }
255 }
256 }
257
258 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StopWidth, ___E> for StopWidth
259 where
260 ___E: ?Sized,
261 {
262 #[inline]
263 fn encode(
264 self,
265 encoder: &mut ___E,
266 out: &mut ::core::mem::MaybeUninit<crate::wire::StopWidth>,
267 _: (),
268 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
269 ::fidl_next::Encode::encode(&self, encoder, out, ())
270 }
271 }
272
273 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StopWidth, ___E> for &'a StopWidth
274 where
275 ___E: ?Sized,
276 {
277 #[inline]
278 fn encode(
279 self,
280 encoder: &mut ___E,
281 out: &mut ::core::mem::MaybeUninit<crate::wire::StopWidth>,
282 _: (),
283 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
284 ::fidl_next::munge!(let crate::wire::StopWidth { value } = out);
285 let _ = value.write(u8::from(match *self {
286 StopWidth::Bits1 => 1,
287
288 StopWidth::Bits2 => 2,
289 }));
290
291 Ok(())
292 }
293 }
294
295 impl ::core::convert::From<crate::wire::StopWidth> for StopWidth {
296 fn from(wire: crate::wire::StopWidth) -> Self {
297 match u8::from(wire.value) {
298 1 => Self::Bits1,
299
300 2 => Self::Bits2,
301
302 _ => unsafe { ::core::hint::unreachable_unchecked() },
303 }
304 }
305 }
306
307 impl ::fidl_next::FromWire<crate::wire::StopWidth> for StopWidth {
308 #[inline]
309 fn from_wire(wire: crate::wire::StopWidth) -> Self {
310 Self::from(wire)
311 }
312 }
313
314 impl ::fidl_next::FromWireRef<crate::wire::StopWidth> for StopWidth {
315 #[inline]
316 fn from_wire_ref(wire: &crate::wire::StopWidth) -> Self {
317 Self::from(*wire)
318 }
319 }
320
321 #[doc = " Which parity computation to use, if any.\n"]
322 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
323 #[repr(u8)]
324 pub enum Parity {
325 None = 1,
326 Even = 2,
327 Odd = 3,
328 }
329 impl ::core::convert::TryFrom<u8> for Parity {
330 type Error = ::fidl_next::UnknownStrictEnumMemberError;
331 fn try_from(
332 value: u8,
333 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
334 match value {
335 1 => Ok(Self::None),
336 2 => Ok(Self::Even),
337 3 => Ok(Self::Odd),
338
339 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
340 }
341 }
342 }
343
344 impl ::std::convert::From<Parity> for u8 {
345 fn from(value: Parity) -> Self {
346 match value {
347 Parity::None => 1,
348 Parity::Even => 2,
349 Parity::Odd => 3,
350 }
351 }
352 }
353
354 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Parity, ___E> for Parity
355 where
356 ___E: ?Sized,
357 {
358 #[inline]
359 fn encode(
360 self,
361 encoder: &mut ___E,
362 out: &mut ::core::mem::MaybeUninit<crate::wire::Parity>,
363 _: (),
364 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
365 ::fidl_next::Encode::encode(&self, encoder, out, ())
366 }
367 }
368
369 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Parity, ___E> for &'a Parity
370 where
371 ___E: ?Sized,
372 {
373 #[inline]
374 fn encode(
375 self,
376 encoder: &mut ___E,
377 out: &mut ::core::mem::MaybeUninit<crate::wire::Parity>,
378 _: (),
379 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
380 ::fidl_next::munge!(let crate::wire::Parity { value } = out);
381 let _ = value.write(u8::from(match *self {
382 Parity::None => 1,
383
384 Parity::Even => 2,
385
386 Parity::Odd => 3,
387 }));
388
389 Ok(())
390 }
391 }
392
393 impl ::core::convert::From<crate::wire::Parity> for Parity {
394 fn from(wire: crate::wire::Parity) -> Self {
395 match u8::from(wire.value) {
396 1 => Self::None,
397
398 2 => Self::Even,
399
400 3 => Self::Odd,
401
402 _ => unsafe { ::core::hint::unreachable_unchecked() },
403 }
404 }
405 }
406
407 impl ::fidl_next::FromWire<crate::wire::Parity> for Parity {
408 #[inline]
409 fn from_wire(wire: crate::wire::Parity) -> Self {
410 Self::from(wire)
411 }
412 }
413
414 impl ::fidl_next::FromWireRef<crate::wire::Parity> for Parity {
415 #[inline]
416 fn from_wire_ref(wire: &crate::wire::Parity) -> Self {
417 Self::from(*wire)
418 }
419 }
420
421 #[doc = " What flow control mechanism to use\n"]
422 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
423 #[repr(u8)]
424 pub enum FlowControl {
425 None = 1,
426 CtsRts = 2,
427 }
428 impl ::core::convert::TryFrom<u8> for FlowControl {
429 type Error = ::fidl_next::UnknownStrictEnumMemberError;
430 fn try_from(
431 value: u8,
432 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
433 match value {
434 1 => Ok(Self::None),
435 2 => Ok(Self::CtsRts),
436
437 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
438 }
439 }
440 }
441
442 impl ::std::convert::From<FlowControl> for u8 {
443 fn from(value: FlowControl) -> Self {
444 match value {
445 FlowControl::None => 1,
446 FlowControl::CtsRts => 2,
447 }
448 }
449 }
450
451 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FlowControl, ___E> for FlowControl
452 where
453 ___E: ?Sized,
454 {
455 #[inline]
456 fn encode(
457 self,
458 encoder: &mut ___E,
459 out: &mut ::core::mem::MaybeUninit<crate::wire::FlowControl>,
460 _: (),
461 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
462 ::fidl_next::Encode::encode(&self, encoder, out, ())
463 }
464 }
465
466 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FlowControl, ___E> for &'a FlowControl
467 where
468 ___E: ?Sized,
469 {
470 #[inline]
471 fn encode(
472 self,
473 encoder: &mut ___E,
474 out: &mut ::core::mem::MaybeUninit<crate::wire::FlowControl>,
475 _: (),
476 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
477 ::fidl_next::munge!(let crate::wire::FlowControl { value } = out);
478 let _ = value.write(u8::from(match *self {
479 FlowControl::None => 1,
480
481 FlowControl::CtsRts => 2,
482 }));
483
484 Ok(())
485 }
486 }
487
488 impl ::core::convert::From<crate::wire::FlowControl> for FlowControl {
489 fn from(wire: crate::wire::FlowControl) -> Self {
490 match u8::from(wire.value) {
491 1 => Self::None,
492
493 2 => Self::CtsRts,
494
495 _ => unsafe { ::core::hint::unreachable_unchecked() },
496 }
497 }
498 }
499
500 impl ::fidl_next::FromWire<crate::wire::FlowControl> for FlowControl {
501 #[inline]
502 fn from_wire(wire: crate::wire::FlowControl) -> Self {
503 Self::from(wire)
504 }
505 }
506
507 impl ::fidl_next::FromWireRef<crate::wire::FlowControl> for FlowControl {
508 #[inline]
509 fn from_wire_ref(wire: &crate::wire::FlowControl) -> Self {
510 Self::from(*wire)
511 }
512 }
513
514 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
515 #[repr(C)]
516 pub struct Config {
517 pub character_width: crate::natural::CharacterWidth,
518
519 pub stop_width: crate::natural::StopWidth,
520
521 pub parity: crate::natural::Parity,
522
523 pub control_flow: crate::natural::FlowControl,
524
525 pub baud_rate: u32,
526 }
527
528 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Config, ___E> for Config
529 where
530 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
531 {
532 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::Config> = unsafe {
533 ::fidl_next::CopyOptimization::enable_if(
534 true
535
536 && <
537 crate::natural::CharacterWidth as ::fidl_next::Encode<crate::wire::CharacterWidth, ___E>
538 >::COPY_OPTIMIZATION.is_enabled()
539
540 && <
541 crate::natural::StopWidth as ::fidl_next::Encode<crate::wire::StopWidth, ___E>
542 >::COPY_OPTIMIZATION.is_enabled()
543
544 && <
545 crate::natural::Parity as ::fidl_next::Encode<crate::wire::Parity, ___E>
546 >::COPY_OPTIMIZATION.is_enabled()
547
548 && <
549 crate::natural::FlowControl as ::fidl_next::Encode<crate::wire::FlowControl, ___E>
550 >::COPY_OPTIMIZATION.is_enabled()
551
552 && <
553 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
554 >::COPY_OPTIMIZATION.is_enabled()
555
556 )
557 };
558
559 #[inline]
560 fn encode(
561 self,
562 encoder_: &mut ___E,
563 out_: &mut ::core::mem::MaybeUninit<crate::wire::Config>,
564 _: (),
565 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
566 ::fidl_next::munge! {
567 let crate::wire::Config {
568 character_width,
569 stop_width,
570 parity,
571 control_flow,
572 baud_rate,
573
574 } = out_;
575 }
576
577 ::fidl_next::Encode::encode(self.character_width, encoder_, character_width, ())?;
578
579 let mut _field =
580 unsafe { ::fidl_next::Slot::new_unchecked(character_width.as_mut_ptr()) };
581
582 ::fidl_next::Encode::encode(self.stop_width, encoder_, stop_width, ())?;
583
584 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(stop_width.as_mut_ptr()) };
585
586 ::fidl_next::Encode::encode(self.parity, encoder_, parity, ())?;
587
588 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parity.as_mut_ptr()) };
589
590 ::fidl_next::Encode::encode(self.control_flow, encoder_, control_flow, ())?;
591
592 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(control_flow.as_mut_ptr()) };
593
594 ::fidl_next::Encode::encode(self.baud_rate, encoder_, baud_rate, ())?;
595
596 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(baud_rate.as_mut_ptr()) };
597
598 Ok(())
599 }
600 }
601
602 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Config, ___E> for &'a Config
603 where
604 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
605 {
606 #[inline]
607 fn encode(
608 self,
609 encoder_: &mut ___E,
610 out_: &mut ::core::mem::MaybeUninit<crate::wire::Config>,
611 _: (),
612 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
613 ::fidl_next::munge! {
614 let crate::wire::Config {
615 character_width,
616 stop_width,
617 parity,
618 control_flow,
619 baud_rate,
620
621 } = out_;
622 }
623
624 ::fidl_next::Encode::encode(&self.character_width, encoder_, character_width, ())?;
625
626 let mut _field =
627 unsafe { ::fidl_next::Slot::new_unchecked(character_width.as_mut_ptr()) };
628
629 ::fidl_next::Encode::encode(&self.stop_width, encoder_, stop_width, ())?;
630
631 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(stop_width.as_mut_ptr()) };
632
633 ::fidl_next::Encode::encode(&self.parity, encoder_, parity, ())?;
634
635 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parity.as_mut_ptr()) };
636
637 ::fidl_next::Encode::encode(&self.control_flow, encoder_, control_flow, ())?;
638
639 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(control_flow.as_mut_ptr()) };
640
641 ::fidl_next::Encode::encode(&self.baud_rate, encoder_, baud_rate, ())?;
642
643 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(baud_rate.as_mut_ptr()) };
644
645 Ok(())
646 }
647 }
648
649 unsafe impl<___E>
650 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Config>, ___E>
651 for Config
652 where
653 ___E: ::fidl_next::Encoder + ?Sized,
654 Config: ::fidl_next::Encode<crate::wire::Config, ___E>,
655 {
656 #[inline]
657 fn encode_option(
658 this: ::core::option::Option<Self>,
659 encoder: &mut ___E,
660 out: &mut ::core::mem::MaybeUninit<
661 ::fidl_next::wire::Box<'static, crate::wire::Config>,
662 >,
663 _: (),
664 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
665 if let Some(inner) = this {
666 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
667 ::fidl_next::wire::Box::encode_present(out);
668 } else {
669 ::fidl_next::wire::Box::encode_absent(out);
670 }
671
672 Ok(())
673 }
674 }
675
676 unsafe impl<'a, ___E>
677 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Config>, ___E>
678 for &'a Config
679 where
680 ___E: ::fidl_next::Encoder + ?Sized,
681 &'a Config: ::fidl_next::Encode<crate::wire::Config, ___E>,
682 {
683 #[inline]
684 fn encode_option(
685 this: ::core::option::Option<Self>,
686 encoder: &mut ___E,
687 out: &mut ::core::mem::MaybeUninit<
688 ::fidl_next::wire::Box<'static, crate::wire::Config>,
689 >,
690 _: (),
691 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
692 if let Some(inner) = this {
693 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
694 ::fidl_next::wire::Box::encode_present(out);
695 } else {
696 ::fidl_next::wire::Box::encode_absent(out);
697 }
698
699 Ok(())
700 }
701 }
702
703 impl ::fidl_next::FromWire<crate::wire::Config> for Config {
704 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::Config, Self> = unsafe {
705 ::fidl_next::CopyOptimization::enable_if(
706 true
707
708 && <
709 crate::natural::CharacterWidth as ::fidl_next::FromWire<crate::wire::CharacterWidth>
710 >::COPY_OPTIMIZATION.is_enabled()
711
712 && <
713 crate::natural::StopWidth as ::fidl_next::FromWire<crate::wire::StopWidth>
714 >::COPY_OPTIMIZATION.is_enabled()
715
716 && <
717 crate::natural::Parity as ::fidl_next::FromWire<crate::wire::Parity>
718 >::COPY_OPTIMIZATION.is_enabled()
719
720 && <
721 crate::natural::FlowControl as ::fidl_next::FromWire<crate::wire::FlowControl>
722 >::COPY_OPTIMIZATION.is_enabled()
723
724 && <
725 u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>
726 >::COPY_OPTIMIZATION.is_enabled()
727
728 )
729 };
730
731 #[inline]
732 fn from_wire(wire: crate::wire::Config) -> Self {
733 Self {
734 character_width: ::fidl_next::FromWire::from_wire(wire.character_width),
735
736 stop_width: ::fidl_next::FromWire::from_wire(wire.stop_width),
737
738 parity: ::fidl_next::FromWire::from_wire(wire.parity),
739
740 control_flow: ::fidl_next::FromWire::from_wire(wire.control_flow),
741
742 baud_rate: ::fidl_next::FromWire::from_wire(wire.baud_rate),
743 }
744 }
745 }
746
747 impl ::fidl_next::FromWireRef<crate::wire::Config> for Config {
748 #[inline]
749 fn from_wire_ref(wire: &crate::wire::Config) -> Self {
750 Self {
751 character_width: ::fidl_next::FromWireRef::from_wire_ref(&wire.character_width),
752
753 stop_width: ::fidl_next::FromWireRef::from_wire_ref(&wire.stop_width),
754
755 parity: ::fidl_next::FromWireRef::from_wire_ref(&wire.parity),
756
757 control_flow: ::fidl_next::FromWireRef::from_wire_ref(&wire.control_flow),
758
759 baud_rate: ::fidl_next::FromWireRef::from_wire_ref(&wire.baud_rate),
760 }
761 }
762 }
763
764 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
765 #[repr(C)]
766 pub struct DeviceGetClassResponse {
767 pub device_class: crate::natural::Class,
768 }
769
770 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetClassResponse, ___E>
771 for DeviceGetClassResponse
772 where
773 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
774 {
775 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
776 Self,
777 crate::wire::DeviceGetClassResponse,
778 > = unsafe {
779 ::fidl_next::CopyOptimization::enable_if(
780 true
781
782 && <
783 crate::natural::Class as ::fidl_next::Encode<crate::wire::Class, ___E>
784 >::COPY_OPTIMIZATION.is_enabled()
785
786 )
787 };
788
789 #[inline]
790 fn encode(
791 self,
792 encoder_: &mut ___E,
793 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetClassResponse>,
794 _: (),
795 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
796 ::fidl_next::munge! {
797 let crate::wire::DeviceGetClassResponse {
798 device_class,
799
800 } = out_;
801 }
802
803 ::fidl_next::Encode::encode(self.device_class, encoder_, device_class, ())?;
804
805 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(device_class.as_mut_ptr()) };
806
807 Ok(())
808 }
809 }
810
811 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceGetClassResponse, ___E>
812 for &'a DeviceGetClassResponse
813 where
814 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
815 {
816 #[inline]
817 fn encode(
818 self,
819 encoder_: &mut ___E,
820 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetClassResponse>,
821 _: (),
822 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
823 ::fidl_next::munge! {
824 let crate::wire::DeviceGetClassResponse {
825 device_class,
826
827 } = out_;
828 }
829
830 ::fidl_next::Encode::encode(&self.device_class, encoder_, device_class, ())?;
831
832 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(device_class.as_mut_ptr()) };
833
834 Ok(())
835 }
836 }
837
838 unsafe impl<___E>
839 ::fidl_next::EncodeOption<
840 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetClassResponse>,
841 ___E,
842 > for DeviceGetClassResponse
843 where
844 ___E: ::fidl_next::Encoder + ?Sized,
845 DeviceGetClassResponse: ::fidl_next::Encode<crate::wire::DeviceGetClassResponse, ___E>,
846 {
847 #[inline]
848 fn encode_option(
849 this: ::core::option::Option<Self>,
850 encoder: &mut ___E,
851 out: &mut ::core::mem::MaybeUninit<
852 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetClassResponse>,
853 >,
854 _: (),
855 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
856 if let Some(inner) = this {
857 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
858 ::fidl_next::wire::Box::encode_present(out);
859 } else {
860 ::fidl_next::wire::Box::encode_absent(out);
861 }
862
863 Ok(())
864 }
865 }
866
867 unsafe impl<'a, ___E>
868 ::fidl_next::EncodeOption<
869 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetClassResponse>,
870 ___E,
871 > for &'a DeviceGetClassResponse
872 where
873 ___E: ::fidl_next::Encoder + ?Sized,
874 &'a DeviceGetClassResponse: ::fidl_next::Encode<crate::wire::DeviceGetClassResponse, ___E>,
875 {
876 #[inline]
877 fn encode_option(
878 this: ::core::option::Option<Self>,
879 encoder: &mut ___E,
880 out: &mut ::core::mem::MaybeUninit<
881 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetClassResponse>,
882 >,
883 _: (),
884 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
885 if let Some(inner) = this {
886 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
887 ::fidl_next::wire::Box::encode_present(out);
888 } else {
889 ::fidl_next::wire::Box::encode_absent(out);
890 }
891
892 Ok(())
893 }
894 }
895
896 impl ::fidl_next::FromWire<crate::wire::DeviceGetClassResponse> for DeviceGetClassResponse {
897 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
898 crate::wire::DeviceGetClassResponse,
899 Self,
900 > = unsafe {
901 ::fidl_next::CopyOptimization::enable_if(
902 true
903
904 && <
905 crate::natural::Class as ::fidl_next::FromWire<crate::wire::Class>
906 >::COPY_OPTIMIZATION.is_enabled()
907
908 )
909 };
910
911 #[inline]
912 fn from_wire(wire: crate::wire::DeviceGetClassResponse) -> Self {
913 Self { device_class: ::fidl_next::FromWire::from_wire(wire.device_class) }
914 }
915 }
916
917 impl ::fidl_next::FromWireRef<crate::wire::DeviceGetClassResponse> for DeviceGetClassResponse {
918 #[inline]
919 fn from_wire_ref(wire: &crate::wire::DeviceGetClassResponse) -> Self {
920 Self { device_class: ::fidl_next::FromWireRef::from_wire_ref(&wire.device_class) }
921 }
922 }
923
924 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
925 #[repr(C)]
926 pub struct DeviceSetConfigRequest {
927 pub config: crate::natural::Config,
928 }
929
930 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceSetConfigRequest, ___E>
931 for DeviceSetConfigRequest
932 where
933 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
934 {
935 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
936 Self,
937 crate::wire::DeviceSetConfigRequest,
938 > = unsafe {
939 ::fidl_next::CopyOptimization::enable_if(
940 true && <crate::natural::Config as ::fidl_next::Encode<
941 crate::wire::Config,
942 ___E,
943 >>::COPY_OPTIMIZATION
944 .is_enabled(),
945 )
946 };
947
948 #[inline]
949 fn encode(
950 self,
951 encoder_: &mut ___E,
952 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSetConfigRequest>,
953 _: (),
954 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
955 ::fidl_next::munge! {
956 let crate::wire::DeviceSetConfigRequest {
957 config,
958
959 } = out_;
960 }
961
962 ::fidl_next::Encode::encode(self.config, encoder_, config, ())?;
963
964 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(config.as_mut_ptr()) };
965
966 Ok(())
967 }
968 }
969
970 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceSetConfigRequest, ___E>
971 for &'a DeviceSetConfigRequest
972 where
973 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
974 {
975 #[inline]
976 fn encode(
977 self,
978 encoder_: &mut ___E,
979 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSetConfigRequest>,
980 _: (),
981 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
982 ::fidl_next::munge! {
983 let crate::wire::DeviceSetConfigRequest {
984 config,
985
986 } = out_;
987 }
988
989 ::fidl_next::Encode::encode(&self.config, encoder_, config, ())?;
990
991 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(config.as_mut_ptr()) };
992
993 Ok(())
994 }
995 }
996
997 unsafe impl<___E>
998 ::fidl_next::EncodeOption<
999 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigRequest>,
1000 ___E,
1001 > for DeviceSetConfigRequest
1002 where
1003 ___E: ::fidl_next::Encoder + ?Sized,
1004 DeviceSetConfigRequest: ::fidl_next::Encode<crate::wire::DeviceSetConfigRequest, ___E>,
1005 {
1006 #[inline]
1007 fn encode_option(
1008 this: ::core::option::Option<Self>,
1009 encoder: &mut ___E,
1010 out: &mut ::core::mem::MaybeUninit<
1011 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigRequest>,
1012 >,
1013 _: (),
1014 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1015 if let Some(inner) = this {
1016 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1017 ::fidl_next::wire::Box::encode_present(out);
1018 } else {
1019 ::fidl_next::wire::Box::encode_absent(out);
1020 }
1021
1022 Ok(())
1023 }
1024 }
1025
1026 unsafe impl<'a, ___E>
1027 ::fidl_next::EncodeOption<
1028 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigRequest>,
1029 ___E,
1030 > for &'a DeviceSetConfigRequest
1031 where
1032 ___E: ::fidl_next::Encoder + ?Sized,
1033 &'a DeviceSetConfigRequest: ::fidl_next::Encode<crate::wire::DeviceSetConfigRequest, ___E>,
1034 {
1035 #[inline]
1036 fn encode_option(
1037 this: ::core::option::Option<Self>,
1038 encoder: &mut ___E,
1039 out: &mut ::core::mem::MaybeUninit<
1040 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigRequest>,
1041 >,
1042 _: (),
1043 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1044 if let Some(inner) = this {
1045 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1046 ::fidl_next::wire::Box::encode_present(out);
1047 } else {
1048 ::fidl_next::wire::Box::encode_absent(out);
1049 }
1050
1051 Ok(())
1052 }
1053 }
1054
1055 impl ::fidl_next::FromWire<crate::wire::DeviceSetConfigRequest> for DeviceSetConfigRequest {
1056 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1057 crate::wire::DeviceSetConfigRequest,
1058 Self,
1059 > = unsafe {
1060 ::fidl_next::CopyOptimization::enable_if(
1061 true && <crate::natural::Config as ::fidl_next::FromWire<
1062 crate::wire::Config,
1063 >>::COPY_OPTIMIZATION
1064 .is_enabled(),
1065 )
1066 };
1067
1068 #[inline]
1069 fn from_wire(wire: crate::wire::DeviceSetConfigRequest) -> Self {
1070 Self { config: ::fidl_next::FromWire::from_wire(wire.config) }
1071 }
1072 }
1073
1074 impl ::fidl_next::FromWireRef<crate::wire::DeviceSetConfigRequest> for DeviceSetConfigRequest {
1075 #[inline]
1076 fn from_wire_ref(wire: &crate::wire::DeviceSetConfigRequest) -> Self {
1077 Self { config: ::fidl_next::FromWireRef::from_wire_ref(&wire.config) }
1078 }
1079 }
1080
1081 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1082 #[repr(C)]
1083 pub struct DeviceSetConfigResponse {
1084 pub s: ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status>,
1085 }
1086
1087 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceSetConfigResponse, ___E>
1088 for DeviceSetConfigResponse
1089 where
1090 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1091 {
1092 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1093 Self,
1094 crate::wire::DeviceSetConfigResponse,
1095 > = unsafe {
1096 ::fidl_next::CopyOptimization::enable_if(
1097 true
1098
1099 && <
1100 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>
1101 >::COPY_OPTIMIZATION.is_enabled()
1102
1103 )
1104 };
1105
1106 #[inline]
1107 fn encode(
1108 self,
1109 encoder_: &mut ___E,
1110 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSetConfigResponse>,
1111 _: (),
1112 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1113 ::fidl_next::munge! {
1114 let crate::wire::DeviceSetConfigResponse {
1115 s,
1116
1117 } = out_;
1118 }
1119
1120 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
1121
1122 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1123
1124 Ok(())
1125 }
1126 }
1127
1128 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceSetConfigResponse, ___E>
1129 for &'a DeviceSetConfigResponse
1130 where
1131 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1132 {
1133 #[inline]
1134 fn encode(
1135 self,
1136 encoder_: &mut ___E,
1137 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSetConfigResponse>,
1138 _: (),
1139 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1140 ::fidl_next::munge! {
1141 let crate::wire::DeviceSetConfigResponse {
1142 s,
1143
1144 } = out_;
1145 }
1146
1147 ::fidl_next::Encode::encode(&self.s, encoder_, s, ())?;
1148
1149 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(s.as_mut_ptr()) };
1150
1151 Ok(())
1152 }
1153 }
1154
1155 unsafe impl<___E>
1156 ::fidl_next::EncodeOption<
1157 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigResponse>,
1158 ___E,
1159 > for DeviceSetConfigResponse
1160 where
1161 ___E: ::fidl_next::Encoder + ?Sized,
1162 DeviceSetConfigResponse: ::fidl_next::Encode<crate::wire::DeviceSetConfigResponse, ___E>,
1163 {
1164 #[inline]
1165 fn encode_option(
1166 this: ::core::option::Option<Self>,
1167 encoder: &mut ___E,
1168 out: &mut ::core::mem::MaybeUninit<
1169 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigResponse>,
1170 >,
1171 _: (),
1172 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1173 if let Some(inner) = this {
1174 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1175 ::fidl_next::wire::Box::encode_present(out);
1176 } else {
1177 ::fidl_next::wire::Box::encode_absent(out);
1178 }
1179
1180 Ok(())
1181 }
1182 }
1183
1184 unsafe impl<'a, ___E>
1185 ::fidl_next::EncodeOption<
1186 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigResponse>,
1187 ___E,
1188 > for &'a DeviceSetConfigResponse
1189 where
1190 ___E: ::fidl_next::Encoder + ?Sized,
1191 &'a DeviceSetConfigResponse:
1192 ::fidl_next::Encode<crate::wire::DeviceSetConfigResponse, ___E>,
1193 {
1194 #[inline]
1195 fn encode_option(
1196 this: ::core::option::Option<Self>,
1197 encoder: &mut ___E,
1198 out: &mut ::core::mem::MaybeUninit<
1199 ::fidl_next::wire::Box<'static, crate::wire::DeviceSetConfigResponse>,
1200 >,
1201 _: (),
1202 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1203 if let Some(inner) = this {
1204 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1205 ::fidl_next::wire::Box::encode_present(out);
1206 } else {
1207 ::fidl_next::wire::Box::encode_absent(out);
1208 }
1209
1210 Ok(())
1211 }
1212 }
1213
1214 impl ::fidl_next::FromWire<crate::wire::DeviceSetConfigResponse> for DeviceSetConfigResponse {
1215 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1216 crate::wire::DeviceSetConfigResponse,
1217 Self,
1218 > = unsafe {
1219 ::fidl_next::CopyOptimization::enable_if(
1220 true
1221
1222 && <
1223 ::core::result::Result<(), ::fidl_next::fuchsia::zx::Status> as ::fidl_next::FromWire<::fidl_next::wire::fuchsia::StatusResult>
1224 >::COPY_OPTIMIZATION.is_enabled()
1225
1226 )
1227 };
1228
1229 #[inline]
1230 fn from_wire(wire: crate::wire::DeviceSetConfigResponse) -> Self {
1231 Self { s: ::fidl_next::FromWire::from_wire(wire.s) }
1232 }
1233 }
1234
1235 impl ::fidl_next::FromWireRef<crate::wire::DeviceSetConfigResponse> for DeviceSetConfigResponse {
1236 #[inline]
1237 fn from_wire_ref(wire: &crate::wire::DeviceSetConfigResponse) -> Self {
1238 Self { s: ::fidl_next::FromWireRef::from_wire_ref(&wire.s) }
1239 }
1240 }
1241
1242 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1243 pub struct DeviceReadResponse {
1244 pub data: ::std::vec::Vec<u8>,
1245 }
1246
1247 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceReadResponse<'static>, ___E>
1248 for DeviceReadResponse
1249 where
1250 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1251 ___E: ::fidl_next::Encoder,
1252 {
1253 #[inline]
1254 fn encode(
1255 self,
1256 encoder_: &mut ___E,
1257 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadResponse<'static>>,
1258 _: (),
1259 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1260 ::fidl_next::munge! {
1261 let crate::wire::DeviceReadResponse {
1262 data,
1263
1264 } = out_;
1265 }
1266
1267 ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
1268
1269 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1270 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1271
1272 Ok(())
1273 }
1274 }
1275
1276 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceReadResponse<'static>, ___E>
1277 for &'a DeviceReadResponse
1278 where
1279 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1280 ___E: ::fidl_next::Encoder,
1281 {
1282 #[inline]
1283 fn encode(
1284 self,
1285 encoder_: &mut ___E,
1286 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadResponse<'static>>,
1287 _: (),
1288 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1289 ::fidl_next::munge! {
1290 let crate::wire::DeviceReadResponse {
1291 data,
1292
1293 } = out_;
1294 }
1295
1296 ::fidl_next::Encode::encode(&self.data, encoder_, data, (4294967295, ()))?;
1297
1298 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1299 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1300
1301 Ok(())
1302 }
1303 }
1304
1305 unsafe impl<___E>
1306 ::fidl_next::EncodeOption<
1307 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadResponse<'static>>,
1308 ___E,
1309 > for DeviceReadResponse
1310 where
1311 ___E: ::fidl_next::Encoder + ?Sized,
1312 DeviceReadResponse: ::fidl_next::Encode<crate::wire::DeviceReadResponse<'static>, ___E>,
1313 {
1314 #[inline]
1315 fn encode_option(
1316 this: ::core::option::Option<Self>,
1317 encoder: &mut ___E,
1318 out: &mut ::core::mem::MaybeUninit<
1319 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadResponse<'static>>,
1320 >,
1321 _: (),
1322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1323 if let Some(inner) = this {
1324 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1325 ::fidl_next::wire::Box::encode_present(out);
1326 } else {
1327 ::fidl_next::wire::Box::encode_absent(out);
1328 }
1329
1330 Ok(())
1331 }
1332 }
1333
1334 unsafe impl<'a, ___E>
1335 ::fidl_next::EncodeOption<
1336 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadResponse<'static>>,
1337 ___E,
1338 > for &'a DeviceReadResponse
1339 where
1340 ___E: ::fidl_next::Encoder + ?Sized,
1341 &'a DeviceReadResponse: ::fidl_next::Encode<crate::wire::DeviceReadResponse<'static>, ___E>,
1342 {
1343 #[inline]
1344 fn encode_option(
1345 this: ::core::option::Option<Self>,
1346 encoder: &mut ___E,
1347 out: &mut ::core::mem::MaybeUninit<
1348 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadResponse<'static>>,
1349 >,
1350 _: (),
1351 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1352 if let Some(inner) = this {
1353 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1354 ::fidl_next::wire::Box::encode_present(out);
1355 } else {
1356 ::fidl_next::wire::Box::encode_absent(out);
1357 }
1358
1359 Ok(())
1360 }
1361 }
1362
1363 impl<'de> ::fidl_next::FromWire<crate::wire::DeviceReadResponse<'de>> for DeviceReadResponse {
1364 #[inline]
1365 fn from_wire(wire: crate::wire::DeviceReadResponse<'de>) -> Self {
1366 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
1367 }
1368 }
1369
1370 impl<'de> ::fidl_next::FromWireRef<crate::wire::DeviceReadResponse<'de>> for DeviceReadResponse {
1371 #[inline]
1372 fn from_wire_ref(wire: &crate::wire::DeviceReadResponse<'de>) -> Self {
1373 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
1374 }
1375 }
1376
1377 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1378 pub struct DeviceWriteRequest {
1379 pub data: ::std::vec::Vec<u8>,
1380 }
1381
1382 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceWriteRequest<'static>, ___E>
1383 for DeviceWriteRequest
1384 where
1385 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1386 ___E: ::fidl_next::Encoder,
1387 {
1388 #[inline]
1389 fn encode(
1390 self,
1391 encoder_: &mut ___E,
1392 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceWriteRequest<'static>>,
1393 _: (),
1394 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1395 ::fidl_next::munge! {
1396 let crate::wire::DeviceWriteRequest {
1397 data,
1398
1399 } = out_;
1400 }
1401
1402 ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
1403
1404 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1405 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1406
1407 Ok(())
1408 }
1409 }
1410
1411 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceWriteRequest<'static>, ___E>
1412 for &'a DeviceWriteRequest
1413 where
1414 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1415 ___E: ::fidl_next::Encoder,
1416 {
1417 #[inline]
1418 fn encode(
1419 self,
1420 encoder_: &mut ___E,
1421 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceWriteRequest<'static>>,
1422 _: (),
1423 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1424 ::fidl_next::munge! {
1425 let crate::wire::DeviceWriteRequest {
1426 data,
1427
1428 } = out_;
1429 }
1430
1431 ::fidl_next::Encode::encode(&self.data, encoder_, data, (4294967295, ()))?;
1432
1433 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(data.as_mut_ptr()) };
1434 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1435
1436 Ok(())
1437 }
1438 }
1439
1440 unsafe impl<___E>
1441 ::fidl_next::EncodeOption<
1442 ::fidl_next::wire::Box<'static, crate::wire::DeviceWriteRequest<'static>>,
1443 ___E,
1444 > for DeviceWriteRequest
1445 where
1446 ___E: ::fidl_next::Encoder + ?Sized,
1447 DeviceWriteRequest: ::fidl_next::Encode<crate::wire::DeviceWriteRequest<'static>, ___E>,
1448 {
1449 #[inline]
1450 fn encode_option(
1451 this: ::core::option::Option<Self>,
1452 encoder: &mut ___E,
1453 out: &mut ::core::mem::MaybeUninit<
1454 ::fidl_next::wire::Box<'static, crate::wire::DeviceWriteRequest<'static>>,
1455 >,
1456 _: (),
1457 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1458 if let Some(inner) = this {
1459 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1460 ::fidl_next::wire::Box::encode_present(out);
1461 } else {
1462 ::fidl_next::wire::Box::encode_absent(out);
1463 }
1464
1465 Ok(())
1466 }
1467 }
1468
1469 unsafe impl<'a, ___E>
1470 ::fidl_next::EncodeOption<
1471 ::fidl_next::wire::Box<'static, crate::wire::DeviceWriteRequest<'static>>,
1472 ___E,
1473 > for &'a DeviceWriteRequest
1474 where
1475 ___E: ::fidl_next::Encoder + ?Sized,
1476 &'a DeviceWriteRequest: ::fidl_next::Encode<crate::wire::DeviceWriteRequest<'static>, ___E>,
1477 {
1478 #[inline]
1479 fn encode_option(
1480 this: ::core::option::Option<Self>,
1481 encoder: &mut ___E,
1482 out: &mut ::core::mem::MaybeUninit<
1483 ::fidl_next::wire::Box<'static, crate::wire::DeviceWriteRequest<'static>>,
1484 >,
1485 _: (),
1486 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1487 if let Some(inner) = this {
1488 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1489 ::fidl_next::wire::Box::encode_present(out);
1490 } else {
1491 ::fidl_next::wire::Box::encode_absent(out);
1492 }
1493
1494 Ok(())
1495 }
1496 }
1497
1498 impl<'de> ::fidl_next::FromWire<crate::wire::DeviceWriteRequest<'de>> for DeviceWriteRequest {
1499 #[inline]
1500 fn from_wire(wire: crate::wire::DeviceWriteRequest<'de>) -> Self {
1501 Self { data: ::fidl_next::FromWire::from_wire(wire.data) }
1502 }
1503 }
1504
1505 impl<'de> ::fidl_next::FromWireRef<crate::wire::DeviceWriteRequest<'de>> for DeviceWriteRequest {
1506 #[inline]
1507 fn from_wire_ref(wire: &crate::wire::DeviceWriteRequest<'de>) -> Self {
1508 Self { data: ::fidl_next::FromWireRef::from_wire_ref(&wire.data) }
1509 }
1510 }
1511
1512 pub type DeviceWriteResponse = ();
1513
1514 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1515 pub struct SerialPortInfo {
1516 pub serial_class: crate::natural::Class,
1517
1518 pub serial_vid: u32,
1519
1520 pub serial_pid: u32,
1521 }
1522
1523 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SerialPortInfo, ___E> for SerialPortInfo
1524 where
1525 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1526 {
1527 #[inline]
1528 fn encode(
1529 self,
1530 encoder_: &mut ___E,
1531 out_: &mut ::core::mem::MaybeUninit<crate::wire::SerialPortInfo>,
1532 _: (),
1533 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1534 ::fidl_next::munge! {
1535 let crate::wire::SerialPortInfo {
1536 serial_class,
1537 serial_vid,
1538 serial_pid,
1539
1540 } = out_;
1541 }
1542
1543 ::fidl_next::Encode::encode(self.serial_class, encoder_, serial_class, ())?;
1544
1545 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(serial_class.as_mut_ptr()) };
1546
1547 ::fidl_next::Encode::encode(self.serial_vid, encoder_, serial_vid, ())?;
1548
1549 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(serial_vid.as_mut_ptr()) };
1550
1551 ::fidl_next::Encode::encode(self.serial_pid, encoder_, serial_pid, ())?;
1552
1553 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(serial_pid.as_mut_ptr()) };
1554
1555 Ok(())
1556 }
1557 }
1558
1559 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SerialPortInfo, ___E> for &'a SerialPortInfo
1560 where
1561 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1562 {
1563 #[inline]
1564 fn encode(
1565 self,
1566 encoder_: &mut ___E,
1567 out_: &mut ::core::mem::MaybeUninit<crate::wire::SerialPortInfo>,
1568 _: (),
1569 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1570 ::fidl_next::munge! {
1571 let crate::wire::SerialPortInfo {
1572 serial_class,
1573 serial_vid,
1574 serial_pid,
1575
1576 } = out_;
1577 }
1578
1579 ::fidl_next::Encode::encode(&self.serial_class, encoder_, serial_class, ())?;
1580
1581 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(serial_class.as_mut_ptr()) };
1582
1583 ::fidl_next::Encode::encode(&self.serial_vid, encoder_, serial_vid, ())?;
1584
1585 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(serial_vid.as_mut_ptr()) };
1586
1587 ::fidl_next::Encode::encode(&self.serial_pid, encoder_, serial_pid, ())?;
1588
1589 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(serial_pid.as_mut_ptr()) };
1590
1591 Ok(())
1592 }
1593 }
1594
1595 unsafe impl<___E>
1596 ::fidl_next::EncodeOption<
1597 ::fidl_next::wire::Box<'static, crate::wire::SerialPortInfo>,
1598 ___E,
1599 > for SerialPortInfo
1600 where
1601 ___E: ::fidl_next::Encoder + ?Sized,
1602 SerialPortInfo: ::fidl_next::Encode<crate::wire::SerialPortInfo, ___E>,
1603 {
1604 #[inline]
1605 fn encode_option(
1606 this: ::core::option::Option<Self>,
1607 encoder: &mut ___E,
1608 out: &mut ::core::mem::MaybeUninit<
1609 ::fidl_next::wire::Box<'static, crate::wire::SerialPortInfo>,
1610 >,
1611 _: (),
1612 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1613 if let Some(inner) = this {
1614 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1615 ::fidl_next::wire::Box::encode_present(out);
1616 } else {
1617 ::fidl_next::wire::Box::encode_absent(out);
1618 }
1619
1620 Ok(())
1621 }
1622 }
1623
1624 unsafe impl<'a, ___E>
1625 ::fidl_next::EncodeOption<
1626 ::fidl_next::wire::Box<'static, crate::wire::SerialPortInfo>,
1627 ___E,
1628 > for &'a SerialPortInfo
1629 where
1630 ___E: ::fidl_next::Encoder + ?Sized,
1631 &'a SerialPortInfo: ::fidl_next::Encode<crate::wire::SerialPortInfo, ___E>,
1632 {
1633 #[inline]
1634 fn encode_option(
1635 this: ::core::option::Option<Self>,
1636 encoder: &mut ___E,
1637 out: &mut ::core::mem::MaybeUninit<
1638 ::fidl_next::wire::Box<'static, crate::wire::SerialPortInfo>,
1639 >,
1640 _: (),
1641 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1642 if let Some(inner) = this {
1643 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1644 ::fidl_next::wire::Box::encode_present(out);
1645 } else {
1646 ::fidl_next::wire::Box::encode_absent(out);
1647 }
1648
1649 Ok(())
1650 }
1651 }
1652
1653 impl ::fidl_next::FromWire<crate::wire::SerialPortInfo> for SerialPortInfo {
1654 #[inline]
1655 fn from_wire(wire: crate::wire::SerialPortInfo) -> Self {
1656 Self {
1657 serial_class: ::fidl_next::FromWire::from_wire(wire.serial_class),
1658
1659 serial_vid: ::fidl_next::FromWire::from_wire(wire.serial_vid),
1660
1661 serial_pid: ::fidl_next::FromWire::from_wire(wire.serial_pid),
1662 }
1663 }
1664 }
1665
1666 impl ::fidl_next::FromWireRef<crate::wire::SerialPortInfo> for SerialPortInfo {
1667 #[inline]
1668 fn from_wire_ref(wire: &crate::wire::SerialPortInfo) -> Self {
1669 Self {
1670 serial_class: ::fidl_next::FromWireRef::from_wire_ref(&wire.serial_class),
1671
1672 serial_vid: ::fidl_next::FromWireRef::from_wire_ref(&wire.serial_vid),
1673
1674 serial_pid: ::fidl_next::FromWireRef::from_wire_ref(&wire.serial_pid),
1675 }
1676 }
1677 }
1678}
1679
1680pub mod wire {
1681
1682 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1684 #[repr(transparent)]
1685 pub struct CharacterWidth {
1686 pub(crate) value: u8,
1687 }
1688
1689 impl ::fidl_next::Constrained for CharacterWidth {
1690 type Constraint = ();
1691
1692 fn validate(
1693 _: ::fidl_next::Slot<'_, Self>,
1694 _: Self::Constraint,
1695 ) -> Result<(), ::fidl_next::ValidationError> {
1696 Ok(())
1697 }
1698 }
1699
1700 unsafe impl ::fidl_next::Wire for CharacterWidth {
1701 type Narrowed<'de> = Self;
1702
1703 #[inline]
1704 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1705 }
1707 }
1708
1709 impl CharacterWidth {
1710 pub const BITS_5: CharacterWidth = CharacterWidth { value: 1 };
1711
1712 pub const BITS_6: CharacterWidth = CharacterWidth { value: 2 };
1713
1714 pub const BITS_7: CharacterWidth = CharacterWidth { value: 3 };
1715
1716 pub const BITS_8: CharacterWidth = CharacterWidth { value: 4 };
1717 }
1718
1719 unsafe impl<___D> ::fidl_next::Decode<___D> for CharacterWidth
1720 where
1721 ___D: ?Sized,
1722 {
1723 fn decode(
1724 slot: ::fidl_next::Slot<'_, Self>,
1725 _: &mut ___D,
1726 _: (),
1727 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1728 ::fidl_next::munge!(let Self { value } = slot);
1729
1730 match u8::from(*value) {
1731 1 | 2 | 3 | 4 => (),
1732 unknown => {
1733 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1734 }
1735 }
1736
1737 Ok(())
1738 }
1739 }
1740
1741 impl ::core::convert::From<crate::natural::CharacterWidth> for CharacterWidth {
1742 fn from(natural: crate::natural::CharacterWidth) -> Self {
1743 match natural {
1744 crate::natural::CharacterWidth::Bits5 => CharacterWidth::BITS_5,
1745
1746 crate::natural::CharacterWidth::Bits6 => CharacterWidth::BITS_6,
1747
1748 crate::natural::CharacterWidth::Bits7 => CharacterWidth::BITS_7,
1749
1750 crate::natural::CharacterWidth::Bits8 => CharacterWidth::BITS_8,
1751 }
1752 }
1753 }
1754
1755 impl ::fidl_next::IntoNatural for CharacterWidth {
1756 type Natural = crate::natural::CharacterWidth;
1757 }
1758
1759 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1761 #[repr(transparent)]
1762 pub struct Class {
1763 pub(crate) value: u8,
1764 }
1765
1766 impl ::fidl_next::Constrained for Class {
1767 type Constraint = ();
1768
1769 fn validate(
1770 _: ::fidl_next::Slot<'_, Self>,
1771 _: Self::Constraint,
1772 ) -> Result<(), ::fidl_next::ValidationError> {
1773 Ok(())
1774 }
1775 }
1776
1777 unsafe impl ::fidl_next::Wire for Class {
1778 type Narrowed<'de> = Self;
1779
1780 #[inline]
1781 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1782 }
1784 }
1785
1786 impl Class {
1787 pub const GENERIC: Class = Class { value: 1 };
1788
1789 pub const BLUETOOTH_HCI: Class = Class { value: 2 };
1790
1791 pub const CONSOLE: Class = Class { value: 3 };
1792
1793 pub const KERNEL_DEBUG: Class = Class { value: 4 };
1794
1795 pub const MCU: Class = Class { value: 5 };
1796 }
1797
1798 unsafe impl<___D> ::fidl_next::Decode<___D> for Class
1799 where
1800 ___D: ?Sized,
1801 {
1802 fn decode(
1803 slot: ::fidl_next::Slot<'_, Self>,
1804 _: &mut ___D,
1805 _: (),
1806 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1807 ::fidl_next::munge!(let Self { value } = slot);
1808
1809 match u8::from(*value) {
1810 1 | 2 | 3 | 4 | 5 => (),
1811 unknown => {
1812 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1813 }
1814 }
1815
1816 Ok(())
1817 }
1818 }
1819
1820 impl ::core::convert::From<crate::natural::Class> for Class {
1821 fn from(natural: crate::natural::Class) -> Self {
1822 match natural {
1823 crate::natural::Class::Generic => Class::GENERIC,
1824
1825 crate::natural::Class::BluetoothHci => Class::BLUETOOTH_HCI,
1826
1827 crate::natural::Class::Console => Class::CONSOLE,
1828
1829 crate::natural::Class::KernelDebug => Class::KERNEL_DEBUG,
1830
1831 crate::natural::Class::Mcu => Class::MCU,
1832 }
1833 }
1834 }
1835
1836 impl ::fidl_next::IntoNatural for Class {
1837 type Natural = crate::natural::Class;
1838 }
1839
1840 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1842 #[repr(transparent)]
1843 pub struct StopWidth {
1844 pub(crate) value: u8,
1845 }
1846
1847 impl ::fidl_next::Constrained for StopWidth {
1848 type Constraint = ();
1849
1850 fn validate(
1851 _: ::fidl_next::Slot<'_, Self>,
1852 _: Self::Constraint,
1853 ) -> Result<(), ::fidl_next::ValidationError> {
1854 Ok(())
1855 }
1856 }
1857
1858 unsafe impl ::fidl_next::Wire for StopWidth {
1859 type Narrowed<'de> = Self;
1860
1861 #[inline]
1862 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1863 }
1865 }
1866
1867 impl StopWidth {
1868 pub const BITS_1: StopWidth = StopWidth { value: 1 };
1869
1870 pub const BITS_2: StopWidth = StopWidth { value: 2 };
1871 }
1872
1873 unsafe impl<___D> ::fidl_next::Decode<___D> for StopWidth
1874 where
1875 ___D: ?Sized,
1876 {
1877 fn decode(
1878 slot: ::fidl_next::Slot<'_, Self>,
1879 _: &mut ___D,
1880 _: (),
1881 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1882 ::fidl_next::munge!(let Self { value } = slot);
1883
1884 match u8::from(*value) {
1885 1 | 2 => (),
1886 unknown => {
1887 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1888 }
1889 }
1890
1891 Ok(())
1892 }
1893 }
1894
1895 impl ::core::convert::From<crate::natural::StopWidth> for StopWidth {
1896 fn from(natural: crate::natural::StopWidth) -> Self {
1897 match natural {
1898 crate::natural::StopWidth::Bits1 => StopWidth::BITS_1,
1899
1900 crate::natural::StopWidth::Bits2 => StopWidth::BITS_2,
1901 }
1902 }
1903 }
1904
1905 impl ::fidl_next::IntoNatural for StopWidth {
1906 type Natural = crate::natural::StopWidth;
1907 }
1908
1909 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1911 #[repr(transparent)]
1912 pub struct Parity {
1913 pub(crate) value: u8,
1914 }
1915
1916 impl ::fidl_next::Constrained for Parity {
1917 type Constraint = ();
1918
1919 fn validate(
1920 _: ::fidl_next::Slot<'_, Self>,
1921 _: Self::Constraint,
1922 ) -> Result<(), ::fidl_next::ValidationError> {
1923 Ok(())
1924 }
1925 }
1926
1927 unsafe impl ::fidl_next::Wire for Parity {
1928 type Narrowed<'de> = Self;
1929
1930 #[inline]
1931 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1932 }
1934 }
1935
1936 impl Parity {
1937 pub const NONE: Parity = Parity { value: 1 };
1938
1939 pub const EVEN: Parity = Parity { value: 2 };
1940
1941 pub const ODD: Parity = Parity { value: 3 };
1942 }
1943
1944 unsafe impl<___D> ::fidl_next::Decode<___D> for Parity
1945 where
1946 ___D: ?Sized,
1947 {
1948 fn decode(
1949 slot: ::fidl_next::Slot<'_, Self>,
1950 _: &mut ___D,
1951 _: (),
1952 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1953 ::fidl_next::munge!(let Self { value } = slot);
1954
1955 match u8::from(*value) {
1956 1 | 2 | 3 => (),
1957 unknown => {
1958 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1959 }
1960 }
1961
1962 Ok(())
1963 }
1964 }
1965
1966 impl ::core::convert::From<crate::natural::Parity> for Parity {
1967 fn from(natural: crate::natural::Parity) -> Self {
1968 match natural {
1969 crate::natural::Parity::None => Parity::NONE,
1970
1971 crate::natural::Parity::Even => Parity::EVEN,
1972
1973 crate::natural::Parity::Odd => Parity::ODD,
1974 }
1975 }
1976 }
1977
1978 impl ::fidl_next::IntoNatural for Parity {
1979 type Natural = crate::natural::Parity;
1980 }
1981
1982 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1984 #[repr(transparent)]
1985 pub struct FlowControl {
1986 pub(crate) value: u8,
1987 }
1988
1989 impl ::fidl_next::Constrained for FlowControl {
1990 type Constraint = ();
1991
1992 fn validate(
1993 _: ::fidl_next::Slot<'_, Self>,
1994 _: Self::Constraint,
1995 ) -> Result<(), ::fidl_next::ValidationError> {
1996 Ok(())
1997 }
1998 }
1999
2000 unsafe impl ::fidl_next::Wire for FlowControl {
2001 type Narrowed<'de> = Self;
2002
2003 #[inline]
2004 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2005 }
2007 }
2008
2009 impl FlowControl {
2010 pub const NONE: FlowControl = FlowControl { value: 1 };
2011
2012 pub const CTS_RTS: FlowControl = FlowControl { value: 2 };
2013 }
2014
2015 unsafe impl<___D> ::fidl_next::Decode<___D> for FlowControl
2016 where
2017 ___D: ?Sized,
2018 {
2019 fn decode(
2020 slot: ::fidl_next::Slot<'_, Self>,
2021 _: &mut ___D,
2022 _: (),
2023 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2024 ::fidl_next::munge!(let Self { value } = slot);
2025
2026 match u8::from(*value) {
2027 1 | 2 => (),
2028 unknown => {
2029 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
2030 }
2031 }
2032
2033 Ok(())
2034 }
2035 }
2036
2037 impl ::core::convert::From<crate::natural::FlowControl> for FlowControl {
2038 fn from(natural: crate::natural::FlowControl) -> Self {
2039 match natural {
2040 crate::natural::FlowControl::None => FlowControl::NONE,
2041
2042 crate::natural::FlowControl::CtsRts => FlowControl::CTS_RTS,
2043 }
2044 }
2045 }
2046
2047 impl ::fidl_next::IntoNatural for FlowControl {
2048 type Natural = crate::natural::FlowControl;
2049 }
2050
2051 #[derive(Clone, Debug)]
2053 #[repr(C)]
2054 pub struct Config {
2055 pub character_width: crate::wire::CharacterWidth,
2056
2057 pub stop_width: crate::wire::StopWidth,
2058
2059 pub parity: crate::wire::Parity,
2060
2061 pub control_flow: crate::wire::FlowControl,
2062
2063 pub baud_rate: ::fidl_next::wire::Uint32,
2064 }
2065
2066 static_assertions::const_assert_eq!(std::mem::size_of::<Config>(), 8);
2067 static_assertions::const_assert_eq!(std::mem::align_of::<Config>(), 4);
2068
2069 static_assertions::const_assert_eq!(std::mem::offset_of!(Config, character_width), 0);
2070
2071 static_assertions::const_assert_eq!(std::mem::offset_of!(Config, stop_width), 1);
2072
2073 static_assertions::const_assert_eq!(std::mem::offset_of!(Config, parity), 2);
2074
2075 static_assertions::const_assert_eq!(std::mem::offset_of!(Config, control_flow), 3);
2076
2077 static_assertions::const_assert_eq!(std::mem::offset_of!(Config, baud_rate), 4);
2078
2079 impl ::fidl_next::Constrained for Config {
2080 type Constraint = ();
2081
2082 fn validate(
2083 _: ::fidl_next::Slot<'_, Self>,
2084 _: Self::Constraint,
2085 ) -> Result<(), ::fidl_next::ValidationError> {
2086 Ok(())
2087 }
2088 }
2089
2090 unsafe impl ::fidl_next::Wire for Config {
2091 type Narrowed<'de> = Config;
2092
2093 #[inline]
2094 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2095 ::fidl_next::munge! {
2096 let Self {
2097 character_width,
2098 stop_width,
2099 parity,
2100 control_flow,
2101 baud_rate,
2102
2103 } = &mut *out_;
2104 }
2105
2106 ::fidl_next::Wire::zero_padding(character_width);
2107
2108 ::fidl_next::Wire::zero_padding(stop_width);
2109
2110 ::fidl_next::Wire::zero_padding(parity);
2111
2112 ::fidl_next::Wire::zero_padding(control_flow);
2113
2114 ::fidl_next::Wire::zero_padding(baud_rate);
2115 }
2116 }
2117
2118 unsafe impl<___D> ::fidl_next::Decode<___D> for Config
2119 where
2120 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2121 {
2122 fn decode(
2123 slot_: ::fidl_next::Slot<'_, Self>,
2124 decoder_: &mut ___D,
2125 _: (),
2126 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2127 ::fidl_next::munge! {
2128 let Self {
2129 mut character_width,
2130 mut stop_width,
2131 mut parity,
2132 mut control_flow,
2133 mut baud_rate,
2134
2135 } = slot_;
2136 }
2137
2138 let _field = character_width.as_mut();
2139
2140 ::fidl_next::Decode::decode(character_width.as_mut(), decoder_, ())?;
2141
2142 let _field = stop_width.as_mut();
2143
2144 ::fidl_next::Decode::decode(stop_width.as_mut(), decoder_, ())?;
2145
2146 let _field = parity.as_mut();
2147
2148 ::fidl_next::Decode::decode(parity.as_mut(), decoder_, ())?;
2149
2150 let _field = control_flow.as_mut();
2151
2152 ::fidl_next::Decode::decode(control_flow.as_mut(), decoder_, ())?;
2153
2154 let _field = baud_rate.as_mut();
2155
2156 ::fidl_next::Decode::decode(baud_rate.as_mut(), decoder_, ())?;
2157
2158 Ok(())
2159 }
2160 }
2161
2162 impl ::fidl_next::IntoNatural for Config {
2163 type Natural = crate::natural::Config;
2164 }
2165
2166 #[derive(Clone, Debug)]
2168 #[repr(C)]
2169 pub struct DeviceGetClassResponse {
2170 pub device_class: crate::wire::Class,
2171 }
2172
2173 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetClassResponse>(), 1);
2174 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetClassResponse>(), 1);
2175
2176 static_assertions::const_assert_eq!(
2177 std::mem::offset_of!(DeviceGetClassResponse, device_class),
2178 0
2179 );
2180
2181 impl ::fidl_next::Constrained for DeviceGetClassResponse {
2182 type Constraint = ();
2183
2184 fn validate(
2185 _: ::fidl_next::Slot<'_, Self>,
2186 _: Self::Constraint,
2187 ) -> Result<(), ::fidl_next::ValidationError> {
2188 Ok(())
2189 }
2190 }
2191
2192 unsafe impl ::fidl_next::Wire for DeviceGetClassResponse {
2193 type Narrowed<'de> = DeviceGetClassResponse;
2194
2195 #[inline]
2196 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2197 ::fidl_next::munge! {
2198 let Self {
2199 device_class,
2200
2201 } = &mut *out_;
2202 }
2203
2204 ::fidl_next::Wire::zero_padding(device_class);
2205 }
2206 }
2207
2208 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetClassResponse
2209 where
2210 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2211 {
2212 fn decode(
2213 slot_: ::fidl_next::Slot<'_, Self>,
2214 decoder_: &mut ___D,
2215 _: (),
2216 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2217 ::fidl_next::munge! {
2218 let Self {
2219 mut device_class,
2220
2221 } = slot_;
2222 }
2223
2224 let _field = device_class.as_mut();
2225
2226 ::fidl_next::Decode::decode(device_class.as_mut(), decoder_, ())?;
2227
2228 Ok(())
2229 }
2230 }
2231
2232 impl ::fidl_next::IntoNatural for DeviceGetClassResponse {
2233 type Natural = crate::natural::DeviceGetClassResponse;
2234 }
2235
2236 #[derive(Clone, Debug)]
2238 #[repr(C)]
2239 pub struct DeviceSetConfigRequest {
2240 pub config: crate::wire::Config,
2241 }
2242
2243 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceSetConfigRequest>(), 8);
2244 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceSetConfigRequest>(), 4);
2245
2246 static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceSetConfigRequest, config), 0);
2247
2248 impl ::fidl_next::Constrained for DeviceSetConfigRequest {
2249 type Constraint = ();
2250
2251 fn validate(
2252 _: ::fidl_next::Slot<'_, Self>,
2253 _: Self::Constraint,
2254 ) -> Result<(), ::fidl_next::ValidationError> {
2255 Ok(())
2256 }
2257 }
2258
2259 unsafe impl ::fidl_next::Wire for DeviceSetConfigRequest {
2260 type Narrowed<'de> = DeviceSetConfigRequest;
2261
2262 #[inline]
2263 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2264 ::fidl_next::munge! {
2265 let Self {
2266 config,
2267
2268 } = &mut *out_;
2269 }
2270
2271 ::fidl_next::Wire::zero_padding(config);
2272 }
2273 }
2274
2275 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceSetConfigRequest
2276 where
2277 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2278 {
2279 fn decode(
2280 slot_: ::fidl_next::Slot<'_, Self>,
2281 decoder_: &mut ___D,
2282 _: (),
2283 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2284 ::fidl_next::munge! {
2285 let Self {
2286 mut config,
2287
2288 } = slot_;
2289 }
2290
2291 let _field = config.as_mut();
2292
2293 ::fidl_next::Decode::decode(config.as_mut(), decoder_, ())?;
2294
2295 Ok(())
2296 }
2297 }
2298
2299 impl ::fidl_next::IntoNatural for DeviceSetConfigRequest {
2300 type Natural = crate::natural::DeviceSetConfigRequest;
2301 }
2302
2303 #[derive(Clone, Debug)]
2305 #[repr(C)]
2306 pub struct DeviceSetConfigResponse {
2307 pub s: ::fidl_next::wire::fuchsia::StatusResult,
2308 }
2309
2310 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceSetConfigResponse>(), 4);
2311 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceSetConfigResponse>(), 4);
2312
2313 static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceSetConfigResponse, s), 0);
2314
2315 impl ::fidl_next::Constrained for DeviceSetConfigResponse {
2316 type Constraint = ();
2317
2318 fn validate(
2319 _: ::fidl_next::Slot<'_, Self>,
2320 _: Self::Constraint,
2321 ) -> Result<(), ::fidl_next::ValidationError> {
2322 Ok(())
2323 }
2324 }
2325
2326 unsafe impl ::fidl_next::Wire for DeviceSetConfigResponse {
2327 type Narrowed<'de> = DeviceSetConfigResponse;
2328
2329 #[inline]
2330 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2331 ::fidl_next::munge! {
2332 let Self {
2333 s,
2334
2335 } = &mut *out_;
2336 }
2337
2338 ::fidl_next::Wire::zero_padding(s);
2339 }
2340 }
2341
2342 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceSetConfigResponse
2343 where
2344 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2345 {
2346 fn decode(
2347 slot_: ::fidl_next::Slot<'_, Self>,
2348 decoder_: &mut ___D,
2349 _: (),
2350 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2351 ::fidl_next::munge! {
2352 let Self {
2353 mut s,
2354
2355 } = slot_;
2356 }
2357
2358 let _field = s.as_mut();
2359
2360 ::fidl_next::Decode::decode(s.as_mut(), decoder_, ())?;
2361
2362 Ok(())
2363 }
2364 }
2365
2366 impl ::fidl_next::IntoNatural for DeviceSetConfigResponse {
2367 type Natural = crate::natural::DeviceSetConfigResponse;
2368 }
2369
2370 #[derive(Debug)]
2372 #[repr(C)]
2373 pub struct DeviceReadResponse<'de> {
2374 pub data: ::fidl_next::wire::Vector<'de, u8>,
2375 }
2376
2377 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceReadResponse<'_>>(), 16);
2378 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceReadResponse<'_>>(), 8);
2379
2380 static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceReadResponse<'_>, data), 0);
2381
2382 impl ::fidl_next::Constrained for DeviceReadResponse<'_> {
2383 type Constraint = ();
2384
2385 fn validate(
2386 _: ::fidl_next::Slot<'_, Self>,
2387 _: Self::Constraint,
2388 ) -> Result<(), ::fidl_next::ValidationError> {
2389 Ok(())
2390 }
2391 }
2392
2393 unsafe impl ::fidl_next::Wire for DeviceReadResponse<'static> {
2394 type Narrowed<'de> = DeviceReadResponse<'de>;
2395
2396 #[inline]
2397 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2398 ::fidl_next::munge! {
2399 let Self {
2400 data,
2401
2402 } = &mut *out_;
2403 }
2404
2405 ::fidl_next::Wire::zero_padding(data);
2406 }
2407 }
2408
2409 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceReadResponse<'de>
2410 where
2411 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2412 ___D: ::fidl_next::Decoder<'de>,
2413 {
2414 fn decode(
2415 slot_: ::fidl_next::Slot<'_, Self>,
2416 decoder_: &mut ___D,
2417 _: (),
2418 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2419 ::fidl_next::munge! {
2420 let Self {
2421 mut data,
2422
2423 } = slot_;
2424 }
2425
2426 let _field = data.as_mut();
2427 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
2428 ::fidl_next::Decode::decode(data.as_mut(), decoder_, (4294967295, ()))?;
2429
2430 Ok(())
2431 }
2432 }
2433
2434 impl<'de> ::fidl_next::IntoNatural for DeviceReadResponse<'de> {
2435 type Natural = crate::natural::DeviceReadResponse;
2436 }
2437
2438 #[derive(Debug)]
2440 #[repr(C)]
2441 pub struct DeviceWriteRequest<'de> {
2442 pub data: ::fidl_next::wire::Vector<'de, u8>,
2443 }
2444
2445 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceWriteRequest<'_>>(), 16);
2446 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceWriteRequest<'_>>(), 8);
2447
2448 static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceWriteRequest<'_>, data), 0);
2449
2450 impl ::fidl_next::Constrained for DeviceWriteRequest<'_> {
2451 type Constraint = ();
2452
2453 fn validate(
2454 _: ::fidl_next::Slot<'_, Self>,
2455 _: Self::Constraint,
2456 ) -> Result<(), ::fidl_next::ValidationError> {
2457 Ok(())
2458 }
2459 }
2460
2461 unsafe impl ::fidl_next::Wire for DeviceWriteRequest<'static> {
2462 type Narrowed<'de> = DeviceWriteRequest<'de>;
2463
2464 #[inline]
2465 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2466 ::fidl_next::munge! {
2467 let Self {
2468 data,
2469
2470 } = &mut *out_;
2471 }
2472
2473 ::fidl_next::Wire::zero_padding(data);
2474 }
2475 }
2476
2477 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceWriteRequest<'de>
2478 where
2479 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2480 ___D: ::fidl_next::Decoder<'de>,
2481 {
2482 fn decode(
2483 slot_: ::fidl_next::Slot<'_, Self>,
2484 decoder_: &mut ___D,
2485 _: (),
2486 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2487 ::fidl_next::munge! {
2488 let Self {
2489 mut data,
2490
2491 } = slot_;
2492 }
2493
2494 let _field = data.as_mut();
2495 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
2496 ::fidl_next::Decode::decode(data.as_mut(), decoder_, (4294967295, ()))?;
2497
2498 Ok(())
2499 }
2500 }
2501
2502 impl<'de> ::fidl_next::IntoNatural for DeviceWriteRequest<'de> {
2503 type Natural = crate::natural::DeviceWriteRequest;
2504 }
2505
2506 pub type DeviceWriteResponse = ::fidl_next::wire::Unit;
2508
2509 #[derive(Clone, Debug)]
2511 #[repr(C)]
2512 pub struct SerialPortInfo {
2513 pub serial_class: crate::wire::Class,
2514
2515 pub serial_vid: ::fidl_next::wire::Uint32,
2516
2517 pub serial_pid: ::fidl_next::wire::Uint32,
2518 }
2519
2520 static_assertions::const_assert_eq!(std::mem::size_of::<SerialPortInfo>(), 12);
2521 static_assertions::const_assert_eq!(std::mem::align_of::<SerialPortInfo>(), 4);
2522
2523 static_assertions::const_assert_eq!(std::mem::offset_of!(SerialPortInfo, serial_class), 0);
2524
2525 static_assertions::const_assert_eq!(std::mem::offset_of!(SerialPortInfo, serial_vid), 4);
2526
2527 static_assertions::const_assert_eq!(std::mem::offset_of!(SerialPortInfo, serial_pid), 8);
2528
2529 impl ::fidl_next::Constrained for SerialPortInfo {
2530 type Constraint = ();
2531
2532 fn validate(
2533 _: ::fidl_next::Slot<'_, Self>,
2534 _: Self::Constraint,
2535 ) -> Result<(), ::fidl_next::ValidationError> {
2536 Ok(())
2537 }
2538 }
2539
2540 unsafe impl ::fidl_next::Wire for SerialPortInfo {
2541 type Narrowed<'de> = SerialPortInfo;
2542
2543 #[inline]
2544 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2545 ::fidl_next::munge! {
2546 let Self {
2547 serial_class,
2548 serial_vid,
2549 serial_pid,
2550
2551 } = &mut *out_;
2552 }
2553
2554 ::fidl_next::Wire::zero_padding(serial_class);
2555
2556 ::fidl_next::Wire::zero_padding(serial_vid);
2557
2558 ::fidl_next::Wire::zero_padding(serial_pid);
2559
2560 unsafe {
2561 out_.as_mut_ptr().cast::<u8>().add(1).write_bytes(0, 3);
2562 }
2563 }
2564 }
2565
2566 unsafe impl<___D> ::fidl_next::Decode<___D> for SerialPortInfo
2567 where
2568 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2569 {
2570 fn decode(
2571 slot_: ::fidl_next::Slot<'_, Self>,
2572 decoder_: &mut ___D,
2573 _: (),
2574 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2575 if slot_.as_bytes()[1..4] != [0u8; 3] {
2576 return Err(::fidl_next::DecodeError::InvalidPadding);
2577 }
2578
2579 ::fidl_next::munge! {
2580 let Self {
2581 mut serial_class,
2582 mut serial_vid,
2583 mut serial_pid,
2584
2585 } = slot_;
2586 }
2587
2588 let _field = serial_class.as_mut();
2589
2590 ::fidl_next::Decode::decode(serial_class.as_mut(), decoder_, ())?;
2591
2592 let _field = serial_vid.as_mut();
2593
2594 ::fidl_next::Decode::decode(serial_vid.as_mut(), decoder_, ())?;
2595
2596 let _field = serial_pid.as_mut();
2597
2598 ::fidl_next::Decode::decode(serial_pid.as_mut(), decoder_, ())?;
2599
2600 Ok(())
2601 }
2602 }
2603
2604 impl ::fidl_next::IntoNatural for SerialPortInfo {
2605 type Natural = crate::natural::SerialPortInfo;
2606 }
2607}
2608
2609pub mod wire_optional {}
2610
2611pub mod generic {
2612
2613 pub struct Config<T0, T1, T2, T3, T4> {
2615 pub character_width: T0,
2616
2617 pub stop_width: T1,
2618
2619 pub parity: T2,
2620
2621 pub control_flow: T3,
2622
2623 pub baud_rate: T4,
2624 }
2625
2626 unsafe impl<___E, T0, T1, T2, T3, T4> ::fidl_next::Encode<crate::wire::Config, ___E>
2627 for Config<T0, T1, T2, T3, T4>
2628 where
2629 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2630 T0: ::fidl_next::Encode<crate::wire::CharacterWidth, ___E>,
2631 T1: ::fidl_next::Encode<crate::wire::StopWidth, ___E>,
2632 T2: ::fidl_next::Encode<crate::wire::Parity, ___E>,
2633 T3: ::fidl_next::Encode<crate::wire::FlowControl, ___E>,
2634 T4: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2635 {
2636 #[inline]
2637 fn encode(
2638 self,
2639 encoder_: &mut ___E,
2640 out_: &mut ::core::mem::MaybeUninit<crate::wire::Config>,
2641 _: (),
2642 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2643 ::fidl_next::munge! {
2644 let crate::wire::Config {
2645 character_width,
2646 stop_width,
2647 parity,
2648 control_flow,
2649 baud_rate,
2650
2651 } = out_;
2652 }
2653
2654 ::fidl_next::Encode::encode(self.character_width, encoder_, character_width, ())?;
2655
2656 ::fidl_next::Encode::encode(self.stop_width, encoder_, stop_width, ())?;
2657
2658 ::fidl_next::Encode::encode(self.parity, encoder_, parity, ())?;
2659
2660 ::fidl_next::Encode::encode(self.control_flow, encoder_, control_flow, ())?;
2661
2662 ::fidl_next::Encode::encode(self.baud_rate, encoder_, baud_rate, ())?;
2663
2664 Ok(())
2665 }
2666 }
2667
2668 pub struct DeviceGetClassResponse<T0> {
2670 pub device_class: T0,
2671 }
2672
2673 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetClassResponse, ___E>
2674 for DeviceGetClassResponse<T0>
2675 where
2676 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2677 T0: ::fidl_next::Encode<crate::wire::Class, ___E>,
2678 {
2679 #[inline]
2680 fn encode(
2681 self,
2682 encoder_: &mut ___E,
2683 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetClassResponse>,
2684 _: (),
2685 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2686 ::fidl_next::munge! {
2687 let crate::wire::DeviceGetClassResponse {
2688 device_class,
2689
2690 } = out_;
2691 }
2692
2693 ::fidl_next::Encode::encode(self.device_class, encoder_, device_class, ())?;
2694
2695 Ok(())
2696 }
2697 }
2698
2699 pub struct DeviceSetConfigRequest<T0> {
2701 pub config: T0,
2702 }
2703
2704 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceSetConfigRequest, ___E>
2705 for DeviceSetConfigRequest<T0>
2706 where
2707 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2708 T0: ::fidl_next::Encode<crate::wire::Config, ___E>,
2709 {
2710 #[inline]
2711 fn encode(
2712 self,
2713 encoder_: &mut ___E,
2714 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSetConfigRequest>,
2715 _: (),
2716 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2717 ::fidl_next::munge! {
2718 let crate::wire::DeviceSetConfigRequest {
2719 config,
2720
2721 } = out_;
2722 }
2723
2724 ::fidl_next::Encode::encode(self.config, encoder_, config, ())?;
2725
2726 Ok(())
2727 }
2728 }
2729
2730 pub struct DeviceSetConfigResponse<T0> {
2732 pub s: T0,
2733 }
2734
2735 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceSetConfigResponse, ___E>
2736 for DeviceSetConfigResponse<T0>
2737 where
2738 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2739 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::StatusResult, ___E>,
2740 {
2741 #[inline]
2742 fn encode(
2743 self,
2744 encoder_: &mut ___E,
2745 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSetConfigResponse>,
2746 _: (),
2747 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2748 ::fidl_next::munge! {
2749 let crate::wire::DeviceSetConfigResponse {
2750 s,
2751
2752 } = out_;
2753 }
2754
2755 ::fidl_next::Encode::encode(self.s, encoder_, s, ())?;
2756
2757 Ok(())
2758 }
2759 }
2760
2761 pub struct DeviceReadResponse<T0> {
2763 pub data: T0,
2764 }
2765
2766 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceReadResponse<'static>, ___E>
2767 for DeviceReadResponse<T0>
2768 where
2769 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2770 ___E: ::fidl_next::Encoder,
2771 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2772 {
2773 #[inline]
2774 fn encode(
2775 self,
2776 encoder_: &mut ___E,
2777 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadResponse<'static>>,
2778 _: (),
2779 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2780 ::fidl_next::munge! {
2781 let crate::wire::DeviceReadResponse {
2782 data,
2783
2784 } = out_;
2785 }
2786
2787 ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
2788
2789 Ok(())
2790 }
2791 }
2792
2793 pub struct DeviceWriteRequest<T0> {
2795 pub data: T0,
2796 }
2797
2798 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceWriteRequest<'static>, ___E>
2799 for DeviceWriteRequest<T0>
2800 where
2801 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2802 ___E: ::fidl_next::Encoder,
2803 T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
2804 {
2805 #[inline]
2806 fn encode(
2807 self,
2808 encoder_: &mut ___E,
2809 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceWriteRequest<'static>>,
2810 _: (),
2811 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2812 ::fidl_next::munge! {
2813 let crate::wire::DeviceWriteRequest {
2814 data,
2815
2816 } = out_;
2817 }
2818
2819 ::fidl_next::Encode::encode(self.data, encoder_, data, (4294967295, ()))?;
2820
2821 Ok(())
2822 }
2823 }
2824
2825 pub type DeviceWriteResponse = ();
2827
2828 pub struct SerialPortInfo<T0, T1, T2> {
2830 pub serial_class: T0,
2831
2832 pub serial_vid: T1,
2833
2834 pub serial_pid: T2,
2835 }
2836
2837 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::SerialPortInfo, ___E>
2838 for SerialPortInfo<T0, T1, T2>
2839 where
2840 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2841 T0: ::fidl_next::Encode<crate::wire::Class, ___E>,
2842 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2843 T2: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2844 {
2845 #[inline]
2846 fn encode(
2847 self,
2848 encoder_: &mut ___E,
2849 out_: &mut ::core::mem::MaybeUninit<crate::wire::SerialPortInfo>,
2850 _: (),
2851 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2852 ::fidl_next::munge! {
2853 let crate::wire::SerialPortInfo {
2854 serial_class,
2855 serial_vid,
2856 serial_pid,
2857
2858 } = out_;
2859 }
2860
2861 ::fidl_next::Encode::encode(self.serial_class, encoder_, serial_class, ())?;
2862
2863 ::fidl_next::Encode::encode(self.serial_vid, encoder_, serial_vid, ())?;
2864
2865 ::fidl_next::Encode::encode(self.serial_pid, encoder_, serial_pid, ())?;
2866
2867 Ok(())
2868 }
2869 }
2870}
2871
2872pub use self::natural::*;
2873
2874#[doc = " A serial device.\n"]
2876#[derive(PartialEq, Debug)]
2877pub struct Device;
2878
2879#[cfg(target_os = "fuchsia")]
2880impl ::fidl_next::HasTransport for Device {
2881 type Transport = ::fidl_next::fuchsia::zx::Channel;
2882}
2883
2884pub mod device {
2885 pub mod prelude {
2886 pub use crate::{
2887 Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
2888 DeviceServerHandler, device,
2889 };
2890
2891 pub use crate::natural::DeviceGetClassResponse;
2892
2893 pub use crate::natural::DeviceSetConfigRequest;
2894
2895 pub use crate::natural::DeviceSetConfigResponse;
2896
2897 pub use crate::natural::DeviceWriteRequest;
2898
2899 pub use crate::natural::DeviceReadResponse;
2900
2901 pub use crate::natural::DeviceWriteResponse;
2902 }
2903
2904 pub struct GetClass;
2905
2906 impl ::fidl_next::Method for GetClass {
2907 const ORDINAL: u64 = 4415985931870841739;
2908 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2909 ::fidl_next::protocol::Flexibility::Strict;
2910
2911 type Protocol = crate::Device;
2912
2913 type Request = ::fidl_next::wire::EmptyMessageBody;
2914 }
2915
2916 impl ::fidl_next::TwoWayMethod for GetClass {
2917 type Response = ::fidl_next::wire::Strict<crate::wire::DeviceGetClassResponse>;
2918 }
2919
2920 impl<___R> ::fidl_next::Respond<___R> for GetClass {
2921 type Output = ::fidl_next::Strict<crate::generic::DeviceGetClassResponse<___R>>;
2922
2923 fn respond(response: ___R) -> Self::Output {
2924 ::fidl_next::Strict(crate::generic::DeviceGetClassResponse { device_class: response })
2925 }
2926 }
2927
2928 pub struct SetConfig;
2929
2930 impl ::fidl_next::Method for SetConfig {
2931 const ORDINAL: u64 = 8582182240303739251;
2932 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2933 ::fidl_next::protocol::Flexibility::Strict;
2934
2935 type Protocol = crate::Device;
2936
2937 type Request = crate::wire::DeviceSetConfigRequest;
2938 }
2939
2940 impl ::fidl_next::TwoWayMethod for SetConfig {
2941 type Response = ::fidl_next::wire::Strict<crate::wire::DeviceSetConfigResponse>;
2942 }
2943
2944 impl<___R> ::fidl_next::Respond<___R> for SetConfig {
2945 type Output = ::fidl_next::Strict<crate::generic::DeviceSetConfigResponse<___R>>;
2946
2947 fn respond(response: ___R) -> Self::Output {
2948 ::fidl_next::Strict(crate::generic::DeviceSetConfigResponse { s: response })
2949 }
2950 }
2951
2952 pub struct Read;
2953
2954 impl ::fidl_next::Method for Read {
2955 const ORDINAL: u64 = 7188903048813456856;
2956 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2957 ::fidl_next::protocol::Flexibility::Strict;
2958
2959 type Protocol = crate::Device;
2960
2961 type Request = ::fidl_next::wire::EmptyMessageBody;
2962 }
2963
2964 impl ::fidl_next::TwoWayMethod for Read {
2965 type Response = ::fidl_next::wire::Result<
2966 'static,
2967 crate::wire::DeviceReadResponse<'static>,
2968 ::fidl_next::wire::fuchsia::StatusResult,
2969 >;
2970 }
2971
2972 impl<___R> ::fidl_next::Respond<___R> for Read {
2973 type Output = ::core::result::Result<
2974 crate::generic::DeviceReadResponse<___R>,
2975 ::fidl_next::never::Never,
2976 >;
2977
2978 fn respond(response: ___R) -> Self::Output {
2979 ::core::result::Result::Ok(crate::generic::DeviceReadResponse { data: response })
2980 }
2981 }
2982
2983 impl<___R> ::fidl_next::RespondErr<___R> for Read {
2984 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2985
2986 fn respond_err(response: ___R) -> Self::Output {
2987 ::core::result::Result::Err(response)
2988 }
2989 }
2990
2991 pub struct Write;
2992
2993 impl ::fidl_next::Method for Write {
2994 const ORDINAL: u64 = 7685302253716076444;
2995 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2996 ::fidl_next::protocol::Flexibility::Strict;
2997
2998 type Protocol = crate::Device;
2999
3000 type Request = crate::wire::DeviceWriteRequest<'static>;
3001 }
3002
3003 impl ::fidl_next::TwoWayMethod for Write {
3004 type Response = ::fidl_next::wire::Result<
3005 'static,
3006 crate::wire::DeviceWriteResponse,
3007 ::fidl_next::wire::fuchsia::StatusResult,
3008 >;
3009 }
3010
3011 impl<___R> ::fidl_next::Respond<___R> for Write {
3012 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3013
3014 fn respond(response: ___R) -> Self::Output {
3015 ::core::result::Result::Ok(response)
3016 }
3017 }
3018
3019 impl<___R> ::fidl_next::RespondErr<___R> for Write {
3020 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3021
3022 fn respond_err(response: ___R) -> Self::Output {
3023 ::core::result::Result::Err(response)
3024 }
3025 }
3026
3027 mod ___detail {
3028 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
3029 where
3030 ___T: ::fidl_next::Transport,
3031 {
3032 type Client = DeviceClient<___T>;
3033 type Server = DeviceServer<___T>;
3034 }
3035
3036 #[repr(transparent)]
3038 pub struct DeviceClient<___T: ::fidl_next::Transport> {
3039 #[allow(dead_code)]
3040 client: ::fidl_next::protocol::Client<___T>,
3041 }
3042
3043 impl<___T> DeviceClient<___T>
3044 where
3045 ___T: ::fidl_next::Transport,
3046 {
3047 #[doc = " Lookup what type of serial device this is.\n"]
3048 pub fn get_class(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetClass, ___T> {
3049 ::fidl_next::TwoWayFuture::from_untyped(
3050 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
3051 4415985931870841739,
3052 <super::GetClass as ::fidl_next::Method>::FLEXIBILITY,
3053 (),
3054 ),
3055 )
3056 }
3057
3058 #[doc = " Set the configuration of this serial device.\n"]
3059 pub fn set_config(
3060 &self,
3061
3062 config: impl ::fidl_next::Encode<
3063 crate::wire::Config,
3064 <___T as ::fidl_next::Transport>::SendBuffer,
3065 >,
3066 ) -> ::fidl_next::TwoWayFuture<'_, super::SetConfig, ___T>
3067 where
3068 <___T as ::fidl_next::Transport>::SendBuffer:
3069 ::fidl_next::encoder::InternalHandleEncoder,
3070 {
3071 self.set_config_with(crate::generic::DeviceSetConfigRequest { config })
3072 }
3073
3074 #[doc = " Set the configuration of this serial device.\n"]
3075 pub fn set_config_with<___R>(
3076 &self,
3077 request: ___R,
3078 ) -> ::fidl_next::TwoWayFuture<'_, super::SetConfig, ___T>
3079 where
3080 ___R: ::fidl_next::Encode<
3081 crate::wire::DeviceSetConfigRequest,
3082 <___T as ::fidl_next::Transport>::SendBuffer,
3083 >,
3084 {
3085 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3086 8582182240303739251,
3087 <super::SetConfig as ::fidl_next::Method>::FLEXIBILITY,
3088 request,
3089 ))
3090 }
3091
3092 #[doc = " Reads data from the serial port.\n"]
3093 pub fn read(&self) -> ::fidl_next::TwoWayFuture<'_, super::Read, ___T> {
3094 ::fidl_next::TwoWayFuture::from_untyped(
3095 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
3096 7188903048813456856,
3097 <super::Read as ::fidl_next::Method>::FLEXIBILITY,
3098 (),
3099 ),
3100 )
3101 }
3102
3103 #[doc = " Writes data to the serial port.\n"]
3104 pub fn write(
3105 &self,
3106
3107 data: impl ::fidl_next::Encode<
3108 ::fidl_next::wire::Vector<'static, u8>,
3109 <___T as ::fidl_next::Transport>::SendBuffer,
3110 >,
3111 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
3112 where
3113 <___T as ::fidl_next::Transport>::SendBuffer:
3114 ::fidl_next::encoder::InternalHandleEncoder,
3115 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3116 {
3117 self.write_with(crate::generic::DeviceWriteRequest { data })
3118 }
3119
3120 #[doc = " Writes data to the serial port.\n"]
3121 pub fn write_with<___R>(
3122 &self,
3123 request: ___R,
3124 ) -> ::fidl_next::TwoWayFuture<'_, super::Write, ___T>
3125 where
3126 ___R: ::fidl_next::Encode<
3127 crate::wire::DeviceWriteRequest<'static>,
3128 <___T as ::fidl_next::Transport>::SendBuffer,
3129 >,
3130 {
3131 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3132 7685302253716076444,
3133 <super::Write as ::fidl_next::Method>::FLEXIBILITY,
3134 request,
3135 ))
3136 }
3137 }
3138
3139 #[repr(transparent)]
3141 pub struct DeviceServer<___T: ::fidl_next::Transport> {
3142 server: ::fidl_next::protocol::Server<___T>,
3143 }
3144
3145 impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
3146 }
3147}
3148
3149#[diagnostic::on_unimplemented(
3150 note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3151)]
3152
3153pub trait DeviceLocalClientHandler<
3157 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3158 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3159>
3160{
3161}
3162
3163impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
3164where
3165 ___H: DeviceLocalClientHandler<___T>,
3166 ___T: ::fidl_next::Transport,
3167{
3168 async fn on_event(
3169 handler: &mut ___H,
3170 mut message: ::fidl_next::Message<___T>,
3171 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3172 match *message.header().ordinal {
3173 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3174 }
3175 }
3176}
3177
3178#[diagnostic::on_unimplemented(
3179 note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3180)]
3181
3182pub trait DeviceLocalServerHandler<
3186 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3187 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3188>
3189{
3190 #[doc = " Lookup what type of serial device this is.\n"]
3191 fn get_class(
3192 &mut self,
3193
3194 responder: ::fidl_next::Responder<device::GetClass, ___T>,
3195 ) -> impl ::core::future::Future<Output = ()>;
3196
3197 #[doc = " Set the configuration of this serial device.\n"]
3198 fn set_config(
3199 &mut self,
3200
3201 request: ::fidl_next::Request<device::SetConfig, ___T>,
3202
3203 responder: ::fidl_next::Responder<device::SetConfig, ___T>,
3204 ) -> impl ::core::future::Future<Output = ()>;
3205
3206 #[doc = " Reads data from the serial port.\n"]
3207 fn read(
3208 &mut self,
3209
3210 responder: ::fidl_next::Responder<device::Read, ___T>,
3211 ) -> impl ::core::future::Future<Output = ()>;
3212
3213 #[doc = " Writes data to the serial port.\n"]
3214 fn write(
3215 &mut self,
3216
3217 request: ::fidl_next::Request<device::Write, ___T>,
3218
3219 responder: ::fidl_next::Responder<device::Write, ___T>,
3220 ) -> impl ::core::future::Future<Output = ()>;
3221}
3222
3223impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
3224where
3225 ___H: DeviceLocalServerHandler<___T>,
3226 ___T: ::fidl_next::Transport,
3227 for<'de> crate::wire::DeviceSetConfigRequest: ::fidl_next::Decode<
3228 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3229 Constraint = (),
3230 >,
3231 for<'de> crate::wire::DeviceWriteRequest<'de>: ::fidl_next::Decode<
3232 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3233 Constraint = (),
3234 >,
3235{
3236 async fn on_one_way(
3237 handler: &mut ___H,
3238 mut message: ::fidl_next::Message<___T>,
3239 ) -> ::core::result::Result<
3240 (),
3241 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3242 > {
3243 match *message.header().ordinal {
3244 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3245 }
3246 }
3247
3248 async fn on_two_way(
3249 handler: &mut ___H,
3250 mut message: ::fidl_next::Message<___T>,
3251 responder: ::fidl_next::protocol::Responder<___T>,
3252 ) -> ::core::result::Result<
3253 (),
3254 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3255 > {
3256 match *message.header().ordinal {
3257 4415985931870841739 => {
3258 let responder = ::fidl_next::Responder::from_untyped(responder);
3259
3260 handler.get_class(responder).await;
3261 Ok(())
3262 }
3263
3264 8582182240303739251 => {
3265 let responder = ::fidl_next::Responder::from_untyped(responder);
3266
3267 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3268 Ok(decoded) => {
3269 handler
3270 .set_config(::fidl_next::Request::from_decoded(decoded), responder)
3271 .await;
3272 Ok(())
3273 }
3274 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3275 ordinal: 8582182240303739251,
3276 error,
3277 }),
3278 }
3279 }
3280
3281 7188903048813456856 => {
3282 let responder = ::fidl_next::Responder::from_untyped(responder);
3283
3284 handler.read(responder).await;
3285 Ok(())
3286 }
3287
3288 7685302253716076444 => {
3289 let responder = ::fidl_next::Responder::from_untyped(responder);
3290
3291 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3292 Ok(decoded) => {
3293 handler.write(::fidl_next::Request::from_decoded(decoded), responder).await;
3294 Ok(())
3295 }
3296 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3297 ordinal: 7685302253716076444,
3298 error,
3299 }),
3300 }
3301 }
3302
3303 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3304 }
3305 }
3306}
3307
3308pub trait DeviceClientHandler<
3312 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3313 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3314>
3315{
3316}
3317
3318impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
3319where
3320 ___H: DeviceClientHandler<___T> + ::core::marker::Send,
3321 ___T: ::fidl_next::Transport,
3322{
3323 async fn on_event(
3324 handler: &mut ___H,
3325 mut message: ::fidl_next::Message<___T>,
3326 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3327 match *message.header().ordinal {
3328 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3329 }
3330 }
3331}
3332
3333pub trait DeviceServerHandler<
3337 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3338 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3339>
3340{
3341 #[doc = " Lookup what type of serial device this is.\n"]
3342 fn get_class(
3343 &mut self,
3344
3345 responder: ::fidl_next::Responder<device::GetClass, ___T>,
3346 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3347
3348 #[doc = " Set the configuration of this serial device.\n"]
3349 fn set_config(
3350 &mut self,
3351
3352 request: ::fidl_next::Request<device::SetConfig, ___T>,
3353
3354 responder: ::fidl_next::Responder<device::SetConfig, ___T>,
3355 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3356
3357 #[doc = " Reads data from the serial port.\n"]
3358 fn read(
3359 &mut self,
3360
3361 responder: ::fidl_next::Responder<device::Read, ___T>,
3362 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3363
3364 #[doc = " Writes data to the serial port.\n"]
3365 fn write(
3366 &mut self,
3367
3368 request: ::fidl_next::Request<device::Write, ___T>,
3369
3370 responder: ::fidl_next::Responder<device::Write, ___T>,
3371 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3372}
3373
3374impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
3375where
3376 ___H: DeviceServerHandler<___T> + ::core::marker::Send,
3377 ___T: ::fidl_next::Transport,
3378 for<'de> crate::wire::DeviceSetConfigRequest: ::fidl_next::Decode<
3379 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3380 Constraint = (),
3381 >,
3382 for<'de> crate::wire::DeviceWriteRequest<'de>: ::fidl_next::Decode<
3383 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3384 Constraint = (),
3385 >,
3386{
3387 async fn on_one_way(
3388 handler: &mut ___H,
3389 mut message: ::fidl_next::Message<___T>,
3390 ) -> ::core::result::Result<
3391 (),
3392 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3393 > {
3394 match *message.header().ordinal {
3395 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3396 }
3397 }
3398
3399 async fn on_two_way(
3400 handler: &mut ___H,
3401 mut message: ::fidl_next::Message<___T>,
3402 responder: ::fidl_next::protocol::Responder<___T>,
3403 ) -> ::core::result::Result<
3404 (),
3405 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3406 > {
3407 match *message.header().ordinal {
3408 4415985931870841739 => {
3409 let responder = ::fidl_next::Responder::from_untyped(responder);
3410
3411 handler.get_class(responder).await;
3412 Ok(())
3413 }
3414
3415 8582182240303739251 => {
3416 let responder = ::fidl_next::Responder::from_untyped(responder);
3417
3418 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3419 Ok(decoded) => {
3420 handler
3421 .set_config(::fidl_next::Request::from_decoded(decoded), responder)
3422 .await;
3423 Ok(())
3424 }
3425 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3426 ordinal: 8582182240303739251,
3427 error,
3428 }),
3429 }
3430 }
3431
3432 7188903048813456856 => {
3433 let responder = ::fidl_next::Responder::from_untyped(responder);
3434
3435 handler.read(responder).await;
3436 Ok(())
3437 }
3438
3439 7685302253716076444 => {
3440 let responder = ::fidl_next::Responder::from_untyped(responder);
3441
3442 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3443 Ok(decoded) => {
3444 handler.write(::fidl_next::Request::from_decoded(decoded), responder).await;
3445 Ok(())
3446 }
3447 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3448 ordinal: 7685302253716076444,
3449 error,
3450 }),
3451 }
3452 }
3453
3454 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3455 }
3456 }
3457}
3458
3459impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
3460{}
3461
3462impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
3463where
3464 ___H: DeviceClientHandler<___T>,
3465 ___T: ::fidl_next::Transport,
3466{
3467}
3468
3469impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
3470where
3471 ___H: DeviceServerHandler<___T>,
3472 ___T: ::fidl_next::Transport,
3473{
3474 async fn get_class(&mut self, responder: ::fidl_next::Responder<device::GetClass, ___T>) {
3475 ___H::get_class(&mut self.0, responder).await
3476 }
3477
3478 async fn set_config(
3479 &mut self,
3480
3481 request: ::fidl_next::Request<device::SetConfig, ___T>,
3482
3483 responder: ::fidl_next::Responder<device::SetConfig, ___T>,
3484 ) {
3485 ___H::set_config(&mut self.0, request, responder).await
3486 }
3487
3488 async fn read(&mut self, responder: ::fidl_next::Responder<device::Read, ___T>) {
3489 ___H::read(&mut self.0, responder).await
3490 }
3491
3492 async fn write(
3493 &mut self,
3494
3495 request: ::fidl_next::Request<device::Write, ___T>,
3496
3497 responder: ::fidl_next::Responder<device::Write, ___T>,
3498 ) {
3499 ___H::write(&mut self.0, request, responder).await
3500 }
3501}