1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " The length of time it takes to move to a power level.\n + `target_level` is the power level we\'re moving to.\n + `latency_us` is the time it takes to move to the level in microseconds.\n"]
8 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 pub struct Transition {
10 pub target_level: ::core::option::Option<u8>,
11
12 pub latency_us: ::core::option::Option<u32>,
13 }
14
15 impl Transition {
16 fn __max_ordinal(&self) -> usize {
17 if self.latency_us.is_some() {
18 return 2;
19 }
20
21 if self.target_level.is_some() {
22 return 1;
23 }
24
25 0
26 }
27 }
28
29 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Transition<'static>, ___E> for Transition
30 where
31 ___E: ::fidl_next::Encoder + ?Sized,
32 {
33 #[inline]
34 fn encode(
35 mut self,
36 encoder: &mut ___E,
37 out: &mut ::core::mem::MaybeUninit<crate::wire::Transition<'static>>,
38 _: (),
39 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
40 ::fidl_next::munge!(let crate::wire::Transition { table } = out);
41
42 let max_ord = self.__max_ordinal();
43
44 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
45 ::fidl_next::Wire::zero_padding(&mut out);
46
47 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
48 ::fidl_next::wire::Envelope,
49 >(encoder, max_ord);
50
51 for i in 1..=max_ord {
52 match i {
53 2 => {
54 if let Some(value) = self.latency_us.take() {
55 ::fidl_next::wire::Envelope::encode_value::<
56 ::fidl_next::wire::Uint32,
57 ___E,
58 >(
59 value, preallocated.encoder, &mut out, ()
60 )?;
61 } else {
62 ::fidl_next::wire::Envelope::encode_zero(&mut out)
63 }
64 }
65
66 1 => {
67 if let Some(value) = self.target_level.take() {
68 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
69 value,
70 preallocated.encoder,
71 &mut out,
72 (),
73 )?;
74 } else {
75 ::fidl_next::wire::Envelope::encode_zero(&mut out)
76 }
77 }
78
79 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
80 }
81 unsafe {
82 preallocated.write_next(out.assume_init_ref());
83 }
84 }
85
86 ::fidl_next::wire::Table::encode_len(table, max_ord);
87
88 Ok(())
89 }
90 }
91
92 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Transition<'static>, ___E> for &'a Transition
93 where
94 ___E: ::fidl_next::Encoder + ?Sized,
95 {
96 #[inline]
97 fn encode(
98 self,
99 encoder: &mut ___E,
100 out: &mut ::core::mem::MaybeUninit<crate::wire::Transition<'static>>,
101 _: (),
102 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
103 ::fidl_next::munge!(let crate::wire::Transition { table } = out);
104
105 let max_ord = self.__max_ordinal();
106
107 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
108 ::fidl_next::Wire::zero_padding(&mut out);
109
110 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
111 ::fidl_next::wire::Envelope,
112 >(encoder, max_ord);
113
114 for i in 1..=max_ord {
115 match i {
116 2 => {
117 if let Some(value) = &self.latency_us {
118 ::fidl_next::wire::Envelope::encode_value::<
119 ::fidl_next::wire::Uint32,
120 ___E,
121 >(
122 value, preallocated.encoder, &mut out, ()
123 )?;
124 } else {
125 ::fidl_next::wire::Envelope::encode_zero(&mut out)
126 }
127 }
128
129 1 => {
130 if let Some(value) = &self.target_level {
131 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
132 value,
133 preallocated.encoder,
134 &mut out,
135 (),
136 )?;
137 } else {
138 ::fidl_next::wire::Envelope::encode_zero(&mut out)
139 }
140 }
141
142 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
143 }
144 unsafe {
145 preallocated.write_next(out.assume_init_ref());
146 }
147 }
148
149 ::fidl_next::wire::Table::encode_len(table, max_ord);
150
151 Ok(())
152 }
153 }
154
155 impl<'de> ::fidl_next::FromWire<crate::wire::Transition<'de>> for Transition {
156 #[inline]
157 fn from_wire(wire_: crate::wire::Transition<'de>) -> Self {
158 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
159
160 let target_level = wire_.table.get(1);
161
162 let latency_us = wire_.table.get(2);
163
164 Self {
165 target_level: target_level.map(|envelope| {
166 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
167 }),
168
169 latency_us: latency_us.map(|envelope| {
170 ::fidl_next::FromWire::from_wire(unsafe {
171 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
172 })
173 }),
174 }
175 }
176 }
177
178 impl<'de> ::fidl_next::FromWireRef<crate::wire::Transition<'de>> for Transition {
179 #[inline]
180 fn from_wire_ref(wire: &crate::wire::Transition<'de>) -> Self {
181 Self {
182 target_level: wire.table.get(1).map(|envelope| {
183 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
184 envelope.deref_unchecked::<u8>()
185 })
186 }),
187
188 latency_us: wire.table.get(2).map(|envelope| {
189 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
190 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
191 })
192 }),
193 }
194 }
195 }
196
197 #[doc = " A zero-indexed set of levels that a device can assume.\n + `level` is the zero-indexed level of this `PowerLevel`.\n + `name` is a human-readable label for this `PowerLevel`, used only for\n debugging.\n + `transitions` describes the levels that are valid transitions from this\n `PowerLevel`.\n"]
198 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
199 pub struct PowerLevel {
200 pub level: ::core::option::Option<u8>,
201
202 pub name: ::core::option::Option<::std::string::String>,
203
204 pub transitions: ::core::option::Option<::std::vec::Vec<crate::natural::Transition>>,
205 }
206
207 impl PowerLevel {
208 fn __max_ordinal(&self) -> usize {
209 if self.transitions.is_some() {
210 return 3;
211 }
212
213 if self.name.is_some() {
214 return 2;
215 }
216
217 if self.level.is_some() {
218 return 1;
219 }
220
221 0
222 }
223 }
224
225 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerLevel<'static>, ___E> for PowerLevel
226 where
227 ___E: ::fidl_next::Encoder + ?Sized,
228 {
229 #[inline]
230 fn encode(
231 mut self,
232 encoder: &mut ___E,
233 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerLevel<'static>>,
234 _: (),
235 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
236 ::fidl_next::munge!(let crate::wire::PowerLevel { table } = out);
237
238 let max_ord = self.__max_ordinal();
239
240 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
241 ::fidl_next::Wire::zero_padding(&mut out);
242
243 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
244 ::fidl_next::wire::Envelope,
245 >(encoder, max_ord);
246
247 for i in 1..=max_ord {
248 match i {
249 3 => {
250 if let Some(value) = self.transitions.take() {
251 ::fidl_next::wire::Envelope::encode_value::<
252 ::fidl_next::wire::Vector<
253 'static,
254 crate::wire::Transition<'static>,
255 >,
256 ___E,
257 >(
258 value, preallocated.encoder, &mut out, (127, ())
259 )?;
260 } else {
261 ::fidl_next::wire::Envelope::encode_zero(&mut out)
262 }
263 }
264
265 2 => {
266 if let Some(value) = self.name.take() {
267 ::fidl_next::wire::Envelope::encode_value::<
268 ::fidl_next::wire::String<'static>,
269 ___E,
270 >(
271 value, preallocated.encoder, &mut out, 63
272 )?;
273 } else {
274 ::fidl_next::wire::Envelope::encode_zero(&mut out)
275 }
276 }
277
278 1 => {
279 if let Some(value) = self.level.take() {
280 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
281 value,
282 preallocated.encoder,
283 &mut out,
284 (),
285 )?;
286 } else {
287 ::fidl_next::wire::Envelope::encode_zero(&mut out)
288 }
289 }
290
291 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
292 }
293 unsafe {
294 preallocated.write_next(out.assume_init_ref());
295 }
296 }
297
298 ::fidl_next::wire::Table::encode_len(table, max_ord);
299
300 Ok(())
301 }
302 }
303
304 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PowerLevel<'static>, ___E> for &'a PowerLevel
305 where
306 ___E: ::fidl_next::Encoder + ?Sized,
307 {
308 #[inline]
309 fn encode(
310 self,
311 encoder: &mut ___E,
312 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerLevel<'static>>,
313 _: (),
314 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
315 ::fidl_next::munge!(let crate::wire::PowerLevel { table } = out);
316
317 let max_ord = self.__max_ordinal();
318
319 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
320 ::fidl_next::Wire::zero_padding(&mut out);
321
322 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
323 ::fidl_next::wire::Envelope,
324 >(encoder, max_ord);
325
326 for i in 1..=max_ord {
327 match i {
328 3 => {
329 if let Some(value) = &self.transitions {
330 ::fidl_next::wire::Envelope::encode_value::<
331 ::fidl_next::wire::Vector<
332 'static,
333 crate::wire::Transition<'static>,
334 >,
335 ___E,
336 >(
337 value, preallocated.encoder, &mut out, (127, ())
338 )?;
339 } else {
340 ::fidl_next::wire::Envelope::encode_zero(&mut out)
341 }
342 }
343
344 2 => {
345 if let Some(value) = &self.name {
346 ::fidl_next::wire::Envelope::encode_value::<
347 ::fidl_next::wire::String<'static>,
348 ___E,
349 >(
350 value, preallocated.encoder, &mut out, 63
351 )?;
352 } else {
353 ::fidl_next::wire::Envelope::encode_zero(&mut out)
354 }
355 }
356
357 1 => {
358 if let Some(value) = &self.level {
359 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
360 value,
361 preallocated.encoder,
362 &mut out,
363 (),
364 )?;
365 } else {
366 ::fidl_next::wire::Envelope::encode_zero(&mut out)
367 }
368 }
369
370 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
371 }
372 unsafe {
373 preallocated.write_next(out.assume_init_ref());
374 }
375 }
376
377 ::fidl_next::wire::Table::encode_len(table, max_ord);
378
379 Ok(())
380 }
381 }
382
383 impl<'de> ::fidl_next::FromWire<crate::wire::PowerLevel<'de>> for PowerLevel {
384 #[inline]
385 fn from_wire(wire_: crate::wire::PowerLevel<'de>) -> Self {
386 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
387
388 let level = wire_.table.get(1);
389
390 let name = wire_.table.get(2);
391
392 let transitions = wire_.table.get(3);
393
394 Self {
395
396
397 level: level.map(|envelope| ::fidl_next::FromWire::from_wire(
398 unsafe { envelope.read_unchecked::<u8>() }
399 )),
400
401
402 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
403 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
404 )),
405
406
407 transitions: transitions.map(|envelope| ::fidl_next::FromWire::from_wire(
408 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>>() }
409 )),
410
411 }
412 }
413 }
414
415 impl<'de> ::fidl_next::FromWireRef<crate::wire::PowerLevel<'de>> for PowerLevel {
416 #[inline]
417 fn from_wire_ref(wire: &crate::wire::PowerLevel<'de>) -> Self {
418 Self {
419
420
421 level: wire.table.get(1)
422 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
423 unsafe { envelope.deref_unchecked::<u8>() }
424 )),
425
426
427 name: wire.table.get(2)
428 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
429 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
430 )),
431
432
433 transitions: wire.table.get(3)
434 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
435 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>>() }
436 )),
437
438 }
439 }
440 }
441
442 #[doc = " Set of `PowerLevel`s and a human-readable identifier. A `PowerLevel` itself\n contains information about valid transitions out of that level.\n"]
443 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
444 pub struct PowerElement {
445 pub name: ::core::option::Option<::std::string::String>,
446
447 pub levels: ::core::option::Option<::std::vec::Vec<crate::natural::PowerLevel>>,
448 }
449
450 impl PowerElement {
451 fn __max_ordinal(&self) -> usize {
452 if self.levels.is_some() {
453 return 2;
454 }
455
456 if self.name.is_some() {
457 return 1;
458 }
459
460 0
461 }
462 }
463
464 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerElement<'static>, ___E> for PowerElement
465 where
466 ___E: ::fidl_next::Encoder + ?Sized,
467 {
468 #[inline]
469 fn encode(
470 mut self,
471 encoder: &mut ___E,
472 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerElement<'static>>,
473 _: (),
474 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
475 ::fidl_next::munge!(let crate::wire::PowerElement { table } = out);
476
477 let max_ord = self.__max_ordinal();
478
479 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
480 ::fidl_next::Wire::zero_padding(&mut out);
481
482 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
483 ::fidl_next::wire::Envelope,
484 >(encoder, max_ord);
485
486 for i in 1..=max_ord {
487 match i {
488 2 => {
489 if let Some(value) = self.levels.take() {
490 ::fidl_next::wire::Envelope::encode_value::<
491 ::fidl_next::wire::Vector<
492 'static,
493 crate::wire::PowerLevel<'static>,
494 >,
495 ___E,
496 >(
497 value, preallocated.encoder, &mut out, (128, ())
498 )?;
499 } else {
500 ::fidl_next::wire::Envelope::encode_zero(&mut out)
501 }
502 }
503
504 1 => {
505 if let Some(value) = self.name.take() {
506 ::fidl_next::wire::Envelope::encode_value::<
507 ::fidl_next::wire::String<'static>,
508 ___E,
509 >(
510 value, preallocated.encoder, &mut out, 63
511 )?;
512 } else {
513 ::fidl_next::wire::Envelope::encode_zero(&mut out)
514 }
515 }
516
517 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
518 }
519 unsafe {
520 preallocated.write_next(out.assume_init_ref());
521 }
522 }
523
524 ::fidl_next::wire::Table::encode_len(table, max_ord);
525
526 Ok(())
527 }
528 }
529
530 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PowerElement<'static>, ___E>
531 for &'a PowerElement
532 where
533 ___E: ::fidl_next::Encoder + ?Sized,
534 {
535 #[inline]
536 fn encode(
537 self,
538 encoder: &mut ___E,
539 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerElement<'static>>,
540 _: (),
541 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
542 ::fidl_next::munge!(let crate::wire::PowerElement { table } = out);
543
544 let max_ord = self.__max_ordinal();
545
546 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
547 ::fidl_next::Wire::zero_padding(&mut out);
548
549 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
550 ::fidl_next::wire::Envelope,
551 >(encoder, max_ord);
552
553 for i in 1..=max_ord {
554 match i {
555 2 => {
556 if let Some(value) = &self.levels {
557 ::fidl_next::wire::Envelope::encode_value::<
558 ::fidl_next::wire::Vector<
559 'static,
560 crate::wire::PowerLevel<'static>,
561 >,
562 ___E,
563 >(
564 value, preallocated.encoder, &mut out, (128, ())
565 )?;
566 } else {
567 ::fidl_next::wire::Envelope::encode_zero(&mut out)
568 }
569 }
570
571 1 => {
572 if let Some(value) = &self.name {
573 ::fidl_next::wire::Envelope::encode_value::<
574 ::fidl_next::wire::String<'static>,
575 ___E,
576 >(
577 value, preallocated.encoder, &mut out, 63
578 )?;
579 } else {
580 ::fidl_next::wire::Envelope::encode_zero(&mut out)
581 }
582 }
583
584 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
585 }
586 unsafe {
587 preallocated.write_next(out.assume_init_ref());
588 }
589 }
590
591 ::fidl_next::wire::Table::encode_len(table, max_ord);
592
593 Ok(())
594 }
595 }
596
597 impl<'de> ::fidl_next::FromWire<crate::wire::PowerElement<'de>> for PowerElement {
598 #[inline]
599 fn from_wire(wire_: crate::wire::PowerElement<'de>) -> Self {
600 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
601
602 let name = wire_.table.get(1);
603
604 let levels = wire_.table.get(2);
605
606 Self {
607
608
609 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
610 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
611 )),
612
613
614 levels: levels.map(|envelope| ::fidl_next::FromWire::from_wire(
615 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>>() }
616 )),
617
618 }
619 }
620 }
621
622 impl<'de> ::fidl_next::FromWireRef<crate::wire::PowerElement<'de>> for PowerElement {
623 #[inline]
624 fn from_wire_ref(wire: &crate::wire::PowerElement<'de>) -> Self {
625 Self {
626
627
628 name: wire.table.get(1)
629 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
630 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
631 )),
632
633
634 levels: wire.table.get(2)
635 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
636 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>>() }
637 )),
638
639 }
640 }
641 }
642
643 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
644 #[repr(u32)]
645 pub enum SagElement {
646 ExecutionState = 1,
647 ApplicationActivity = 4,
648 }
649 impl ::core::convert::TryFrom<u32> for SagElement {
650 type Error = ::fidl_next::UnknownStrictEnumMemberError;
651 fn try_from(
652 value: u32,
653 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
654 match value {
655 1 => Ok(Self::ExecutionState),
656 4 => Ok(Self::ApplicationActivity),
657
658 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
659 }
660 }
661 }
662
663 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SagElement, ___E> for SagElement
664 where
665 ___E: ?Sized,
666 {
667 #[inline]
668 fn encode(
669 self,
670 encoder: &mut ___E,
671 out: &mut ::core::mem::MaybeUninit<crate::wire::SagElement>,
672 _: (),
673 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
674 ::fidl_next::Encode::encode(&self, encoder, out, ())
675 }
676 }
677
678 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SagElement, ___E> for &'a SagElement
679 where
680 ___E: ?Sized,
681 {
682 #[inline]
683 fn encode(
684 self,
685 encoder: &mut ___E,
686 out: &mut ::core::mem::MaybeUninit<crate::wire::SagElement>,
687 _: (),
688 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
689 ::fidl_next::munge!(let crate::wire::SagElement { value } = out);
690 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
691 SagElement::ExecutionState => 1,
692
693 SagElement::ApplicationActivity => 4,
694 }));
695
696 Ok(())
697 }
698 }
699
700 impl ::core::convert::From<crate::wire::SagElement> for SagElement {
701 fn from(wire: crate::wire::SagElement) -> Self {
702 match u32::from(wire.value) {
703 1 => Self::ExecutionState,
704
705 4 => Self::ApplicationActivity,
706
707 _ => unsafe { ::core::hint::unreachable_unchecked() },
708 }
709 }
710 }
711
712 impl ::fidl_next::FromWire<crate::wire::SagElement> for SagElement {
713 #[inline]
714 fn from_wire(wire: crate::wire::SagElement) -> Self {
715 Self::from(wire)
716 }
717 }
718
719 impl ::fidl_next::FromWireRef<crate::wire::SagElement> for SagElement {
720 #[inline]
721 fn from_wire_ref(wire: &crate::wire::SagElement) -> Self {
722 Self::from(*wire)
723 }
724 }
725
726 #[doc = " Represents the power elements related to controlling the CPU. This is an\n enum with a single variant to add flexibility for future addition of more\n elements related to CPU power state.\n"]
727 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
728 #[repr(u32)]
729 pub enum CpuPowerElement {
730 Cpu = 1,
731 }
732 impl ::core::convert::TryFrom<u32> for CpuPowerElement {
733 type Error = ::fidl_next::UnknownStrictEnumMemberError;
734 fn try_from(
735 value: u32,
736 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
737 match value {
738 1 => Ok(Self::Cpu),
739
740 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
741 }
742 }
743 }
744
745 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CpuPowerElement, ___E> for CpuPowerElement
746 where
747 ___E: ?Sized,
748 {
749 #[inline]
750 fn encode(
751 self,
752 encoder: &mut ___E,
753 out: &mut ::core::mem::MaybeUninit<crate::wire::CpuPowerElement>,
754 _: (),
755 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
756 ::fidl_next::Encode::encode(&self, encoder, out, ())
757 }
758 }
759
760 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CpuPowerElement, ___E>
761 for &'a CpuPowerElement
762 where
763 ___E: ?Sized,
764 {
765 #[inline]
766 fn encode(
767 self,
768 encoder: &mut ___E,
769 out: &mut ::core::mem::MaybeUninit<crate::wire::CpuPowerElement>,
770 _: (),
771 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
772 ::fidl_next::munge!(let crate::wire::CpuPowerElement { value } = out);
773 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
774 CpuPowerElement::Cpu => 1,
775 }));
776
777 Ok(())
778 }
779 }
780
781 impl ::core::convert::From<crate::wire::CpuPowerElement> for CpuPowerElement {
782 fn from(wire: crate::wire::CpuPowerElement) -> Self {
783 match u32::from(wire.value) {
784 1 => Self::Cpu,
785
786 _ => unsafe { ::core::hint::unreachable_unchecked() },
787 }
788 }
789 }
790
791 impl ::fidl_next::FromWire<crate::wire::CpuPowerElement> for CpuPowerElement {
792 #[inline]
793 fn from_wire(wire: crate::wire::CpuPowerElement) -> Self {
794 Self::from(wire)
795 }
796 }
797
798 impl ::fidl_next::FromWireRef<crate::wire::CpuPowerElement> for CpuPowerElement {
799 #[inline]
800 fn from_wire_ref(wire: &crate::wire::CpuPowerElement) -> Self {
801 Self::from(*wire)
802 }
803 }
804
805 #[doc = " Identifier for an element that is another element\'s parent, in other words\n an element that the other element depends upon.\n"]
806 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
807 pub enum ParentElement {
808 Sag(crate::natural::SagElement),
809
810 InstanceName(::std::string::String),
811
812 CpuControl(crate::natural::CpuPowerElement),
813 }
814
815 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ParentElement<'static>, ___E> for ParentElement
816 where
817 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
818 ___E: ::fidl_next::Encoder,
819 {
820 #[inline]
821 fn encode(
822 self,
823 encoder: &mut ___E,
824 out: &mut ::core::mem::MaybeUninit<crate::wire::ParentElement<'static>>,
825 _: (),
826 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
827 ::fidl_next::munge!(let crate::wire::ParentElement { raw, _phantom: _ } = out);
828
829 match self {
830 Self::Sag(value) => ::fidl_next::wire::Union::encode_as::<
831 ___E,
832 crate::wire::SagElement,
833 >(value, 1, encoder, raw, ())?,
834
835 Self::InstanceName(value) => ::fidl_next::wire::Union::encode_as::<
836 ___E,
837 ::fidl_next::wire::String<'static>,
838 >(value, 2, encoder, raw, 63)?,
839
840 Self::CpuControl(value) => ::fidl_next::wire::Union::encode_as::<
841 ___E,
842 crate::wire::CpuPowerElement,
843 >(value, 3, encoder, raw, ())?,
844 }
845
846 Ok(())
847 }
848 }
849
850 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ParentElement<'static>, ___E>
851 for &'a ParentElement
852 where
853 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
854 ___E: ::fidl_next::Encoder,
855 {
856 #[inline]
857 fn encode(
858 self,
859 encoder: &mut ___E,
860 out: &mut ::core::mem::MaybeUninit<crate::wire::ParentElement<'static>>,
861 _: (),
862 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
863 ::fidl_next::munge!(let crate::wire::ParentElement { raw, _phantom: _ } = out);
864
865 match self {
866 ParentElement::Sag(value) => ::fidl_next::wire::Union::encode_as::<
867 ___E,
868 crate::wire::SagElement,
869 >(value, 1, encoder, raw, ())?,
870
871 ParentElement::InstanceName(value) => ::fidl_next::wire::Union::encode_as::<
872 ___E,
873 ::fidl_next::wire::String<'static>,
874 >(value, 2, encoder, raw, 63)?,
875
876 ParentElement::CpuControl(value) => ::fidl_next::wire::Union::encode_as::<
877 ___E,
878 crate::wire::CpuPowerElement,
879 >(value, 3, encoder, raw, ())?,
880 }
881
882 Ok(())
883 }
884 }
885
886 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::ParentElement<'static>, ___E>
887 for ParentElement
888 where
889 ___E: ?Sized,
890 ParentElement: ::fidl_next::Encode<crate::wire::ParentElement<'static>, ___E>,
891 {
892 #[inline]
893 fn encode_option(
894 this: ::core::option::Option<Self>,
895 encoder: &mut ___E,
896 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ParentElement<'static>>,
897 _: (),
898 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
899 ::fidl_next::munge!(let crate::wire_optional::ParentElement { raw, _phantom: _ } = &mut *out);
900
901 if let Some(inner) = this {
902 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
903 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
904 } else {
905 ::fidl_next::wire::Union::encode_absent(raw);
906 }
907
908 Ok(())
909 }
910 }
911
912 unsafe impl<'a, ___E>
913 ::fidl_next::EncodeOption<crate::wire_optional::ParentElement<'static>, ___E>
914 for &'a ParentElement
915 where
916 ___E: ?Sized,
917 &'a ParentElement: ::fidl_next::Encode<crate::wire::ParentElement<'static>, ___E>,
918 {
919 #[inline]
920 fn encode_option(
921 this: ::core::option::Option<Self>,
922 encoder: &mut ___E,
923 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ParentElement<'static>>,
924 _: (),
925 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
926 ::fidl_next::munge!(let crate::wire_optional::ParentElement { raw, _phantom: _ } = &mut *out);
927
928 if let Some(inner) = this {
929 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
930 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
931 } else {
932 ::fidl_next::wire::Union::encode_absent(raw);
933 }
934
935 Ok(())
936 }
937 }
938
939 impl<'de> ::fidl_next::FromWire<crate::wire::ParentElement<'de>> for ParentElement {
940 #[inline]
941 fn from_wire(wire: crate::wire::ParentElement<'de>) -> Self {
942 let wire = ::core::mem::ManuallyDrop::new(wire);
943 match wire.raw.ordinal() {
944 1 => Self::Sag(::fidl_next::FromWire::from_wire(unsafe {
945 wire.raw.get().read_unchecked::<crate::wire::SagElement>()
946 })),
947
948 2 => Self::InstanceName(::fidl_next::FromWire::from_wire(unsafe {
949 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
950 })),
951
952 3 => Self::CpuControl(::fidl_next::FromWire::from_wire(unsafe {
953 wire.raw.get().read_unchecked::<crate::wire::CpuPowerElement>()
954 })),
955
956 _ => unsafe { ::core::hint::unreachable_unchecked() },
957 }
958 }
959 }
960
961 impl<'de> ::fidl_next::FromWireRef<crate::wire::ParentElement<'de>> for ParentElement {
962 #[inline]
963 fn from_wire_ref(wire: &crate::wire::ParentElement<'de>) -> Self {
964 match wire.raw.ordinal() {
965 1 => Self::Sag(::fidl_next::FromWireRef::from_wire_ref(unsafe {
966 wire.raw.get().deref_unchecked::<crate::wire::SagElement>()
967 })),
968
969 2 => Self::InstanceName(::fidl_next::FromWireRef::from_wire_ref(unsafe {
970 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
971 })),
972
973 3 => Self::CpuControl(::fidl_next::FromWireRef::from_wire_ref(unsafe {
974 wire.raw.get().deref_unchecked::<crate::wire::CpuPowerElement>()
975 })),
976
977 _ => unsafe { ::core::hint::unreachable_unchecked() },
978 }
979 }
980 }
981
982 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ParentElement<'de>> for ParentElement {
983 #[inline]
984 fn from_wire_option(
985 wire: crate::wire_optional::ParentElement<'de>,
986 ) -> ::core::option::Option<Self> {
987 if let Some(inner) = wire.into_option() {
988 Some(::fidl_next::FromWire::from_wire(inner))
989 } else {
990 None
991 }
992 }
993 }
994
995 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ParentElement<'de>>
996 for Box<ParentElement>
997 {
998 #[inline]
999 fn from_wire_option(
1000 wire: crate::wire_optional::ParentElement<'de>,
1001 ) -> ::core::option::Option<Self> {
1002 <ParentElement as ::fidl_next::FromWireOption<
1003 crate::wire_optional::ParentElement<'de>,
1004 >>::from_wire_option(wire)
1005 .map(Box::new)
1006 }
1007 }
1008
1009 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ParentElement<'de>>
1010 for Box<ParentElement>
1011 {
1012 #[inline]
1013 fn from_wire_option_ref(
1014 wire: &crate::wire_optional::ParentElement<'de>,
1015 ) -> ::core::option::Option<Self> {
1016 if let Some(inner) = wire.as_ref() {
1017 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1018 } else {
1019 None
1020 }
1021 }
1022 }
1023
1024 #[doc = " Represents a dependency between two power levels of two different\n `PowerElement`s.\n"]
1025 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1026 pub struct LevelTuple {
1027 pub child_level: ::core::option::Option<u8>,
1028
1029 pub parent_level: ::core::option::Option<u8>,
1030 }
1031
1032 impl LevelTuple {
1033 fn __max_ordinal(&self) -> usize {
1034 if self.parent_level.is_some() {
1035 return 2;
1036 }
1037
1038 if self.child_level.is_some() {
1039 return 1;
1040 }
1041
1042 0
1043 }
1044 }
1045
1046 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LevelTuple<'static>, ___E> for LevelTuple
1047 where
1048 ___E: ::fidl_next::Encoder + ?Sized,
1049 {
1050 #[inline]
1051 fn encode(
1052 mut self,
1053 encoder: &mut ___E,
1054 out: &mut ::core::mem::MaybeUninit<crate::wire::LevelTuple<'static>>,
1055 _: (),
1056 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1057 ::fidl_next::munge!(let crate::wire::LevelTuple { table } = out);
1058
1059 let max_ord = self.__max_ordinal();
1060
1061 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1062 ::fidl_next::Wire::zero_padding(&mut out);
1063
1064 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1065 ::fidl_next::wire::Envelope,
1066 >(encoder, max_ord);
1067
1068 for i in 1..=max_ord {
1069 match i {
1070 2 => {
1071 if let Some(value) = self.parent_level.take() {
1072 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1073 value,
1074 preallocated.encoder,
1075 &mut out,
1076 (),
1077 )?;
1078 } else {
1079 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1080 }
1081 }
1082
1083 1 => {
1084 if let Some(value) = self.child_level.take() {
1085 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1086 value,
1087 preallocated.encoder,
1088 &mut out,
1089 (),
1090 )?;
1091 } else {
1092 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1093 }
1094 }
1095
1096 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1097 }
1098 unsafe {
1099 preallocated.write_next(out.assume_init_ref());
1100 }
1101 }
1102
1103 ::fidl_next::wire::Table::encode_len(table, max_ord);
1104
1105 Ok(())
1106 }
1107 }
1108
1109 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LevelTuple<'static>, ___E> for &'a LevelTuple
1110 where
1111 ___E: ::fidl_next::Encoder + ?Sized,
1112 {
1113 #[inline]
1114 fn encode(
1115 self,
1116 encoder: &mut ___E,
1117 out: &mut ::core::mem::MaybeUninit<crate::wire::LevelTuple<'static>>,
1118 _: (),
1119 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1120 ::fidl_next::munge!(let crate::wire::LevelTuple { table } = out);
1121
1122 let max_ord = self.__max_ordinal();
1123
1124 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1125 ::fidl_next::Wire::zero_padding(&mut out);
1126
1127 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1128 ::fidl_next::wire::Envelope,
1129 >(encoder, max_ord);
1130
1131 for i in 1..=max_ord {
1132 match i {
1133 2 => {
1134 if let Some(value) = &self.parent_level {
1135 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1136 value,
1137 preallocated.encoder,
1138 &mut out,
1139 (),
1140 )?;
1141 } else {
1142 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1143 }
1144 }
1145
1146 1 => {
1147 if let Some(value) = &self.child_level {
1148 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1149 value,
1150 preallocated.encoder,
1151 &mut out,
1152 (),
1153 )?;
1154 } else {
1155 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1156 }
1157 }
1158
1159 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1160 }
1161 unsafe {
1162 preallocated.write_next(out.assume_init_ref());
1163 }
1164 }
1165
1166 ::fidl_next::wire::Table::encode_len(table, max_ord);
1167
1168 Ok(())
1169 }
1170 }
1171
1172 impl<'de> ::fidl_next::FromWire<crate::wire::LevelTuple<'de>> for LevelTuple {
1173 #[inline]
1174 fn from_wire(wire_: crate::wire::LevelTuple<'de>) -> Self {
1175 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1176
1177 let child_level = wire_.table.get(1);
1178
1179 let parent_level = wire_.table.get(2);
1180
1181 Self {
1182 child_level: child_level.map(|envelope| {
1183 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
1184 }),
1185
1186 parent_level: parent_level.map(|envelope| {
1187 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
1188 }),
1189 }
1190 }
1191 }
1192
1193 impl<'de> ::fidl_next::FromWireRef<crate::wire::LevelTuple<'de>> for LevelTuple {
1194 #[inline]
1195 fn from_wire_ref(wire: &crate::wire::LevelTuple<'de>) -> Self {
1196 Self {
1197 child_level: wire.table.get(1).map(|envelope| {
1198 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1199 envelope.deref_unchecked::<u8>()
1200 })
1201 }),
1202
1203 parent_level: wire.table.get(2).map(|envelope| {
1204 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1205 envelope.deref_unchecked::<u8>()
1206 })
1207 }),
1208 }
1209 }
1210 }
1211
1212 #[doc = " Describes the relationship between the `PowerLevel`s of two\n `PowerElement`s. `child` is the name of the `PowerElement` which has\n `PowerLevel`s that depend on `parent`.\n + `child` is the name for a `PowerElement` which a driver owns.\n + `parent` is the name for a `PowerElement` which a driver has access to\n + `level_deps` is the map of level dependencies from `child` to `parent`.\n"]
1213 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1214 pub struct PowerDependency {
1215 pub child: ::core::option::Option<::std::string::String>,
1216
1217 pub parent: ::core::option::Option<crate::natural::ParentElement>,
1218
1219 pub level_deps: ::core::option::Option<::std::vec::Vec<crate::natural::LevelTuple>>,
1220 }
1221
1222 impl PowerDependency {
1223 fn __max_ordinal(&self) -> usize {
1224 if self.level_deps.is_some() {
1225 return 3;
1226 }
1227
1228 if self.parent.is_some() {
1229 return 2;
1230 }
1231
1232 if self.child.is_some() {
1233 return 1;
1234 }
1235
1236 0
1237 }
1238 }
1239
1240 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerDependency<'static>, ___E>
1241 for PowerDependency
1242 where
1243 ___E: ::fidl_next::Encoder + ?Sized,
1244 {
1245 #[inline]
1246 fn encode(
1247 mut self,
1248 encoder: &mut ___E,
1249 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerDependency<'static>>,
1250 _: (),
1251 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1252 ::fidl_next::munge!(let crate::wire::PowerDependency { table } = out);
1253
1254 let max_ord = self.__max_ordinal();
1255
1256 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1257 ::fidl_next::Wire::zero_padding(&mut out);
1258
1259 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1260 ::fidl_next::wire::Envelope,
1261 >(encoder, max_ord);
1262
1263 for i in 1..=max_ord {
1264 match i {
1265 3 => {
1266 if let Some(value) = self.level_deps.take() {
1267 ::fidl_next::wire::Envelope::encode_value::<
1268 ::fidl_next::wire::Vector<
1269 'static,
1270 crate::wire::LevelTuple<'static>,
1271 >,
1272 ___E,
1273 >(
1274 value, preallocated.encoder, &mut out, (128, ())
1275 )?;
1276 } else {
1277 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1278 }
1279 }
1280
1281 2 => {
1282 if let Some(value) = self.parent.take() {
1283 ::fidl_next::wire::Envelope::encode_value::<
1284 crate::wire::ParentElement<'static>,
1285 ___E,
1286 >(
1287 value, preallocated.encoder, &mut out, ()
1288 )?;
1289 } else {
1290 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1291 }
1292 }
1293
1294 1 => {
1295 if let Some(value) = self.child.take() {
1296 ::fidl_next::wire::Envelope::encode_value::<
1297 ::fidl_next::wire::String<'static>,
1298 ___E,
1299 >(
1300 value, preallocated.encoder, &mut out, 63
1301 )?;
1302 } else {
1303 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1304 }
1305 }
1306
1307 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1308 }
1309 unsafe {
1310 preallocated.write_next(out.assume_init_ref());
1311 }
1312 }
1313
1314 ::fidl_next::wire::Table::encode_len(table, max_ord);
1315
1316 Ok(())
1317 }
1318 }
1319
1320 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PowerDependency<'static>, ___E>
1321 for &'a PowerDependency
1322 where
1323 ___E: ::fidl_next::Encoder + ?Sized,
1324 {
1325 #[inline]
1326 fn encode(
1327 self,
1328 encoder: &mut ___E,
1329 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerDependency<'static>>,
1330 _: (),
1331 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1332 ::fidl_next::munge!(let crate::wire::PowerDependency { table } = out);
1333
1334 let max_ord = self.__max_ordinal();
1335
1336 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1337 ::fidl_next::Wire::zero_padding(&mut out);
1338
1339 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1340 ::fidl_next::wire::Envelope,
1341 >(encoder, max_ord);
1342
1343 for i in 1..=max_ord {
1344 match i {
1345 3 => {
1346 if let Some(value) = &self.level_deps {
1347 ::fidl_next::wire::Envelope::encode_value::<
1348 ::fidl_next::wire::Vector<
1349 'static,
1350 crate::wire::LevelTuple<'static>,
1351 >,
1352 ___E,
1353 >(
1354 value, preallocated.encoder, &mut out, (128, ())
1355 )?;
1356 } else {
1357 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1358 }
1359 }
1360
1361 2 => {
1362 if let Some(value) = &self.parent {
1363 ::fidl_next::wire::Envelope::encode_value::<
1364 crate::wire::ParentElement<'static>,
1365 ___E,
1366 >(
1367 value, preallocated.encoder, &mut out, ()
1368 )?;
1369 } else {
1370 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1371 }
1372 }
1373
1374 1 => {
1375 if let Some(value) = &self.child {
1376 ::fidl_next::wire::Envelope::encode_value::<
1377 ::fidl_next::wire::String<'static>,
1378 ___E,
1379 >(
1380 value, preallocated.encoder, &mut out, 63
1381 )?;
1382 } else {
1383 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1384 }
1385 }
1386
1387 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1388 }
1389 unsafe {
1390 preallocated.write_next(out.assume_init_ref());
1391 }
1392 }
1393
1394 ::fidl_next::wire::Table::encode_len(table, max_ord);
1395
1396 Ok(())
1397 }
1398 }
1399
1400 impl<'de> ::fidl_next::FromWire<crate::wire::PowerDependency<'de>> for PowerDependency {
1401 #[inline]
1402 fn from_wire(wire_: crate::wire::PowerDependency<'de>) -> Self {
1403 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1404
1405 let child = wire_.table.get(1);
1406
1407 let parent = wire_.table.get(2);
1408
1409 let level_deps = wire_.table.get(3);
1410
1411 Self {
1412
1413
1414 child: child.map(|envelope| ::fidl_next::FromWire::from_wire(
1415 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
1416 )),
1417
1418
1419 parent: parent.map(|envelope| ::fidl_next::FromWire::from_wire(
1420 unsafe { envelope.read_unchecked::<crate::wire::ParentElement<'de>>() }
1421 )),
1422
1423
1424 level_deps: level_deps.map(|envelope| ::fidl_next::FromWire::from_wire(
1425 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>>() }
1426 )),
1427
1428 }
1429 }
1430 }
1431
1432 impl<'de> ::fidl_next::FromWireRef<crate::wire::PowerDependency<'de>> for PowerDependency {
1433 #[inline]
1434 fn from_wire_ref(wire: &crate::wire::PowerDependency<'de>) -> Self {
1435 Self {
1436
1437
1438 child: wire.table.get(1)
1439 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1440 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
1441 )),
1442
1443
1444 parent: wire.table.get(2)
1445 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1446 unsafe { envelope.deref_unchecked::<crate::wire::ParentElement<'de>>() }
1447 )),
1448
1449
1450 level_deps: wire.table.get(3)
1451 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1452 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>>() }
1453 )),
1454
1455 }
1456 }
1457 }
1458
1459 #[doc = " Contains the `PowerElement` description and any dependencies it has on\n other `PowerElement`s.\n"]
1460 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1461 pub struct PowerElementConfiguration {
1462 pub element: ::core::option::Option<crate::natural::PowerElement>,
1463
1464 pub dependencies: ::core::option::Option<::std::vec::Vec<crate::natural::PowerDependency>>,
1465 }
1466
1467 impl PowerElementConfiguration {
1468 fn __max_ordinal(&self) -> usize {
1469 if self.dependencies.is_some() {
1470 return 2;
1471 }
1472
1473 if self.element.is_some() {
1474 return 1;
1475 }
1476
1477 0
1478 }
1479 }
1480
1481 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerElementConfiguration<'static>, ___E>
1482 for PowerElementConfiguration
1483 where
1484 ___E: ::fidl_next::Encoder + ?Sized,
1485 {
1486 #[inline]
1487 fn encode(
1488 mut self,
1489 encoder: &mut ___E,
1490 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerElementConfiguration<'static>>,
1491 _: (),
1492 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1493 ::fidl_next::munge!(let crate::wire::PowerElementConfiguration { table } = out);
1494
1495 let max_ord = self.__max_ordinal();
1496
1497 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1498 ::fidl_next::Wire::zero_padding(&mut out);
1499
1500 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1501 ::fidl_next::wire::Envelope,
1502 >(encoder, max_ord);
1503
1504 for i in 1..=max_ord {
1505 match i {
1506 2 => {
1507 if let Some(value) = self.dependencies.take() {
1508 ::fidl_next::wire::Envelope::encode_value::<
1509 ::fidl_next::wire::Vector<
1510 'static,
1511 crate::wire::PowerDependency<'static>,
1512 >,
1513 ___E,
1514 >(
1515 value, preallocated.encoder, &mut out, (128, ())
1516 )?;
1517 } else {
1518 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1519 }
1520 }
1521
1522 1 => {
1523 if let Some(value) = self.element.take() {
1524 ::fidl_next::wire::Envelope::encode_value::<
1525 crate::wire::PowerElement<'static>,
1526 ___E,
1527 >(
1528 value, preallocated.encoder, &mut out, ()
1529 )?;
1530 } else {
1531 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1532 }
1533 }
1534
1535 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1536 }
1537 unsafe {
1538 preallocated.write_next(out.assume_init_ref());
1539 }
1540 }
1541
1542 ::fidl_next::wire::Table::encode_len(table, max_ord);
1543
1544 Ok(())
1545 }
1546 }
1547
1548 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PowerElementConfiguration<'static>, ___E>
1549 for &'a PowerElementConfiguration
1550 where
1551 ___E: ::fidl_next::Encoder + ?Sized,
1552 {
1553 #[inline]
1554 fn encode(
1555 self,
1556 encoder: &mut ___E,
1557 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerElementConfiguration<'static>>,
1558 _: (),
1559 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1560 ::fidl_next::munge!(let crate::wire::PowerElementConfiguration { table } = out);
1561
1562 let max_ord = self.__max_ordinal();
1563
1564 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1565 ::fidl_next::Wire::zero_padding(&mut out);
1566
1567 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1568 ::fidl_next::wire::Envelope,
1569 >(encoder, max_ord);
1570
1571 for i in 1..=max_ord {
1572 match i {
1573 2 => {
1574 if let Some(value) = &self.dependencies {
1575 ::fidl_next::wire::Envelope::encode_value::<
1576 ::fidl_next::wire::Vector<
1577 'static,
1578 crate::wire::PowerDependency<'static>,
1579 >,
1580 ___E,
1581 >(
1582 value, preallocated.encoder, &mut out, (128, ())
1583 )?;
1584 } else {
1585 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1586 }
1587 }
1588
1589 1 => {
1590 if let Some(value) = &self.element {
1591 ::fidl_next::wire::Envelope::encode_value::<
1592 crate::wire::PowerElement<'static>,
1593 ___E,
1594 >(
1595 value, preallocated.encoder, &mut out, ()
1596 )?;
1597 } else {
1598 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1599 }
1600 }
1601
1602 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1603 }
1604 unsafe {
1605 preallocated.write_next(out.assume_init_ref());
1606 }
1607 }
1608
1609 ::fidl_next::wire::Table::encode_len(table, max_ord);
1610
1611 Ok(())
1612 }
1613 }
1614
1615 impl<'de> ::fidl_next::FromWire<crate::wire::PowerElementConfiguration<'de>>
1616 for PowerElementConfiguration
1617 {
1618 #[inline]
1619 fn from_wire(wire_: crate::wire::PowerElementConfiguration<'de>) -> Self {
1620 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1621
1622 let element = wire_.table.get(1);
1623
1624 let dependencies = wire_.table.get(2);
1625
1626 Self {
1627
1628
1629 element: element.map(|envelope| ::fidl_next::FromWire::from_wire(
1630 unsafe { envelope.read_unchecked::<crate::wire::PowerElement<'de>>() }
1631 )),
1632
1633
1634 dependencies: dependencies.map(|envelope| ::fidl_next::FromWire::from_wire(
1635 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>>() }
1636 )),
1637
1638 }
1639 }
1640 }
1641
1642 impl<'de> ::fidl_next::FromWireRef<crate::wire::PowerElementConfiguration<'de>>
1643 for PowerElementConfiguration
1644 {
1645 #[inline]
1646 fn from_wire_ref(wire: &crate::wire::PowerElementConfiguration<'de>) -> Self {
1647 Self {
1648
1649
1650 element: wire.table.get(1)
1651 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1652 unsafe { envelope.deref_unchecked::<crate::wire::PowerElement<'de>>() }
1653 )),
1654
1655
1656 dependencies: wire.table.get(2)
1657 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
1658 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>>() }
1659 )),
1660
1661 }
1662 }
1663 }
1664
1665 #[doc = " The configuration for a component\'s power elements.\n"]
1666 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1667 pub struct ComponentPowerConfiguration {
1668 pub power_elements: ::std::vec::Vec<crate::natural::PowerElementConfiguration>,
1669 }
1670
1671 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ComponentPowerConfiguration<'static>, ___E>
1672 for ComponentPowerConfiguration
1673 where
1674 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1675 ___E: ::fidl_next::Encoder,
1676 {
1677 #[inline]
1678 fn encode(
1679 self,
1680 encoder_: &mut ___E,
1681 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentPowerConfiguration<'static>>,
1682 _: (),
1683 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1684 ::fidl_next::munge! {
1685 let crate::wire::ComponentPowerConfiguration {
1686 power_elements,
1687
1688 } = out_;
1689 }
1690
1691 ::fidl_next::Encode::encode(self.power_elements, encoder_, power_elements, (32, ()))?;
1692
1693 let mut _field =
1694 unsafe { ::fidl_next::Slot::new_unchecked(power_elements.as_mut_ptr()) };
1695 ::fidl_next::Constrained::validate(_field, (32, ()))?;
1696
1697 Ok(())
1698 }
1699 }
1700
1701 unsafe impl<'a, ___E>
1702 ::fidl_next::Encode<crate::wire::ComponentPowerConfiguration<'static>, ___E>
1703 for &'a ComponentPowerConfiguration
1704 where
1705 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1706 ___E: ::fidl_next::Encoder,
1707 {
1708 #[inline]
1709 fn encode(
1710 self,
1711 encoder_: &mut ___E,
1712 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentPowerConfiguration<'static>>,
1713 _: (),
1714 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1715 ::fidl_next::munge! {
1716 let crate::wire::ComponentPowerConfiguration {
1717 power_elements,
1718
1719 } = out_;
1720 }
1721
1722 ::fidl_next::Encode::encode(&self.power_elements, encoder_, power_elements, (32, ()))?;
1723
1724 let mut _field =
1725 unsafe { ::fidl_next::Slot::new_unchecked(power_elements.as_mut_ptr()) };
1726 ::fidl_next::Constrained::validate(_field, (32, ()))?;
1727
1728 Ok(())
1729 }
1730 }
1731
1732 unsafe impl<___E>
1733 ::fidl_next::EncodeOption<
1734 ::fidl_next::wire::Box<'static, crate::wire::ComponentPowerConfiguration<'static>>,
1735 ___E,
1736 > for ComponentPowerConfiguration
1737 where
1738 ___E: ::fidl_next::Encoder + ?Sized,
1739 ComponentPowerConfiguration:
1740 ::fidl_next::Encode<crate::wire::ComponentPowerConfiguration<'static>, ___E>,
1741 {
1742 #[inline]
1743 fn encode_option(
1744 this: ::core::option::Option<Self>,
1745 encoder: &mut ___E,
1746 out: &mut ::core::mem::MaybeUninit<
1747 ::fidl_next::wire::Box<'static, crate::wire::ComponentPowerConfiguration<'static>>,
1748 >,
1749 _: (),
1750 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1751 if let Some(inner) = this {
1752 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1753 ::fidl_next::wire::Box::encode_present(out);
1754 } else {
1755 ::fidl_next::wire::Box::encode_absent(out);
1756 }
1757
1758 Ok(())
1759 }
1760 }
1761
1762 unsafe impl<'a, ___E>
1763 ::fidl_next::EncodeOption<
1764 ::fidl_next::wire::Box<'static, crate::wire::ComponentPowerConfiguration<'static>>,
1765 ___E,
1766 > for &'a ComponentPowerConfiguration
1767 where
1768 ___E: ::fidl_next::Encoder + ?Sized,
1769 &'a ComponentPowerConfiguration:
1770 ::fidl_next::Encode<crate::wire::ComponentPowerConfiguration<'static>, ___E>,
1771 {
1772 #[inline]
1773 fn encode_option(
1774 this: ::core::option::Option<Self>,
1775 encoder: &mut ___E,
1776 out: &mut ::core::mem::MaybeUninit<
1777 ::fidl_next::wire::Box<'static, crate::wire::ComponentPowerConfiguration<'static>>,
1778 >,
1779 _: (),
1780 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1781 if let Some(inner) = this {
1782 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1783 ::fidl_next::wire::Box::encode_present(out);
1784 } else {
1785 ::fidl_next::wire::Box::encode_absent(out);
1786 }
1787
1788 Ok(())
1789 }
1790 }
1791
1792 impl<'de> ::fidl_next::FromWire<crate::wire::ComponentPowerConfiguration<'de>>
1793 for ComponentPowerConfiguration
1794 {
1795 #[inline]
1796 fn from_wire(wire: crate::wire::ComponentPowerConfiguration<'de>) -> Self {
1797 Self { power_elements: ::fidl_next::FromWire::from_wire(wire.power_elements) }
1798 }
1799 }
1800
1801 impl<'de> ::fidl_next::FromWireRef<crate::wire::ComponentPowerConfiguration<'de>>
1802 for ComponentPowerConfiguration
1803 {
1804 #[inline]
1805 fn from_wire_ref(wire: &crate::wire::ComponentPowerConfiguration<'de>) -> Self {
1806 Self { power_elements: ::fidl_next::FromWireRef::from_wire_ref(&wire.power_elements) }
1807 }
1808 }
1809
1810 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1811 #[repr(C)]
1812 pub struct DeviceRegisterPowerDomainRequest {
1813 pub min_needed_voltage: u32,
1814
1815 pub max_supported_voltage: u32,
1816 }
1817
1818 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceRegisterPowerDomainRequest, ___E>
1819 for DeviceRegisterPowerDomainRequest
1820 where
1821 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1822 {
1823 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1824 Self,
1825 crate::wire::DeviceRegisterPowerDomainRequest,
1826 > = unsafe {
1827 ::fidl_next::CopyOptimization::enable_if(
1828 true
1829
1830 && <
1831 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
1832 >::COPY_OPTIMIZATION.is_enabled()
1833
1834 && <
1835 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
1836 >::COPY_OPTIMIZATION.is_enabled()
1837
1838 )
1839 };
1840
1841 #[inline]
1842 fn encode(
1843 self,
1844 encoder_: &mut ___E,
1845 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterPowerDomainRequest>,
1846 _: (),
1847 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1848 ::fidl_next::munge! {
1849 let crate::wire::DeviceRegisterPowerDomainRequest {
1850 min_needed_voltage,
1851 max_supported_voltage,
1852
1853 } = out_;
1854 }
1855
1856 ::fidl_next::Encode::encode(self.min_needed_voltage, encoder_, min_needed_voltage, ())?;
1857
1858 let mut _field =
1859 unsafe { ::fidl_next::Slot::new_unchecked(min_needed_voltage.as_mut_ptr()) };
1860
1861 ::fidl_next::Encode::encode(
1862 self.max_supported_voltage,
1863 encoder_,
1864 max_supported_voltage,
1865 (),
1866 )?;
1867
1868 let mut _field =
1869 unsafe { ::fidl_next::Slot::new_unchecked(max_supported_voltage.as_mut_ptr()) };
1870
1871 Ok(())
1872 }
1873 }
1874
1875 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceRegisterPowerDomainRequest, ___E>
1876 for &'a DeviceRegisterPowerDomainRequest
1877 where
1878 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1879 {
1880 #[inline]
1881 fn encode(
1882 self,
1883 encoder_: &mut ___E,
1884 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterPowerDomainRequest>,
1885 _: (),
1886 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1887 ::fidl_next::munge! {
1888 let crate::wire::DeviceRegisterPowerDomainRequest {
1889 min_needed_voltage,
1890 max_supported_voltage,
1891
1892 } = out_;
1893 }
1894
1895 ::fidl_next::Encode::encode(
1896 &self.min_needed_voltage,
1897 encoder_,
1898 min_needed_voltage,
1899 (),
1900 )?;
1901
1902 let mut _field =
1903 unsafe { ::fidl_next::Slot::new_unchecked(min_needed_voltage.as_mut_ptr()) };
1904
1905 ::fidl_next::Encode::encode(
1906 &self.max_supported_voltage,
1907 encoder_,
1908 max_supported_voltage,
1909 (),
1910 )?;
1911
1912 let mut _field =
1913 unsafe { ::fidl_next::Slot::new_unchecked(max_supported_voltage.as_mut_ptr()) };
1914
1915 Ok(())
1916 }
1917 }
1918
1919 unsafe impl<___E>
1920 ::fidl_next::EncodeOption<
1921 ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterPowerDomainRequest>,
1922 ___E,
1923 > for DeviceRegisterPowerDomainRequest
1924 where
1925 ___E: ::fidl_next::Encoder + ?Sized,
1926 DeviceRegisterPowerDomainRequest:
1927 ::fidl_next::Encode<crate::wire::DeviceRegisterPowerDomainRequest, ___E>,
1928 {
1929 #[inline]
1930 fn encode_option(
1931 this: ::core::option::Option<Self>,
1932 encoder: &mut ___E,
1933 out: &mut ::core::mem::MaybeUninit<
1934 ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterPowerDomainRequest>,
1935 >,
1936 _: (),
1937 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1938 if let Some(inner) = this {
1939 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1940 ::fidl_next::wire::Box::encode_present(out);
1941 } else {
1942 ::fidl_next::wire::Box::encode_absent(out);
1943 }
1944
1945 Ok(())
1946 }
1947 }
1948
1949 unsafe impl<'a, ___E>
1950 ::fidl_next::EncodeOption<
1951 ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterPowerDomainRequest>,
1952 ___E,
1953 > for &'a DeviceRegisterPowerDomainRequest
1954 where
1955 ___E: ::fidl_next::Encoder + ?Sized,
1956 &'a DeviceRegisterPowerDomainRequest:
1957 ::fidl_next::Encode<crate::wire::DeviceRegisterPowerDomainRequest, ___E>,
1958 {
1959 #[inline]
1960 fn encode_option(
1961 this: ::core::option::Option<Self>,
1962 encoder: &mut ___E,
1963 out: &mut ::core::mem::MaybeUninit<
1964 ::fidl_next::wire::Box<'static, crate::wire::DeviceRegisterPowerDomainRequest>,
1965 >,
1966 _: (),
1967 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1968 if let Some(inner) = this {
1969 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1970 ::fidl_next::wire::Box::encode_present(out);
1971 } else {
1972 ::fidl_next::wire::Box::encode_absent(out);
1973 }
1974
1975 Ok(())
1976 }
1977 }
1978
1979 impl ::fidl_next::FromWire<crate::wire::DeviceRegisterPowerDomainRequest>
1980 for DeviceRegisterPowerDomainRequest
1981 {
1982 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1983 crate::wire::DeviceRegisterPowerDomainRequest,
1984 Self,
1985 > = unsafe {
1986 ::fidl_next::CopyOptimization::enable_if(
1987 true
1988 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
1989 .is_enabled()
1990 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
1991 .is_enabled(),
1992 )
1993 };
1994
1995 #[inline]
1996 fn from_wire(wire: crate::wire::DeviceRegisterPowerDomainRequest) -> Self {
1997 Self {
1998 min_needed_voltage: ::fidl_next::FromWire::from_wire(wire.min_needed_voltage),
1999
2000 max_supported_voltage: ::fidl_next::FromWire::from_wire(wire.max_supported_voltage),
2001 }
2002 }
2003 }
2004
2005 impl ::fidl_next::FromWireRef<crate::wire::DeviceRegisterPowerDomainRequest>
2006 for DeviceRegisterPowerDomainRequest
2007 {
2008 #[inline]
2009 fn from_wire_ref(wire: &crate::wire::DeviceRegisterPowerDomainRequest) -> Self {
2010 Self {
2011 min_needed_voltage: ::fidl_next::FromWireRef::from_wire_ref(
2012 &wire.min_needed_voltage,
2013 ),
2014
2015 max_supported_voltage: ::fidl_next::FromWireRef::from_wire_ref(
2016 &wire.max_supported_voltage,
2017 ),
2018 }
2019 }
2020 }
2021
2022 pub type DeviceRegisterPowerDomainResponse = ();
2023
2024 pub type DeviceUnregisterPowerDomainResponse = ();
2025
2026 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2027 #[repr(C)]
2028 pub struct DeviceGetSupportedVoltageRangeResponse {
2029 pub min: u32,
2030
2031 pub max: u32,
2032 }
2033
2034 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetSupportedVoltageRangeResponse, ___E>
2035 for DeviceGetSupportedVoltageRangeResponse
2036 where
2037 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2038 {
2039 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2040 Self,
2041 crate::wire::DeviceGetSupportedVoltageRangeResponse,
2042 > = unsafe {
2043 ::fidl_next::CopyOptimization::enable_if(
2044 true
2045
2046 && <
2047 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
2048 >::COPY_OPTIMIZATION.is_enabled()
2049
2050 && <
2051 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
2052 >::COPY_OPTIMIZATION.is_enabled()
2053
2054 )
2055 };
2056
2057 #[inline]
2058 fn encode(
2059 self,
2060 encoder_: &mut ___E,
2061 out_: &mut ::core::mem::MaybeUninit<
2062 crate::wire::DeviceGetSupportedVoltageRangeResponse,
2063 >,
2064 _: (),
2065 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2066 ::fidl_next::munge! {
2067 let crate::wire::DeviceGetSupportedVoltageRangeResponse {
2068 min,
2069 max,
2070
2071 } = out_;
2072 }
2073
2074 ::fidl_next::Encode::encode(self.min, encoder_, min, ())?;
2075
2076 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(min.as_mut_ptr()) };
2077
2078 ::fidl_next::Encode::encode(self.max, encoder_, max, ())?;
2079
2080 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(max.as_mut_ptr()) };
2081
2082 Ok(())
2083 }
2084 }
2085
2086 unsafe impl<'a, ___E>
2087 ::fidl_next::Encode<crate::wire::DeviceGetSupportedVoltageRangeResponse, ___E>
2088 for &'a DeviceGetSupportedVoltageRangeResponse
2089 where
2090 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2091 {
2092 #[inline]
2093 fn encode(
2094 self,
2095 encoder_: &mut ___E,
2096 out_: &mut ::core::mem::MaybeUninit<
2097 crate::wire::DeviceGetSupportedVoltageRangeResponse,
2098 >,
2099 _: (),
2100 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2101 ::fidl_next::munge! {
2102 let crate::wire::DeviceGetSupportedVoltageRangeResponse {
2103 min,
2104 max,
2105
2106 } = out_;
2107 }
2108
2109 ::fidl_next::Encode::encode(&self.min, encoder_, min, ())?;
2110
2111 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(min.as_mut_ptr()) };
2112
2113 ::fidl_next::Encode::encode(&self.max, encoder_, max, ())?;
2114
2115 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(max.as_mut_ptr()) };
2116
2117 Ok(())
2118 }
2119 }
2120
2121 unsafe impl<___E>
2122 ::fidl_next::EncodeOption<
2123 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetSupportedVoltageRangeResponse>,
2124 ___E,
2125 > for DeviceGetSupportedVoltageRangeResponse
2126 where
2127 ___E: ::fidl_next::Encoder + ?Sized,
2128 DeviceGetSupportedVoltageRangeResponse:
2129 ::fidl_next::Encode<crate::wire::DeviceGetSupportedVoltageRangeResponse, ___E>,
2130 {
2131 #[inline]
2132 fn encode_option(
2133 this: ::core::option::Option<Self>,
2134 encoder: &mut ___E,
2135 out: &mut ::core::mem::MaybeUninit<
2136 ::fidl_next::wire::Box<
2137 'static,
2138 crate::wire::DeviceGetSupportedVoltageRangeResponse,
2139 >,
2140 >,
2141 _: (),
2142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2143 if let Some(inner) = this {
2144 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2145 ::fidl_next::wire::Box::encode_present(out);
2146 } else {
2147 ::fidl_next::wire::Box::encode_absent(out);
2148 }
2149
2150 Ok(())
2151 }
2152 }
2153
2154 unsafe impl<'a, ___E>
2155 ::fidl_next::EncodeOption<
2156 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetSupportedVoltageRangeResponse>,
2157 ___E,
2158 > for &'a DeviceGetSupportedVoltageRangeResponse
2159 where
2160 ___E: ::fidl_next::Encoder + ?Sized,
2161 &'a DeviceGetSupportedVoltageRangeResponse:
2162 ::fidl_next::Encode<crate::wire::DeviceGetSupportedVoltageRangeResponse, ___E>,
2163 {
2164 #[inline]
2165 fn encode_option(
2166 this: ::core::option::Option<Self>,
2167 encoder: &mut ___E,
2168 out: &mut ::core::mem::MaybeUninit<
2169 ::fidl_next::wire::Box<
2170 'static,
2171 crate::wire::DeviceGetSupportedVoltageRangeResponse,
2172 >,
2173 >,
2174 _: (),
2175 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2176 if let Some(inner) = this {
2177 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2178 ::fidl_next::wire::Box::encode_present(out);
2179 } else {
2180 ::fidl_next::wire::Box::encode_absent(out);
2181 }
2182
2183 Ok(())
2184 }
2185 }
2186
2187 impl ::fidl_next::FromWire<crate::wire::DeviceGetSupportedVoltageRangeResponse>
2188 for DeviceGetSupportedVoltageRangeResponse
2189 {
2190 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2191 crate::wire::DeviceGetSupportedVoltageRangeResponse,
2192 Self,
2193 > = unsafe {
2194 ::fidl_next::CopyOptimization::enable_if(
2195 true
2196 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
2197 .is_enabled()
2198 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
2199 .is_enabled(),
2200 )
2201 };
2202
2203 #[inline]
2204 fn from_wire(wire: crate::wire::DeviceGetSupportedVoltageRangeResponse) -> Self {
2205 Self {
2206 min: ::fidl_next::FromWire::from_wire(wire.min),
2207
2208 max: ::fidl_next::FromWire::from_wire(wire.max),
2209 }
2210 }
2211 }
2212
2213 impl ::fidl_next::FromWireRef<crate::wire::DeviceGetSupportedVoltageRangeResponse>
2214 for DeviceGetSupportedVoltageRangeResponse
2215 {
2216 #[inline]
2217 fn from_wire_ref(wire: &crate::wire::DeviceGetSupportedVoltageRangeResponse) -> Self {
2218 Self {
2219 min: ::fidl_next::FromWireRef::from_wire_ref(&wire.min),
2220
2221 max: ::fidl_next::FromWireRef::from_wire_ref(&wire.max),
2222 }
2223 }
2224 }
2225
2226 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2227 #[repr(C)]
2228 pub struct DeviceRequestVoltageRequest {
2229 pub voltage: u32,
2230 }
2231
2232 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageRequest, ___E>
2233 for DeviceRequestVoltageRequest
2234 where
2235 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2236 {
2237 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2238 Self,
2239 crate::wire::DeviceRequestVoltageRequest,
2240 > = unsafe {
2241 ::fidl_next::CopyOptimization::enable_if(
2242 true
2243
2244 && <
2245 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
2246 >::COPY_OPTIMIZATION.is_enabled()
2247
2248 )
2249 };
2250
2251 #[inline]
2252 fn encode(
2253 self,
2254 encoder_: &mut ___E,
2255 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageRequest>,
2256 _: (),
2257 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2258 ::fidl_next::munge! {
2259 let crate::wire::DeviceRequestVoltageRequest {
2260 voltage,
2261
2262 } = out_;
2263 }
2264
2265 ::fidl_next::Encode::encode(self.voltage, encoder_, voltage, ())?;
2266
2267 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(voltage.as_mut_ptr()) };
2268
2269 Ok(())
2270 }
2271 }
2272
2273 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageRequest, ___E>
2274 for &'a DeviceRequestVoltageRequest
2275 where
2276 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2277 {
2278 #[inline]
2279 fn encode(
2280 self,
2281 encoder_: &mut ___E,
2282 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageRequest>,
2283 _: (),
2284 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2285 ::fidl_next::munge! {
2286 let crate::wire::DeviceRequestVoltageRequest {
2287 voltage,
2288
2289 } = out_;
2290 }
2291
2292 ::fidl_next::Encode::encode(&self.voltage, encoder_, voltage, ())?;
2293
2294 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(voltage.as_mut_ptr()) };
2295
2296 Ok(())
2297 }
2298 }
2299
2300 unsafe impl<___E>
2301 ::fidl_next::EncodeOption<
2302 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageRequest>,
2303 ___E,
2304 > for DeviceRequestVoltageRequest
2305 where
2306 ___E: ::fidl_next::Encoder + ?Sized,
2307 DeviceRequestVoltageRequest:
2308 ::fidl_next::Encode<crate::wire::DeviceRequestVoltageRequest, ___E>,
2309 {
2310 #[inline]
2311 fn encode_option(
2312 this: ::core::option::Option<Self>,
2313 encoder: &mut ___E,
2314 out: &mut ::core::mem::MaybeUninit<
2315 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageRequest>,
2316 >,
2317 _: (),
2318 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2319 if let Some(inner) = this {
2320 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2321 ::fidl_next::wire::Box::encode_present(out);
2322 } else {
2323 ::fidl_next::wire::Box::encode_absent(out);
2324 }
2325
2326 Ok(())
2327 }
2328 }
2329
2330 unsafe impl<'a, ___E>
2331 ::fidl_next::EncodeOption<
2332 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageRequest>,
2333 ___E,
2334 > for &'a DeviceRequestVoltageRequest
2335 where
2336 ___E: ::fidl_next::Encoder + ?Sized,
2337 &'a DeviceRequestVoltageRequest:
2338 ::fidl_next::Encode<crate::wire::DeviceRequestVoltageRequest, ___E>,
2339 {
2340 #[inline]
2341 fn encode_option(
2342 this: ::core::option::Option<Self>,
2343 encoder: &mut ___E,
2344 out: &mut ::core::mem::MaybeUninit<
2345 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageRequest>,
2346 >,
2347 _: (),
2348 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2349 if let Some(inner) = this {
2350 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2351 ::fidl_next::wire::Box::encode_present(out);
2352 } else {
2353 ::fidl_next::wire::Box::encode_absent(out);
2354 }
2355
2356 Ok(())
2357 }
2358 }
2359
2360 impl ::fidl_next::FromWire<crate::wire::DeviceRequestVoltageRequest>
2361 for DeviceRequestVoltageRequest
2362 {
2363 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2364 crate::wire::DeviceRequestVoltageRequest,
2365 Self,
2366 > = unsafe {
2367 ::fidl_next::CopyOptimization::enable_if(
2368 true
2369 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
2370 .is_enabled(),
2371 )
2372 };
2373
2374 #[inline]
2375 fn from_wire(wire: crate::wire::DeviceRequestVoltageRequest) -> Self {
2376 Self { voltage: ::fidl_next::FromWire::from_wire(wire.voltage) }
2377 }
2378 }
2379
2380 impl ::fidl_next::FromWireRef<crate::wire::DeviceRequestVoltageRequest>
2381 for DeviceRequestVoltageRequest
2382 {
2383 #[inline]
2384 fn from_wire_ref(wire: &crate::wire::DeviceRequestVoltageRequest) -> Self {
2385 Self { voltage: ::fidl_next::FromWireRef::from_wire_ref(&wire.voltage) }
2386 }
2387 }
2388
2389 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2390 #[repr(C)]
2391 pub struct DeviceRequestVoltageResponse {
2392 pub actual_voltage: u32,
2393 }
2394
2395 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageResponse, ___E>
2396 for DeviceRequestVoltageResponse
2397 where
2398 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2399 {
2400 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2401 Self,
2402 crate::wire::DeviceRequestVoltageResponse,
2403 > = unsafe {
2404 ::fidl_next::CopyOptimization::enable_if(
2405 true
2406
2407 && <
2408 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
2409 >::COPY_OPTIMIZATION.is_enabled()
2410
2411 )
2412 };
2413
2414 #[inline]
2415 fn encode(
2416 self,
2417 encoder_: &mut ___E,
2418 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageResponse>,
2419 _: (),
2420 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2421 ::fidl_next::munge! {
2422 let crate::wire::DeviceRequestVoltageResponse {
2423 actual_voltage,
2424
2425 } = out_;
2426 }
2427
2428 ::fidl_next::Encode::encode(self.actual_voltage, encoder_, actual_voltage, ())?;
2429
2430 let mut _field =
2431 unsafe { ::fidl_next::Slot::new_unchecked(actual_voltage.as_mut_ptr()) };
2432
2433 Ok(())
2434 }
2435 }
2436
2437 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageResponse, ___E>
2438 for &'a DeviceRequestVoltageResponse
2439 where
2440 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2441 {
2442 #[inline]
2443 fn encode(
2444 self,
2445 encoder_: &mut ___E,
2446 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageResponse>,
2447 _: (),
2448 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2449 ::fidl_next::munge! {
2450 let crate::wire::DeviceRequestVoltageResponse {
2451 actual_voltage,
2452
2453 } = out_;
2454 }
2455
2456 ::fidl_next::Encode::encode(&self.actual_voltage, encoder_, actual_voltage, ())?;
2457
2458 let mut _field =
2459 unsafe { ::fidl_next::Slot::new_unchecked(actual_voltage.as_mut_ptr()) };
2460
2461 Ok(())
2462 }
2463 }
2464
2465 unsafe impl<___E>
2466 ::fidl_next::EncodeOption<
2467 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageResponse>,
2468 ___E,
2469 > for DeviceRequestVoltageResponse
2470 where
2471 ___E: ::fidl_next::Encoder + ?Sized,
2472 DeviceRequestVoltageResponse:
2473 ::fidl_next::Encode<crate::wire::DeviceRequestVoltageResponse, ___E>,
2474 {
2475 #[inline]
2476 fn encode_option(
2477 this: ::core::option::Option<Self>,
2478 encoder: &mut ___E,
2479 out: &mut ::core::mem::MaybeUninit<
2480 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageResponse>,
2481 >,
2482 _: (),
2483 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2484 if let Some(inner) = this {
2485 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2486 ::fidl_next::wire::Box::encode_present(out);
2487 } else {
2488 ::fidl_next::wire::Box::encode_absent(out);
2489 }
2490
2491 Ok(())
2492 }
2493 }
2494
2495 unsafe impl<'a, ___E>
2496 ::fidl_next::EncodeOption<
2497 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageResponse>,
2498 ___E,
2499 > for &'a DeviceRequestVoltageResponse
2500 where
2501 ___E: ::fidl_next::Encoder + ?Sized,
2502 &'a DeviceRequestVoltageResponse:
2503 ::fidl_next::Encode<crate::wire::DeviceRequestVoltageResponse, ___E>,
2504 {
2505 #[inline]
2506 fn encode_option(
2507 this: ::core::option::Option<Self>,
2508 encoder: &mut ___E,
2509 out: &mut ::core::mem::MaybeUninit<
2510 ::fidl_next::wire::Box<'static, crate::wire::DeviceRequestVoltageResponse>,
2511 >,
2512 _: (),
2513 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2514 if let Some(inner) = this {
2515 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2516 ::fidl_next::wire::Box::encode_present(out);
2517 } else {
2518 ::fidl_next::wire::Box::encode_absent(out);
2519 }
2520
2521 Ok(())
2522 }
2523 }
2524
2525 impl ::fidl_next::FromWire<crate::wire::DeviceRequestVoltageResponse>
2526 for DeviceRequestVoltageResponse
2527 {
2528 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2529 crate::wire::DeviceRequestVoltageResponse,
2530 Self,
2531 > = unsafe {
2532 ::fidl_next::CopyOptimization::enable_if(
2533 true
2534 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
2535 .is_enabled(),
2536 )
2537 };
2538
2539 #[inline]
2540 fn from_wire(wire: crate::wire::DeviceRequestVoltageResponse) -> Self {
2541 Self { actual_voltage: ::fidl_next::FromWire::from_wire(wire.actual_voltage) }
2542 }
2543 }
2544
2545 impl ::fidl_next::FromWireRef<crate::wire::DeviceRequestVoltageResponse>
2546 for DeviceRequestVoltageResponse
2547 {
2548 #[inline]
2549 fn from_wire_ref(wire: &crate::wire::DeviceRequestVoltageResponse) -> Self {
2550 Self { actual_voltage: ::fidl_next::FromWireRef::from_wire_ref(&wire.actual_voltage) }
2551 }
2552 }
2553
2554 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2555 #[repr(C)]
2556 pub struct DeviceGetCurrentVoltageRequest {
2557 pub index: u32,
2558 }
2559
2560 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageRequest, ___E>
2561 for DeviceGetCurrentVoltageRequest
2562 where
2563 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2564 {
2565 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2566 Self,
2567 crate::wire::DeviceGetCurrentVoltageRequest,
2568 > = unsafe {
2569 ::fidl_next::CopyOptimization::enable_if(
2570 true
2571
2572 && <
2573 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
2574 >::COPY_OPTIMIZATION.is_enabled()
2575
2576 )
2577 };
2578
2579 #[inline]
2580 fn encode(
2581 self,
2582 encoder_: &mut ___E,
2583 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageRequest>,
2584 _: (),
2585 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2586 ::fidl_next::munge! {
2587 let crate::wire::DeviceGetCurrentVoltageRequest {
2588 index,
2589
2590 } = out_;
2591 }
2592
2593 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
2594
2595 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(index.as_mut_ptr()) };
2596
2597 Ok(())
2598 }
2599 }
2600
2601 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageRequest, ___E>
2602 for &'a DeviceGetCurrentVoltageRequest
2603 where
2604 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2605 {
2606 #[inline]
2607 fn encode(
2608 self,
2609 encoder_: &mut ___E,
2610 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageRequest>,
2611 _: (),
2612 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2613 ::fidl_next::munge! {
2614 let crate::wire::DeviceGetCurrentVoltageRequest {
2615 index,
2616
2617 } = out_;
2618 }
2619
2620 ::fidl_next::Encode::encode(&self.index, encoder_, index, ())?;
2621
2622 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(index.as_mut_ptr()) };
2623
2624 Ok(())
2625 }
2626 }
2627
2628 unsafe impl<___E>
2629 ::fidl_next::EncodeOption<
2630 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageRequest>,
2631 ___E,
2632 > for DeviceGetCurrentVoltageRequest
2633 where
2634 ___E: ::fidl_next::Encoder + ?Sized,
2635 DeviceGetCurrentVoltageRequest:
2636 ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageRequest, ___E>,
2637 {
2638 #[inline]
2639 fn encode_option(
2640 this: ::core::option::Option<Self>,
2641 encoder: &mut ___E,
2642 out: &mut ::core::mem::MaybeUninit<
2643 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageRequest>,
2644 >,
2645 _: (),
2646 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2647 if let Some(inner) = this {
2648 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2649 ::fidl_next::wire::Box::encode_present(out);
2650 } else {
2651 ::fidl_next::wire::Box::encode_absent(out);
2652 }
2653
2654 Ok(())
2655 }
2656 }
2657
2658 unsafe impl<'a, ___E>
2659 ::fidl_next::EncodeOption<
2660 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageRequest>,
2661 ___E,
2662 > for &'a DeviceGetCurrentVoltageRequest
2663 where
2664 ___E: ::fidl_next::Encoder + ?Sized,
2665 &'a DeviceGetCurrentVoltageRequest:
2666 ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageRequest, ___E>,
2667 {
2668 #[inline]
2669 fn encode_option(
2670 this: ::core::option::Option<Self>,
2671 encoder: &mut ___E,
2672 out: &mut ::core::mem::MaybeUninit<
2673 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageRequest>,
2674 >,
2675 _: (),
2676 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2677 if let Some(inner) = this {
2678 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2679 ::fidl_next::wire::Box::encode_present(out);
2680 } else {
2681 ::fidl_next::wire::Box::encode_absent(out);
2682 }
2683
2684 Ok(())
2685 }
2686 }
2687
2688 impl ::fidl_next::FromWire<crate::wire::DeviceGetCurrentVoltageRequest>
2689 for DeviceGetCurrentVoltageRequest
2690 {
2691 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2692 crate::wire::DeviceGetCurrentVoltageRequest,
2693 Self,
2694 > = unsafe {
2695 ::fidl_next::CopyOptimization::enable_if(
2696 true
2697 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
2698 .is_enabled(),
2699 )
2700 };
2701
2702 #[inline]
2703 fn from_wire(wire: crate::wire::DeviceGetCurrentVoltageRequest) -> Self {
2704 Self { index: ::fidl_next::FromWire::from_wire(wire.index) }
2705 }
2706 }
2707
2708 impl ::fidl_next::FromWireRef<crate::wire::DeviceGetCurrentVoltageRequest>
2709 for DeviceGetCurrentVoltageRequest
2710 {
2711 #[inline]
2712 fn from_wire_ref(wire: &crate::wire::DeviceGetCurrentVoltageRequest) -> Self {
2713 Self { index: ::fidl_next::FromWireRef::from_wire_ref(&wire.index) }
2714 }
2715 }
2716
2717 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2718 #[repr(C)]
2719 pub struct DeviceGetCurrentVoltageResponse {
2720 pub current_voltage: u32,
2721 }
2722
2723 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageResponse, ___E>
2724 for DeviceGetCurrentVoltageResponse
2725 where
2726 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2727 {
2728 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2729 Self,
2730 crate::wire::DeviceGetCurrentVoltageResponse,
2731 > = unsafe {
2732 ::fidl_next::CopyOptimization::enable_if(
2733 true
2734
2735 && <
2736 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
2737 >::COPY_OPTIMIZATION.is_enabled()
2738
2739 )
2740 };
2741
2742 #[inline]
2743 fn encode(
2744 self,
2745 encoder_: &mut ___E,
2746 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageResponse>,
2747 _: (),
2748 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2749 ::fidl_next::munge! {
2750 let crate::wire::DeviceGetCurrentVoltageResponse {
2751 current_voltage,
2752
2753 } = out_;
2754 }
2755
2756 ::fidl_next::Encode::encode(self.current_voltage, encoder_, current_voltage, ())?;
2757
2758 let mut _field =
2759 unsafe { ::fidl_next::Slot::new_unchecked(current_voltage.as_mut_ptr()) };
2760
2761 Ok(())
2762 }
2763 }
2764
2765 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageResponse, ___E>
2766 for &'a DeviceGetCurrentVoltageResponse
2767 where
2768 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2769 {
2770 #[inline]
2771 fn encode(
2772 self,
2773 encoder_: &mut ___E,
2774 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageResponse>,
2775 _: (),
2776 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2777 ::fidl_next::munge! {
2778 let crate::wire::DeviceGetCurrentVoltageResponse {
2779 current_voltage,
2780
2781 } = out_;
2782 }
2783
2784 ::fidl_next::Encode::encode(&self.current_voltage, encoder_, current_voltage, ())?;
2785
2786 let mut _field =
2787 unsafe { ::fidl_next::Slot::new_unchecked(current_voltage.as_mut_ptr()) };
2788
2789 Ok(())
2790 }
2791 }
2792
2793 unsafe impl<___E>
2794 ::fidl_next::EncodeOption<
2795 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageResponse>,
2796 ___E,
2797 > for DeviceGetCurrentVoltageResponse
2798 where
2799 ___E: ::fidl_next::Encoder + ?Sized,
2800 DeviceGetCurrentVoltageResponse:
2801 ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageResponse, ___E>,
2802 {
2803 #[inline]
2804 fn encode_option(
2805 this: ::core::option::Option<Self>,
2806 encoder: &mut ___E,
2807 out: &mut ::core::mem::MaybeUninit<
2808 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageResponse>,
2809 >,
2810 _: (),
2811 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2812 if let Some(inner) = this {
2813 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2814 ::fidl_next::wire::Box::encode_present(out);
2815 } else {
2816 ::fidl_next::wire::Box::encode_absent(out);
2817 }
2818
2819 Ok(())
2820 }
2821 }
2822
2823 unsafe impl<'a, ___E>
2824 ::fidl_next::EncodeOption<
2825 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageResponse>,
2826 ___E,
2827 > for &'a DeviceGetCurrentVoltageResponse
2828 where
2829 ___E: ::fidl_next::Encoder + ?Sized,
2830 &'a DeviceGetCurrentVoltageResponse:
2831 ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageResponse, ___E>,
2832 {
2833 #[inline]
2834 fn encode_option(
2835 this: ::core::option::Option<Self>,
2836 encoder: &mut ___E,
2837 out: &mut ::core::mem::MaybeUninit<
2838 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetCurrentVoltageResponse>,
2839 >,
2840 _: (),
2841 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2842 if let Some(inner) = this {
2843 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2844 ::fidl_next::wire::Box::encode_present(out);
2845 } else {
2846 ::fidl_next::wire::Box::encode_absent(out);
2847 }
2848
2849 Ok(())
2850 }
2851 }
2852
2853 impl ::fidl_next::FromWire<crate::wire::DeviceGetCurrentVoltageResponse>
2854 for DeviceGetCurrentVoltageResponse
2855 {
2856 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2857 crate::wire::DeviceGetCurrentVoltageResponse,
2858 Self,
2859 > = unsafe {
2860 ::fidl_next::CopyOptimization::enable_if(
2861 true
2862 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
2863 .is_enabled(),
2864 )
2865 };
2866
2867 #[inline]
2868 fn from_wire(wire: crate::wire::DeviceGetCurrentVoltageResponse) -> Self {
2869 Self { current_voltage: ::fidl_next::FromWire::from_wire(wire.current_voltage) }
2870 }
2871 }
2872
2873 impl ::fidl_next::FromWireRef<crate::wire::DeviceGetCurrentVoltageResponse>
2874 for DeviceGetCurrentVoltageResponse
2875 {
2876 #[inline]
2877 fn from_wire_ref(wire: &crate::wire::DeviceGetCurrentVoltageResponse) -> Self {
2878 Self { current_voltage: ::fidl_next::FromWireRef::from_wire_ref(&wire.current_voltage) }
2879 }
2880 }
2881
2882 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2883 #[repr(u8)]
2884 pub enum PowerDomainStatus {
2885 Disabled = 1,
2886 Enabled = 2,
2887 }
2888 impl ::core::convert::TryFrom<u8> for PowerDomainStatus {
2889 type Error = ::fidl_next::UnknownStrictEnumMemberError;
2890 fn try_from(
2891 value: u8,
2892 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
2893 match value {
2894 1 => Ok(Self::Disabled),
2895 2 => Ok(Self::Enabled),
2896
2897 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
2898 }
2899 }
2900 }
2901
2902 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerDomainStatus, ___E> for PowerDomainStatus
2903 where
2904 ___E: ?Sized,
2905 {
2906 #[inline]
2907 fn encode(
2908 self,
2909 encoder: &mut ___E,
2910 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerDomainStatus>,
2911 _: (),
2912 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2913 ::fidl_next::Encode::encode(&self, encoder, out, ())
2914 }
2915 }
2916
2917 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PowerDomainStatus, ___E>
2918 for &'a PowerDomainStatus
2919 where
2920 ___E: ?Sized,
2921 {
2922 #[inline]
2923 fn encode(
2924 self,
2925 encoder: &mut ___E,
2926 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerDomainStatus>,
2927 _: (),
2928 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2929 ::fidl_next::munge!(let crate::wire::PowerDomainStatus { value } = out);
2930 let _ = value.write(u8::from(match *self {
2931 PowerDomainStatus::Disabled => 1,
2932
2933 PowerDomainStatus::Enabled => 2,
2934 }));
2935
2936 Ok(())
2937 }
2938 }
2939
2940 impl ::core::convert::From<crate::wire::PowerDomainStatus> for PowerDomainStatus {
2941 fn from(wire: crate::wire::PowerDomainStatus) -> Self {
2942 match u8::from(wire.value) {
2943 1 => Self::Disabled,
2944
2945 2 => Self::Enabled,
2946
2947 _ => unsafe { ::core::hint::unreachable_unchecked() },
2948 }
2949 }
2950 }
2951
2952 impl ::fidl_next::FromWire<crate::wire::PowerDomainStatus> for PowerDomainStatus {
2953 #[inline]
2954 fn from_wire(wire: crate::wire::PowerDomainStatus) -> Self {
2955 Self::from(wire)
2956 }
2957 }
2958
2959 impl ::fidl_next::FromWireRef<crate::wire::PowerDomainStatus> for PowerDomainStatus {
2960 #[inline]
2961 fn from_wire_ref(wire: &crate::wire::PowerDomainStatus) -> Self {
2962 Self::from(*wire)
2963 }
2964 }
2965
2966 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2967 #[repr(C)]
2968 pub struct DeviceGetPowerDomainStatusResponse {
2969 pub status: crate::natural::PowerDomainStatus,
2970 }
2971
2972 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetPowerDomainStatusResponse, ___E>
2973 for DeviceGetPowerDomainStatusResponse
2974 where
2975 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2976 {
2977 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
2978 Self,
2979 crate::wire::DeviceGetPowerDomainStatusResponse,
2980 > = unsafe {
2981 ::fidl_next::CopyOptimization::enable_if(
2982 true && <crate::natural::PowerDomainStatus as ::fidl_next::Encode<
2983 crate::wire::PowerDomainStatus,
2984 ___E,
2985 >>::COPY_OPTIMIZATION
2986 .is_enabled(),
2987 )
2988 };
2989
2990 #[inline]
2991 fn encode(
2992 self,
2993 encoder_: &mut ___E,
2994 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPowerDomainStatusResponse>,
2995 _: (),
2996 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2997 ::fidl_next::munge! {
2998 let crate::wire::DeviceGetPowerDomainStatusResponse {
2999 status,
3000
3001 } = out_;
3002 }
3003
3004 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
3005
3006 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
3007
3008 Ok(())
3009 }
3010 }
3011
3012 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceGetPowerDomainStatusResponse, ___E>
3013 for &'a DeviceGetPowerDomainStatusResponse
3014 where
3015 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3016 {
3017 #[inline]
3018 fn encode(
3019 self,
3020 encoder_: &mut ___E,
3021 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPowerDomainStatusResponse>,
3022 _: (),
3023 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3024 ::fidl_next::munge! {
3025 let crate::wire::DeviceGetPowerDomainStatusResponse {
3026 status,
3027
3028 } = out_;
3029 }
3030
3031 ::fidl_next::Encode::encode(&self.status, encoder_, status, ())?;
3032
3033 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
3034
3035 Ok(())
3036 }
3037 }
3038
3039 unsafe impl<___E>
3040 ::fidl_next::EncodeOption<
3041 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPowerDomainStatusResponse>,
3042 ___E,
3043 > for DeviceGetPowerDomainStatusResponse
3044 where
3045 ___E: ::fidl_next::Encoder + ?Sized,
3046 DeviceGetPowerDomainStatusResponse:
3047 ::fidl_next::Encode<crate::wire::DeviceGetPowerDomainStatusResponse, ___E>,
3048 {
3049 #[inline]
3050 fn encode_option(
3051 this: ::core::option::Option<Self>,
3052 encoder: &mut ___E,
3053 out: &mut ::core::mem::MaybeUninit<
3054 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPowerDomainStatusResponse>,
3055 >,
3056 _: (),
3057 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3058 if let Some(inner) = this {
3059 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3060 ::fidl_next::wire::Box::encode_present(out);
3061 } else {
3062 ::fidl_next::wire::Box::encode_absent(out);
3063 }
3064
3065 Ok(())
3066 }
3067 }
3068
3069 unsafe impl<'a, ___E>
3070 ::fidl_next::EncodeOption<
3071 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPowerDomainStatusResponse>,
3072 ___E,
3073 > for &'a DeviceGetPowerDomainStatusResponse
3074 where
3075 ___E: ::fidl_next::Encoder + ?Sized,
3076 &'a DeviceGetPowerDomainStatusResponse:
3077 ::fidl_next::Encode<crate::wire::DeviceGetPowerDomainStatusResponse, ___E>,
3078 {
3079 #[inline]
3080 fn encode_option(
3081 this: ::core::option::Option<Self>,
3082 encoder: &mut ___E,
3083 out: &mut ::core::mem::MaybeUninit<
3084 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetPowerDomainStatusResponse>,
3085 >,
3086 _: (),
3087 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3088 if let Some(inner) = this {
3089 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3090 ::fidl_next::wire::Box::encode_present(out);
3091 } else {
3092 ::fidl_next::wire::Box::encode_absent(out);
3093 }
3094
3095 Ok(())
3096 }
3097 }
3098
3099 impl ::fidl_next::FromWire<crate::wire::DeviceGetPowerDomainStatusResponse>
3100 for DeviceGetPowerDomainStatusResponse
3101 {
3102 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3103 crate::wire::DeviceGetPowerDomainStatusResponse,
3104 Self,
3105 > = unsafe {
3106 ::fidl_next::CopyOptimization::enable_if(
3107 true && <crate::natural::PowerDomainStatus as ::fidl_next::FromWire<
3108 crate::wire::PowerDomainStatus,
3109 >>::COPY_OPTIMIZATION
3110 .is_enabled(),
3111 )
3112 };
3113
3114 #[inline]
3115 fn from_wire(wire: crate::wire::DeviceGetPowerDomainStatusResponse) -> Self {
3116 Self { status: ::fidl_next::FromWire::from_wire(wire.status) }
3117 }
3118 }
3119
3120 impl ::fidl_next::FromWireRef<crate::wire::DeviceGetPowerDomainStatusResponse>
3121 for DeviceGetPowerDomainStatusResponse
3122 {
3123 #[inline]
3124 fn from_wire_ref(wire: &crate::wire::DeviceGetPowerDomainStatusResponse) -> Self {
3125 Self { status: ::fidl_next::FromWireRef::from_wire_ref(&wire.status) }
3126 }
3127 }
3128
3129 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3130 #[repr(C)]
3131 pub struct DeviceWritePmicCtrlRegRequest {
3132 pub reg_addr: u32,
3133
3134 pub value: u32,
3135 }
3136
3137 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceWritePmicCtrlRegRequest, ___E>
3138 for DeviceWritePmicCtrlRegRequest
3139 where
3140 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3141 {
3142 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3143 Self,
3144 crate::wire::DeviceWritePmicCtrlRegRequest,
3145 > = unsafe {
3146 ::fidl_next::CopyOptimization::enable_if(
3147 true
3148
3149 && <
3150 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
3151 >::COPY_OPTIMIZATION.is_enabled()
3152
3153 && <
3154 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
3155 >::COPY_OPTIMIZATION.is_enabled()
3156
3157 )
3158 };
3159
3160 #[inline]
3161 fn encode(
3162 self,
3163 encoder_: &mut ___E,
3164 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceWritePmicCtrlRegRequest>,
3165 _: (),
3166 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3167 ::fidl_next::munge! {
3168 let crate::wire::DeviceWritePmicCtrlRegRequest {
3169 reg_addr,
3170 value,
3171
3172 } = out_;
3173 }
3174
3175 ::fidl_next::Encode::encode(self.reg_addr, encoder_, reg_addr, ())?;
3176
3177 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reg_addr.as_mut_ptr()) };
3178
3179 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
3180
3181 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
3182
3183 Ok(())
3184 }
3185 }
3186
3187 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceWritePmicCtrlRegRequest, ___E>
3188 for &'a DeviceWritePmicCtrlRegRequest
3189 where
3190 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3191 {
3192 #[inline]
3193 fn encode(
3194 self,
3195 encoder_: &mut ___E,
3196 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceWritePmicCtrlRegRequest>,
3197 _: (),
3198 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3199 ::fidl_next::munge! {
3200 let crate::wire::DeviceWritePmicCtrlRegRequest {
3201 reg_addr,
3202 value,
3203
3204 } = out_;
3205 }
3206
3207 ::fidl_next::Encode::encode(&self.reg_addr, encoder_, reg_addr, ())?;
3208
3209 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reg_addr.as_mut_ptr()) };
3210
3211 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
3212
3213 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
3214
3215 Ok(())
3216 }
3217 }
3218
3219 unsafe impl<___E>
3220 ::fidl_next::EncodeOption<
3221 ::fidl_next::wire::Box<'static, crate::wire::DeviceWritePmicCtrlRegRequest>,
3222 ___E,
3223 > for DeviceWritePmicCtrlRegRequest
3224 where
3225 ___E: ::fidl_next::Encoder + ?Sized,
3226 DeviceWritePmicCtrlRegRequest:
3227 ::fidl_next::Encode<crate::wire::DeviceWritePmicCtrlRegRequest, ___E>,
3228 {
3229 #[inline]
3230 fn encode_option(
3231 this: ::core::option::Option<Self>,
3232 encoder: &mut ___E,
3233 out: &mut ::core::mem::MaybeUninit<
3234 ::fidl_next::wire::Box<'static, crate::wire::DeviceWritePmicCtrlRegRequest>,
3235 >,
3236 _: (),
3237 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3238 if let Some(inner) = this {
3239 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3240 ::fidl_next::wire::Box::encode_present(out);
3241 } else {
3242 ::fidl_next::wire::Box::encode_absent(out);
3243 }
3244
3245 Ok(())
3246 }
3247 }
3248
3249 unsafe impl<'a, ___E>
3250 ::fidl_next::EncodeOption<
3251 ::fidl_next::wire::Box<'static, crate::wire::DeviceWritePmicCtrlRegRequest>,
3252 ___E,
3253 > for &'a DeviceWritePmicCtrlRegRequest
3254 where
3255 ___E: ::fidl_next::Encoder + ?Sized,
3256 &'a DeviceWritePmicCtrlRegRequest:
3257 ::fidl_next::Encode<crate::wire::DeviceWritePmicCtrlRegRequest, ___E>,
3258 {
3259 #[inline]
3260 fn encode_option(
3261 this: ::core::option::Option<Self>,
3262 encoder: &mut ___E,
3263 out: &mut ::core::mem::MaybeUninit<
3264 ::fidl_next::wire::Box<'static, crate::wire::DeviceWritePmicCtrlRegRequest>,
3265 >,
3266 _: (),
3267 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3268 if let Some(inner) = this {
3269 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3270 ::fidl_next::wire::Box::encode_present(out);
3271 } else {
3272 ::fidl_next::wire::Box::encode_absent(out);
3273 }
3274
3275 Ok(())
3276 }
3277 }
3278
3279 impl ::fidl_next::FromWire<crate::wire::DeviceWritePmicCtrlRegRequest>
3280 for DeviceWritePmicCtrlRegRequest
3281 {
3282 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3283 crate::wire::DeviceWritePmicCtrlRegRequest,
3284 Self,
3285 > = unsafe {
3286 ::fidl_next::CopyOptimization::enable_if(
3287 true
3288 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
3289 .is_enabled()
3290 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
3291 .is_enabled(),
3292 )
3293 };
3294
3295 #[inline]
3296 fn from_wire(wire: crate::wire::DeviceWritePmicCtrlRegRequest) -> Self {
3297 Self {
3298 reg_addr: ::fidl_next::FromWire::from_wire(wire.reg_addr),
3299
3300 value: ::fidl_next::FromWire::from_wire(wire.value),
3301 }
3302 }
3303 }
3304
3305 impl ::fidl_next::FromWireRef<crate::wire::DeviceWritePmicCtrlRegRequest>
3306 for DeviceWritePmicCtrlRegRequest
3307 {
3308 #[inline]
3309 fn from_wire_ref(wire: &crate::wire::DeviceWritePmicCtrlRegRequest) -> Self {
3310 Self {
3311 reg_addr: ::fidl_next::FromWireRef::from_wire_ref(&wire.reg_addr),
3312
3313 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
3314 }
3315 }
3316 }
3317
3318 pub type DeviceWritePmicCtrlRegResponse = ();
3319
3320 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3321 #[repr(C)]
3322 pub struct DeviceReadPmicCtrlRegRequest {
3323 pub reg_addr: u32,
3324 }
3325
3326 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegRequest, ___E>
3327 for DeviceReadPmicCtrlRegRequest
3328 where
3329 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3330 {
3331 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3332 Self,
3333 crate::wire::DeviceReadPmicCtrlRegRequest,
3334 > = unsafe {
3335 ::fidl_next::CopyOptimization::enable_if(
3336 true
3337
3338 && <
3339 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
3340 >::COPY_OPTIMIZATION.is_enabled()
3341
3342 )
3343 };
3344
3345 #[inline]
3346 fn encode(
3347 self,
3348 encoder_: &mut ___E,
3349 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegRequest>,
3350 _: (),
3351 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3352 ::fidl_next::munge! {
3353 let crate::wire::DeviceReadPmicCtrlRegRequest {
3354 reg_addr,
3355
3356 } = out_;
3357 }
3358
3359 ::fidl_next::Encode::encode(self.reg_addr, encoder_, reg_addr, ())?;
3360
3361 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reg_addr.as_mut_ptr()) };
3362
3363 Ok(())
3364 }
3365 }
3366
3367 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegRequest, ___E>
3368 for &'a DeviceReadPmicCtrlRegRequest
3369 where
3370 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3371 {
3372 #[inline]
3373 fn encode(
3374 self,
3375 encoder_: &mut ___E,
3376 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegRequest>,
3377 _: (),
3378 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3379 ::fidl_next::munge! {
3380 let crate::wire::DeviceReadPmicCtrlRegRequest {
3381 reg_addr,
3382
3383 } = out_;
3384 }
3385
3386 ::fidl_next::Encode::encode(&self.reg_addr, encoder_, reg_addr, ())?;
3387
3388 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reg_addr.as_mut_ptr()) };
3389
3390 Ok(())
3391 }
3392 }
3393
3394 unsafe impl<___E>
3395 ::fidl_next::EncodeOption<
3396 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegRequest>,
3397 ___E,
3398 > for DeviceReadPmicCtrlRegRequest
3399 where
3400 ___E: ::fidl_next::Encoder + ?Sized,
3401 DeviceReadPmicCtrlRegRequest:
3402 ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegRequest, ___E>,
3403 {
3404 #[inline]
3405 fn encode_option(
3406 this: ::core::option::Option<Self>,
3407 encoder: &mut ___E,
3408 out: &mut ::core::mem::MaybeUninit<
3409 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegRequest>,
3410 >,
3411 _: (),
3412 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3413 if let Some(inner) = this {
3414 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3415 ::fidl_next::wire::Box::encode_present(out);
3416 } else {
3417 ::fidl_next::wire::Box::encode_absent(out);
3418 }
3419
3420 Ok(())
3421 }
3422 }
3423
3424 unsafe impl<'a, ___E>
3425 ::fidl_next::EncodeOption<
3426 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegRequest>,
3427 ___E,
3428 > for &'a DeviceReadPmicCtrlRegRequest
3429 where
3430 ___E: ::fidl_next::Encoder + ?Sized,
3431 &'a DeviceReadPmicCtrlRegRequest:
3432 ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegRequest, ___E>,
3433 {
3434 #[inline]
3435 fn encode_option(
3436 this: ::core::option::Option<Self>,
3437 encoder: &mut ___E,
3438 out: &mut ::core::mem::MaybeUninit<
3439 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegRequest>,
3440 >,
3441 _: (),
3442 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3443 if let Some(inner) = this {
3444 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3445 ::fidl_next::wire::Box::encode_present(out);
3446 } else {
3447 ::fidl_next::wire::Box::encode_absent(out);
3448 }
3449
3450 Ok(())
3451 }
3452 }
3453
3454 impl ::fidl_next::FromWire<crate::wire::DeviceReadPmicCtrlRegRequest>
3455 for DeviceReadPmicCtrlRegRequest
3456 {
3457 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3458 crate::wire::DeviceReadPmicCtrlRegRequest,
3459 Self,
3460 > = unsafe {
3461 ::fidl_next::CopyOptimization::enable_if(
3462 true
3463 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
3464 .is_enabled(),
3465 )
3466 };
3467
3468 #[inline]
3469 fn from_wire(wire: crate::wire::DeviceReadPmicCtrlRegRequest) -> Self {
3470 Self { reg_addr: ::fidl_next::FromWire::from_wire(wire.reg_addr) }
3471 }
3472 }
3473
3474 impl ::fidl_next::FromWireRef<crate::wire::DeviceReadPmicCtrlRegRequest>
3475 for DeviceReadPmicCtrlRegRequest
3476 {
3477 #[inline]
3478 fn from_wire_ref(wire: &crate::wire::DeviceReadPmicCtrlRegRequest) -> Self {
3479 Self { reg_addr: ::fidl_next::FromWireRef::from_wire_ref(&wire.reg_addr) }
3480 }
3481 }
3482
3483 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3484 #[repr(C)]
3485 pub struct DeviceReadPmicCtrlRegResponse {
3486 pub value: u32,
3487 }
3488
3489 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegResponse, ___E>
3490 for DeviceReadPmicCtrlRegResponse
3491 where
3492 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3493 {
3494 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3495 Self,
3496 crate::wire::DeviceReadPmicCtrlRegResponse,
3497 > = unsafe {
3498 ::fidl_next::CopyOptimization::enable_if(
3499 true
3500
3501 && <
3502 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
3503 >::COPY_OPTIMIZATION.is_enabled()
3504
3505 )
3506 };
3507
3508 #[inline]
3509 fn encode(
3510 self,
3511 encoder_: &mut ___E,
3512 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegResponse>,
3513 _: (),
3514 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3515 ::fidl_next::munge! {
3516 let crate::wire::DeviceReadPmicCtrlRegResponse {
3517 value,
3518
3519 } = out_;
3520 }
3521
3522 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
3523
3524 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
3525
3526 Ok(())
3527 }
3528 }
3529
3530 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegResponse, ___E>
3531 for &'a DeviceReadPmicCtrlRegResponse
3532 where
3533 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3534 {
3535 #[inline]
3536 fn encode(
3537 self,
3538 encoder_: &mut ___E,
3539 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegResponse>,
3540 _: (),
3541 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3542 ::fidl_next::munge! {
3543 let crate::wire::DeviceReadPmicCtrlRegResponse {
3544 value,
3545
3546 } = out_;
3547 }
3548
3549 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
3550
3551 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
3552
3553 Ok(())
3554 }
3555 }
3556
3557 unsafe impl<___E>
3558 ::fidl_next::EncodeOption<
3559 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegResponse>,
3560 ___E,
3561 > for DeviceReadPmicCtrlRegResponse
3562 where
3563 ___E: ::fidl_next::Encoder + ?Sized,
3564 DeviceReadPmicCtrlRegResponse:
3565 ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegResponse, ___E>,
3566 {
3567 #[inline]
3568 fn encode_option(
3569 this: ::core::option::Option<Self>,
3570 encoder: &mut ___E,
3571 out: &mut ::core::mem::MaybeUninit<
3572 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegResponse>,
3573 >,
3574 _: (),
3575 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3576 if let Some(inner) = this {
3577 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3578 ::fidl_next::wire::Box::encode_present(out);
3579 } else {
3580 ::fidl_next::wire::Box::encode_absent(out);
3581 }
3582
3583 Ok(())
3584 }
3585 }
3586
3587 unsafe impl<'a, ___E>
3588 ::fidl_next::EncodeOption<
3589 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegResponse>,
3590 ___E,
3591 > for &'a DeviceReadPmicCtrlRegResponse
3592 where
3593 ___E: ::fidl_next::Encoder + ?Sized,
3594 &'a DeviceReadPmicCtrlRegResponse:
3595 ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegResponse, ___E>,
3596 {
3597 #[inline]
3598 fn encode_option(
3599 this: ::core::option::Option<Self>,
3600 encoder: &mut ___E,
3601 out: &mut ::core::mem::MaybeUninit<
3602 ::fidl_next::wire::Box<'static, crate::wire::DeviceReadPmicCtrlRegResponse>,
3603 >,
3604 _: (),
3605 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3606 if let Some(inner) = this {
3607 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3608 ::fidl_next::wire::Box::encode_present(out);
3609 } else {
3610 ::fidl_next::wire::Box::encode_absent(out);
3611 }
3612
3613 Ok(())
3614 }
3615 }
3616
3617 impl ::fidl_next::FromWire<crate::wire::DeviceReadPmicCtrlRegResponse>
3618 for DeviceReadPmicCtrlRegResponse
3619 {
3620 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
3621 crate::wire::DeviceReadPmicCtrlRegResponse,
3622 Self,
3623 > = unsafe {
3624 ::fidl_next::CopyOptimization::enable_if(
3625 true
3626 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
3627 .is_enabled(),
3628 )
3629 };
3630
3631 #[inline]
3632 fn from_wire(wire: crate::wire::DeviceReadPmicCtrlRegResponse) -> Self {
3633 Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
3634 }
3635 }
3636
3637 impl ::fidl_next::FromWireRef<crate::wire::DeviceReadPmicCtrlRegResponse>
3638 for DeviceReadPmicCtrlRegResponse
3639 {
3640 #[inline]
3641 fn from_wire_ref(wire: &crate::wire::DeviceReadPmicCtrlRegResponse) -> Self {
3642 Self { value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value) }
3643 }
3644 }
3645
3646 #[doc = " Information related to a power domain.\n"]
3647 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3648 pub struct Domain {
3649 pub id: ::core::option::Option<u32>,
3650 }
3651
3652 impl Domain {
3653 fn __max_ordinal(&self) -> usize {
3654 if self.id.is_some() {
3655 return 1;
3656 }
3657
3658 0
3659 }
3660 }
3661
3662 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Domain<'static>, ___E> for Domain
3663 where
3664 ___E: ::fidl_next::Encoder + ?Sized,
3665 {
3666 #[inline]
3667 fn encode(
3668 mut self,
3669 encoder: &mut ___E,
3670 out: &mut ::core::mem::MaybeUninit<crate::wire::Domain<'static>>,
3671 _: (),
3672 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3673 ::fidl_next::munge!(let crate::wire::Domain { table } = out);
3674
3675 let max_ord = self.__max_ordinal();
3676
3677 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3678 ::fidl_next::Wire::zero_padding(&mut out);
3679
3680 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3681 ::fidl_next::wire::Envelope,
3682 >(encoder, max_ord);
3683
3684 for i in 1..=max_ord {
3685 match i {
3686 1 => {
3687 if let Some(value) = self.id.take() {
3688 ::fidl_next::wire::Envelope::encode_value::<
3689 ::fidl_next::wire::Uint32,
3690 ___E,
3691 >(
3692 value, preallocated.encoder, &mut out, ()
3693 )?;
3694 } else {
3695 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3696 }
3697 }
3698
3699 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3700 }
3701 unsafe {
3702 preallocated.write_next(out.assume_init_ref());
3703 }
3704 }
3705
3706 ::fidl_next::wire::Table::encode_len(table, max_ord);
3707
3708 Ok(())
3709 }
3710 }
3711
3712 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Domain<'static>, ___E> for &'a Domain
3713 where
3714 ___E: ::fidl_next::Encoder + ?Sized,
3715 {
3716 #[inline]
3717 fn encode(
3718 self,
3719 encoder: &mut ___E,
3720 out: &mut ::core::mem::MaybeUninit<crate::wire::Domain<'static>>,
3721 _: (),
3722 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3723 ::fidl_next::munge!(let crate::wire::Domain { table } = out);
3724
3725 let max_ord = self.__max_ordinal();
3726
3727 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3728 ::fidl_next::Wire::zero_padding(&mut out);
3729
3730 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3731 ::fidl_next::wire::Envelope,
3732 >(encoder, max_ord);
3733
3734 for i in 1..=max_ord {
3735 match i {
3736 1 => {
3737 if let Some(value) = &self.id {
3738 ::fidl_next::wire::Envelope::encode_value::<
3739 ::fidl_next::wire::Uint32,
3740 ___E,
3741 >(
3742 value, preallocated.encoder, &mut out, ()
3743 )?;
3744 } else {
3745 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3746 }
3747 }
3748
3749 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3750 }
3751 unsafe {
3752 preallocated.write_next(out.assume_init_ref());
3753 }
3754 }
3755
3756 ::fidl_next::wire::Table::encode_len(table, max_ord);
3757
3758 Ok(())
3759 }
3760 }
3761
3762 impl<'de> ::fidl_next::FromWire<crate::wire::Domain<'de>> for Domain {
3763 #[inline]
3764 fn from_wire(wire_: crate::wire::Domain<'de>) -> Self {
3765 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3766
3767 let id = wire_.table.get(1);
3768
3769 Self {
3770 id: id.map(|envelope| {
3771 ::fidl_next::FromWire::from_wire(unsafe {
3772 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
3773 })
3774 }),
3775 }
3776 }
3777 }
3778
3779 impl<'de> ::fidl_next::FromWireRef<crate::wire::Domain<'de>> for Domain {
3780 #[inline]
3781 fn from_wire_ref(wire: &crate::wire::Domain<'de>) -> Self {
3782 Self {
3783 id: wire.table.get(1).map(|envelope| {
3784 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3785 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
3786 })
3787 }),
3788 }
3789 }
3790 }
3791
3792 #[doc = " Passed to the power core driver in metadata.\n"]
3793 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3794 pub struct DomainMetadata {
3795 pub domains: ::core::option::Option<::std::vec::Vec<crate::natural::Domain>>,
3796 }
3797
3798 impl DomainMetadata {
3799 fn __max_ordinal(&self) -> usize {
3800 if self.domains.is_some() {
3801 return 1;
3802 }
3803
3804 0
3805 }
3806 }
3807
3808 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DomainMetadata<'static>, ___E> for DomainMetadata
3809 where
3810 ___E: ::fidl_next::Encoder + ?Sized,
3811 {
3812 #[inline]
3813 fn encode(
3814 mut self,
3815 encoder: &mut ___E,
3816 out: &mut ::core::mem::MaybeUninit<crate::wire::DomainMetadata<'static>>,
3817 _: (),
3818 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3819 ::fidl_next::munge!(let crate::wire::DomainMetadata { table } = out);
3820
3821 let max_ord = self.__max_ordinal();
3822
3823 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3824 ::fidl_next::Wire::zero_padding(&mut out);
3825
3826 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3827 ::fidl_next::wire::Envelope,
3828 >(encoder, max_ord);
3829
3830 for i in 1..=max_ord {
3831 match i {
3832 1 => {
3833 if let Some(value) = self.domains.take() {
3834 ::fidl_next::wire::Envelope::encode_value::<
3835 ::fidl_next::wire::Vector<'static, crate::wire::Domain<'static>>,
3836 ___E,
3837 >(
3838 value, preallocated.encoder, &mut out, (4294967295, ())
3839 )?;
3840 } else {
3841 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3842 }
3843 }
3844
3845 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3846 }
3847 unsafe {
3848 preallocated.write_next(out.assume_init_ref());
3849 }
3850 }
3851
3852 ::fidl_next::wire::Table::encode_len(table, max_ord);
3853
3854 Ok(())
3855 }
3856 }
3857
3858 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DomainMetadata<'static>, ___E>
3859 for &'a DomainMetadata
3860 where
3861 ___E: ::fidl_next::Encoder + ?Sized,
3862 {
3863 #[inline]
3864 fn encode(
3865 self,
3866 encoder: &mut ___E,
3867 out: &mut ::core::mem::MaybeUninit<crate::wire::DomainMetadata<'static>>,
3868 _: (),
3869 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3870 ::fidl_next::munge!(let crate::wire::DomainMetadata { table } = out);
3871
3872 let max_ord = self.__max_ordinal();
3873
3874 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3875 ::fidl_next::Wire::zero_padding(&mut out);
3876
3877 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3878 ::fidl_next::wire::Envelope,
3879 >(encoder, max_ord);
3880
3881 for i in 1..=max_ord {
3882 match i {
3883 1 => {
3884 if let Some(value) = &self.domains {
3885 ::fidl_next::wire::Envelope::encode_value::<
3886 ::fidl_next::wire::Vector<'static, crate::wire::Domain<'static>>,
3887 ___E,
3888 >(
3889 value, preallocated.encoder, &mut out, (4294967295, ())
3890 )?;
3891 } else {
3892 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3893 }
3894 }
3895
3896 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3897 }
3898 unsafe {
3899 preallocated.write_next(out.assume_init_ref());
3900 }
3901 }
3902
3903 ::fidl_next::wire::Table::encode_len(table, max_ord);
3904
3905 Ok(())
3906 }
3907 }
3908
3909 impl<'de> ::fidl_next::FromWire<crate::wire::DomainMetadata<'de>> for DomainMetadata {
3910 #[inline]
3911 fn from_wire(wire_: crate::wire::DomainMetadata<'de>) -> Self {
3912 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3913
3914 let domains = wire_.table.get(1);
3915
3916 Self {
3917
3918
3919 domains: domains.map(|envelope| ::fidl_next::FromWire::from_wire(
3920 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>>() }
3921 )),
3922
3923 }
3924 }
3925 }
3926
3927 impl<'de> ::fidl_next::FromWireRef<crate::wire::DomainMetadata<'de>> for DomainMetadata {
3928 #[inline]
3929 fn from_wire_ref(wire: &crate::wire::DomainMetadata<'de>) -> Self {
3930 Self {
3931
3932
3933 domains: wire.table.get(1)
3934 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
3935 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>>() }
3936 )),
3937
3938 }
3939 }
3940 }
3941
3942 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3943 #[repr(u32)]
3944 pub enum FrameworkElementLevels {
3945 Off = 0,
3946 On = 1,
3947 }
3948 impl ::core::convert::TryFrom<u32> for FrameworkElementLevels {
3949 type Error = ::fidl_next::UnknownStrictEnumMemberError;
3950 fn try_from(
3951 value: u32,
3952 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
3953 match value {
3954 0 => Ok(Self::Off),
3955 1 => Ok(Self::On),
3956
3957 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
3958 }
3959 }
3960 }
3961
3962 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FrameworkElementLevels, ___E>
3963 for FrameworkElementLevels
3964 where
3965 ___E: ?Sized,
3966 {
3967 #[inline]
3968 fn encode(
3969 self,
3970 encoder: &mut ___E,
3971 out: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkElementLevels>,
3972 _: (),
3973 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3974 ::fidl_next::Encode::encode(&self, encoder, out, ())
3975 }
3976 }
3977
3978 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FrameworkElementLevels, ___E>
3979 for &'a FrameworkElementLevels
3980 where
3981 ___E: ?Sized,
3982 {
3983 #[inline]
3984 fn encode(
3985 self,
3986 encoder: &mut ___E,
3987 out: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkElementLevels>,
3988 _: (),
3989 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3990 ::fidl_next::munge!(let crate::wire::FrameworkElementLevels { value } = out);
3991 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
3992 FrameworkElementLevels::Off => 0,
3993
3994 FrameworkElementLevels::On => 1,
3995 }));
3996
3997 Ok(())
3998 }
3999 }
4000
4001 impl ::core::convert::From<crate::wire::FrameworkElementLevels> for FrameworkElementLevels {
4002 fn from(wire: crate::wire::FrameworkElementLevels) -> Self {
4003 match u32::from(wire.value) {
4004 0 => Self::Off,
4005
4006 1 => Self::On,
4007
4008 _ => unsafe { ::core::hint::unreachable_unchecked() },
4009 }
4010 }
4011 }
4012
4013 impl ::fidl_next::FromWire<crate::wire::FrameworkElementLevels> for FrameworkElementLevels {
4014 #[inline]
4015 fn from_wire(wire: crate::wire::FrameworkElementLevels) -> Self {
4016 Self::from(wire)
4017 }
4018 }
4019
4020 impl ::fidl_next::FromWireRef<crate::wire::FrameworkElementLevels> for FrameworkElementLevels {
4021 #[inline]
4022 fn from_wire_ref(wire: &crate::wire::FrameworkElementLevels) -> Self {
4023 Self::from(*wire)
4024 }
4025 }
4026}
4027
4028pub mod wire {
4029
4030 #[repr(C)]
4032 pub struct Transition<'de> {
4033 pub(crate) table: ::fidl_next::wire::Table<'de>,
4034 }
4035
4036 impl<'de> Drop for Transition<'de> {
4037 fn drop(&mut self) {
4038 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
4039
4040 let _ = self
4041 .table
4042 .get(2)
4043 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
4044 }
4045 }
4046
4047 impl ::fidl_next::Constrained for Transition<'_> {
4048 type Constraint = ();
4049
4050 fn validate(
4051 _: ::fidl_next::Slot<'_, Self>,
4052 _: Self::Constraint,
4053 ) -> Result<(), ::fidl_next::ValidationError> {
4054 Ok(())
4055 }
4056 }
4057
4058 unsafe impl ::fidl_next::Wire for Transition<'static> {
4059 type Narrowed<'de> = Transition<'de>;
4060
4061 #[inline]
4062 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4063 ::fidl_next::munge!(let Self { table } = out);
4064 ::fidl_next::wire::Table::zero_padding(table);
4065 }
4066 }
4067
4068 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Transition<'de>
4069 where
4070 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4071 {
4072 fn decode(
4073 slot: ::fidl_next::Slot<'_, Self>,
4074 decoder: &mut ___D,
4075 _: (),
4076 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4077 ::fidl_next::munge!(let Self { table } = slot);
4078
4079 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4080 match ordinal {
4081 0 => unsafe { ::core::hint::unreachable_unchecked() },
4082
4083 1 => {
4084 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
4085 slot.as_mut(),
4086 decoder,
4087 (),
4088 )?;
4089
4090 Ok(())
4091 }
4092
4093 2 => {
4094 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
4095 slot.as_mut(),
4096 decoder,
4097 (),
4098 )?;
4099
4100 Ok(())
4101 }
4102
4103 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4104 }
4105 })
4106 }
4107 }
4108
4109 impl<'de> Transition<'de> {
4110 pub fn target_level(&self) -> ::core::option::Option<&u8> {
4111 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4112 }
4113
4114 pub fn latency_us(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
4115 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4116 }
4117 }
4118
4119 impl<'de> ::core::fmt::Debug for Transition<'de> {
4120 fn fmt(
4121 &self,
4122 f: &mut ::core::fmt::Formatter<'_>,
4123 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4124 f.debug_struct("Transition")
4125 .field("target_level", &self.target_level())
4126 .field("latency_us", &self.latency_us())
4127 .finish()
4128 }
4129 }
4130
4131 impl<'de> ::fidl_next::IntoNatural for Transition<'de> {
4132 type Natural = crate::natural::Transition;
4133 }
4134
4135 #[repr(C)]
4137 pub struct PowerLevel<'de> {
4138 pub(crate) table: ::fidl_next::wire::Table<'de>,
4139 }
4140
4141 impl<'de> Drop for PowerLevel<'de> {
4142 fn drop(&mut self) {
4143 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
4144
4145 let _ = self.table.get(2).map(|envelope| unsafe {
4146 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4147 });
4148
4149 let _ = self.table.get(3).map(|envelope| unsafe {
4150 envelope
4151 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>>(
4152 )
4153 });
4154 }
4155 }
4156
4157 impl ::fidl_next::Constrained for PowerLevel<'_> {
4158 type Constraint = ();
4159
4160 fn validate(
4161 _: ::fidl_next::Slot<'_, Self>,
4162 _: Self::Constraint,
4163 ) -> Result<(), ::fidl_next::ValidationError> {
4164 Ok(())
4165 }
4166 }
4167
4168 unsafe impl ::fidl_next::Wire for PowerLevel<'static> {
4169 type Narrowed<'de> = PowerLevel<'de>;
4170
4171 #[inline]
4172 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4173 ::fidl_next::munge!(let Self { table } = out);
4174 ::fidl_next::wire::Table::zero_padding(table);
4175 }
4176 }
4177
4178 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerLevel<'de>
4179 where
4180 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4181 {
4182 fn decode(
4183 slot: ::fidl_next::Slot<'_, Self>,
4184 decoder: &mut ___D,
4185 _: (),
4186 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4187 ::fidl_next::munge!(let Self { table } = slot);
4188
4189 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4190 match ordinal {
4191 0 => unsafe { ::core::hint::unreachable_unchecked() },
4192
4193 1 => {
4194 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
4195 slot.as_mut(),
4196 decoder,
4197 (),
4198 )?;
4199
4200 Ok(())
4201 }
4202
4203 2 => {
4204 ::fidl_next::wire::Envelope::decode_as::<
4205 ___D,
4206 ::fidl_next::wire::String<'de>,
4207 >(slot.as_mut(), decoder, 63)?;
4208
4209 let value = unsafe {
4210 slot.deref_unchecked()
4211 .deref_unchecked::<::fidl_next::wire::String<'_>>()
4212 };
4213
4214 if value.len() > 63 {
4215 return Err(::fidl_next::DecodeError::VectorTooLong {
4216 size: value.len() as u64,
4217 limit: 63,
4218 });
4219 }
4220
4221 Ok(())
4222 }
4223
4224 3 => {
4225 ::fidl_next::wire::Envelope::decode_as::<
4226 ___D,
4227 ::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>,
4228 >(slot.as_mut(), decoder, (127, ()))?;
4229
4230 let value = unsafe {
4231 slot
4232 .deref_unchecked()
4233 .deref_unchecked::<
4234 ::fidl_next::wire::Vector<'_, crate::wire::Transition<'_>>
4235 >()
4236 };
4237
4238 if value.len() > 127 {
4239 return Err(::fidl_next::DecodeError::VectorTooLong {
4240 size: value.len() as u64,
4241 limit: 127,
4242 });
4243 }
4244
4245 Ok(())
4246 }
4247
4248 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4249 }
4250 })
4251 }
4252 }
4253
4254 impl<'de> PowerLevel<'de> {
4255 pub fn level(&self) -> ::core::option::Option<&u8> {
4256 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4257 }
4258
4259 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
4260 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4261 }
4262
4263 pub fn transitions(
4264 &self,
4265 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>>
4266 {
4267 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4268 }
4269 }
4270
4271 impl<'de> ::core::fmt::Debug for PowerLevel<'de> {
4272 fn fmt(
4273 &self,
4274 f: &mut ::core::fmt::Formatter<'_>,
4275 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4276 f.debug_struct("PowerLevel")
4277 .field("level", &self.level())
4278 .field("name", &self.name())
4279 .field("transitions", &self.transitions())
4280 .finish()
4281 }
4282 }
4283
4284 impl<'de> ::fidl_next::IntoNatural for PowerLevel<'de> {
4285 type Natural = crate::natural::PowerLevel;
4286 }
4287
4288 #[repr(C)]
4290 pub struct PowerElement<'de> {
4291 pub(crate) table: ::fidl_next::wire::Table<'de>,
4292 }
4293
4294 impl<'de> Drop for PowerElement<'de> {
4295 fn drop(&mut self) {
4296 let _ = self.table.get(1).map(|envelope| unsafe {
4297 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4298 });
4299
4300 let _ = self.table.get(2).map(|envelope| unsafe {
4301 envelope
4302 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>>(
4303 )
4304 });
4305 }
4306 }
4307
4308 impl ::fidl_next::Constrained for PowerElement<'_> {
4309 type Constraint = ();
4310
4311 fn validate(
4312 _: ::fidl_next::Slot<'_, Self>,
4313 _: Self::Constraint,
4314 ) -> Result<(), ::fidl_next::ValidationError> {
4315 Ok(())
4316 }
4317 }
4318
4319 unsafe impl ::fidl_next::Wire for PowerElement<'static> {
4320 type Narrowed<'de> = PowerElement<'de>;
4321
4322 #[inline]
4323 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4324 ::fidl_next::munge!(let Self { table } = out);
4325 ::fidl_next::wire::Table::zero_padding(table);
4326 }
4327 }
4328
4329 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerElement<'de>
4330 where
4331 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4332 {
4333 fn decode(
4334 slot: ::fidl_next::Slot<'_, Self>,
4335 decoder: &mut ___D,
4336 _: (),
4337 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4338 ::fidl_next::munge!(let Self { table } = slot);
4339
4340 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4341 match ordinal {
4342 0 => unsafe { ::core::hint::unreachable_unchecked() },
4343
4344 1 => {
4345 ::fidl_next::wire::Envelope::decode_as::<
4346 ___D,
4347 ::fidl_next::wire::String<'de>,
4348 >(slot.as_mut(), decoder, 63)?;
4349
4350 let value = unsafe {
4351 slot.deref_unchecked()
4352 .deref_unchecked::<::fidl_next::wire::String<'_>>()
4353 };
4354
4355 if value.len() > 63 {
4356 return Err(::fidl_next::DecodeError::VectorTooLong {
4357 size: value.len() as u64,
4358 limit: 63,
4359 });
4360 }
4361
4362 Ok(())
4363 }
4364
4365 2 => {
4366 ::fidl_next::wire::Envelope::decode_as::<
4367 ___D,
4368 ::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>,
4369 >(slot.as_mut(), decoder, (128, ()))?;
4370
4371 let value = unsafe {
4372 slot
4373 .deref_unchecked()
4374 .deref_unchecked::<
4375 ::fidl_next::wire::Vector<'_, crate::wire::PowerLevel<'_>>
4376 >()
4377 };
4378
4379 if value.len() > 128 {
4380 return Err(::fidl_next::DecodeError::VectorTooLong {
4381 size: value.len() as u64,
4382 limit: 128,
4383 });
4384 }
4385
4386 Ok(())
4387 }
4388
4389 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4390 }
4391 })
4392 }
4393 }
4394
4395 impl<'de> PowerElement<'de> {
4396 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
4397 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4398 }
4399
4400 pub fn levels(
4401 &self,
4402 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>>
4403 {
4404 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4405 }
4406 }
4407
4408 impl<'de> ::core::fmt::Debug for PowerElement<'de> {
4409 fn fmt(
4410 &self,
4411 f: &mut ::core::fmt::Formatter<'_>,
4412 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4413 f.debug_struct("PowerElement")
4414 .field("name", &self.name())
4415 .field("levels", &self.levels())
4416 .finish()
4417 }
4418 }
4419
4420 impl<'de> ::fidl_next::IntoNatural for PowerElement<'de> {
4421 type Natural = crate::natural::PowerElement;
4422 }
4423
4424 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
4426 #[repr(transparent)]
4427 pub struct SagElement {
4428 pub(crate) value: ::fidl_next::wire::Uint32,
4429 }
4430
4431 impl ::fidl_next::Constrained for SagElement {
4432 type Constraint = ();
4433
4434 fn validate(
4435 _: ::fidl_next::Slot<'_, Self>,
4436 _: Self::Constraint,
4437 ) -> Result<(), ::fidl_next::ValidationError> {
4438 Ok(())
4439 }
4440 }
4441
4442 unsafe impl ::fidl_next::Wire for SagElement {
4443 type Narrowed<'de> = Self;
4444
4445 #[inline]
4446 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4447 }
4449 }
4450
4451 impl SagElement {
4452 pub const EXECUTION_STATE: SagElement = SagElement { value: ::fidl_next::wire::Uint32(1) };
4453
4454 pub const APPLICATION_ACTIVITY: SagElement =
4455 SagElement { value: ::fidl_next::wire::Uint32(4) };
4456 }
4457
4458 unsafe impl<___D> ::fidl_next::Decode<___D> for SagElement
4459 where
4460 ___D: ?Sized,
4461 {
4462 fn decode(
4463 slot: ::fidl_next::Slot<'_, Self>,
4464 _: &mut ___D,
4465 _: (),
4466 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4467 ::fidl_next::munge!(let Self { value } = slot);
4468
4469 match u32::from(*value) {
4470 1 | 4 => (),
4471 unknown => {
4472 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
4473 }
4474 }
4475
4476 Ok(())
4477 }
4478 }
4479
4480 impl ::core::convert::From<crate::natural::SagElement> for SagElement {
4481 fn from(natural: crate::natural::SagElement) -> Self {
4482 match natural {
4483 crate::natural::SagElement::ExecutionState => SagElement::EXECUTION_STATE,
4484
4485 crate::natural::SagElement::ApplicationActivity => SagElement::APPLICATION_ACTIVITY,
4486 }
4487 }
4488 }
4489
4490 impl ::fidl_next::IntoNatural for SagElement {
4491 type Natural = crate::natural::SagElement;
4492 }
4493
4494 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
4496 #[repr(transparent)]
4497 pub struct CpuPowerElement {
4498 pub(crate) value: ::fidl_next::wire::Uint32,
4499 }
4500
4501 impl ::fidl_next::Constrained for CpuPowerElement {
4502 type Constraint = ();
4503
4504 fn validate(
4505 _: ::fidl_next::Slot<'_, Self>,
4506 _: Self::Constraint,
4507 ) -> Result<(), ::fidl_next::ValidationError> {
4508 Ok(())
4509 }
4510 }
4511
4512 unsafe impl ::fidl_next::Wire for CpuPowerElement {
4513 type Narrowed<'de> = Self;
4514
4515 #[inline]
4516 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4517 }
4519 }
4520
4521 impl CpuPowerElement {
4522 pub const CPU: CpuPowerElement = CpuPowerElement { value: ::fidl_next::wire::Uint32(1) };
4523 }
4524
4525 unsafe impl<___D> ::fidl_next::Decode<___D> for CpuPowerElement
4526 where
4527 ___D: ?Sized,
4528 {
4529 fn decode(
4530 slot: ::fidl_next::Slot<'_, Self>,
4531 _: &mut ___D,
4532 _: (),
4533 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4534 ::fidl_next::munge!(let Self { value } = slot);
4535
4536 match u32::from(*value) {
4537 1 => (),
4538 unknown => {
4539 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
4540 }
4541 }
4542
4543 Ok(())
4544 }
4545 }
4546
4547 impl ::core::convert::From<crate::natural::CpuPowerElement> for CpuPowerElement {
4548 fn from(natural: crate::natural::CpuPowerElement) -> Self {
4549 match natural {
4550 crate::natural::CpuPowerElement::Cpu => CpuPowerElement::CPU,
4551 }
4552 }
4553 }
4554
4555 impl ::fidl_next::IntoNatural for CpuPowerElement {
4556 type Natural = crate::natural::CpuPowerElement;
4557 }
4558
4559 #[repr(transparent)]
4561 pub struct ParentElement<'de> {
4562 pub(crate) raw: ::fidl_next::wire::Union,
4563 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4564 }
4565
4566 impl<'de> Drop for ParentElement<'de> {
4567 fn drop(&mut self) {
4568 match self.raw.ordinal() {
4569 1 => {
4570 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::SagElement>() };
4571 }
4572
4573 2 => {
4574 let _ = unsafe {
4575 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
4576 };
4577 }
4578
4579 3 => {
4580 let _ =
4581 unsafe { self.raw.get().read_unchecked::<crate::wire::CpuPowerElement>() };
4582 }
4583
4584 _ => unsafe { ::core::hint::unreachable_unchecked() },
4585 }
4586 }
4587 }
4588
4589 impl ::fidl_next::Constrained for ParentElement<'_> {
4590 type Constraint = ();
4591
4592 fn validate(
4593 _: ::fidl_next::Slot<'_, Self>,
4594 _: Self::Constraint,
4595 ) -> Result<(), ::fidl_next::ValidationError> {
4596 Ok(())
4597 }
4598 }
4599
4600 unsafe impl ::fidl_next::Wire for ParentElement<'static> {
4601 type Narrowed<'de> = ParentElement<'de>;
4602
4603 #[inline]
4604 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4605 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4606 ::fidl_next::wire::Union::zero_padding(raw);
4607 }
4608 }
4609
4610 pub mod parent_element {
4611 pub enum Ref<'de> {
4612 Sag(&'de crate::wire::SagElement),
4613
4614 InstanceName(&'de ::fidl_next::wire::String<'de>),
4615
4616 CpuControl(&'de crate::wire::CpuPowerElement),
4617 }
4618 }
4619
4620 impl<'de> ParentElement<'de> {
4621 pub fn as_ref(&self) -> crate::wire::parent_element::Ref<'_> {
4622 match self.raw.ordinal() {
4623 1 => crate::wire::parent_element::Ref::Sag(unsafe {
4624 self.raw.get().deref_unchecked::<crate::wire::SagElement>()
4625 }),
4626
4627 2 => crate::wire::parent_element::Ref::InstanceName(unsafe {
4628 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
4629 }),
4630
4631 3 => crate::wire::parent_element::Ref::CpuControl(unsafe {
4632 self.raw.get().deref_unchecked::<crate::wire::CpuPowerElement>()
4633 }),
4634
4635 _ => unsafe { ::core::hint::unreachable_unchecked() },
4636 }
4637 }
4638 }
4639
4640 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ParentElement<'de>
4641 where
4642 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4643 ___D: ::fidl_next::Decoder<'de>,
4644 {
4645 fn decode(
4646 mut slot: ::fidl_next::Slot<'_, Self>,
4647 decoder: &mut ___D,
4648 _: (),
4649 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4650 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4651 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
4652 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SagElement>(
4653 raw,
4654 decoder,
4655 (),
4656 )?,
4657
4658 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
4659 raw, decoder, 63,
4660 )?,
4661
4662 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CpuPowerElement>(
4663 raw,
4664 decoder,
4665 (),
4666 )?,
4667
4668 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
4669 }
4670
4671 Ok(())
4672 }
4673 }
4674
4675 impl<'de> ::core::fmt::Debug for ParentElement<'de> {
4676 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4677 match self.raw.ordinal() {
4678 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::SagElement>().fmt(f) },
4679 2 => unsafe {
4680 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
4681 },
4682 3 => unsafe {
4683 self.raw.get().deref_unchecked::<crate::wire::CpuPowerElement>().fmt(f)
4684 },
4685 _ => unsafe { ::core::hint::unreachable_unchecked() },
4686 }
4687 }
4688 }
4689
4690 impl<'de> ::fidl_next::IntoNatural for ParentElement<'de> {
4691 type Natural = crate::natural::ParentElement;
4692 }
4693
4694 #[repr(C)]
4696 pub struct LevelTuple<'de> {
4697 pub(crate) table: ::fidl_next::wire::Table<'de>,
4698 }
4699
4700 impl<'de> Drop for LevelTuple<'de> {
4701 fn drop(&mut self) {
4702 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
4703
4704 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
4705 }
4706 }
4707
4708 impl ::fidl_next::Constrained for LevelTuple<'_> {
4709 type Constraint = ();
4710
4711 fn validate(
4712 _: ::fidl_next::Slot<'_, Self>,
4713 _: Self::Constraint,
4714 ) -> Result<(), ::fidl_next::ValidationError> {
4715 Ok(())
4716 }
4717 }
4718
4719 unsafe impl ::fidl_next::Wire for LevelTuple<'static> {
4720 type Narrowed<'de> = LevelTuple<'de>;
4721
4722 #[inline]
4723 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4724 ::fidl_next::munge!(let Self { table } = out);
4725 ::fidl_next::wire::Table::zero_padding(table);
4726 }
4727 }
4728
4729 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LevelTuple<'de>
4730 where
4731 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4732 {
4733 fn decode(
4734 slot: ::fidl_next::Slot<'_, Self>,
4735 decoder: &mut ___D,
4736 _: (),
4737 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4738 ::fidl_next::munge!(let Self { table } = slot);
4739
4740 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4741 match ordinal {
4742 0 => unsafe { ::core::hint::unreachable_unchecked() },
4743
4744 1 => {
4745 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
4746 slot.as_mut(),
4747 decoder,
4748 (),
4749 )?;
4750
4751 Ok(())
4752 }
4753
4754 2 => {
4755 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
4756 slot.as_mut(),
4757 decoder,
4758 (),
4759 )?;
4760
4761 Ok(())
4762 }
4763
4764 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4765 }
4766 })
4767 }
4768 }
4769
4770 impl<'de> LevelTuple<'de> {
4771 pub fn child_level(&self) -> ::core::option::Option<&u8> {
4772 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4773 }
4774
4775 pub fn parent_level(&self) -> ::core::option::Option<&u8> {
4776 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4777 }
4778 }
4779
4780 impl<'de> ::core::fmt::Debug for LevelTuple<'de> {
4781 fn fmt(
4782 &self,
4783 f: &mut ::core::fmt::Formatter<'_>,
4784 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4785 f.debug_struct("LevelTuple")
4786 .field("child_level", &self.child_level())
4787 .field("parent_level", &self.parent_level())
4788 .finish()
4789 }
4790 }
4791
4792 impl<'de> ::fidl_next::IntoNatural for LevelTuple<'de> {
4793 type Natural = crate::natural::LevelTuple;
4794 }
4795
4796 #[repr(C)]
4798 pub struct PowerDependency<'de> {
4799 pub(crate) table: ::fidl_next::wire::Table<'de>,
4800 }
4801
4802 impl<'de> Drop for PowerDependency<'de> {
4803 fn drop(&mut self) {
4804 let _ = self.table.get(1).map(|envelope| unsafe {
4805 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4806 });
4807
4808 let _ = self.table.get(2).map(|envelope| unsafe {
4809 envelope.read_unchecked::<crate::wire::ParentElement<'de>>()
4810 });
4811
4812 let _ = self.table.get(3).map(|envelope| unsafe {
4813 envelope
4814 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>>(
4815 )
4816 });
4817 }
4818 }
4819
4820 impl ::fidl_next::Constrained for PowerDependency<'_> {
4821 type Constraint = ();
4822
4823 fn validate(
4824 _: ::fidl_next::Slot<'_, Self>,
4825 _: Self::Constraint,
4826 ) -> Result<(), ::fidl_next::ValidationError> {
4827 Ok(())
4828 }
4829 }
4830
4831 unsafe impl ::fidl_next::Wire for PowerDependency<'static> {
4832 type Narrowed<'de> = PowerDependency<'de>;
4833
4834 #[inline]
4835 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4836 ::fidl_next::munge!(let Self { table } = out);
4837 ::fidl_next::wire::Table::zero_padding(table);
4838 }
4839 }
4840
4841 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerDependency<'de>
4842 where
4843 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4844 {
4845 fn decode(
4846 slot: ::fidl_next::Slot<'_, Self>,
4847 decoder: &mut ___D,
4848 _: (),
4849 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4850 ::fidl_next::munge!(let Self { table } = slot);
4851
4852 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4853 match ordinal {
4854 0 => unsafe { ::core::hint::unreachable_unchecked() },
4855
4856 1 => {
4857 ::fidl_next::wire::Envelope::decode_as::<
4858 ___D,
4859 ::fidl_next::wire::String<'de>,
4860 >(slot.as_mut(), decoder, 63)?;
4861
4862 let value = unsafe {
4863 slot.deref_unchecked()
4864 .deref_unchecked::<::fidl_next::wire::String<'_>>()
4865 };
4866
4867 if value.len() > 63 {
4868 return Err(::fidl_next::DecodeError::VectorTooLong {
4869 size: value.len() as u64,
4870 limit: 63,
4871 });
4872 }
4873
4874 Ok(())
4875 }
4876
4877 2 => {
4878 ::fidl_next::wire::Envelope::decode_as::<
4879 ___D,
4880 crate::wire::ParentElement<'de>,
4881 >(slot.as_mut(), decoder, ())?;
4882
4883 Ok(())
4884 }
4885
4886 3 => {
4887 ::fidl_next::wire::Envelope::decode_as::<
4888 ___D,
4889 ::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>,
4890 >(slot.as_mut(), decoder, (128, ()))?;
4891
4892 let value = unsafe {
4893 slot
4894 .deref_unchecked()
4895 .deref_unchecked::<
4896 ::fidl_next::wire::Vector<'_, crate::wire::LevelTuple<'_>>
4897 >()
4898 };
4899
4900 if value.len() > 128 {
4901 return Err(::fidl_next::DecodeError::VectorTooLong {
4902 size: value.len() as u64,
4903 limit: 128,
4904 });
4905 }
4906
4907 Ok(())
4908 }
4909
4910 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4911 }
4912 })
4913 }
4914 }
4915
4916 impl<'de> PowerDependency<'de> {
4917 pub fn child(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
4918 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4919 }
4920
4921 pub fn parent(&self) -> ::core::option::Option<&crate::wire::ParentElement<'de>> {
4922 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4923 }
4924
4925 pub fn level_deps(
4926 &self,
4927 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>>
4928 {
4929 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4930 }
4931 }
4932
4933 impl<'de> ::core::fmt::Debug for PowerDependency<'de> {
4934 fn fmt(
4935 &self,
4936 f: &mut ::core::fmt::Formatter<'_>,
4937 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4938 f.debug_struct("PowerDependency")
4939 .field("child", &self.child())
4940 .field("parent", &self.parent())
4941 .field("level_deps", &self.level_deps())
4942 .finish()
4943 }
4944 }
4945
4946 impl<'de> ::fidl_next::IntoNatural for PowerDependency<'de> {
4947 type Natural = crate::natural::PowerDependency;
4948 }
4949
4950 #[repr(C)]
4952 pub struct PowerElementConfiguration<'de> {
4953 pub(crate) table: ::fidl_next::wire::Table<'de>,
4954 }
4955
4956 impl<'de> Drop for PowerElementConfiguration<'de> {
4957 fn drop(&mut self) {
4958 let _ = self.table.get(1).map(|envelope| unsafe {
4959 envelope.read_unchecked::<crate::wire::PowerElement<'de>>()
4960 });
4961
4962 let _ = self.table.get(2)
4963 .map(|envelope| unsafe {
4964 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>>()
4965 });
4966 }
4967 }
4968
4969 impl ::fidl_next::Constrained for PowerElementConfiguration<'_> {
4970 type Constraint = ();
4971
4972 fn validate(
4973 _: ::fidl_next::Slot<'_, Self>,
4974 _: Self::Constraint,
4975 ) -> Result<(), ::fidl_next::ValidationError> {
4976 Ok(())
4977 }
4978 }
4979
4980 unsafe impl ::fidl_next::Wire for PowerElementConfiguration<'static> {
4981 type Narrowed<'de> = PowerElementConfiguration<'de>;
4982
4983 #[inline]
4984 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4985 ::fidl_next::munge!(let Self { table } = out);
4986 ::fidl_next::wire::Table::zero_padding(table);
4987 }
4988 }
4989
4990 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerElementConfiguration<'de>
4991 where
4992 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4993 {
4994 fn decode(
4995 slot: ::fidl_next::Slot<'_, Self>,
4996 decoder: &mut ___D,
4997 _: (),
4998 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4999 ::fidl_next::munge!(let Self { table } = slot);
5000
5001 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5002 match ordinal {
5003 0 => unsafe { ::core::hint::unreachable_unchecked() },
5004
5005 1 => {
5006 ::fidl_next::wire::Envelope::decode_as::<
5007 ___D,
5008 crate::wire::PowerElement<'de>,
5009 >(slot.as_mut(), decoder, ())?;
5010
5011 Ok(())
5012 }
5013
5014 2 => {
5015 ::fidl_next::wire::Envelope::decode_as::<
5016 ___D,
5017 ::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>,
5018 >(slot.as_mut(), decoder, (128, ()))?;
5019
5020 let value = unsafe {
5021 slot
5022 .deref_unchecked()
5023 .deref_unchecked::<
5024 ::fidl_next::wire::Vector<'_, crate::wire::PowerDependency<'_>>
5025 >()
5026 };
5027
5028 if value.len() > 128 {
5029 return Err(::fidl_next::DecodeError::VectorTooLong {
5030 size: value.len() as u64,
5031 limit: 128,
5032 });
5033 }
5034
5035 Ok(())
5036 }
5037
5038 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
5039 }
5040 })
5041 }
5042 }
5043
5044 impl<'de> PowerElementConfiguration<'de> {
5045 pub fn element(&self) -> ::core::option::Option<&crate::wire::PowerElement<'de>> {
5046 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5047 }
5048
5049 pub fn dependencies(
5050 &self,
5051 ) -> ::core::option::Option<
5052 &::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>,
5053 > {
5054 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5055 }
5056 }
5057
5058 impl<'de> ::core::fmt::Debug for PowerElementConfiguration<'de> {
5059 fn fmt(
5060 &self,
5061 f: &mut ::core::fmt::Formatter<'_>,
5062 ) -> ::core::result::Result<(), ::core::fmt::Error> {
5063 f.debug_struct("PowerElementConfiguration")
5064 .field("element", &self.element())
5065 .field("dependencies", &self.dependencies())
5066 .finish()
5067 }
5068 }
5069
5070 impl<'de> ::fidl_next::IntoNatural for PowerElementConfiguration<'de> {
5071 type Natural = crate::natural::PowerElementConfiguration;
5072 }
5073
5074 #[derive(Debug)]
5076 #[repr(C)]
5077 pub struct ComponentPowerConfiguration<'de> {
5078 pub power_elements:
5079 ::fidl_next::wire::Vector<'de, crate::wire::PowerElementConfiguration<'de>>,
5080 }
5081
5082 static_assertions::const_assert_eq!(std::mem::size_of::<ComponentPowerConfiguration<'_>>(), 16);
5083 static_assertions::const_assert_eq!(std::mem::align_of::<ComponentPowerConfiguration<'_>>(), 8);
5084
5085 static_assertions::const_assert_eq!(
5086 std::mem::offset_of!(ComponentPowerConfiguration<'_>, power_elements),
5087 0
5088 );
5089
5090 impl ::fidl_next::Constrained for ComponentPowerConfiguration<'_> {
5091 type Constraint = ();
5092
5093 fn validate(
5094 _: ::fidl_next::Slot<'_, Self>,
5095 _: Self::Constraint,
5096 ) -> Result<(), ::fidl_next::ValidationError> {
5097 Ok(())
5098 }
5099 }
5100
5101 unsafe impl ::fidl_next::Wire for ComponentPowerConfiguration<'static> {
5102 type Narrowed<'de> = ComponentPowerConfiguration<'de>;
5103
5104 #[inline]
5105 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5106 ::fidl_next::munge! {
5107 let Self {
5108 power_elements,
5109
5110 } = &mut *out_;
5111 }
5112
5113 ::fidl_next::Wire::zero_padding(power_elements);
5114 }
5115 }
5116
5117 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentPowerConfiguration<'de>
5118 where
5119 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5120 ___D: ::fidl_next::Decoder<'de>,
5121 {
5122 fn decode(
5123 slot_: ::fidl_next::Slot<'_, Self>,
5124 decoder_: &mut ___D,
5125 _: (),
5126 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5127 ::fidl_next::munge! {
5128 let Self {
5129 mut power_elements,
5130
5131 } = slot_;
5132 }
5133
5134 let _field = power_elements.as_mut();
5135 ::fidl_next::Constrained::validate(_field, (32, ()))?;
5136 ::fidl_next::Decode::decode(power_elements.as_mut(), decoder_, (32, ()))?;
5137
5138 let power_elements = unsafe { power_elements.deref_unchecked() };
5139
5140 if power_elements.len() > 32 {
5141 return Err(::fidl_next::DecodeError::VectorTooLong {
5142 size: power_elements.len() as u64,
5143 limit: 32,
5144 });
5145 }
5146
5147 Ok(())
5148 }
5149 }
5150
5151 impl<'de> ::fidl_next::IntoNatural for ComponentPowerConfiguration<'de> {
5152 type Natural = crate::natural::ComponentPowerConfiguration;
5153 }
5154
5155 #[derive(Clone, Debug)]
5157 #[repr(C)]
5158 pub struct DeviceRegisterPowerDomainRequest {
5159 pub min_needed_voltage: ::fidl_next::wire::Uint32,
5160
5161 pub max_supported_voltage: ::fidl_next::wire::Uint32,
5162 }
5163
5164 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRegisterPowerDomainRequest>(), 8);
5165 static_assertions::const_assert_eq!(
5166 std::mem::align_of::<DeviceRegisterPowerDomainRequest>(),
5167 4
5168 );
5169
5170 static_assertions::const_assert_eq!(
5171 std::mem::offset_of!(DeviceRegisterPowerDomainRequest, min_needed_voltage),
5172 0
5173 );
5174
5175 static_assertions::const_assert_eq!(
5176 std::mem::offset_of!(DeviceRegisterPowerDomainRequest, max_supported_voltage),
5177 4
5178 );
5179
5180 impl ::fidl_next::Constrained for DeviceRegisterPowerDomainRequest {
5181 type Constraint = ();
5182
5183 fn validate(
5184 _: ::fidl_next::Slot<'_, Self>,
5185 _: Self::Constraint,
5186 ) -> Result<(), ::fidl_next::ValidationError> {
5187 Ok(())
5188 }
5189 }
5190
5191 unsafe impl ::fidl_next::Wire for DeviceRegisterPowerDomainRequest {
5192 type Narrowed<'de> = DeviceRegisterPowerDomainRequest;
5193
5194 #[inline]
5195 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5196 ::fidl_next::munge! {
5197 let Self {
5198 min_needed_voltage,
5199 max_supported_voltage,
5200
5201 } = &mut *out_;
5202 }
5203
5204 ::fidl_next::Wire::zero_padding(min_needed_voltage);
5205
5206 ::fidl_next::Wire::zero_padding(max_supported_voltage);
5207 }
5208 }
5209
5210 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceRegisterPowerDomainRequest
5211 where
5212 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5213 {
5214 fn decode(
5215 slot_: ::fidl_next::Slot<'_, Self>,
5216 decoder_: &mut ___D,
5217 _: (),
5218 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5219 ::fidl_next::munge! {
5220 let Self {
5221 mut min_needed_voltage,
5222 mut max_supported_voltage,
5223
5224 } = slot_;
5225 }
5226
5227 let _field = min_needed_voltage.as_mut();
5228
5229 ::fidl_next::Decode::decode(min_needed_voltage.as_mut(), decoder_, ())?;
5230
5231 let _field = max_supported_voltage.as_mut();
5232
5233 ::fidl_next::Decode::decode(max_supported_voltage.as_mut(), decoder_, ())?;
5234
5235 Ok(())
5236 }
5237 }
5238
5239 impl ::fidl_next::IntoNatural for DeviceRegisterPowerDomainRequest {
5240 type Natural = crate::natural::DeviceRegisterPowerDomainRequest;
5241 }
5242
5243 pub type DeviceRegisterPowerDomainResponse = ::fidl_next::wire::Unit;
5245
5246 pub type DeviceUnregisterPowerDomainResponse = ::fidl_next::wire::Unit;
5248
5249 #[derive(Clone, Debug)]
5251 #[repr(C)]
5252 pub struct DeviceGetSupportedVoltageRangeResponse {
5253 pub min: ::fidl_next::wire::Uint32,
5254
5255 pub max: ::fidl_next::wire::Uint32,
5256 }
5257
5258 static_assertions::const_assert_eq!(
5259 std::mem::size_of::<DeviceGetSupportedVoltageRangeResponse>(),
5260 8
5261 );
5262 static_assertions::const_assert_eq!(
5263 std::mem::align_of::<DeviceGetSupportedVoltageRangeResponse>(),
5264 4
5265 );
5266
5267 static_assertions::const_assert_eq!(
5268 std::mem::offset_of!(DeviceGetSupportedVoltageRangeResponse, min),
5269 0
5270 );
5271
5272 static_assertions::const_assert_eq!(
5273 std::mem::offset_of!(DeviceGetSupportedVoltageRangeResponse, max),
5274 4
5275 );
5276
5277 impl ::fidl_next::Constrained for DeviceGetSupportedVoltageRangeResponse {
5278 type Constraint = ();
5279
5280 fn validate(
5281 _: ::fidl_next::Slot<'_, Self>,
5282 _: Self::Constraint,
5283 ) -> Result<(), ::fidl_next::ValidationError> {
5284 Ok(())
5285 }
5286 }
5287
5288 unsafe impl ::fidl_next::Wire for DeviceGetSupportedVoltageRangeResponse {
5289 type Narrowed<'de> = DeviceGetSupportedVoltageRangeResponse;
5290
5291 #[inline]
5292 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5293 ::fidl_next::munge! {
5294 let Self {
5295 min,
5296 max,
5297
5298 } = &mut *out_;
5299 }
5300
5301 ::fidl_next::Wire::zero_padding(min);
5302
5303 ::fidl_next::Wire::zero_padding(max);
5304 }
5305 }
5306
5307 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetSupportedVoltageRangeResponse
5308 where
5309 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5310 {
5311 fn decode(
5312 slot_: ::fidl_next::Slot<'_, Self>,
5313 decoder_: &mut ___D,
5314 _: (),
5315 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5316 ::fidl_next::munge! {
5317 let Self {
5318 mut min,
5319 mut max,
5320
5321 } = slot_;
5322 }
5323
5324 let _field = min.as_mut();
5325
5326 ::fidl_next::Decode::decode(min.as_mut(), decoder_, ())?;
5327
5328 let _field = max.as_mut();
5329
5330 ::fidl_next::Decode::decode(max.as_mut(), decoder_, ())?;
5331
5332 Ok(())
5333 }
5334 }
5335
5336 impl ::fidl_next::IntoNatural for DeviceGetSupportedVoltageRangeResponse {
5337 type Natural = crate::natural::DeviceGetSupportedVoltageRangeResponse;
5338 }
5339
5340 #[derive(Clone, Debug)]
5342 #[repr(C)]
5343 pub struct DeviceRequestVoltageRequest {
5344 pub voltage: ::fidl_next::wire::Uint32,
5345 }
5346
5347 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRequestVoltageRequest>(), 4);
5348 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceRequestVoltageRequest>(), 4);
5349
5350 static_assertions::const_assert_eq!(
5351 std::mem::offset_of!(DeviceRequestVoltageRequest, voltage),
5352 0
5353 );
5354
5355 impl ::fidl_next::Constrained for DeviceRequestVoltageRequest {
5356 type Constraint = ();
5357
5358 fn validate(
5359 _: ::fidl_next::Slot<'_, Self>,
5360 _: Self::Constraint,
5361 ) -> Result<(), ::fidl_next::ValidationError> {
5362 Ok(())
5363 }
5364 }
5365
5366 unsafe impl ::fidl_next::Wire for DeviceRequestVoltageRequest {
5367 type Narrowed<'de> = DeviceRequestVoltageRequest;
5368
5369 #[inline]
5370 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5371 ::fidl_next::munge! {
5372 let Self {
5373 voltage,
5374
5375 } = &mut *out_;
5376 }
5377
5378 ::fidl_next::Wire::zero_padding(voltage);
5379 }
5380 }
5381
5382 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceRequestVoltageRequest
5383 where
5384 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5385 {
5386 fn decode(
5387 slot_: ::fidl_next::Slot<'_, Self>,
5388 decoder_: &mut ___D,
5389 _: (),
5390 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5391 ::fidl_next::munge! {
5392 let Self {
5393 mut voltage,
5394
5395 } = slot_;
5396 }
5397
5398 let _field = voltage.as_mut();
5399
5400 ::fidl_next::Decode::decode(voltage.as_mut(), decoder_, ())?;
5401
5402 Ok(())
5403 }
5404 }
5405
5406 impl ::fidl_next::IntoNatural for DeviceRequestVoltageRequest {
5407 type Natural = crate::natural::DeviceRequestVoltageRequest;
5408 }
5409
5410 #[derive(Clone, Debug)]
5412 #[repr(C)]
5413 pub struct DeviceRequestVoltageResponse {
5414 pub actual_voltage: ::fidl_next::wire::Uint32,
5415 }
5416
5417 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRequestVoltageResponse>(), 4);
5418 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceRequestVoltageResponse>(), 4);
5419
5420 static_assertions::const_assert_eq!(
5421 std::mem::offset_of!(DeviceRequestVoltageResponse, actual_voltage),
5422 0
5423 );
5424
5425 impl ::fidl_next::Constrained for DeviceRequestVoltageResponse {
5426 type Constraint = ();
5427
5428 fn validate(
5429 _: ::fidl_next::Slot<'_, Self>,
5430 _: Self::Constraint,
5431 ) -> Result<(), ::fidl_next::ValidationError> {
5432 Ok(())
5433 }
5434 }
5435
5436 unsafe impl ::fidl_next::Wire for DeviceRequestVoltageResponse {
5437 type Narrowed<'de> = DeviceRequestVoltageResponse;
5438
5439 #[inline]
5440 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5441 ::fidl_next::munge! {
5442 let Self {
5443 actual_voltage,
5444
5445 } = &mut *out_;
5446 }
5447
5448 ::fidl_next::Wire::zero_padding(actual_voltage);
5449 }
5450 }
5451
5452 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceRequestVoltageResponse
5453 where
5454 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5455 {
5456 fn decode(
5457 slot_: ::fidl_next::Slot<'_, Self>,
5458 decoder_: &mut ___D,
5459 _: (),
5460 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5461 ::fidl_next::munge! {
5462 let Self {
5463 mut actual_voltage,
5464
5465 } = slot_;
5466 }
5467
5468 let _field = actual_voltage.as_mut();
5469
5470 ::fidl_next::Decode::decode(actual_voltage.as_mut(), decoder_, ())?;
5471
5472 Ok(())
5473 }
5474 }
5475
5476 impl ::fidl_next::IntoNatural for DeviceRequestVoltageResponse {
5477 type Natural = crate::natural::DeviceRequestVoltageResponse;
5478 }
5479
5480 #[derive(Clone, Debug)]
5482 #[repr(C)]
5483 pub struct DeviceGetCurrentVoltageRequest {
5484 pub index: ::fidl_next::wire::Uint32,
5485 }
5486
5487 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetCurrentVoltageRequest>(), 4);
5488 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetCurrentVoltageRequest>(), 4);
5489
5490 static_assertions::const_assert_eq!(
5491 std::mem::offset_of!(DeviceGetCurrentVoltageRequest, index),
5492 0
5493 );
5494
5495 impl ::fidl_next::Constrained for DeviceGetCurrentVoltageRequest {
5496 type Constraint = ();
5497
5498 fn validate(
5499 _: ::fidl_next::Slot<'_, Self>,
5500 _: Self::Constraint,
5501 ) -> Result<(), ::fidl_next::ValidationError> {
5502 Ok(())
5503 }
5504 }
5505
5506 unsafe impl ::fidl_next::Wire for DeviceGetCurrentVoltageRequest {
5507 type Narrowed<'de> = DeviceGetCurrentVoltageRequest;
5508
5509 #[inline]
5510 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5511 ::fidl_next::munge! {
5512 let Self {
5513 index,
5514
5515 } = &mut *out_;
5516 }
5517
5518 ::fidl_next::Wire::zero_padding(index);
5519 }
5520 }
5521
5522 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetCurrentVoltageRequest
5523 where
5524 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5525 {
5526 fn decode(
5527 slot_: ::fidl_next::Slot<'_, Self>,
5528 decoder_: &mut ___D,
5529 _: (),
5530 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5531 ::fidl_next::munge! {
5532 let Self {
5533 mut index,
5534
5535 } = slot_;
5536 }
5537
5538 let _field = index.as_mut();
5539
5540 ::fidl_next::Decode::decode(index.as_mut(), decoder_, ())?;
5541
5542 Ok(())
5543 }
5544 }
5545
5546 impl ::fidl_next::IntoNatural for DeviceGetCurrentVoltageRequest {
5547 type Natural = crate::natural::DeviceGetCurrentVoltageRequest;
5548 }
5549
5550 #[derive(Clone, Debug)]
5552 #[repr(C)]
5553 pub struct DeviceGetCurrentVoltageResponse {
5554 pub current_voltage: ::fidl_next::wire::Uint32,
5555 }
5556
5557 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetCurrentVoltageResponse>(), 4);
5558 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetCurrentVoltageResponse>(), 4);
5559
5560 static_assertions::const_assert_eq!(
5561 std::mem::offset_of!(DeviceGetCurrentVoltageResponse, current_voltage),
5562 0
5563 );
5564
5565 impl ::fidl_next::Constrained for DeviceGetCurrentVoltageResponse {
5566 type Constraint = ();
5567
5568 fn validate(
5569 _: ::fidl_next::Slot<'_, Self>,
5570 _: Self::Constraint,
5571 ) -> Result<(), ::fidl_next::ValidationError> {
5572 Ok(())
5573 }
5574 }
5575
5576 unsafe impl ::fidl_next::Wire for DeviceGetCurrentVoltageResponse {
5577 type Narrowed<'de> = DeviceGetCurrentVoltageResponse;
5578
5579 #[inline]
5580 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5581 ::fidl_next::munge! {
5582 let Self {
5583 current_voltage,
5584
5585 } = &mut *out_;
5586 }
5587
5588 ::fidl_next::Wire::zero_padding(current_voltage);
5589 }
5590 }
5591
5592 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetCurrentVoltageResponse
5593 where
5594 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5595 {
5596 fn decode(
5597 slot_: ::fidl_next::Slot<'_, Self>,
5598 decoder_: &mut ___D,
5599 _: (),
5600 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5601 ::fidl_next::munge! {
5602 let Self {
5603 mut current_voltage,
5604
5605 } = slot_;
5606 }
5607
5608 let _field = current_voltage.as_mut();
5609
5610 ::fidl_next::Decode::decode(current_voltage.as_mut(), decoder_, ())?;
5611
5612 Ok(())
5613 }
5614 }
5615
5616 impl ::fidl_next::IntoNatural for DeviceGetCurrentVoltageResponse {
5617 type Natural = crate::natural::DeviceGetCurrentVoltageResponse;
5618 }
5619
5620 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5622 #[repr(transparent)]
5623 pub struct PowerDomainStatus {
5624 pub(crate) value: u8,
5625 }
5626
5627 impl ::fidl_next::Constrained for PowerDomainStatus {
5628 type Constraint = ();
5629
5630 fn validate(
5631 _: ::fidl_next::Slot<'_, Self>,
5632 _: Self::Constraint,
5633 ) -> Result<(), ::fidl_next::ValidationError> {
5634 Ok(())
5635 }
5636 }
5637
5638 unsafe impl ::fidl_next::Wire for PowerDomainStatus {
5639 type Narrowed<'de> = Self;
5640
5641 #[inline]
5642 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5643 }
5645 }
5646
5647 impl PowerDomainStatus {
5648 pub const DISABLED: PowerDomainStatus = PowerDomainStatus { value: 1 };
5649
5650 pub const ENABLED: PowerDomainStatus = PowerDomainStatus { value: 2 };
5651 }
5652
5653 unsafe impl<___D> ::fidl_next::Decode<___D> for PowerDomainStatus
5654 where
5655 ___D: ?Sized,
5656 {
5657 fn decode(
5658 slot: ::fidl_next::Slot<'_, Self>,
5659 _: &mut ___D,
5660 _: (),
5661 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5662 ::fidl_next::munge!(let Self { value } = slot);
5663
5664 match u8::from(*value) {
5665 1 | 2 => (),
5666 unknown => {
5667 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
5668 }
5669 }
5670
5671 Ok(())
5672 }
5673 }
5674
5675 impl ::core::convert::From<crate::natural::PowerDomainStatus> for PowerDomainStatus {
5676 fn from(natural: crate::natural::PowerDomainStatus) -> Self {
5677 match natural {
5678 crate::natural::PowerDomainStatus::Disabled => PowerDomainStatus::DISABLED,
5679
5680 crate::natural::PowerDomainStatus::Enabled => PowerDomainStatus::ENABLED,
5681 }
5682 }
5683 }
5684
5685 impl ::fidl_next::IntoNatural for PowerDomainStatus {
5686 type Natural = crate::natural::PowerDomainStatus;
5687 }
5688
5689 #[derive(Clone, Debug)]
5691 #[repr(C)]
5692 pub struct DeviceGetPowerDomainStatusResponse {
5693 pub status: crate::wire::PowerDomainStatus,
5694 }
5695
5696 static_assertions::const_assert_eq!(
5697 std::mem::size_of::<DeviceGetPowerDomainStatusResponse>(),
5698 1
5699 );
5700 static_assertions::const_assert_eq!(
5701 std::mem::align_of::<DeviceGetPowerDomainStatusResponse>(),
5702 1
5703 );
5704
5705 static_assertions::const_assert_eq!(
5706 std::mem::offset_of!(DeviceGetPowerDomainStatusResponse, status),
5707 0
5708 );
5709
5710 impl ::fidl_next::Constrained for DeviceGetPowerDomainStatusResponse {
5711 type Constraint = ();
5712
5713 fn validate(
5714 _: ::fidl_next::Slot<'_, Self>,
5715 _: Self::Constraint,
5716 ) -> Result<(), ::fidl_next::ValidationError> {
5717 Ok(())
5718 }
5719 }
5720
5721 unsafe impl ::fidl_next::Wire for DeviceGetPowerDomainStatusResponse {
5722 type Narrowed<'de> = DeviceGetPowerDomainStatusResponse;
5723
5724 #[inline]
5725 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5726 ::fidl_next::munge! {
5727 let Self {
5728 status,
5729
5730 } = &mut *out_;
5731 }
5732
5733 ::fidl_next::Wire::zero_padding(status);
5734 }
5735 }
5736
5737 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetPowerDomainStatusResponse
5738 where
5739 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5740 {
5741 fn decode(
5742 slot_: ::fidl_next::Slot<'_, Self>,
5743 decoder_: &mut ___D,
5744 _: (),
5745 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5746 ::fidl_next::munge! {
5747 let Self {
5748 mut status,
5749
5750 } = slot_;
5751 }
5752
5753 let _field = status.as_mut();
5754
5755 ::fidl_next::Decode::decode(status.as_mut(), decoder_, ())?;
5756
5757 Ok(())
5758 }
5759 }
5760
5761 impl ::fidl_next::IntoNatural for DeviceGetPowerDomainStatusResponse {
5762 type Natural = crate::natural::DeviceGetPowerDomainStatusResponse;
5763 }
5764
5765 #[derive(Clone, Debug)]
5767 #[repr(C)]
5768 pub struct DeviceWritePmicCtrlRegRequest {
5769 pub reg_addr: ::fidl_next::wire::Uint32,
5770
5771 pub value: ::fidl_next::wire::Uint32,
5772 }
5773
5774 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceWritePmicCtrlRegRequest>(), 8);
5775 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceWritePmicCtrlRegRequest>(), 4);
5776
5777 static_assertions::const_assert_eq!(
5778 std::mem::offset_of!(DeviceWritePmicCtrlRegRequest, reg_addr),
5779 0
5780 );
5781
5782 static_assertions::const_assert_eq!(
5783 std::mem::offset_of!(DeviceWritePmicCtrlRegRequest, value),
5784 4
5785 );
5786
5787 impl ::fidl_next::Constrained for DeviceWritePmicCtrlRegRequest {
5788 type Constraint = ();
5789
5790 fn validate(
5791 _: ::fidl_next::Slot<'_, Self>,
5792 _: Self::Constraint,
5793 ) -> Result<(), ::fidl_next::ValidationError> {
5794 Ok(())
5795 }
5796 }
5797
5798 unsafe impl ::fidl_next::Wire for DeviceWritePmicCtrlRegRequest {
5799 type Narrowed<'de> = DeviceWritePmicCtrlRegRequest;
5800
5801 #[inline]
5802 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5803 ::fidl_next::munge! {
5804 let Self {
5805 reg_addr,
5806 value,
5807
5808 } = &mut *out_;
5809 }
5810
5811 ::fidl_next::Wire::zero_padding(reg_addr);
5812
5813 ::fidl_next::Wire::zero_padding(value);
5814 }
5815 }
5816
5817 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceWritePmicCtrlRegRequest
5818 where
5819 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5820 {
5821 fn decode(
5822 slot_: ::fidl_next::Slot<'_, Self>,
5823 decoder_: &mut ___D,
5824 _: (),
5825 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5826 ::fidl_next::munge! {
5827 let Self {
5828 mut reg_addr,
5829 mut value,
5830
5831 } = slot_;
5832 }
5833
5834 let _field = reg_addr.as_mut();
5835
5836 ::fidl_next::Decode::decode(reg_addr.as_mut(), decoder_, ())?;
5837
5838 let _field = value.as_mut();
5839
5840 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
5841
5842 Ok(())
5843 }
5844 }
5845
5846 impl ::fidl_next::IntoNatural for DeviceWritePmicCtrlRegRequest {
5847 type Natural = crate::natural::DeviceWritePmicCtrlRegRequest;
5848 }
5849
5850 pub type DeviceWritePmicCtrlRegResponse = ::fidl_next::wire::Unit;
5852
5853 #[derive(Clone, Debug)]
5855 #[repr(C)]
5856 pub struct DeviceReadPmicCtrlRegRequest {
5857 pub reg_addr: ::fidl_next::wire::Uint32,
5858 }
5859
5860 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceReadPmicCtrlRegRequest>(), 4);
5861 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceReadPmicCtrlRegRequest>(), 4);
5862
5863 static_assertions::const_assert_eq!(
5864 std::mem::offset_of!(DeviceReadPmicCtrlRegRequest, reg_addr),
5865 0
5866 );
5867
5868 impl ::fidl_next::Constrained for DeviceReadPmicCtrlRegRequest {
5869 type Constraint = ();
5870
5871 fn validate(
5872 _: ::fidl_next::Slot<'_, Self>,
5873 _: Self::Constraint,
5874 ) -> Result<(), ::fidl_next::ValidationError> {
5875 Ok(())
5876 }
5877 }
5878
5879 unsafe impl ::fidl_next::Wire for DeviceReadPmicCtrlRegRequest {
5880 type Narrowed<'de> = DeviceReadPmicCtrlRegRequest;
5881
5882 #[inline]
5883 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5884 ::fidl_next::munge! {
5885 let Self {
5886 reg_addr,
5887
5888 } = &mut *out_;
5889 }
5890
5891 ::fidl_next::Wire::zero_padding(reg_addr);
5892 }
5893 }
5894
5895 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceReadPmicCtrlRegRequest
5896 where
5897 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5898 {
5899 fn decode(
5900 slot_: ::fidl_next::Slot<'_, Self>,
5901 decoder_: &mut ___D,
5902 _: (),
5903 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5904 ::fidl_next::munge! {
5905 let Self {
5906 mut reg_addr,
5907
5908 } = slot_;
5909 }
5910
5911 let _field = reg_addr.as_mut();
5912
5913 ::fidl_next::Decode::decode(reg_addr.as_mut(), decoder_, ())?;
5914
5915 Ok(())
5916 }
5917 }
5918
5919 impl ::fidl_next::IntoNatural for DeviceReadPmicCtrlRegRequest {
5920 type Natural = crate::natural::DeviceReadPmicCtrlRegRequest;
5921 }
5922
5923 #[derive(Clone, Debug)]
5925 #[repr(C)]
5926 pub struct DeviceReadPmicCtrlRegResponse {
5927 pub value: ::fidl_next::wire::Uint32,
5928 }
5929
5930 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceReadPmicCtrlRegResponse>(), 4);
5931 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceReadPmicCtrlRegResponse>(), 4);
5932
5933 static_assertions::const_assert_eq!(
5934 std::mem::offset_of!(DeviceReadPmicCtrlRegResponse, value),
5935 0
5936 );
5937
5938 impl ::fidl_next::Constrained for DeviceReadPmicCtrlRegResponse {
5939 type Constraint = ();
5940
5941 fn validate(
5942 _: ::fidl_next::Slot<'_, Self>,
5943 _: Self::Constraint,
5944 ) -> Result<(), ::fidl_next::ValidationError> {
5945 Ok(())
5946 }
5947 }
5948
5949 unsafe impl ::fidl_next::Wire for DeviceReadPmicCtrlRegResponse {
5950 type Narrowed<'de> = DeviceReadPmicCtrlRegResponse;
5951
5952 #[inline]
5953 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5954 ::fidl_next::munge! {
5955 let Self {
5956 value,
5957
5958 } = &mut *out_;
5959 }
5960
5961 ::fidl_next::Wire::zero_padding(value);
5962 }
5963 }
5964
5965 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceReadPmicCtrlRegResponse
5966 where
5967 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5968 {
5969 fn decode(
5970 slot_: ::fidl_next::Slot<'_, Self>,
5971 decoder_: &mut ___D,
5972 _: (),
5973 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5974 ::fidl_next::munge! {
5975 let Self {
5976 mut value,
5977
5978 } = slot_;
5979 }
5980
5981 let _field = value.as_mut();
5982
5983 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
5984
5985 Ok(())
5986 }
5987 }
5988
5989 impl ::fidl_next::IntoNatural for DeviceReadPmicCtrlRegResponse {
5990 type Natural = crate::natural::DeviceReadPmicCtrlRegResponse;
5991 }
5992
5993 #[repr(C)]
5995 pub struct Domain<'de> {
5996 pub(crate) table: ::fidl_next::wire::Table<'de>,
5997 }
5998
5999 impl<'de> Drop for Domain<'de> {
6000 fn drop(&mut self) {
6001 let _ = self
6002 .table
6003 .get(1)
6004 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
6005 }
6006 }
6007
6008 impl ::fidl_next::Constrained for Domain<'_> {
6009 type Constraint = ();
6010
6011 fn validate(
6012 _: ::fidl_next::Slot<'_, Self>,
6013 _: Self::Constraint,
6014 ) -> Result<(), ::fidl_next::ValidationError> {
6015 Ok(())
6016 }
6017 }
6018
6019 unsafe impl ::fidl_next::Wire for Domain<'static> {
6020 type Narrowed<'de> = Domain<'de>;
6021
6022 #[inline]
6023 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6024 ::fidl_next::munge!(let Self { table } = out);
6025 ::fidl_next::wire::Table::zero_padding(table);
6026 }
6027 }
6028
6029 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Domain<'de>
6030 where
6031 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6032 {
6033 fn decode(
6034 slot: ::fidl_next::Slot<'_, Self>,
6035 decoder: &mut ___D,
6036 _: (),
6037 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6038 ::fidl_next::munge!(let Self { table } = slot);
6039
6040 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6041 match ordinal {
6042 0 => unsafe { ::core::hint::unreachable_unchecked() },
6043
6044 1 => {
6045 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
6046 slot.as_mut(),
6047 decoder,
6048 (),
6049 )?;
6050
6051 Ok(())
6052 }
6053
6054 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6055 }
6056 })
6057 }
6058 }
6059
6060 impl<'de> Domain<'de> {
6061 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
6062 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6063 }
6064 }
6065
6066 impl<'de> ::core::fmt::Debug for Domain<'de> {
6067 fn fmt(
6068 &self,
6069 f: &mut ::core::fmt::Formatter<'_>,
6070 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6071 f.debug_struct("Domain").field("id", &self.id()).finish()
6072 }
6073 }
6074
6075 impl<'de> ::fidl_next::IntoNatural for Domain<'de> {
6076 type Natural = crate::natural::Domain;
6077 }
6078
6079 #[repr(C)]
6081 pub struct DomainMetadata<'de> {
6082 pub(crate) table: ::fidl_next::wire::Table<'de>,
6083 }
6084
6085 impl<'de> Drop for DomainMetadata<'de> {
6086 fn drop(&mut self) {
6087 let _ = self.table.get(1).map(|envelope| unsafe {
6088 envelope
6089 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>>()
6090 });
6091 }
6092 }
6093
6094 impl ::fidl_next::Constrained for DomainMetadata<'_> {
6095 type Constraint = ();
6096
6097 fn validate(
6098 _: ::fidl_next::Slot<'_, Self>,
6099 _: Self::Constraint,
6100 ) -> Result<(), ::fidl_next::ValidationError> {
6101 Ok(())
6102 }
6103 }
6104
6105 unsafe impl ::fidl_next::Wire for DomainMetadata<'static> {
6106 type Narrowed<'de> = DomainMetadata<'de>;
6107
6108 #[inline]
6109 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6110 ::fidl_next::munge!(let Self { table } = out);
6111 ::fidl_next::wire::Table::zero_padding(table);
6112 }
6113 }
6114
6115 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DomainMetadata<'de>
6116 where
6117 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6118 {
6119 fn decode(
6120 slot: ::fidl_next::Slot<'_, Self>,
6121 decoder: &mut ___D,
6122 _: (),
6123 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6124 ::fidl_next::munge!(let Self { table } = slot);
6125
6126 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6127 match ordinal {
6128 0 => unsafe { ::core::hint::unreachable_unchecked() },
6129
6130 1 => {
6131 ::fidl_next::wire::Envelope::decode_as::<
6132 ___D,
6133 ::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>,
6134 >(slot.as_mut(), decoder, (4294967295, ()))?;
6135
6136 Ok(())
6137 }
6138
6139 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6140 }
6141 })
6142 }
6143 }
6144
6145 impl<'de> DomainMetadata<'de> {
6146 pub fn domains(
6147 &self,
6148 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>>
6149 {
6150 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6151 }
6152 }
6153
6154 impl<'de> ::core::fmt::Debug for DomainMetadata<'de> {
6155 fn fmt(
6156 &self,
6157 f: &mut ::core::fmt::Formatter<'_>,
6158 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6159 f.debug_struct("DomainMetadata").field("domains", &self.domains()).finish()
6160 }
6161 }
6162
6163 impl<'de> ::fidl_next::IntoNatural for DomainMetadata<'de> {
6164 type Natural = crate::natural::DomainMetadata;
6165 }
6166
6167 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6169 #[repr(transparent)]
6170 pub struct FrameworkElementLevels {
6171 pub(crate) value: ::fidl_next::wire::Uint32,
6172 }
6173
6174 impl ::fidl_next::Constrained for FrameworkElementLevels {
6175 type Constraint = ();
6176
6177 fn validate(
6178 _: ::fidl_next::Slot<'_, Self>,
6179 _: Self::Constraint,
6180 ) -> Result<(), ::fidl_next::ValidationError> {
6181 Ok(())
6182 }
6183 }
6184
6185 unsafe impl ::fidl_next::Wire for FrameworkElementLevels {
6186 type Narrowed<'de> = Self;
6187
6188 #[inline]
6189 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6190 }
6192 }
6193
6194 impl FrameworkElementLevels {
6195 pub const OFF: FrameworkElementLevels =
6196 FrameworkElementLevels { value: ::fidl_next::wire::Uint32(0) };
6197
6198 pub const ON: FrameworkElementLevels =
6199 FrameworkElementLevels { value: ::fidl_next::wire::Uint32(1) };
6200 }
6201
6202 unsafe impl<___D> ::fidl_next::Decode<___D> for FrameworkElementLevels
6203 where
6204 ___D: ?Sized,
6205 {
6206 fn decode(
6207 slot: ::fidl_next::Slot<'_, Self>,
6208 _: &mut ___D,
6209 _: (),
6210 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6211 ::fidl_next::munge!(let Self { value } = slot);
6212
6213 match u32::from(*value) {
6214 0 | 1 => (),
6215 unknown => {
6216 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
6217 }
6218 }
6219
6220 Ok(())
6221 }
6222 }
6223
6224 impl ::core::convert::From<crate::natural::FrameworkElementLevels> for FrameworkElementLevels {
6225 fn from(natural: crate::natural::FrameworkElementLevels) -> Self {
6226 match natural {
6227 crate::natural::FrameworkElementLevels::Off => FrameworkElementLevels::OFF,
6228
6229 crate::natural::FrameworkElementLevels::On => FrameworkElementLevels::ON,
6230 }
6231 }
6232 }
6233
6234 impl ::fidl_next::IntoNatural for FrameworkElementLevels {
6235 type Natural = crate::natural::FrameworkElementLevels;
6236 }
6237}
6238
6239pub mod wire_optional {
6240
6241 #[repr(transparent)]
6242 pub struct ParentElement<'de> {
6243 pub(crate) raw: ::fidl_next::wire::Union,
6244 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6245 }
6246
6247 impl ::fidl_next::Constrained for ParentElement<'_> {
6248 type Constraint = ();
6249
6250 fn validate(
6251 _: ::fidl_next::Slot<'_, Self>,
6252 _: Self::Constraint,
6253 ) -> Result<(), ::fidl_next::ValidationError> {
6254 Ok(())
6255 }
6256 }
6257
6258 unsafe impl ::fidl_next::Wire for ParentElement<'static> {
6259 type Narrowed<'de> = ParentElement<'de>;
6260
6261 #[inline]
6262 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6263 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6264 ::fidl_next::wire::Union::zero_padding(raw);
6265 }
6266 }
6267
6268 impl<'de> ParentElement<'de> {
6269 pub fn is_some(&self) -> bool {
6270 self.raw.is_some()
6271 }
6272
6273 pub fn is_none(&self) -> bool {
6274 self.raw.is_none()
6275 }
6276
6277 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ParentElement<'de>> {
6278 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6279 }
6280
6281 pub fn into_option(self) -> ::core::option::Option<crate::wire::ParentElement<'de>> {
6282 if self.is_some() {
6283 Some(crate::wire::ParentElement {
6284 raw: self.raw,
6285 _phantom: ::core::marker::PhantomData,
6286 })
6287 } else {
6288 None
6289 }
6290 }
6291 }
6292
6293 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ParentElement<'de>
6294 where
6295 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6296 ___D: ::fidl_next::Decoder<'de>,
6297 {
6298 fn decode(
6299 mut slot: ::fidl_next::Slot<'_, Self>,
6300 decoder: &mut ___D,
6301 _: (),
6302 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6303 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6304 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
6305 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SagElement>(
6306 raw,
6307 decoder,
6308 (),
6309 )?,
6310
6311 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
6312 raw, decoder, 63,
6313 )?,
6314
6315 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CpuPowerElement>(
6316 raw,
6317 decoder,
6318 (),
6319 )?,
6320
6321 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
6322 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
6323 }
6324
6325 Ok(())
6326 }
6327 }
6328
6329 impl<'de> ::core::fmt::Debug for ParentElement<'de> {
6330 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6331 self.as_ref().fmt(f)
6332 }
6333 }
6334
6335 impl<'de> ::fidl_next::IntoNatural for ParentElement<'de> {
6336 type Natural = ::core::option::Option<crate::natural::ParentElement>;
6337 }
6338}
6339
6340pub mod generic {
6341
6342 pub struct ComponentPowerConfiguration<T0> {
6344 pub power_elements: T0,
6345 }
6346
6347 unsafe impl<___E, T0>
6348 ::fidl_next::Encode<crate::wire::ComponentPowerConfiguration<'static>, ___E>
6349 for ComponentPowerConfiguration<T0>
6350 where
6351 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6352 ___E: ::fidl_next::Encoder,
6353 T0: ::fidl_next::Encode<
6354 ::fidl_next::wire::Vector<'static, crate::wire::PowerElementConfiguration<'static>>,
6355 ___E,
6356 >,
6357 {
6358 #[inline]
6359 fn encode(
6360 self,
6361 encoder_: &mut ___E,
6362 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentPowerConfiguration<'static>>,
6363 _: (),
6364 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6365 ::fidl_next::munge! {
6366 let crate::wire::ComponentPowerConfiguration {
6367 power_elements,
6368
6369 } = out_;
6370 }
6371
6372 ::fidl_next::Encode::encode(self.power_elements, encoder_, power_elements, (32, ()))?;
6373
6374 Ok(())
6375 }
6376 }
6377
6378 pub struct DeviceRegisterPowerDomainRequest<T0, T1> {
6380 pub min_needed_voltage: T0,
6381
6382 pub max_supported_voltage: T1,
6383 }
6384
6385 unsafe impl<___E, T0, T1>
6386 ::fidl_next::Encode<crate::wire::DeviceRegisterPowerDomainRequest, ___E>
6387 for DeviceRegisterPowerDomainRequest<T0, T1>
6388 where
6389 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6390 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6391 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6392 {
6393 #[inline]
6394 fn encode(
6395 self,
6396 encoder_: &mut ___E,
6397 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterPowerDomainRequest>,
6398 _: (),
6399 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6400 ::fidl_next::munge! {
6401 let crate::wire::DeviceRegisterPowerDomainRequest {
6402 min_needed_voltage,
6403 max_supported_voltage,
6404
6405 } = out_;
6406 }
6407
6408 ::fidl_next::Encode::encode(self.min_needed_voltage, encoder_, min_needed_voltage, ())?;
6409
6410 ::fidl_next::Encode::encode(
6411 self.max_supported_voltage,
6412 encoder_,
6413 max_supported_voltage,
6414 (),
6415 )?;
6416
6417 Ok(())
6418 }
6419 }
6420
6421 pub type DeviceRegisterPowerDomainResponse = ();
6423
6424 pub type DeviceUnregisterPowerDomainResponse = ();
6426
6427 pub struct DeviceGetSupportedVoltageRangeResponse<T0, T1> {
6429 pub min: T0,
6430
6431 pub max: T1,
6432 }
6433
6434 unsafe impl<___E, T0, T1>
6435 ::fidl_next::Encode<crate::wire::DeviceGetSupportedVoltageRangeResponse, ___E>
6436 for DeviceGetSupportedVoltageRangeResponse<T0, T1>
6437 where
6438 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6439 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6440 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6441 {
6442 #[inline]
6443 fn encode(
6444 self,
6445 encoder_: &mut ___E,
6446 out_: &mut ::core::mem::MaybeUninit<
6447 crate::wire::DeviceGetSupportedVoltageRangeResponse,
6448 >,
6449 _: (),
6450 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6451 ::fidl_next::munge! {
6452 let crate::wire::DeviceGetSupportedVoltageRangeResponse {
6453 min,
6454 max,
6455
6456 } = out_;
6457 }
6458
6459 ::fidl_next::Encode::encode(self.min, encoder_, min, ())?;
6460
6461 ::fidl_next::Encode::encode(self.max, encoder_, max, ())?;
6462
6463 Ok(())
6464 }
6465 }
6466
6467 pub struct DeviceRequestVoltageRequest<T0> {
6469 pub voltage: T0,
6470 }
6471
6472 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageRequest, ___E>
6473 for DeviceRequestVoltageRequest<T0>
6474 where
6475 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6476 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6477 {
6478 #[inline]
6479 fn encode(
6480 self,
6481 encoder_: &mut ___E,
6482 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageRequest>,
6483 _: (),
6484 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6485 ::fidl_next::munge! {
6486 let crate::wire::DeviceRequestVoltageRequest {
6487 voltage,
6488
6489 } = out_;
6490 }
6491
6492 ::fidl_next::Encode::encode(self.voltage, encoder_, voltage, ())?;
6493
6494 Ok(())
6495 }
6496 }
6497
6498 pub struct DeviceRequestVoltageResponse<T0> {
6500 pub actual_voltage: T0,
6501 }
6502
6503 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageResponse, ___E>
6504 for DeviceRequestVoltageResponse<T0>
6505 where
6506 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6507 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6508 {
6509 #[inline]
6510 fn encode(
6511 self,
6512 encoder_: &mut ___E,
6513 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageResponse>,
6514 _: (),
6515 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6516 ::fidl_next::munge! {
6517 let crate::wire::DeviceRequestVoltageResponse {
6518 actual_voltage,
6519
6520 } = out_;
6521 }
6522
6523 ::fidl_next::Encode::encode(self.actual_voltage, encoder_, actual_voltage, ())?;
6524
6525 Ok(())
6526 }
6527 }
6528
6529 pub struct DeviceGetCurrentVoltageRequest<T0> {
6531 pub index: T0,
6532 }
6533
6534 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageRequest, ___E>
6535 for DeviceGetCurrentVoltageRequest<T0>
6536 where
6537 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6538 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6539 {
6540 #[inline]
6541 fn encode(
6542 self,
6543 encoder_: &mut ___E,
6544 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageRequest>,
6545 _: (),
6546 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6547 ::fidl_next::munge! {
6548 let crate::wire::DeviceGetCurrentVoltageRequest {
6549 index,
6550
6551 } = out_;
6552 }
6553
6554 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
6555
6556 Ok(())
6557 }
6558 }
6559
6560 pub struct DeviceGetCurrentVoltageResponse<T0> {
6562 pub current_voltage: T0,
6563 }
6564
6565 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageResponse, ___E>
6566 for DeviceGetCurrentVoltageResponse<T0>
6567 where
6568 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6569 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6570 {
6571 #[inline]
6572 fn encode(
6573 self,
6574 encoder_: &mut ___E,
6575 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageResponse>,
6576 _: (),
6577 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6578 ::fidl_next::munge! {
6579 let crate::wire::DeviceGetCurrentVoltageResponse {
6580 current_voltage,
6581
6582 } = out_;
6583 }
6584
6585 ::fidl_next::Encode::encode(self.current_voltage, encoder_, current_voltage, ())?;
6586
6587 Ok(())
6588 }
6589 }
6590
6591 pub struct DeviceGetPowerDomainStatusResponse<T0> {
6593 pub status: T0,
6594 }
6595
6596 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetPowerDomainStatusResponse, ___E>
6597 for DeviceGetPowerDomainStatusResponse<T0>
6598 where
6599 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6600 T0: ::fidl_next::Encode<crate::wire::PowerDomainStatus, ___E>,
6601 {
6602 #[inline]
6603 fn encode(
6604 self,
6605 encoder_: &mut ___E,
6606 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPowerDomainStatusResponse>,
6607 _: (),
6608 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6609 ::fidl_next::munge! {
6610 let crate::wire::DeviceGetPowerDomainStatusResponse {
6611 status,
6612
6613 } = out_;
6614 }
6615
6616 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
6617
6618 Ok(())
6619 }
6620 }
6621
6622 pub struct DeviceWritePmicCtrlRegRequest<T0, T1> {
6624 pub reg_addr: T0,
6625
6626 pub value: T1,
6627 }
6628
6629 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::DeviceWritePmicCtrlRegRequest, ___E>
6630 for DeviceWritePmicCtrlRegRequest<T0, T1>
6631 where
6632 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6633 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6634 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6635 {
6636 #[inline]
6637 fn encode(
6638 self,
6639 encoder_: &mut ___E,
6640 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceWritePmicCtrlRegRequest>,
6641 _: (),
6642 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6643 ::fidl_next::munge! {
6644 let crate::wire::DeviceWritePmicCtrlRegRequest {
6645 reg_addr,
6646 value,
6647
6648 } = out_;
6649 }
6650
6651 ::fidl_next::Encode::encode(self.reg_addr, encoder_, reg_addr, ())?;
6652
6653 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
6654
6655 Ok(())
6656 }
6657 }
6658
6659 pub type DeviceWritePmicCtrlRegResponse = ();
6661
6662 pub struct DeviceReadPmicCtrlRegRequest<T0> {
6664 pub reg_addr: T0,
6665 }
6666
6667 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegRequest, ___E>
6668 for DeviceReadPmicCtrlRegRequest<T0>
6669 where
6670 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6671 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6672 {
6673 #[inline]
6674 fn encode(
6675 self,
6676 encoder_: &mut ___E,
6677 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegRequest>,
6678 _: (),
6679 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6680 ::fidl_next::munge! {
6681 let crate::wire::DeviceReadPmicCtrlRegRequest {
6682 reg_addr,
6683
6684 } = out_;
6685 }
6686
6687 ::fidl_next::Encode::encode(self.reg_addr, encoder_, reg_addr, ())?;
6688
6689 Ok(())
6690 }
6691 }
6692
6693 pub struct DeviceReadPmicCtrlRegResponse<T0> {
6695 pub value: T0,
6696 }
6697
6698 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegResponse, ___E>
6699 for DeviceReadPmicCtrlRegResponse<T0>
6700 where
6701 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6702 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6703 {
6704 #[inline]
6705 fn encode(
6706 self,
6707 encoder_: &mut ___E,
6708 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegResponse>,
6709 _: (),
6710 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6711 ::fidl_next::munge! {
6712 let crate::wire::DeviceReadPmicCtrlRegResponse {
6713 value,
6714
6715 } = out_;
6716 }
6717
6718 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
6719
6720 Ok(())
6721 }
6722 }
6723}
6724
6725pub use self::natural::*;
6726
6727pub const MAX_NAME_LENGTH: u16 = 63 as u16;
6728
6729#[doc = " This means we could have up to 128 power levels, which seems like more than\n enough.\n"]
6730pub const MAX_TRANSITIONS: u16 = 127 as u16;
6731
6732#[doc = " Should be MAX_TRANSITIONS + 1\n"]
6733pub const MAX_LEVELS: u16 = 128 as u16;
6734
6735pub const MAX_DEPENDENCIES: u16 = 128 as u16;
6736
6737pub const MAX_POWER_ELEMENTS: u16 = 32 as u16;
6738
6739#[derive(PartialEq, Debug)]
6741pub struct Device;
6742
6743impl ::fidl_next::Discoverable for Device {
6744 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.power.Device";
6745}
6746
6747#[cfg(target_os = "fuchsia")]
6748impl ::fidl_next::HasTransport for Device {
6749 type Transport = ::fidl_next::fuchsia::zx::Channel;
6750}
6751
6752pub mod device {
6753 pub mod prelude {
6754 pub use crate::{
6755 Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
6756 DeviceServerHandler, device,
6757 };
6758
6759 pub use crate::natural::DeviceGetCurrentVoltageRequest;
6760
6761 pub use crate::natural::DeviceReadPmicCtrlRegRequest;
6762
6763 pub use crate::natural::DeviceRegisterPowerDomainRequest;
6764
6765 pub use crate::natural::DeviceRequestVoltageRequest;
6766
6767 pub use crate::natural::DeviceWritePmicCtrlRegRequest;
6768
6769 pub use crate::natural::DeviceGetCurrentVoltageResponse;
6770
6771 pub use crate::natural::DeviceGetPowerDomainStatusResponse;
6772
6773 pub use crate::natural::DeviceGetSupportedVoltageRangeResponse;
6774
6775 pub use crate::natural::DeviceReadPmicCtrlRegResponse;
6776
6777 pub use crate::natural::DeviceRegisterPowerDomainResponse;
6778
6779 pub use crate::natural::DeviceRequestVoltageResponse;
6780
6781 pub use crate::natural::DeviceUnregisterPowerDomainResponse;
6782
6783 pub use crate::natural::DeviceWritePmicCtrlRegResponse;
6784 }
6785
6786 pub struct RegisterPowerDomain;
6787
6788 impl ::fidl_next::Method for RegisterPowerDomain {
6789 const ORDINAL: u64 = 4458069386545205468;
6790 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6791 ::fidl_next::protocol::Flexibility::Strict;
6792
6793 type Protocol = crate::Device;
6794
6795 type Request = crate::wire::DeviceRegisterPowerDomainRequest;
6796 }
6797
6798 impl ::fidl_next::TwoWayMethod for RegisterPowerDomain {
6799 type Response = ::fidl_next::wire::Result<
6800 'static,
6801 crate::wire::DeviceRegisterPowerDomainResponse,
6802 ::fidl_next::wire::Int32,
6803 >;
6804 }
6805
6806 impl<___R> ::fidl_next::Respond<___R> for RegisterPowerDomain {
6807 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
6808
6809 fn respond(response: ___R) -> Self::Output {
6810 ::core::result::Result::Ok(response)
6811 }
6812 }
6813
6814 impl<___R> ::fidl_next::RespondErr<___R> for RegisterPowerDomain {
6815 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
6816
6817 fn respond_err(response: ___R) -> Self::Output {
6818 ::core::result::Result::Err(response)
6819 }
6820 }
6821
6822 pub struct UnregisterPowerDomain;
6823
6824 impl ::fidl_next::Method for UnregisterPowerDomain {
6825 const ORDINAL: u64 = 7717805237469023337;
6826 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6827 ::fidl_next::protocol::Flexibility::Strict;
6828
6829 type Protocol = crate::Device;
6830
6831 type Request = ::fidl_next::wire::EmptyMessageBody;
6832 }
6833
6834 impl ::fidl_next::TwoWayMethod for UnregisterPowerDomain {
6835 type Response = ::fidl_next::wire::Result<
6836 'static,
6837 crate::wire::DeviceUnregisterPowerDomainResponse,
6838 ::fidl_next::wire::Int32,
6839 >;
6840 }
6841
6842 impl<___R> ::fidl_next::Respond<___R> for UnregisterPowerDomain {
6843 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
6844
6845 fn respond(response: ___R) -> Self::Output {
6846 ::core::result::Result::Ok(response)
6847 }
6848 }
6849
6850 impl<___R> ::fidl_next::RespondErr<___R> for UnregisterPowerDomain {
6851 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
6852
6853 fn respond_err(response: ___R) -> Self::Output {
6854 ::core::result::Result::Err(response)
6855 }
6856 }
6857
6858 pub struct GetSupportedVoltageRange;
6859
6860 impl ::fidl_next::Method for GetSupportedVoltageRange {
6861 const ORDINAL: u64 = 7887361504891407856;
6862 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6863 ::fidl_next::protocol::Flexibility::Strict;
6864
6865 type Protocol = crate::Device;
6866
6867 type Request = ::fidl_next::wire::EmptyMessageBody;
6868 }
6869
6870 impl ::fidl_next::TwoWayMethod for GetSupportedVoltageRange {
6871 type Response = ::fidl_next::wire::Result<
6872 'static,
6873 crate::wire::DeviceGetSupportedVoltageRangeResponse,
6874 ::fidl_next::wire::Int32,
6875 >;
6876 }
6877
6878 impl<___R> ::fidl_next::Respond<___R> for GetSupportedVoltageRange {
6879 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
6880
6881 fn respond(response: ___R) -> Self::Output {
6882 ::core::result::Result::Ok(response)
6883 }
6884 }
6885
6886 impl<___R> ::fidl_next::RespondErr<___R> for GetSupportedVoltageRange {
6887 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
6888
6889 fn respond_err(response: ___R) -> Self::Output {
6890 ::core::result::Result::Err(response)
6891 }
6892 }
6893
6894 pub struct RequestVoltage;
6895
6896 impl ::fidl_next::Method for RequestVoltage {
6897 const ORDINAL: u64 = 2578932345713622683;
6898 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6899 ::fidl_next::protocol::Flexibility::Strict;
6900
6901 type Protocol = crate::Device;
6902
6903 type Request = crate::wire::DeviceRequestVoltageRequest;
6904 }
6905
6906 impl ::fidl_next::TwoWayMethod for RequestVoltage {
6907 type Response = ::fidl_next::wire::Result<
6908 'static,
6909 crate::wire::DeviceRequestVoltageResponse,
6910 ::fidl_next::wire::Int32,
6911 >;
6912 }
6913
6914 impl<___R> ::fidl_next::Respond<___R> for RequestVoltage {
6915 type Output = ::core::result::Result<
6916 crate::generic::DeviceRequestVoltageResponse<___R>,
6917 ::fidl_next::util::Never,
6918 >;
6919
6920 fn respond(response: ___R) -> Self::Output {
6921 ::core::result::Result::Ok(crate::generic::DeviceRequestVoltageResponse {
6922 actual_voltage: response,
6923 })
6924 }
6925 }
6926
6927 impl<___R> ::fidl_next::RespondErr<___R> for RequestVoltage {
6928 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
6929
6930 fn respond_err(response: ___R) -> Self::Output {
6931 ::core::result::Result::Err(response)
6932 }
6933 }
6934
6935 pub struct GetCurrentVoltage;
6936
6937 impl ::fidl_next::Method for GetCurrentVoltage {
6938 const ORDINAL: u64 = 7683000915093989729;
6939 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6940 ::fidl_next::protocol::Flexibility::Strict;
6941
6942 type Protocol = crate::Device;
6943
6944 type Request = crate::wire::DeviceGetCurrentVoltageRequest;
6945 }
6946
6947 impl ::fidl_next::TwoWayMethod for GetCurrentVoltage {
6948 type Response = ::fidl_next::wire::Result<
6949 'static,
6950 crate::wire::DeviceGetCurrentVoltageResponse,
6951 ::fidl_next::wire::Int32,
6952 >;
6953 }
6954
6955 impl<___R> ::fidl_next::Respond<___R> for GetCurrentVoltage {
6956 type Output = ::core::result::Result<
6957 crate::generic::DeviceGetCurrentVoltageResponse<___R>,
6958 ::fidl_next::util::Never,
6959 >;
6960
6961 fn respond(response: ___R) -> Self::Output {
6962 ::core::result::Result::Ok(crate::generic::DeviceGetCurrentVoltageResponse {
6963 current_voltage: response,
6964 })
6965 }
6966 }
6967
6968 impl<___R> ::fidl_next::RespondErr<___R> for GetCurrentVoltage {
6969 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
6970
6971 fn respond_err(response: ___R) -> Self::Output {
6972 ::core::result::Result::Err(response)
6973 }
6974 }
6975
6976 pub struct GetPowerDomainStatus;
6977
6978 impl ::fidl_next::Method for GetPowerDomainStatus {
6979 const ORDINAL: u64 = 4178917272116294842;
6980 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6981 ::fidl_next::protocol::Flexibility::Strict;
6982
6983 type Protocol = crate::Device;
6984
6985 type Request = ::fidl_next::wire::EmptyMessageBody;
6986 }
6987
6988 impl ::fidl_next::TwoWayMethod for GetPowerDomainStatus {
6989 type Response = ::fidl_next::wire::Result<
6990 'static,
6991 crate::wire::DeviceGetPowerDomainStatusResponse,
6992 ::fidl_next::wire::Int32,
6993 >;
6994 }
6995
6996 impl<___R> ::fidl_next::Respond<___R> for GetPowerDomainStatus {
6997 type Output = ::core::result::Result<
6998 crate::generic::DeviceGetPowerDomainStatusResponse<___R>,
6999 ::fidl_next::util::Never,
7000 >;
7001
7002 fn respond(response: ___R) -> Self::Output {
7003 ::core::result::Result::Ok(crate::generic::DeviceGetPowerDomainStatusResponse {
7004 status: response,
7005 })
7006 }
7007 }
7008
7009 impl<___R> ::fidl_next::RespondErr<___R> for GetPowerDomainStatus {
7010 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
7011
7012 fn respond_err(response: ___R) -> Self::Output {
7013 ::core::result::Result::Err(response)
7014 }
7015 }
7016
7017 pub struct WritePmicCtrlReg;
7018
7019 impl ::fidl_next::Method for WritePmicCtrlReg {
7020 const ORDINAL: u64 = 3749867380549091993;
7021 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7022 ::fidl_next::protocol::Flexibility::Strict;
7023
7024 type Protocol = crate::Device;
7025
7026 type Request = crate::wire::DeviceWritePmicCtrlRegRequest;
7027 }
7028
7029 impl ::fidl_next::TwoWayMethod for WritePmicCtrlReg {
7030 type Response = ::fidl_next::wire::Result<
7031 'static,
7032 crate::wire::DeviceWritePmicCtrlRegResponse,
7033 ::fidl_next::wire::Int32,
7034 >;
7035 }
7036
7037 impl<___R> ::fidl_next::Respond<___R> for WritePmicCtrlReg {
7038 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
7039
7040 fn respond(response: ___R) -> Self::Output {
7041 ::core::result::Result::Ok(response)
7042 }
7043 }
7044
7045 impl<___R> ::fidl_next::RespondErr<___R> for WritePmicCtrlReg {
7046 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
7047
7048 fn respond_err(response: ___R) -> Self::Output {
7049 ::core::result::Result::Err(response)
7050 }
7051 }
7052
7053 pub struct ReadPmicCtrlReg;
7054
7055 impl ::fidl_next::Method for ReadPmicCtrlReg {
7056 const ORDINAL: u64 = 8281766978930618131;
7057 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7058 ::fidl_next::protocol::Flexibility::Strict;
7059
7060 type Protocol = crate::Device;
7061
7062 type Request = crate::wire::DeviceReadPmicCtrlRegRequest;
7063 }
7064
7065 impl ::fidl_next::TwoWayMethod for ReadPmicCtrlReg {
7066 type Response = ::fidl_next::wire::Result<
7067 'static,
7068 crate::wire::DeviceReadPmicCtrlRegResponse,
7069 ::fidl_next::wire::Int32,
7070 >;
7071 }
7072
7073 impl<___R> ::fidl_next::Respond<___R> for ReadPmicCtrlReg {
7074 type Output = ::core::result::Result<
7075 crate::generic::DeviceReadPmicCtrlRegResponse<___R>,
7076 ::fidl_next::util::Never,
7077 >;
7078
7079 fn respond(response: ___R) -> Self::Output {
7080 ::core::result::Result::Ok(crate::generic::DeviceReadPmicCtrlRegResponse {
7081 value: response,
7082 })
7083 }
7084 }
7085
7086 impl<___R> ::fidl_next::RespondErr<___R> for ReadPmicCtrlReg {
7087 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
7088
7089 fn respond_err(response: ___R) -> Self::Output {
7090 ::core::result::Result::Err(response)
7091 }
7092 }
7093
7094 mod ___detail {
7095 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
7096 where
7097 ___T: ::fidl_next::Transport,
7098 {
7099 type Client = DeviceClient<___T>;
7100 type Server = DeviceServer<___T>;
7101 }
7102
7103 #[repr(transparent)]
7105 pub struct DeviceClient<___T: ::fidl_next::Transport> {
7106 #[allow(dead_code)]
7107 client: ::fidl_next::protocol::Client<___T>,
7108 }
7109
7110 impl<___T> DeviceClient<___T>
7111 where
7112 ___T: ::fidl_next::Transport,
7113 {
7114 #[doc = " Register the callee for this power domain. The callee will be registered until\n UnregisterPowerDomain is called. Any voltage changes to the power domain will\n be made considering the min_needed_voltage(in uV) and max_supported_voltage(in uV) published here.\n If voltages mentioned are out of supported voltage range of domain(obtained by calling\n GetSupportedVoltageRange), the callee will be registered with the supported voltage range.\n"]
7115 pub fn register_power_domain(
7116 &self,
7117
7118 min_needed_voltage: impl ::fidl_next::Encode<
7119 ::fidl_next::wire::Uint32,
7120 <___T as ::fidl_next::Transport>::SendBuffer,
7121 >,
7122
7123 max_supported_voltage: impl ::fidl_next::Encode<
7124 ::fidl_next::wire::Uint32,
7125 <___T as ::fidl_next::Transport>::SendBuffer,
7126 >,
7127 ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterPowerDomain, ___T>
7128 where
7129 <___T as ::fidl_next::Transport>::SendBuffer:
7130 ::fidl_next::encoder::InternalHandleEncoder,
7131 {
7132 self.register_power_domain_with(crate::generic::DeviceRegisterPowerDomainRequest {
7133 min_needed_voltage,
7134
7135 max_supported_voltage,
7136 })
7137 }
7138
7139 #[doc = " Register the callee for this power domain. The callee will be registered until\n UnregisterPowerDomain is called. Any voltage changes to the power domain will\n be made considering the min_needed_voltage(in uV) and max_supported_voltage(in uV) published here.\n If voltages mentioned are out of supported voltage range of domain(obtained by calling\n GetSupportedVoltageRange), the callee will be registered with the supported voltage range.\n"]
7140 pub fn register_power_domain_with<___R>(
7141 &self,
7142 request: ___R,
7143 ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterPowerDomain, ___T>
7144 where
7145 ___R: ::fidl_next::Encode<
7146 crate::wire::DeviceRegisterPowerDomainRequest,
7147 <___T as ::fidl_next::Transport>::SendBuffer,
7148 >,
7149 {
7150 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7151 4458069386545205468,
7152 <super::RegisterPowerDomain as ::fidl_next::Method>::FLEXIBILITY,
7153 request,
7154 ))
7155 }
7156
7157 #[doc = " Unregister the callee for this power domain. The callee will no longer be considered as\n a dependent of this power domain.\n"]
7158 pub fn unregister_power_domain(
7159 &self,
7160 ) -> ::fidl_next::TwoWayFuture<'_, super::UnregisterPowerDomain, ___T> {
7161 ::fidl_next::TwoWayFuture::from_untyped(
7162 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7163 7717805237469023337,
7164 <super::UnregisterPowerDomain as ::fidl_next::Method>::FLEXIBILITY,
7165 (),
7166 ),
7167 )
7168 }
7169
7170 #[doc = " Get Supported Voltage Range. min and max are in micorVolts(uV)\n"]
7171 pub fn get_supported_voltage_range(
7172 &self,
7173 ) -> ::fidl_next::TwoWayFuture<'_, super::GetSupportedVoltageRange, ___T> {
7174 ::fidl_next::TwoWayFuture::from_untyped(
7175 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7176 7887361504891407856,
7177 <super::GetSupportedVoltageRange as ::fidl_next::Method>::FLEXIBILITY,
7178 (),
7179 ),
7180 )
7181 }
7182
7183 #[doc = " Request a particular voltage. The actual_voltage is the voltage that the power domain\n is transitioned to after considering supported voltage ranges of all the registered\n dependents. \"voltage\" should be in uV.\n"]
7184 pub fn request_voltage(
7185 &self,
7186
7187 voltage: impl ::fidl_next::Encode<
7188 ::fidl_next::wire::Uint32,
7189 <___T as ::fidl_next::Transport>::SendBuffer,
7190 >,
7191 ) -> ::fidl_next::TwoWayFuture<'_, super::RequestVoltage, ___T>
7192 where
7193 <___T as ::fidl_next::Transport>::SendBuffer:
7194 ::fidl_next::encoder::InternalHandleEncoder,
7195 {
7196 self.request_voltage_with(crate::generic::DeviceRequestVoltageRequest { voltage })
7197 }
7198
7199 #[doc = " Request a particular voltage. The actual_voltage is the voltage that the power domain\n is transitioned to after considering supported voltage ranges of all the registered\n dependents. \"voltage\" should be in uV.\n"]
7200 pub fn request_voltage_with<___R>(
7201 &self,
7202 request: ___R,
7203 ) -> ::fidl_next::TwoWayFuture<'_, super::RequestVoltage, ___T>
7204 where
7205 ___R: ::fidl_next::Encode<
7206 crate::wire::DeviceRequestVoltageRequest,
7207 <___T as ::fidl_next::Transport>::SendBuffer,
7208 >,
7209 {
7210 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7211 2578932345713622683,
7212 <super::RequestVoltage as ::fidl_next::Method>::FLEXIBILITY,
7213 request,
7214 ))
7215 }
7216
7217 #[doc = " Get current voltage in uV.\n"]
7218 pub fn get_current_voltage(
7219 &self,
7220
7221 index: impl ::fidl_next::Encode<
7222 ::fidl_next::wire::Uint32,
7223 <___T as ::fidl_next::Transport>::SendBuffer,
7224 >,
7225 ) -> ::fidl_next::TwoWayFuture<'_, super::GetCurrentVoltage, ___T>
7226 where
7227 <___T as ::fidl_next::Transport>::SendBuffer:
7228 ::fidl_next::encoder::InternalHandleEncoder,
7229 {
7230 self.get_current_voltage_with(crate::generic::DeviceGetCurrentVoltageRequest {
7231 index,
7232 })
7233 }
7234
7235 #[doc = " Get current voltage in uV.\n"]
7236 pub fn get_current_voltage_with<___R>(
7237 &self,
7238 request: ___R,
7239 ) -> ::fidl_next::TwoWayFuture<'_, super::GetCurrentVoltage, ___T>
7240 where
7241 ___R: ::fidl_next::Encode<
7242 crate::wire::DeviceGetCurrentVoltageRequest,
7243 <___T as ::fidl_next::Transport>::SendBuffer,
7244 >,
7245 {
7246 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7247 7683000915093989729,
7248 <super::GetCurrentVoltage as ::fidl_next::Method>::FLEXIBILITY,
7249 request,
7250 ))
7251 }
7252
7253 #[doc = " Get power domain status\n"]
7254 pub fn get_power_domain_status(
7255 &self,
7256 ) -> ::fidl_next::TwoWayFuture<'_, super::GetPowerDomainStatus, ___T> {
7257 ::fidl_next::TwoWayFuture::from_untyped(
7258 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7259 4178917272116294842,
7260 <super::GetPowerDomainStatus as ::fidl_next::Method>::FLEXIBILITY,
7261 (),
7262 ),
7263 )
7264 }
7265
7266 #[doc = " Write to ctrl register of PMIC\n"]
7267 pub fn write_pmic_ctrl_reg(
7268 &self,
7269
7270 reg_addr: impl ::fidl_next::Encode<
7271 ::fidl_next::wire::Uint32,
7272 <___T as ::fidl_next::Transport>::SendBuffer,
7273 >,
7274
7275 value: impl ::fidl_next::Encode<
7276 ::fidl_next::wire::Uint32,
7277 <___T as ::fidl_next::Transport>::SendBuffer,
7278 >,
7279 ) -> ::fidl_next::TwoWayFuture<'_, super::WritePmicCtrlReg, ___T>
7280 where
7281 <___T as ::fidl_next::Transport>::SendBuffer:
7282 ::fidl_next::encoder::InternalHandleEncoder,
7283 {
7284 self.write_pmic_ctrl_reg_with(crate::generic::DeviceWritePmicCtrlRegRequest {
7285 reg_addr,
7286
7287 value,
7288 })
7289 }
7290
7291 #[doc = " Write to ctrl register of PMIC\n"]
7292 pub fn write_pmic_ctrl_reg_with<___R>(
7293 &self,
7294 request: ___R,
7295 ) -> ::fidl_next::TwoWayFuture<'_, super::WritePmicCtrlReg, ___T>
7296 where
7297 ___R: ::fidl_next::Encode<
7298 crate::wire::DeviceWritePmicCtrlRegRequest,
7299 <___T as ::fidl_next::Transport>::SendBuffer,
7300 >,
7301 {
7302 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7303 3749867380549091993,
7304 <super::WritePmicCtrlReg as ::fidl_next::Method>::FLEXIBILITY,
7305 request,
7306 ))
7307 }
7308
7309 #[doc = " Read ctrl register of PMIC\n"]
7310 pub fn read_pmic_ctrl_reg(
7311 &self,
7312
7313 reg_addr: impl ::fidl_next::Encode<
7314 ::fidl_next::wire::Uint32,
7315 <___T as ::fidl_next::Transport>::SendBuffer,
7316 >,
7317 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadPmicCtrlReg, ___T>
7318 where
7319 <___T as ::fidl_next::Transport>::SendBuffer:
7320 ::fidl_next::encoder::InternalHandleEncoder,
7321 {
7322 self.read_pmic_ctrl_reg_with(crate::generic::DeviceReadPmicCtrlRegRequest {
7323 reg_addr,
7324 })
7325 }
7326
7327 #[doc = " Read ctrl register of PMIC\n"]
7328 pub fn read_pmic_ctrl_reg_with<___R>(
7329 &self,
7330 request: ___R,
7331 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadPmicCtrlReg, ___T>
7332 where
7333 ___R: ::fidl_next::Encode<
7334 crate::wire::DeviceReadPmicCtrlRegRequest,
7335 <___T as ::fidl_next::Transport>::SendBuffer,
7336 >,
7337 {
7338 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7339 8281766978930618131,
7340 <super::ReadPmicCtrlReg as ::fidl_next::Method>::FLEXIBILITY,
7341 request,
7342 ))
7343 }
7344 }
7345
7346 #[repr(transparent)]
7348 pub struct DeviceServer<___T: ::fidl_next::Transport> {
7349 server: ::fidl_next::protocol::Server<___T>,
7350 }
7351
7352 impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
7353 }
7354}
7355
7356#[diagnostic::on_unimplemented(
7357 note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
7358)]
7359
7360pub trait DeviceLocalClientHandler<
7364 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7365 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7366>
7367{
7368}
7369
7370impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
7371where
7372 ___H: DeviceLocalClientHandler<___T>,
7373 ___T: ::fidl_next::Transport,
7374{
7375 async fn on_event(
7376 handler: &mut ___H,
7377 ordinal: u64,
7378 flexibility: ::fidl_next::protocol::Flexibility,
7379 body: ::fidl_next::Body<___T>,
7380 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7381 match ordinal {
7382 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7383 }
7384 }
7385}
7386
7387#[diagnostic::on_unimplemented(
7388 note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
7389)]
7390
7391pub trait DeviceLocalServerHandler<
7395 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7396 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7397>
7398{
7399 #[doc = " Register the callee for this power domain. The callee will be registered until\n UnregisterPowerDomain is called. Any voltage changes to the power domain will\n be made considering the min_needed_voltage(in uV) and max_supported_voltage(in uV) published here.\n If voltages mentioned are out of supported voltage range of domain(obtained by calling\n GetSupportedVoltageRange), the callee will be registered with the supported voltage range.\n"]
7400 fn register_power_domain(
7401 &mut self,
7402
7403 request: ::fidl_next::Request<device::RegisterPowerDomain, ___T>,
7404
7405 responder: ::fidl_next::Responder<device::RegisterPowerDomain, ___T>,
7406 ) -> impl ::core::future::Future<Output = ()>;
7407
7408 #[doc = " Unregister the callee for this power domain. The callee will no longer be considered as\n a dependent of this power domain.\n"]
7409 fn unregister_power_domain(
7410 &mut self,
7411
7412 responder: ::fidl_next::Responder<device::UnregisterPowerDomain, ___T>,
7413 ) -> impl ::core::future::Future<Output = ()>;
7414
7415 #[doc = " Get Supported Voltage Range. min and max are in micorVolts(uV)\n"]
7416 fn get_supported_voltage_range(
7417 &mut self,
7418
7419 responder: ::fidl_next::Responder<device::GetSupportedVoltageRange, ___T>,
7420 ) -> impl ::core::future::Future<Output = ()>;
7421
7422 #[doc = " Request a particular voltage. The actual_voltage is the voltage that the power domain\n is transitioned to after considering supported voltage ranges of all the registered\n dependents. \"voltage\" should be in uV.\n"]
7423 fn request_voltage(
7424 &mut self,
7425
7426 request: ::fidl_next::Request<device::RequestVoltage, ___T>,
7427
7428 responder: ::fidl_next::Responder<device::RequestVoltage, ___T>,
7429 ) -> impl ::core::future::Future<Output = ()>;
7430
7431 #[doc = " Get current voltage in uV.\n"]
7432 fn get_current_voltage(
7433 &mut self,
7434
7435 request: ::fidl_next::Request<device::GetCurrentVoltage, ___T>,
7436
7437 responder: ::fidl_next::Responder<device::GetCurrentVoltage, ___T>,
7438 ) -> impl ::core::future::Future<Output = ()>;
7439
7440 #[doc = " Get power domain status\n"]
7441 fn get_power_domain_status(
7442 &mut self,
7443
7444 responder: ::fidl_next::Responder<device::GetPowerDomainStatus, ___T>,
7445 ) -> impl ::core::future::Future<Output = ()>;
7446
7447 #[doc = " Write to ctrl register of PMIC\n"]
7448 fn write_pmic_ctrl_reg(
7449 &mut self,
7450
7451 request: ::fidl_next::Request<device::WritePmicCtrlReg, ___T>,
7452
7453 responder: ::fidl_next::Responder<device::WritePmicCtrlReg, ___T>,
7454 ) -> impl ::core::future::Future<Output = ()>;
7455
7456 #[doc = " Read ctrl register of PMIC\n"]
7457 fn read_pmic_ctrl_reg(
7458 &mut self,
7459
7460 request: ::fidl_next::Request<device::ReadPmicCtrlReg, ___T>,
7461
7462 responder: ::fidl_next::Responder<device::ReadPmicCtrlReg, ___T>,
7463 ) -> impl ::core::future::Future<Output = ()>;
7464}
7465
7466impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
7467where
7468 ___H: DeviceLocalServerHandler<___T>,
7469 ___T: ::fidl_next::Transport,
7470 for<'de> crate::wire::DeviceRegisterPowerDomainRequest: ::fidl_next::Decode<
7471 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7472 Constraint = (),
7473 >,
7474 for<'de> crate::wire::DeviceRequestVoltageRequest: ::fidl_next::Decode<
7475 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7476 Constraint = (),
7477 >,
7478 for<'de> crate::wire::DeviceGetCurrentVoltageRequest: ::fidl_next::Decode<
7479 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7480 Constraint = (),
7481 >,
7482 for<'de> crate::wire::DeviceWritePmicCtrlRegRequest: ::fidl_next::Decode<
7483 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7484 Constraint = (),
7485 >,
7486 for<'de> crate::wire::DeviceReadPmicCtrlRegRequest: ::fidl_next::Decode<
7487 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7488 Constraint = (),
7489 >,
7490{
7491 async fn on_one_way(
7492 handler: &mut ___H,
7493 ordinal: u64,
7494 flexibility: ::fidl_next::protocol::Flexibility,
7495 body: ::fidl_next::Body<___T>,
7496 ) -> ::core::result::Result<
7497 (),
7498 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7499 > {
7500 match ordinal {
7501 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7502 }
7503 }
7504
7505 async fn on_two_way(
7506 handler: &mut ___H,
7507 ordinal: u64,
7508 flexibility: ::fidl_next::protocol::Flexibility,
7509 body: ::fidl_next::Body<___T>,
7510 responder: ::fidl_next::protocol::Responder<___T>,
7511 ) -> ::core::result::Result<
7512 (),
7513 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7514 > {
7515 match ordinal {
7516 4458069386545205468 => {
7517 let responder = ::fidl_next::Responder::from_untyped(responder);
7518
7519 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7520 Ok(decoded) => {
7521 handler
7522 .register_power_domain(
7523 ::fidl_next::Request::from_decoded(decoded),
7524 responder,
7525 )
7526 .await;
7527 Ok(())
7528 }
7529 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7530 ordinal: 4458069386545205468,
7531 error,
7532 }),
7533 }
7534 }
7535
7536 7717805237469023337 => {
7537 let responder = ::fidl_next::Responder::from_untyped(responder);
7538
7539 handler.unregister_power_domain(responder).await;
7540 Ok(())
7541 }
7542
7543 7887361504891407856 => {
7544 let responder = ::fidl_next::Responder::from_untyped(responder);
7545
7546 handler.get_supported_voltage_range(responder).await;
7547 Ok(())
7548 }
7549
7550 2578932345713622683 => {
7551 let responder = ::fidl_next::Responder::from_untyped(responder);
7552
7553 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7554 Ok(decoded) => {
7555 handler
7556 .request_voltage(::fidl_next::Request::from_decoded(decoded), responder)
7557 .await;
7558 Ok(())
7559 }
7560 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7561 ordinal: 2578932345713622683,
7562 error,
7563 }),
7564 }
7565 }
7566
7567 7683000915093989729 => {
7568 let responder = ::fidl_next::Responder::from_untyped(responder);
7569
7570 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7571 Ok(decoded) => {
7572 handler
7573 .get_current_voltage(
7574 ::fidl_next::Request::from_decoded(decoded),
7575 responder,
7576 )
7577 .await;
7578 Ok(())
7579 }
7580 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7581 ordinal: 7683000915093989729,
7582 error,
7583 }),
7584 }
7585 }
7586
7587 4178917272116294842 => {
7588 let responder = ::fidl_next::Responder::from_untyped(responder);
7589
7590 handler.get_power_domain_status(responder).await;
7591 Ok(())
7592 }
7593
7594 3749867380549091993 => {
7595 let responder = ::fidl_next::Responder::from_untyped(responder);
7596
7597 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7598 Ok(decoded) => {
7599 handler
7600 .write_pmic_ctrl_reg(
7601 ::fidl_next::Request::from_decoded(decoded),
7602 responder,
7603 )
7604 .await;
7605 Ok(())
7606 }
7607 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7608 ordinal: 3749867380549091993,
7609 error,
7610 }),
7611 }
7612 }
7613
7614 8281766978930618131 => {
7615 let responder = ::fidl_next::Responder::from_untyped(responder);
7616
7617 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7618 Ok(decoded) => {
7619 handler
7620 .read_pmic_ctrl_reg(
7621 ::fidl_next::Request::from_decoded(decoded),
7622 responder,
7623 )
7624 .await;
7625 Ok(())
7626 }
7627 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7628 ordinal: 8281766978930618131,
7629 error,
7630 }),
7631 }
7632 }
7633
7634 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7635 }
7636 }
7637}
7638
7639pub trait DeviceClientHandler<
7643 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7644 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7645>
7646{
7647}
7648
7649impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
7650where
7651 ___H: DeviceClientHandler<___T> + ::core::marker::Send,
7652 ___T: ::fidl_next::Transport,
7653{
7654 async fn on_event(
7655 handler: &mut ___H,
7656 ordinal: u64,
7657 flexibility: ::fidl_next::protocol::Flexibility,
7658 body: ::fidl_next::Body<___T>,
7659 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7660 match ordinal {
7661 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7662 }
7663 }
7664}
7665
7666pub trait DeviceServerHandler<
7670 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7671 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7672>
7673{
7674 #[doc = " Register the callee for this power domain. The callee will be registered until\n UnregisterPowerDomain is called. Any voltage changes to the power domain will\n be made considering the min_needed_voltage(in uV) and max_supported_voltage(in uV) published here.\n If voltages mentioned are out of supported voltage range of domain(obtained by calling\n GetSupportedVoltageRange), the callee will be registered with the supported voltage range.\n"]
7675 fn register_power_domain(
7676 &mut self,
7677
7678 request: ::fidl_next::Request<device::RegisterPowerDomain, ___T>,
7679
7680 responder: ::fidl_next::Responder<device::RegisterPowerDomain, ___T>,
7681 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7682
7683 #[doc = " Unregister the callee for this power domain. The callee will no longer be considered as\n a dependent of this power domain.\n"]
7684 fn unregister_power_domain(
7685 &mut self,
7686
7687 responder: ::fidl_next::Responder<device::UnregisterPowerDomain, ___T>,
7688 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7689
7690 #[doc = " Get Supported Voltage Range. min and max are in micorVolts(uV)\n"]
7691 fn get_supported_voltage_range(
7692 &mut self,
7693
7694 responder: ::fidl_next::Responder<device::GetSupportedVoltageRange, ___T>,
7695 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7696
7697 #[doc = " Request a particular voltage. The actual_voltage is the voltage that the power domain\n is transitioned to after considering supported voltage ranges of all the registered\n dependents. \"voltage\" should be in uV.\n"]
7698 fn request_voltage(
7699 &mut self,
7700
7701 request: ::fidl_next::Request<device::RequestVoltage, ___T>,
7702
7703 responder: ::fidl_next::Responder<device::RequestVoltage, ___T>,
7704 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7705
7706 #[doc = " Get current voltage in uV.\n"]
7707 fn get_current_voltage(
7708 &mut self,
7709
7710 request: ::fidl_next::Request<device::GetCurrentVoltage, ___T>,
7711
7712 responder: ::fidl_next::Responder<device::GetCurrentVoltage, ___T>,
7713 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7714
7715 #[doc = " Get power domain status\n"]
7716 fn get_power_domain_status(
7717 &mut self,
7718
7719 responder: ::fidl_next::Responder<device::GetPowerDomainStatus, ___T>,
7720 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7721
7722 #[doc = " Write to ctrl register of PMIC\n"]
7723 fn write_pmic_ctrl_reg(
7724 &mut self,
7725
7726 request: ::fidl_next::Request<device::WritePmicCtrlReg, ___T>,
7727
7728 responder: ::fidl_next::Responder<device::WritePmicCtrlReg, ___T>,
7729 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7730
7731 #[doc = " Read ctrl register of PMIC\n"]
7732 fn read_pmic_ctrl_reg(
7733 &mut self,
7734
7735 request: ::fidl_next::Request<device::ReadPmicCtrlReg, ___T>,
7736
7737 responder: ::fidl_next::Responder<device::ReadPmicCtrlReg, ___T>,
7738 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7739}
7740
7741impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
7742where
7743 ___H: DeviceServerHandler<___T> + ::core::marker::Send,
7744 ___T: ::fidl_next::Transport,
7745 for<'de> crate::wire::DeviceRegisterPowerDomainRequest: ::fidl_next::Decode<
7746 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7747 Constraint = (),
7748 >,
7749 for<'de> crate::wire::DeviceRequestVoltageRequest: ::fidl_next::Decode<
7750 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7751 Constraint = (),
7752 >,
7753 for<'de> crate::wire::DeviceGetCurrentVoltageRequest: ::fidl_next::Decode<
7754 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7755 Constraint = (),
7756 >,
7757 for<'de> crate::wire::DeviceWritePmicCtrlRegRequest: ::fidl_next::Decode<
7758 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7759 Constraint = (),
7760 >,
7761 for<'de> crate::wire::DeviceReadPmicCtrlRegRequest: ::fidl_next::Decode<
7762 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7763 Constraint = (),
7764 >,
7765{
7766 async fn on_one_way(
7767 handler: &mut ___H,
7768 ordinal: u64,
7769 flexibility: ::fidl_next::protocol::Flexibility,
7770 body: ::fidl_next::Body<___T>,
7771 ) -> ::core::result::Result<
7772 (),
7773 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7774 > {
7775 match ordinal {
7776 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7777 }
7778 }
7779
7780 async fn on_two_way(
7781 handler: &mut ___H,
7782 ordinal: u64,
7783 flexibility: ::fidl_next::protocol::Flexibility,
7784 body: ::fidl_next::Body<___T>,
7785 responder: ::fidl_next::protocol::Responder<___T>,
7786 ) -> ::core::result::Result<
7787 (),
7788 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7789 > {
7790 match ordinal {
7791 4458069386545205468 => {
7792 let responder = ::fidl_next::Responder::from_untyped(responder);
7793
7794 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7795 Ok(decoded) => {
7796 handler
7797 .register_power_domain(
7798 ::fidl_next::Request::from_decoded(decoded),
7799 responder,
7800 )
7801 .await;
7802 Ok(())
7803 }
7804 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7805 ordinal: 4458069386545205468,
7806 error,
7807 }),
7808 }
7809 }
7810
7811 7717805237469023337 => {
7812 let responder = ::fidl_next::Responder::from_untyped(responder);
7813
7814 handler.unregister_power_domain(responder).await;
7815 Ok(())
7816 }
7817
7818 7887361504891407856 => {
7819 let responder = ::fidl_next::Responder::from_untyped(responder);
7820
7821 handler.get_supported_voltage_range(responder).await;
7822 Ok(())
7823 }
7824
7825 2578932345713622683 => {
7826 let responder = ::fidl_next::Responder::from_untyped(responder);
7827
7828 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7829 Ok(decoded) => {
7830 handler
7831 .request_voltage(::fidl_next::Request::from_decoded(decoded), responder)
7832 .await;
7833 Ok(())
7834 }
7835 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7836 ordinal: 2578932345713622683,
7837 error,
7838 }),
7839 }
7840 }
7841
7842 7683000915093989729 => {
7843 let responder = ::fidl_next::Responder::from_untyped(responder);
7844
7845 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7846 Ok(decoded) => {
7847 handler
7848 .get_current_voltage(
7849 ::fidl_next::Request::from_decoded(decoded),
7850 responder,
7851 )
7852 .await;
7853 Ok(())
7854 }
7855 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7856 ordinal: 7683000915093989729,
7857 error,
7858 }),
7859 }
7860 }
7861
7862 4178917272116294842 => {
7863 let responder = ::fidl_next::Responder::from_untyped(responder);
7864
7865 handler.get_power_domain_status(responder).await;
7866 Ok(())
7867 }
7868
7869 3749867380549091993 => {
7870 let responder = ::fidl_next::Responder::from_untyped(responder);
7871
7872 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7873 Ok(decoded) => {
7874 handler
7875 .write_pmic_ctrl_reg(
7876 ::fidl_next::Request::from_decoded(decoded),
7877 responder,
7878 )
7879 .await;
7880 Ok(())
7881 }
7882 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7883 ordinal: 3749867380549091993,
7884 error,
7885 }),
7886 }
7887 }
7888
7889 8281766978930618131 => {
7890 let responder = ::fidl_next::Responder::from_untyped(responder);
7891
7892 match ::fidl_next::AsDecoderExt::into_decoded(body) {
7893 Ok(decoded) => {
7894 handler
7895 .read_pmic_ctrl_reg(
7896 ::fidl_next::Request::from_decoded(decoded),
7897 responder,
7898 )
7899 .await;
7900 Ok(())
7901 }
7902 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7903 ordinal: 8281766978930618131,
7904 error,
7905 }),
7906 }
7907 }
7908
7909 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7910 }
7911 }
7912}
7913
7914impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
7915{}
7916
7917impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
7918where
7919 ___H: DeviceClientHandler<___T>,
7920 ___T: ::fidl_next::Transport,
7921{
7922}
7923
7924impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
7925where
7926 ___H: DeviceServerHandler<___T>,
7927 ___T: ::fidl_next::Transport,
7928{
7929 async fn register_power_domain(
7930 &mut self,
7931
7932 request: ::fidl_next::Request<device::RegisterPowerDomain, ___T>,
7933
7934 responder: ::fidl_next::Responder<device::RegisterPowerDomain, ___T>,
7935 ) {
7936 ___H::register_power_domain(&mut self.0, request, responder).await
7937 }
7938
7939 async fn unregister_power_domain(
7940 &mut self,
7941
7942 responder: ::fidl_next::Responder<device::UnregisterPowerDomain, ___T>,
7943 ) {
7944 ___H::unregister_power_domain(&mut self.0, responder).await
7945 }
7946
7947 async fn get_supported_voltage_range(
7948 &mut self,
7949
7950 responder: ::fidl_next::Responder<device::GetSupportedVoltageRange, ___T>,
7951 ) {
7952 ___H::get_supported_voltage_range(&mut self.0, responder).await
7953 }
7954
7955 async fn request_voltage(
7956 &mut self,
7957
7958 request: ::fidl_next::Request<device::RequestVoltage, ___T>,
7959
7960 responder: ::fidl_next::Responder<device::RequestVoltage, ___T>,
7961 ) {
7962 ___H::request_voltage(&mut self.0, request, responder).await
7963 }
7964
7965 async fn get_current_voltage(
7966 &mut self,
7967
7968 request: ::fidl_next::Request<device::GetCurrentVoltage, ___T>,
7969
7970 responder: ::fidl_next::Responder<device::GetCurrentVoltage, ___T>,
7971 ) {
7972 ___H::get_current_voltage(&mut self.0, request, responder).await
7973 }
7974
7975 async fn get_power_domain_status(
7976 &mut self,
7977
7978 responder: ::fidl_next::Responder<device::GetPowerDomainStatus, ___T>,
7979 ) {
7980 ___H::get_power_domain_status(&mut self.0, responder).await
7981 }
7982
7983 async fn write_pmic_ctrl_reg(
7984 &mut self,
7985
7986 request: ::fidl_next::Request<device::WritePmicCtrlReg, ___T>,
7987
7988 responder: ::fidl_next::Responder<device::WritePmicCtrlReg, ___T>,
7989 ) {
7990 ___H::write_pmic_ctrl_reg(&mut self.0, request, responder).await
7991 }
7992
7993 async fn read_pmic_ctrl_reg(
7994 &mut self,
7995
7996 request: ::fidl_next::Request<device::ReadPmicCtrlReg, ___T>,
7997
7998 responder: ::fidl_next::Responder<device::ReadPmicCtrlReg, ___T>,
7999 ) {
8000 ___H::read_pmic_ctrl_reg(&mut self.0, request, responder).await
8001 }
8002}