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