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