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