1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " Whether to drive the GPIO to a high or low voltage, or disable the output buffer.\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(u32)]
10 pub enum BufferMode {
11 Input = 0,
12 OutputLow = 1,
13 OutputHigh = 2,
14 }
15 impl ::core::convert::TryFrom<u32> for BufferMode {
16 type Error = ::fidl_next::UnknownStrictEnumMemberError;
17 fn try_from(
18 value: u32,
19 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
20 match value {
21 0 => Ok(Self::Input),
22 1 => Ok(Self::OutputLow),
23 2 => Ok(Self::OutputHigh),
24
25 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
26 }
27 }
28 }
29
30 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BufferMode, ___E> for BufferMode
31 where
32 ___E: ?Sized,
33 {
34 #[inline]
35 fn encode(
36 self,
37 encoder: &mut ___E,
38 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMode>,
39 _: (),
40 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
41 ::fidl_next::Encode::encode(&self, encoder, out, ())
42 }
43 }
44
45 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::BufferMode, ___E> for &'a BufferMode
46 where
47 ___E: ?Sized,
48 {
49 #[inline]
50 fn encode(
51 self,
52 encoder: &mut ___E,
53 out: &mut ::core::mem::MaybeUninit<crate::wire::BufferMode>,
54 _: (),
55 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
56 ::fidl_next::munge!(let crate::wire::BufferMode { value } = out);
57 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
58 BufferMode::Input => 0,
59
60 BufferMode::OutputLow => 1,
61
62 BufferMode::OutputHigh => 2,
63 }));
64
65 Ok(())
66 }
67 }
68
69 impl ::core::convert::From<crate::wire::BufferMode> for BufferMode {
70 fn from(wire: crate::wire::BufferMode) -> Self {
71 match u32::from(wire.value) {
72 0 => Self::Input,
73
74 1 => Self::OutputLow,
75
76 2 => Self::OutputHigh,
77
78 _ => unsafe { ::core::hint::unreachable_unchecked() },
79 }
80 }
81 }
82
83 impl ::fidl_next::FromWire<crate::wire::BufferMode> for BufferMode {
84 #[inline]
85 fn from_wire(wire: crate::wire::BufferMode) -> Self {
86 Self::from(wire)
87 }
88 }
89
90 impl ::fidl_next::FromWireRef<crate::wire::BufferMode> for BufferMode {
91 #[inline]
92 fn from_wire_ref(wire: &crate::wire::BufferMode) -> Self {
93 Self::from(*wire)
94 }
95 }
96
97 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
98 #[repr(C)]
99 pub struct GpioReadResponse {
100 pub value: bool,
101 }
102
103 unsafe impl<___E> ::fidl_next::Encode<crate::wire::GpioReadResponse, ___E> for GpioReadResponse
104 where
105 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
106 {
107 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
108 Self,
109 crate::wire::GpioReadResponse,
110 > = unsafe {
111 ::fidl_next::CopyOptimization::enable_if(
112 true && <bool as ::fidl_next::Encode<bool, ___E>>::COPY_OPTIMIZATION.is_enabled(),
113 )
114 };
115
116 #[inline]
117 fn encode(
118 self,
119 encoder_: &mut ___E,
120 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioReadResponse>,
121 _: (),
122 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
123 ::fidl_next::munge! {
124 let crate::wire::GpioReadResponse {
125 value,
126
127 } = out_;
128 }
129
130 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
131
132 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
133
134 Ok(())
135 }
136 }
137
138 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::GpioReadResponse, ___E>
139 for &'a GpioReadResponse
140 where
141 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
142 {
143 #[inline]
144 fn encode(
145 self,
146 encoder_: &mut ___E,
147 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioReadResponse>,
148 _: (),
149 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
150 ::fidl_next::munge! {
151 let crate::wire::GpioReadResponse {
152 value,
153
154 } = out_;
155 }
156
157 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
158
159 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
160
161 Ok(())
162 }
163 }
164
165 unsafe impl<___E>
166 ::fidl_next::EncodeOption<
167 ::fidl_next::wire::Box<'static, crate::wire::GpioReadResponse>,
168 ___E,
169 > for GpioReadResponse
170 where
171 ___E: ::fidl_next::Encoder + ?Sized,
172 GpioReadResponse: ::fidl_next::Encode<crate::wire::GpioReadResponse, ___E>,
173 {
174 #[inline]
175 fn encode_option(
176 this: ::core::option::Option<Self>,
177 encoder: &mut ___E,
178 out: &mut ::core::mem::MaybeUninit<
179 ::fidl_next::wire::Box<'static, crate::wire::GpioReadResponse>,
180 >,
181 _: (),
182 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
183 if let Some(inner) = this {
184 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
185 ::fidl_next::wire::Box::encode_present(out);
186 } else {
187 ::fidl_next::wire::Box::encode_absent(out);
188 }
189
190 Ok(())
191 }
192 }
193
194 unsafe impl<'a, ___E>
195 ::fidl_next::EncodeOption<
196 ::fidl_next::wire::Box<'static, crate::wire::GpioReadResponse>,
197 ___E,
198 > for &'a GpioReadResponse
199 where
200 ___E: ::fidl_next::Encoder + ?Sized,
201 &'a GpioReadResponse: ::fidl_next::Encode<crate::wire::GpioReadResponse, ___E>,
202 {
203 #[inline]
204 fn encode_option(
205 this: ::core::option::Option<Self>,
206 encoder: &mut ___E,
207 out: &mut ::core::mem::MaybeUninit<
208 ::fidl_next::wire::Box<'static, crate::wire::GpioReadResponse>,
209 >,
210 _: (),
211 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
212 if let Some(inner) = this {
213 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
214 ::fidl_next::wire::Box::encode_present(out);
215 } else {
216 ::fidl_next::wire::Box::encode_absent(out);
217 }
218
219 Ok(())
220 }
221 }
222
223 impl ::fidl_next::FromWire<crate::wire::GpioReadResponse> for GpioReadResponse {
224 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
225 crate::wire::GpioReadResponse,
226 Self,
227 > = unsafe {
228 ::fidl_next::CopyOptimization::enable_if(
229 true && <bool as ::fidl_next::FromWire<bool>>::COPY_OPTIMIZATION.is_enabled(),
230 )
231 };
232
233 #[inline]
234 fn from_wire(wire: crate::wire::GpioReadResponse) -> Self {
235 Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
236 }
237 }
238
239 impl ::fidl_next::FromWireRef<crate::wire::GpioReadResponse> for GpioReadResponse {
240 #[inline]
241 fn from_wire_ref(wire: &crate::wire::GpioReadResponse) -> Self {
242 Self { value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value) }
243 }
244 }
245
246 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
247 #[repr(C)]
248 pub struct GpioSetBufferModeRequest {
249 pub mode: crate::natural::BufferMode,
250 }
251
252 unsafe impl<___E> ::fidl_next::Encode<crate::wire::GpioSetBufferModeRequest, ___E>
253 for GpioSetBufferModeRequest
254 where
255 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
256 {
257 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
258 Self,
259 crate::wire::GpioSetBufferModeRequest,
260 > = unsafe {
261 ::fidl_next::CopyOptimization::enable_if(
262 true && <crate::natural::BufferMode as ::fidl_next::Encode<
263 crate::wire::BufferMode,
264 ___E,
265 >>::COPY_OPTIMIZATION
266 .is_enabled(),
267 )
268 };
269
270 #[inline]
271 fn encode(
272 self,
273 encoder_: &mut ___E,
274 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioSetBufferModeRequest>,
275 _: (),
276 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
277 ::fidl_next::munge! {
278 let crate::wire::GpioSetBufferModeRequest {
279 mode,
280
281 } = out_;
282 }
283
284 ::fidl_next::Encode::encode(self.mode, encoder_, mode, ())?;
285
286 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(mode.as_mut_ptr()) };
287
288 Ok(())
289 }
290 }
291
292 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::GpioSetBufferModeRequest, ___E>
293 for &'a GpioSetBufferModeRequest
294 where
295 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
296 {
297 #[inline]
298 fn encode(
299 self,
300 encoder_: &mut ___E,
301 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioSetBufferModeRequest>,
302 _: (),
303 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
304 ::fidl_next::munge! {
305 let crate::wire::GpioSetBufferModeRequest {
306 mode,
307
308 } = out_;
309 }
310
311 ::fidl_next::Encode::encode(&self.mode, encoder_, mode, ())?;
312
313 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(mode.as_mut_ptr()) };
314
315 Ok(())
316 }
317 }
318
319 unsafe impl<___E>
320 ::fidl_next::EncodeOption<
321 ::fidl_next::wire::Box<'static, crate::wire::GpioSetBufferModeRequest>,
322 ___E,
323 > for GpioSetBufferModeRequest
324 where
325 ___E: ::fidl_next::Encoder + ?Sized,
326 GpioSetBufferModeRequest: ::fidl_next::Encode<crate::wire::GpioSetBufferModeRequest, ___E>,
327 {
328 #[inline]
329 fn encode_option(
330 this: ::core::option::Option<Self>,
331 encoder: &mut ___E,
332 out: &mut ::core::mem::MaybeUninit<
333 ::fidl_next::wire::Box<'static, crate::wire::GpioSetBufferModeRequest>,
334 >,
335 _: (),
336 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
337 if let Some(inner) = this {
338 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
339 ::fidl_next::wire::Box::encode_present(out);
340 } else {
341 ::fidl_next::wire::Box::encode_absent(out);
342 }
343
344 Ok(())
345 }
346 }
347
348 unsafe impl<'a, ___E>
349 ::fidl_next::EncodeOption<
350 ::fidl_next::wire::Box<'static, crate::wire::GpioSetBufferModeRequest>,
351 ___E,
352 > for &'a GpioSetBufferModeRequest
353 where
354 ___E: ::fidl_next::Encoder + ?Sized,
355 &'a GpioSetBufferModeRequest:
356 ::fidl_next::Encode<crate::wire::GpioSetBufferModeRequest, ___E>,
357 {
358 #[inline]
359 fn encode_option(
360 this: ::core::option::Option<Self>,
361 encoder: &mut ___E,
362 out: &mut ::core::mem::MaybeUninit<
363 ::fidl_next::wire::Box<'static, crate::wire::GpioSetBufferModeRequest>,
364 >,
365 _: (),
366 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
367 if let Some(inner) = this {
368 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
369 ::fidl_next::wire::Box::encode_present(out);
370 } else {
371 ::fidl_next::wire::Box::encode_absent(out);
372 }
373
374 Ok(())
375 }
376 }
377
378 impl ::fidl_next::FromWire<crate::wire::GpioSetBufferModeRequest> for GpioSetBufferModeRequest {
379 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
380 crate::wire::GpioSetBufferModeRequest,
381 Self,
382 > = unsafe {
383 ::fidl_next::CopyOptimization::enable_if(
384 true && <crate::natural::BufferMode as ::fidl_next::FromWire<
385 crate::wire::BufferMode,
386 >>::COPY_OPTIMIZATION
387 .is_enabled(),
388 )
389 };
390
391 #[inline]
392 fn from_wire(wire: crate::wire::GpioSetBufferModeRequest) -> Self {
393 Self { mode: ::fidl_next::FromWire::from_wire(wire.mode) }
394 }
395 }
396
397 impl ::fidl_next::FromWireRef<crate::wire::GpioSetBufferModeRequest> for GpioSetBufferModeRequest {
398 #[inline]
399 fn from_wire_ref(wire: &crate::wire::GpioSetBufferModeRequest) -> Self {
400 Self { mode: ::fidl_next::FromWireRef::from_wire_ref(&wire.mode) }
401 }
402 }
403
404 pub type GpioSetBufferModeResponse = ();
405
406 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
407 #[repr(u32)]
408 pub enum InterruptMode {
409 EdgeLow = 0,
410 EdgeHigh = 1,
411 EdgeBoth = 2,
412 LevelLow = 3,
413 LevelHigh = 4,
414 }
415 impl ::core::convert::TryFrom<u32> for InterruptMode {
416 type Error = ::fidl_next::UnknownStrictEnumMemberError;
417 fn try_from(
418 value: u32,
419 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
420 match value {
421 0 => Ok(Self::EdgeLow),
422 1 => Ok(Self::EdgeHigh),
423 2 => Ok(Self::EdgeBoth),
424 3 => Ok(Self::LevelLow),
425 4 => Ok(Self::LevelHigh),
426
427 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
428 }
429 }
430 }
431
432 unsafe impl<___E> ::fidl_next::Encode<crate::wire::InterruptMode, ___E> for InterruptMode
433 where
434 ___E: ?Sized,
435 {
436 #[inline]
437 fn encode(
438 self,
439 encoder: &mut ___E,
440 out: &mut ::core::mem::MaybeUninit<crate::wire::InterruptMode>,
441 _: (),
442 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
443 ::fidl_next::Encode::encode(&self, encoder, out, ())
444 }
445 }
446
447 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::InterruptMode, ___E> for &'a InterruptMode
448 where
449 ___E: ?Sized,
450 {
451 #[inline]
452 fn encode(
453 self,
454 encoder: &mut ___E,
455 out: &mut ::core::mem::MaybeUninit<crate::wire::InterruptMode>,
456 _: (),
457 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
458 ::fidl_next::munge!(let crate::wire::InterruptMode { value } = out);
459 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
460 InterruptMode::EdgeLow => 0,
461
462 InterruptMode::EdgeHigh => 1,
463
464 InterruptMode::EdgeBoth => 2,
465
466 InterruptMode::LevelLow => 3,
467
468 InterruptMode::LevelHigh => 4,
469 }));
470
471 Ok(())
472 }
473 }
474
475 impl ::core::convert::From<crate::wire::InterruptMode> for InterruptMode {
476 fn from(wire: crate::wire::InterruptMode) -> Self {
477 match u32::from(wire.value) {
478 0 => Self::EdgeLow,
479
480 1 => Self::EdgeHigh,
481
482 2 => Self::EdgeBoth,
483
484 3 => Self::LevelLow,
485
486 4 => Self::LevelHigh,
487
488 _ => unsafe { ::core::hint::unreachable_unchecked() },
489 }
490 }
491 }
492
493 impl ::fidl_next::FromWire<crate::wire::InterruptMode> for InterruptMode {
494 #[inline]
495 fn from_wire(wire: crate::wire::InterruptMode) -> Self {
496 Self::from(wire)
497 }
498 }
499
500 impl ::fidl_next::FromWireRef<crate::wire::InterruptMode> for InterruptMode {
501 #[inline]
502 fn from_wire_ref(wire: &crate::wire::InterruptMode) -> Self {
503 Self::from(*wire)
504 }
505 }
506
507 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
508 pub struct InterruptConfiguration {
509 pub mode: ::core::option::Option<crate::natural::InterruptMode>,
510 }
511
512 impl InterruptConfiguration {
513 fn __max_ordinal(&self) -> usize {
514 if self.mode.is_some() {
515 return 1;
516 }
517
518 0
519 }
520 }
521
522 unsafe impl<___E> ::fidl_next::Encode<crate::wire::InterruptConfiguration<'static>, ___E>
523 for InterruptConfiguration
524 where
525 ___E: ::fidl_next::Encoder + ?Sized,
526 {
527 #[inline]
528 fn encode(
529 mut self,
530 encoder: &mut ___E,
531 out: &mut ::core::mem::MaybeUninit<crate::wire::InterruptConfiguration<'static>>,
532 _: (),
533 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
534 ::fidl_next::munge!(let crate::wire::InterruptConfiguration { table } = out);
535
536 let max_ord = self.__max_ordinal();
537
538 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
539 ::fidl_next::Wire::zero_padding(&mut out);
540
541 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
542 ::fidl_next::wire::Envelope,
543 >(encoder, max_ord);
544
545 for i in 1..=max_ord {
546 match i {
547 1 => {
548 if let Some(value) = self.mode.take() {
549 ::fidl_next::wire::Envelope::encode_value::<
550 crate::wire::InterruptMode,
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 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
561 }
562 unsafe {
563 preallocated.write_next(out.assume_init_ref());
564 }
565 }
566
567 ::fidl_next::wire::Table::encode_len(table, max_ord);
568
569 Ok(())
570 }
571 }
572
573 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::InterruptConfiguration<'static>, ___E>
574 for &'a InterruptConfiguration
575 where
576 ___E: ::fidl_next::Encoder + ?Sized,
577 {
578 #[inline]
579 fn encode(
580 self,
581 encoder: &mut ___E,
582 out: &mut ::core::mem::MaybeUninit<crate::wire::InterruptConfiguration<'static>>,
583 _: (),
584 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
585 ::fidl_next::munge!(let crate::wire::InterruptConfiguration { table } = out);
586
587 let max_ord = self.__max_ordinal();
588
589 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
590 ::fidl_next::Wire::zero_padding(&mut out);
591
592 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
593 ::fidl_next::wire::Envelope,
594 >(encoder, max_ord);
595
596 for i in 1..=max_ord {
597 match i {
598 1 => {
599 if let Some(value) = &self.mode {
600 ::fidl_next::wire::Envelope::encode_value::<
601 crate::wire::InterruptMode,
602 ___E,
603 >(
604 value, preallocated.encoder, &mut out, ()
605 )?;
606 } else {
607 ::fidl_next::wire::Envelope::encode_zero(&mut out)
608 }
609 }
610
611 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
612 }
613 unsafe {
614 preallocated.write_next(out.assume_init_ref());
615 }
616 }
617
618 ::fidl_next::wire::Table::encode_len(table, max_ord);
619
620 Ok(())
621 }
622 }
623
624 impl<'de> ::fidl_next::FromWire<crate::wire::InterruptConfiguration<'de>>
625 for InterruptConfiguration
626 {
627 #[inline]
628 fn from_wire(wire_: crate::wire::InterruptConfiguration<'de>) -> Self {
629 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
630
631 let mode = wire_.table.get(1);
632
633 Self {
634 mode: mode.map(|envelope| {
635 ::fidl_next::FromWire::from_wire(unsafe {
636 envelope.read_unchecked::<crate::wire::InterruptMode>()
637 })
638 }),
639 }
640 }
641 }
642
643 impl<'de> ::fidl_next::FromWireRef<crate::wire::InterruptConfiguration<'de>>
644 for InterruptConfiguration
645 {
646 #[inline]
647 fn from_wire_ref(wire: &crate::wire::InterruptConfiguration<'de>) -> Self {
648 Self {
649 mode: wire.table.get(1).map(|envelope| {
650 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
651 envelope.deref_unchecked::<crate::wire::InterruptMode>()
652 })
653 }),
654 }
655 }
656 }
657
658 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
659 pub struct GpioConfigureInterruptRequest {
660 pub config: crate::natural::InterruptConfiguration,
661 }
662
663 unsafe impl<___E> ::fidl_next::Encode<crate::wire::GpioConfigureInterruptRequest<'static>, ___E>
664 for GpioConfigureInterruptRequest
665 where
666 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
667 ___E: ::fidl_next::Encoder,
668 {
669 #[inline]
670 fn encode(
671 self,
672 encoder_: &mut ___E,
673 out_: &mut ::core::mem::MaybeUninit<
674 crate::wire::GpioConfigureInterruptRequest<'static>,
675 >,
676 _: (),
677 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
678 ::fidl_next::munge! {
679 let crate::wire::GpioConfigureInterruptRequest {
680 config,
681
682 } = out_;
683 }
684
685 ::fidl_next::Encode::encode(self.config, encoder_, config, ())?;
686
687 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(config.as_mut_ptr()) };
688
689 Ok(())
690 }
691 }
692
693 unsafe impl<'a, ___E>
694 ::fidl_next::Encode<crate::wire::GpioConfigureInterruptRequest<'static>, ___E>
695 for &'a GpioConfigureInterruptRequest
696 where
697 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
698 ___E: ::fidl_next::Encoder,
699 {
700 #[inline]
701 fn encode(
702 self,
703 encoder_: &mut ___E,
704 out_: &mut ::core::mem::MaybeUninit<
705 crate::wire::GpioConfigureInterruptRequest<'static>,
706 >,
707 _: (),
708 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
709 ::fidl_next::munge! {
710 let crate::wire::GpioConfigureInterruptRequest {
711 config,
712
713 } = out_;
714 }
715
716 ::fidl_next::Encode::encode(&self.config, encoder_, config, ())?;
717
718 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(config.as_mut_ptr()) };
719
720 Ok(())
721 }
722 }
723
724 unsafe impl<___E>
725 ::fidl_next::EncodeOption<
726 ::fidl_next::wire::Box<'static, crate::wire::GpioConfigureInterruptRequest<'static>>,
727 ___E,
728 > for GpioConfigureInterruptRequest
729 where
730 ___E: ::fidl_next::Encoder + ?Sized,
731 GpioConfigureInterruptRequest:
732 ::fidl_next::Encode<crate::wire::GpioConfigureInterruptRequest<'static>, ___E>,
733 {
734 #[inline]
735 fn encode_option(
736 this: ::core::option::Option<Self>,
737 encoder: &mut ___E,
738 out: &mut ::core::mem::MaybeUninit<
739 ::fidl_next::wire::Box<
740 'static,
741 crate::wire::GpioConfigureInterruptRequest<'static>,
742 >,
743 >,
744 _: (),
745 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
746 if let Some(inner) = this {
747 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
748 ::fidl_next::wire::Box::encode_present(out);
749 } else {
750 ::fidl_next::wire::Box::encode_absent(out);
751 }
752
753 Ok(())
754 }
755 }
756
757 unsafe impl<'a, ___E>
758 ::fidl_next::EncodeOption<
759 ::fidl_next::wire::Box<'static, crate::wire::GpioConfigureInterruptRequest<'static>>,
760 ___E,
761 > for &'a GpioConfigureInterruptRequest
762 where
763 ___E: ::fidl_next::Encoder + ?Sized,
764 &'a GpioConfigureInterruptRequest:
765 ::fidl_next::Encode<crate::wire::GpioConfigureInterruptRequest<'static>, ___E>,
766 {
767 #[inline]
768 fn encode_option(
769 this: ::core::option::Option<Self>,
770 encoder: &mut ___E,
771 out: &mut ::core::mem::MaybeUninit<
772 ::fidl_next::wire::Box<
773 'static,
774 crate::wire::GpioConfigureInterruptRequest<'static>,
775 >,
776 >,
777 _: (),
778 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
779 if let Some(inner) = this {
780 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
781 ::fidl_next::wire::Box::encode_present(out);
782 } else {
783 ::fidl_next::wire::Box::encode_absent(out);
784 }
785
786 Ok(())
787 }
788 }
789
790 impl<'de> ::fidl_next::FromWire<crate::wire::GpioConfigureInterruptRequest<'de>>
791 for GpioConfigureInterruptRequest
792 {
793 #[inline]
794 fn from_wire(wire: crate::wire::GpioConfigureInterruptRequest<'de>) -> Self {
795 Self { config: ::fidl_next::FromWire::from_wire(wire.config) }
796 }
797 }
798
799 impl<'de> ::fidl_next::FromWireRef<crate::wire::GpioConfigureInterruptRequest<'de>>
800 for GpioConfigureInterruptRequest
801 {
802 #[inline]
803 fn from_wire_ref(wire: &crate::wire::GpioConfigureInterruptRequest<'de>) -> Self {
804 Self { config: ::fidl_next::FromWireRef::from_wire_ref(&wire.config) }
805 }
806 }
807
808 pub type GpioConfigureInterruptResponse = ();
809
810 pub type GpioReleaseInterruptResponse = ();
811
812 ::fidl_next::bitflags::bitflags! {
813 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct InterruptOptions: u32 {
814 #[doc = " The interrupt wakes up the system if the system is suspended.\n Must not be set if system suspend / resume is disabled.\n"]const WAKEABLE = 1;
815 #[doc = " The interrupt returns a monotonic timestamp from synchronous and\n asynchronous waits. Otherwise, it returns a boot timestamp from waits.\n"]const TIMESTAMP_MONO = 2;
816 const _ = !0;
817 }
818 }
819
820 unsafe impl<___E> ::fidl_next::Encode<crate::wire::InterruptOptions, ___E> for InterruptOptions
821 where
822 ___E: ?Sized,
823 {
824 #[inline]
825 fn encode(
826 self,
827 encoder: &mut ___E,
828 out: &mut ::core::mem::MaybeUninit<crate::wire::InterruptOptions>,
829 _: (),
830 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
831 ::fidl_next::Encode::encode(&self, encoder, out, ())
832 }
833 }
834
835 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::InterruptOptions, ___E>
836 for &'a InterruptOptions
837 where
838 ___E: ?Sized,
839 {
840 #[inline]
841 fn encode(
842 self,
843 _: &mut ___E,
844 out: &mut ::core::mem::MaybeUninit<crate::wire::InterruptOptions>,
845 _: (),
846 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
847 ::fidl_next::munge!(let crate::wire::InterruptOptions { value } = out);
848
849 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
850 Ok(())
851 }
852 }
853
854 impl ::core::convert::From<crate::wire::InterruptOptions> for InterruptOptions {
855 fn from(wire: crate::wire::InterruptOptions) -> Self {
856 Self::from_bits_retain(u32::from(wire.value))
857 }
858 }
859
860 impl ::fidl_next::FromWire<crate::wire::InterruptOptions> for InterruptOptions {
861 #[inline]
862 fn from_wire(wire: crate::wire::InterruptOptions) -> Self {
863 Self::from(wire)
864 }
865 }
866
867 impl ::fidl_next::FromWireRef<crate::wire::InterruptOptions> for InterruptOptions {
868 #[inline]
869 fn from_wire_ref(wire: &crate::wire::InterruptOptions) -> Self {
870 Self::from(*wire)
871 }
872 }
873
874 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
875 #[repr(C)]
876 pub struct GpioGetInterruptRequest {
877 pub options: crate::natural::InterruptOptions,
878 }
879
880 unsafe impl<___E> ::fidl_next::Encode<crate::wire::GpioGetInterruptRequest, ___E>
881 for GpioGetInterruptRequest
882 where
883 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
884 {
885 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
886 Self,
887 crate::wire::GpioGetInterruptRequest,
888 > = unsafe {
889 ::fidl_next::CopyOptimization::enable_if(
890 true && <crate::natural::InterruptOptions as ::fidl_next::Encode<
891 crate::wire::InterruptOptions,
892 ___E,
893 >>::COPY_OPTIMIZATION
894 .is_enabled(),
895 )
896 };
897
898 #[inline]
899 fn encode(
900 self,
901 encoder_: &mut ___E,
902 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioGetInterruptRequest>,
903 _: (),
904 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
905 ::fidl_next::munge! {
906 let crate::wire::GpioGetInterruptRequest {
907 options,
908
909 } = out_;
910 }
911
912 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
913
914 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(options.as_mut_ptr()) };
915
916 Ok(())
917 }
918 }
919
920 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::GpioGetInterruptRequest, ___E>
921 for &'a GpioGetInterruptRequest
922 where
923 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
924 {
925 #[inline]
926 fn encode(
927 self,
928 encoder_: &mut ___E,
929 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioGetInterruptRequest>,
930 _: (),
931 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
932 ::fidl_next::munge! {
933 let crate::wire::GpioGetInterruptRequest {
934 options,
935
936 } = out_;
937 }
938
939 ::fidl_next::Encode::encode(&self.options, encoder_, options, ())?;
940
941 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(options.as_mut_ptr()) };
942
943 Ok(())
944 }
945 }
946
947 unsafe impl<___E>
948 ::fidl_next::EncodeOption<
949 ::fidl_next::wire::Box<'static, crate::wire::GpioGetInterruptRequest>,
950 ___E,
951 > for GpioGetInterruptRequest
952 where
953 ___E: ::fidl_next::Encoder + ?Sized,
954 GpioGetInterruptRequest: ::fidl_next::Encode<crate::wire::GpioGetInterruptRequest, ___E>,
955 {
956 #[inline]
957 fn encode_option(
958 this: ::core::option::Option<Self>,
959 encoder: &mut ___E,
960 out: &mut ::core::mem::MaybeUninit<
961 ::fidl_next::wire::Box<'static, crate::wire::GpioGetInterruptRequest>,
962 >,
963 _: (),
964 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
965 if let Some(inner) = this {
966 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
967 ::fidl_next::wire::Box::encode_present(out);
968 } else {
969 ::fidl_next::wire::Box::encode_absent(out);
970 }
971
972 Ok(())
973 }
974 }
975
976 unsafe impl<'a, ___E>
977 ::fidl_next::EncodeOption<
978 ::fidl_next::wire::Box<'static, crate::wire::GpioGetInterruptRequest>,
979 ___E,
980 > for &'a GpioGetInterruptRequest
981 where
982 ___E: ::fidl_next::Encoder + ?Sized,
983 &'a GpioGetInterruptRequest:
984 ::fidl_next::Encode<crate::wire::GpioGetInterruptRequest, ___E>,
985 {
986 #[inline]
987 fn encode_option(
988 this: ::core::option::Option<Self>,
989 encoder: &mut ___E,
990 out: &mut ::core::mem::MaybeUninit<
991 ::fidl_next::wire::Box<'static, crate::wire::GpioGetInterruptRequest>,
992 >,
993 _: (),
994 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
995 if let Some(inner) = this {
996 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
997 ::fidl_next::wire::Box::encode_present(out);
998 } else {
999 ::fidl_next::wire::Box::encode_absent(out);
1000 }
1001
1002 Ok(())
1003 }
1004 }
1005
1006 impl ::fidl_next::FromWire<crate::wire::GpioGetInterruptRequest> for GpioGetInterruptRequest {
1007 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1008 crate::wire::GpioGetInterruptRequest,
1009 Self,
1010 > = unsafe {
1011 ::fidl_next::CopyOptimization::enable_if(
1012 true && <crate::natural::InterruptOptions as ::fidl_next::FromWire<
1013 crate::wire::InterruptOptions,
1014 >>::COPY_OPTIMIZATION
1015 .is_enabled(),
1016 )
1017 };
1018
1019 #[inline]
1020 fn from_wire(wire: crate::wire::GpioGetInterruptRequest) -> Self {
1021 Self { options: ::fidl_next::FromWire::from_wire(wire.options) }
1022 }
1023 }
1024
1025 impl ::fidl_next::FromWireRef<crate::wire::GpioGetInterruptRequest> for GpioGetInterruptRequest {
1026 #[inline]
1027 fn from_wire_ref(wire: &crate::wire::GpioGetInterruptRequest) -> Self {
1028 Self { options: ::fidl_next::FromWireRef::from_wire_ref(&wire.options) }
1029 }
1030 }
1031}
1032
1033pub mod wire {
1034
1035 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1037 #[repr(transparent)]
1038 pub struct BufferMode {
1039 pub(crate) value: ::fidl_next::wire::Uint32,
1040 }
1041
1042 impl ::fidl_next::Constrained for BufferMode {
1043 type Constraint = ();
1044
1045 fn validate(
1046 _: ::fidl_next::Slot<'_, Self>,
1047 _: Self::Constraint,
1048 ) -> Result<(), ::fidl_next::ValidationError> {
1049 Ok(())
1050 }
1051 }
1052
1053 unsafe impl ::fidl_next::Wire for BufferMode {
1054 type Narrowed<'de> = Self;
1055
1056 #[inline]
1057 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1058 }
1060 }
1061
1062 impl BufferMode {
1063 pub const INPUT: BufferMode = BufferMode { value: ::fidl_next::wire::Uint32(0) };
1064
1065 pub const OUTPUT_LOW: BufferMode = BufferMode { value: ::fidl_next::wire::Uint32(1) };
1066
1067 pub const OUTPUT_HIGH: BufferMode = BufferMode { value: ::fidl_next::wire::Uint32(2) };
1068 }
1069
1070 unsafe impl<___D> ::fidl_next::Decode<___D> for BufferMode
1071 where
1072 ___D: ?Sized,
1073 {
1074 fn decode(
1075 slot: ::fidl_next::Slot<'_, Self>,
1076 _: &mut ___D,
1077 _: (),
1078 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1079 ::fidl_next::munge!(let Self { value } = slot);
1080
1081 match u32::from(*value) {
1082 0 | 1 | 2 => (),
1083 unknown => {
1084 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1085 }
1086 }
1087
1088 Ok(())
1089 }
1090 }
1091
1092 impl ::core::convert::From<crate::natural::BufferMode> for BufferMode {
1093 fn from(natural: crate::natural::BufferMode) -> Self {
1094 match natural {
1095 crate::natural::BufferMode::Input => BufferMode::INPUT,
1096
1097 crate::natural::BufferMode::OutputLow => BufferMode::OUTPUT_LOW,
1098
1099 crate::natural::BufferMode::OutputHigh => BufferMode::OUTPUT_HIGH,
1100 }
1101 }
1102 }
1103
1104 impl ::fidl_next::IntoNatural for BufferMode {
1105 type Natural = crate::natural::BufferMode;
1106 }
1107
1108 #[derive(Clone, Debug)]
1110 #[repr(C)]
1111 pub struct GpioReadResponse {
1112 pub value: bool,
1113 }
1114
1115 static_assertions::const_assert_eq!(std::mem::size_of::<GpioReadResponse>(), 1);
1116 static_assertions::const_assert_eq!(std::mem::align_of::<GpioReadResponse>(), 1);
1117
1118 static_assertions::const_assert_eq!(std::mem::offset_of!(GpioReadResponse, value), 0);
1119
1120 impl ::fidl_next::Constrained for GpioReadResponse {
1121 type Constraint = ();
1122
1123 fn validate(
1124 _: ::fidl_next::Slot<'_, Self>,
1125 _: Self::Constraint,
1126 ) -> Result<(), ::fidl_next::ValidationError> {
1127 Ok(())
1128 }
1129 }
1130
1131 unsafe impl ::fidl_next::Wire for GpioReadResponse {
1132 type Narrowed<'de> = GpioReadResponse;
1133
1134 #[inline]
1135 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1136 ::fidl_next::munge! {
1137 let Self {
1138 value,
1139
1140 } = &mut *out_;
1141 }
1142
1143 ::fidl_next::Wire::zero_padding(value);
1144 }
1145 }
1146
1147 unsafe impl<___D> ::fidl_next::Decode<___D> for GpioReadResponse
1148 where
1149 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1150 {
1151 fn decode(
1152 slot_: ::fidl_next::Slot<'_, Self>,
1153 decoder_: &mut ___D,
1154 _: (),
1155 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1156 ::fidl_next::munge! {
1157 let Self {
1158 mut value,
1159
1160 } = slot_;
1161 }
1162
1163 let _field = value.as_mut();
1164
1165 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
1166
1167 Ok(())
1168 }
1169 }
1170
1171 impl ::fidl_next::IntoNatural for GpioReadResponse {
1172 type Natural = crate::natural::GpioReadResponse;
1173 }
1174
1175 #[derive(Clone, Debug)]
1177 #[repr(C)]
1178 pub struct GpioSetBufferModeRequest {
1179 pub mode: crate::wire::BufferMode,
1180 }
1181
1182 static_assertions::const_assert_eq!(std::mem::size_of::<GpioSetBufferModeRequest>(), 4);
1183 static_assertions::const_assert_eq!(std::mem::align_of::<GpioSetBufferModeRequest>(), 4);
1184
1185 static_assertions::const_assert_eq!(std::mem::offset_of!(GpioSetBufferModeRequest, mode), 0);
1186
1187 impl ::fidl_next::Constrained for GpioSetBufferModeRequest {
1188 type Constraint = ();
1189
1190 fn validate(
1191 _: ::fidl_next::Slot<'_, Self>,
1192 _: Self::Constraint,
1193 ) -> Result<(), ::fidl_next::ValidationError> {
1194 Ok(())
1195 }
1196 }
1197
1198 unsafe impl ::fidl_next::Wire for GpioSetBufferModeRequest {
1199 type Narrowed<'de> = GpioSetBufferModeRequest;
1200
1201 #[inline]
1202 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1203 ::fidl_next::munge! {
1204 let Self {
1205 mode,
1206
1207 } = &mut *out_;
1208 }
1209
1210 ::fidl_next::Wire::zero_padding(mode);
1211 }
1212 }
1213
1214 unsafe impl<___D> ::fidl_next::Decode<___D> for GpioSetBufferModeRequest
1215 where
1216 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1217 {
1218 fn decode(
1219 slot_: ::fidl_next::Slot<'_, Self>,
1220 decoder_: &mut ___D,
1221 _: (),
1222 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1223 ::fidl_next::munge! {
1224 let Self {
1225 mut mode,
1226
1227 } = slot_;
1228 }
1229
1230 let _field = mode.as_mut();
1231
1232 ::fidl_next::Decode::decode(mode.as_mut(), decoder_, ())?;
1233
1234 Ok(())
1235 }
1236 }
1237
1238 impl ::fidl_next::IntoNatural for GpioSetBufferModeRequest {
1239 type Natural = crate::natural::GpioSetBufferModeRequest;
1240 }
1241
1242 pub type GpioSetBufferModeResponse = ::fidl_next::wire::Unit;
1244
1245 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1247 #[repr(transparent)]
1248 pub struct InterruptMode {
1249 pub(crate) value: ::fidl_next::wire::Uint32,
1250 }
1251
1252 impl ::fidl_next::Constrained for InterruptMode {
1253 type Constraint = ();
1254
1255 fn validate(
1256 _: ::fidl_next::Slot<'_, Self>,
1257 _: Self::Constraint,
1258 ) -> Result<(), ::fidl_next::ValidationError> {
1259 Ok(())
1260 }
1261 }
1262
1263 unsafe impl ::fidl_next::Wire for InterruptMode {
1264 type Narrowed<'de> = Self;
1265
1266 #[inline]
1267 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1268 }
1270 }
1271
1272 impl InterruptMode {
1273 pub const EDGE_LOW: InterruptMode = InterruptMode { value: ::fidl_next::wire::Uint32(0) };
1274
1275 pub const EDGE_HIGH: InterruptMode = InterruptMode { value: ::fidl_next::wire::Uint32(1) };
1276
1277 pub const EDGE_BOTH: InterruptMode = InterruptMode { value: ::fidl_next::wire::Uint32(2) };
1278
1279 pub const LEVEL_LOW: InterruptMode = InterruptMode { value: ::fidl_next::wire::Uint32(3) };
1280
1281 pub const LEVEL_HIGH: InterruptMode = InterruptMode { value: ::fidl_next::wire::Uint32(4) };
1282 }
1283
1284 unsafe impl<___D> ::fidl_next::Decode<___D> for InterruptMode
1285 where
1286 ___D: ?Sized,
1287 {
1288 fn decode(
1289 slot: ::fidl_next::Slot<'_, Self>,
1290 _: &mut ___D,
1291 _: (),
1292 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1293 ::fidl_next::munge!(let Self { value } = slot);
1294
1295 match u32::from(*value) {
1296 0 | 1 | 2 | 3 | 4 => (),
1297 unknown => {
1298 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1299 }
1300 }
1301
1302 Ok(())
1303 }
1304 }
1305
1306 impl ::core::convert::From<crate::natural::InterruptMode> for InterruptMode {
1307 fn from(natural: crate::natural::InterruptMode) -> Self {
1308 match natural {
1309 crate::natural::InterruptMode::EdgeLow => InterruptMode::EDGE_LOW,
1310
1311 crate::natural::InterruptMode::EdgeHigh => InterruptMode::EDGE_HIGH,
1312
1313 crate::natural::InterruptMode::EdgeBoth => InterruptMode::EDGE_BOTH,
1314
1315 crate::natural::InterruptMode::LevelLow => InterruptMode::LEVEL_LOW,
1316
1317 crate::natural::InterruptMode::LevelHigh => InterruptMode::LEVEL_HIGH,
1318 }
1319 }
1320 }
1321
1322 impl ::fidl_next::IntoNatural for InterruptMode {
1323 type Natural = crate::natural::InterruptMode;
1324 }
1325
1326 #[repr(C)]
1328 pub struct InterruptConfiguration<'de> {
1329 pub(crate) table: ::fidl_next::wire::Table<'de>,
1330 }
1331
1332 impl<'de> Drop for InterruptConfiguration<'de> {
1333 fn drop(&mut self) {
1334 let _ = self
1335 .table
1336 .get(1)
1337 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::InterruptMode>() });
1338 }
1339 }
1340
1341 impl ::fidl_next::Constrained for InterruptConfiguration<'_> {
1342 type Constraint = ();
1343
1344 fn validate(
1345 _: ::fidl_next::Slot<'_, Self>,
1346 _: Self::Constraint,
1347 ) -> Result<(), ::fidl_next::ValidationError> {
1348 Ok(())
1349 }
1350 }
1351
1352 unsafe impl ::fidl_next::Wire for InterruptConfiguration<'static> {
1353 type Narrowed<'de> = InterruptConfiguration<'de>;
1354
1355 #[inline]
1356 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1357 ::fidl_next::munge!(let Self { table } = out);
1358 ::fidl_next::wire::Table::zero_padding(table);
1359 }
1360 }
1361
1362 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InterruptConfiguration<'de>
1363 where
1364 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1365 {
1366 fn decode(
1367 slot: ::fidl_next::Slot<'_, Self>,
1368 decoder: &mut ___D,
1369 _: (),
1370 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1371 ::fidl_next::munge!(let Self { table } = slot);
1372
1373 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1374 match ordinal {
1375 0 => unsafe { ::core::hint::unreachable_unchecked() },
1376
1377 1 => {
1378 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::InterruptMode>(
1379 slot.as_mut(),
1380 decoder,
1381 (),
1382 )?;
1383
1384 Ok(())
1385 }
1386
1387 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1388 }
1389 })
1390 }
1391 }
1392
1393 impl<'de> InterruptConfiguration<'de> {
1394 pub fn mode(&self) -> ::core::option::Option<&crate::wire::InterruptMode> {
1395 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1396 }
1397
1398 pub fn take_mode(&mut self) -> ::core::option::Option<crate::wire::InterruptMode> {
1399 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1400 }
1401 }
1402
1403 impl<'de> ::core::fmt::Debug for InterruptConfiguration<'de> {
1404 fn fmt(
1405 &self,
1406 f: &mut ::core::fmt::Formatter<'_>,
1407 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1408 f.debug_struct("InterruptConfiguration").field("mode", &self.mode()).finish()
1409 }
1410 }
1411
1412 impl<'de> ::fidl_next::IntoNatural for InterruptConfiguration<'de> {
1413 type Natural = crate::natural::InterruptConfiguration;
1414 }
1415
1416 #[derive(Debug)]
1418 #[repr(C)]
1419 pub struct GpioConfigureInterruptRequest<'de> {
1420 pub config: crate::wire::InterruptConfiguration<'de>,
1421 }
1422
1423 static_assertions::const_assert_eq!(
1424 std::mem::size_of::<GpioConfigureInterruptRequest<'_>>(),
1425 16
1426 );
1427 static_assertions::const_assert_eq!(
1428 std::mem::align_of::<GpioConfigureInterruptRequest<'_>>(),
1429 8
1430 );
1431
1432 static_assertions::const_assert_eq!(
1433 std::mem::offset_of!(GpioConfigureInterruptRequest<'_>, config),
1434 0
1435 );
1436
1437 impl ::fidl_next::Constrained for GpioConfigureInterruptRequest<'_> {
1438 type Constraint = ();
1439
1440 fn validate(
1441 _: ::fidl_next::Slot<'_, Self>,
1442 _: Self::Constraint,
1443 ) -> Result<(), ::fidl_next::ValidationError> {
1444 Ok(())
1445 }
1446 }
1447
1448 unsafe impl ::fidl_next::Wire for GpioConfigureInterruptRequest<'static> {
1449 type Narrowed<'de> = GpioConfigureInterruptRequest<'de>;
1450
1451 #[inline]
1452 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1453 ::fidl_next::munge! {
1454 let Self {
1455 config,
1456
1457 } = &mut *out_;
1458 }
1459
1460 ::fidl_next::Wire::zero_padding(config);
1461 }
1462 }
1463
1464 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for GpioConfigureInterruptRequest<'de>
1465 where
1466 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1467 ___D: ::fidl_next::Decoder<'de>,
1468 {
1469 fn decode(
1470 slot_: ::fidl_next::Slot<'_, Self>,
1471 decoder_: &mut ___D,
1472 _: (),
1473 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1474 ::fidl_next::munge! {
1475 let Self {
1476 mut config,
1477
1478 } = slot_;
1479 }
1480
1481 let _field = config.as_mut();
1482
1483 ::fidl_next::Decode::decode(config.as_mut(), decoder_, ())?;
1484
1485 Ok(())
1486 }
1487 }
1488
1489 impl<'de> ::fidl_next::IntoNatural for GpioConfigureInterruptRequest<'de> {
1490 type Natural = crate::natural::GpioConfigureInterruptRequest;
1491 }
1492
1493 pub type GpioConfigureInterruptResponse = ::fidl_next::wire::Unit;
1495
1496 pub type GpioReleaseInterruptResponse = ::fidl_next::wire::Unit;
1498
1499 #[derive(Clone, Copy, Debug)]
1501 #[repr(transparent)]
1502 pub struct InterruptOptions {
1503 pub(crate) value: ::fidl_next::wire::Uint32,
1504 }
1505
1506 impl ::fidl_next::Constrained for InterruptOptions {
1507 type Constraint = ();
1508
1509 fn validate(
1510 _: ::fidl_next::Slot<'_, Self>,
1511 _: Self::Constraint,
1512 ) -> Result<(), ::fidl_next::ValidationError> {
1513 Ok(())
1514 }
1515 }
1516
1517 unsafe impl ::fidl_next::Wire for InterruptOptions {
1518 type Narrowed<'de> = Self;
1519
1520 #[inline]
1521 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1522 }
1524 }
1525
1526 unsafe impl<___D> ::fidl_next::Decode<___D> for InterruptOptions
1527 where
1528 ___D: ?Sized,
1529 {
1530 fn decode(
1531 slot: ::fidl_next::Slot<'_, Self>,
1532 _: &mut ___D,
1533 _: (),
1534 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1535 Ok(())
1536 }
1537 }
1538
1539 impl ::core::convert::From<crate::natural::InterruptOptions> for InterruptOptions {
1540 fn from(natural: crate::natural::InterruptOptions) -> Self {
1541 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
1542 }
1543 }
1544
1545 impl ::fidl_next::IntoNatural for InterruptOptions {
1546 type Natural = crate::natural::InterruptOptions;
1547 }
1548
1549 #[derive(Clone, Debug)]
1551 #[repr(C)]
1552 pub struct GpioGetInterruptRequest {
1553 pub options: crate::wire::InterruptOptions,
1554 }
1555
1556 static_assertions::const_assert_eq!(std::mem::size_of::<GpioGetInterruptRequest>(), 4);
1557 static_assertions::const_assert_eq!(std::mem::align_of::<GpioGetInterruptRequest>(), 4);
1558
1559 static_assertions::const_assert_eq!(std::mem::offset_of!(GpioGetInterruptRequest, options), 0);
1560
1561 impl ::fidl_next::Constrained for GpioGetInterruptRequest {
1562 type Constraint = ();
1563
1564 fn validate(
1565 _: ::fidl_next::Slot<'_, Self>,
1566 _: Self::Constraint,
1567 ) -> Result<(), ::fidl_next::ValidationError> {
1568 Ok(())
1569 }
1570 }
1571
1572 unsafe impl ::fidl_next::Wire for GpioGetInterruptRequest {
1573 type Narrowed<'de> = GpioGetInterruptRequest;
1574
1575 #[inline]
1576 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1577 ::fidl_next::munge! {
1578 let Self {
1579 options,
1580
1581 } = &mut *out_;
1582 }
1583
1584 ::fidl_next::Wire::zero_padding(options);
1585 }
1586 }
1587
1588 unsafe impl<___D> ::fidl_next::Decode<___D> for GpioGetInterruptRequest
1589 where
1590 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1591 {
1592 fn decode(
1593 slot_: ::fidl_next::Slot<'_, Self>,
1594 decoder_: &mut ___D,
1595 _: (),
1596 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1597 ::fidl_next::munge! {
1598 let Self {
1599 mut options,
1600
1601 } = slot_;
1602 }
1603
1604 let _field = options.as_mut();
1605
1606 ::fidl_next::Decode::decode(options.as_mut(), decoder_, ())?;
1607
1608 Ok(())
1609 }
1610 }
1611
1612 impl ::fidl_next::IntoNatural for GpioGetInterruptRequest {
1613 type Natural = crate::natural::GpioGetInterruptRequest;
1614 }
1615}
1616
1617pub mod wire_optional {}
1618
1619pub mod generic {
1620
1621 pub struct GpioReadResponse<T0> {
1623 pub value: T0,
1624 }
1625
1626 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::GpioReadResponse, ___E>
1627 for GpioReadResponse<T0>
1628 where
1629 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1630 T0: ::fidl_next::Encode<bool, ___E>,
1631 {
1632 #[inline]
1633 fn encode(
1634 self,
1635 encoder_: &mut ___E,
1636 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioReadResponse>,
1637 _: (),
1638 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1639 ::fidl_next::munge! {
1640 let crate::wire::GpioReadResponse {
1641 value,
1642
1643 } = out_;
1644 }
1645
1646 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
1647
1648 Ok(())
1649 }
1650 }
1651
1652 pub struct GpioSetBufferModeRequest<T0> {
1654 pub mode: T0,
1655 }
1656
1657 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::GpioSetBufferModeRequest, ___E>
1658 for GpioSetBufferModeRequest<T0>
1659 where
1660 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1661 T0: ::fidl_next::Encode<crate::wire::BufferMode, ___E>,
1662 {
1663 #[inline]
1664 fn encode(
1665 self,
1666 encoder_: &mut ___E,
1667 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioSetBufferModeRequest>,
1668 _: (),
1669 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1670 ::fidl_next::munge! {
1671 let crate::wire::GpioSetBufferModeRequest {
1672 mode,
1673
1674 } = out_;
1675 }
1676
1677 ::fidl_next::Encode::encode(self.mode, encoder_, mode, ())?;
1678
1679 Ok(())
1680 }
1681 }
1682
1683 pub type GpioSetBufferModeResponse = ();
1685
1686 pub struct GpioConfigureInterruptRequest<T0> {
1688 pub config: T0,
1689 }
1690
1691 unsafe impl<___E, T0>
1692 ::fidl_next::Encode<crate::wire::GpioConfigureInterruptRequest<'static>, ___E>
1693 for GpioConfigureInterruptRequest<T0>
1694 where
1695 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1696 ___E: ::fidl_next::Encoder,
1697 T0: ::fidl_next::Encode<crate::wire::InterruptConfiguration<'static>, ___E>,
1698 {
1699 #[inline]
1700 fn encode(
1701 self,
1702 encoder_: &mut ___E,
1703 out_: &mut ::core::mem::MaybeUninit<
1704 crate::wire::GpioConfigureInterruptRequest<'static>,
1705 >,
1706 _: (),
1707 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1708 ::fidl_next::munge! {
1709 let crate::wire::GpioConfigureInterruptRequest {
1710 config,
1711
1712 } = out_;
1713 }
1714
1715 ::fidl_next::Encode::encode(self.config, encoder_, config, ())?;
1716
1717 Ok(())
1718 }
1719 }
1720
1721 pub type GpioConfigureInterruptResponse = ();
1723
1724 pub type GpioReleaseInterruptResponse = ();
1726
1727 pub struct GpioGetInterruptRequest<T0> {
1729 pub options: T0,
1730 }
1731
1732 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::GpioGetInterruptRequest, ___E>
1733 for GpioGetInterruptRequest<T0>
1734 where
1735 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1736 T0: ::fidl_next::Encode<crate::wire::InterruptOptions, ___E>,
1737 {
1738 #[inline]
1739 fn encode(
1740 self,
1741 encoder_: &mut ___E,
1742 out_: &mut ::core::mem::MaybeUninit<crate::wire::GpioGetInterruptRequest>,
1743 _: (),
1744 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1745 ::fidl_next::munge! {
1746 let crate::wire::GpioGetInterruptRequest {
1747 options,
1748
1749 } = out_;
1750 }
1751
1752 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
1753
1754 Ok(())
1755 }
1756 }
1757}
1758
1759pub use self::natural::*;
1760
1761pub const SIGNAL_ACK_INTERRUPT: u32 = 16777216 as u32;