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