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