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 take_target_level(&mut self) -> ::core::option::Option<u8> {
4115 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
4116 }
4117
4118 pub fn latency_us(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
4119 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4120 }
4121
4122 pub fn take_latency_us(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
4123 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
4124 }
4125 }
4126
4127 impl<'de> ::core::fmt::Debug for Transition<'de> {
4128 fn fmt(
4129 &self,
4130 f: &mut ::core::fmt::Formatter<'_>,
4131 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4132 f.debug_struct("Transition")
4133 .field("target_level", &self.target_level())
4134 .field("latency_us", &self.latency_us())
4135 .finish()
4136 }
4137 }
4138
4139 impl<'de> ::fidl_next::IntoNatural for Transition<'de> {
4140 type Natural = crate::natural::Transition;
4141 }
4142
4143 #[repr(C)]
4145 pub struct PowerLevel<'de> {
4146 pub(crate) table: ::fidl_next::wire::Table<'de>,
4147 }
4148
4149 impl<'de> Drop for PowerLevel<'de> {
4150 fn drop(&mut self) {
4151 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
4152
4153 let _ = self.table.get(2).map(|envelope| unsafe {
4154 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4155 });
4156
4157 let _ = self.table.get(3).map(|envelope| unsafe {
4158 envelope
4159 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>>(
4160 )
4161 });
4162 }
4163 }
4164
4165 impl ::fidl_next::Constrained for PowerLevel<'_> {
4166 type Constraint = ();
4167
4168 fn validate(
4169 _: ::fidl_next::Slot<'_, Self>,
4170 _: Self::Constraint,
4171 ) -> Result<(), ::fidl_next::ValidationError> {
4172 Ok(())
4173 }
4174 }
4175
4176 unsafe impl ::fidl_next::Wire for PowerLevel<'static> {
4177 type Narrowed<'de> = PowerLevel<'de>;
4178
4179 #[inline]
4180 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4181 ::fidl_next::munge!(let Self { table } = out);
4182 ::fidl_next::wire::Table::zero_padding(table);
4183 }
4184 }
4185
4186 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerLevel<'de>
4187 where
4188 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4189 {
4190 fn decode(
4191 slot: ::fidl_next::Slot<'_, Self>,
4192 decoder: &mut ___D,
4193 _: (),
4194 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4195 ::fidl_next::munge!(let Self { table } = slot);
4196
4197 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4198 match ordinal {
4199 0 => unsafe { ::core::hint::unreachable_unchecked() },
4200
4201 1 => {
4202 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
4203 slot.as_mut(),
4204 decoder,
4205 (),
4206 )?;
4207
4208 Ok(())
4209 }
4210
4211 2 => {
4212 ::fidl_next::wire::Envelope::decode_as::<
4213 ___D,
4214 ::fidl_next::wire::String<'de>,
4215 >(slot.as_mut(), decoder, 63)?;
4216
4217 let value = unsafe {
4218 slot.deref_unchecked()
4219 .deref_unchecked::<::fidl_next::wire::String<'_>>()
4220 };
4221
4222 if value.len() > 63 {
4223 return Err(::fidl_next::DecodeError::VectorTooLong {
4224 size: value.len() as u64,
4225 limit: 63,
4226 });
4227 }
4228
4229 Ok(())
4230 }
4231
4232 3 => {
4233 ::fidl_next::wire::Envelope::decode_as::<
4234 ___D,
4235 ::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>,
4236 >(slot.as_mut(), decoder, (127, ()))?;
4237
4238 let value = unsafe {
4239 slot
4240 .deref_unchecked()
4241 .deref_unchecked::<
4242 ::fidl_next::wire::Vector<'_, crate::wire::Transition<'_>>
4243 >()
4244 };
4245
4246 if value.len() > 127 {
4247 return Err(::fidl_next::DecodeError::VectorTooLong {
4248 size: value.len() as u64,
4249 limit: 127,
4250 });
4251 }
4252
4253 Ok(())
4254 }
4255
4256 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4257 }
4258 })
4259 }
4260 }
4261
4262 impl<'de> PowerLevel<'de> {
4263 pub fn level(&self) -> ::core::option::Option<&u8> {
4264 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4265 }
4266
4267 pub fn take_level(&mut self) -> ::core::option::Option<u8> {
4268 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
4269 }
4270
4271 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
4272 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4273 }
4274
4275 pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
4276 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
4277 }
4278
4279 pub fn transitions(
4280 &self,
4281 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>>
4282 {
4283 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4284 }
4285
4286 pub fn take_transitions(
4287 &mut self,
4288 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::Transition<'de>>>
4289 {
4290 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
4291 }
4292 }
4293
4294 impl<'de> ::core::fmt::Debug for PowerLevel<'de> {
4295 fn fmt(
4296 &self,
4297 f: &mut ::core::fmt::Formatter<'_>,
4298 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4299 f.debug_struct("PowerLevel")
4300 .field("level", &self.level())
4301 .field("name", &self.name())
4302 .field("transitions", &self.transitions())
4303 .finish()
4304 }
4305 }
4306
4307 impl<'de> ::fidl_next::IntoNatural for PowerLevel<'de> {
4308 type Natural = crate::natural::PowerLevel;
4309 }
4310
4311 #[repr(C)]
4313 pub struct PowerElement<'de> {
4314 pub(crate) table: ::fidl_next::wire::Table<'de>,
4315 }
4316
4317 impl<'de> Drop for PowerElement<'de> {
4318 fn drop(&mut self) {
4319 let _ = self.table.get(1).map(|envelope| unsafe {
4320 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4321 });
4322
4323 let _ = self.table.get(2).map(|envelope| unsafe {
4324 envelope
4325 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>>(
4326 )
4327 });
4328 }
4329 }
4330
4331 impl ::fidl_next::Constrained for PowerElement<'_> {
4332 type Constraint = ();
4333
4334 fn validate(
4335 _: ::fidl_next::Slot<'_, Self>,
4336 _: Self::Constraint,
4337 ) -> Result<(), ::fidl_next::ValidationError> {
4338 Ok(())
4339 }
4340 }
4341
4342 unsafe impl ::fidl_next::Wire for PowerElement<'static> {
4343 type Narrowed<'de> = PowerElement<'de>;
4344
4345 #[inline]
4346 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4347 ::fidl_next::munge!(let Self { table } = out);
4348 ::fidl_next::wire::Table::zero_padding(table);
4349 }
4350 }
4351
4352 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerElement<'de>
4353 where
4354 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4355 {
4356 fn decode(
4357 slot: ::fidl_next::Slot<'_, Self>,
4358 decoder: &mut ___D,
4359 _: (),
4360 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4361 ::fidl_next::munge!(let Self { table } = slot);
4362
4363 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4364 match ordinal {
4365 0 => unsafe { ::core::hint::unreachable_unchecked() },
4366
4367 1 => {
4368 ::fidl_next::wire::Envelope::decode_as::<
4369 ___D,
4370 ::fidl_next::wire::String<'de>,
4371 >(slot.as_mut(), decoder, 63)?;
4372
4373 let value = unsafe {
4374 slot.deref_unchecked()
4375 .deref_unchecked::<::fidl_next::wire::String<'_>>()
4376 };
4377
4378 if value.len() > 63 {
4379 return Err(::fidl_next::DecodeError::VectorTooLong {
4380 size: value.len() as u64,
4381 limit: 63,
4382 });
4383 }
4384
4385 Ok(())
4386 }
4387
4388 2 => {
4389 ::fidl_next::wire::Envelope::decode_as::<
4390 ___D,
4391 ::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>,
4392 >(slot.as_mut(), decoder, (128, ()))?;
4393
4394 let value = unsafe {
4395 slot
4396 .deref_unchecked()
4397 .deref_unchecked::<
4398 ::fidl_next::wire::Vector<'_, crate::wire::PowerLevel<'_>>
4399 >()
4400 };
4401
4402 if value.len() > 128 {
4403 return Err(::fidl_next::DecodeError::VectorTooLong {
4404 size: value.len() as u64,
4405 limit: 128,
4406 });
4407 }
4408
4409 Ok(())
4410 }
4411
4412 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4413 }
4414 })
4415 }
4416 }
4417
4418 impl<'de> PowerElement<'de> {
4419 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
4420 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4421 }
4422
4423 pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
4424 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
4425 }
4426
4427 pub fn levels(
4428 &self,
4429 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>>
4430 {
4431 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4432 }
4433
4434 pub fn take_levels(
4435 &mut self,
4436 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::PowerLevel<'de>>>
4437 {
4438 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
4439 }
4440 }
4441
4442 impl<'de> ::core::fmt::Debug for PowerElement<'de> {
4443 fn fmt(
4444 &self,
4445 f: &mut ::core::fmt::Formatter<'_>,
4446 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4447 f.debug_struct("PowerElement")
4448 .field("name", &self.name())
4449 .field("levels", &self.levels())
4450 .finish()
4451 }
4452 }
4453
4454 impl<'de> ::fidl_next::IntoNatural for PowerElement<'de> {
4455 type Natural = crate::natural::PowerElement;
4456 }
4457
4458 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
4460 #[repr(transparent)]
4461 pub struct SagElement {
4462 pub(crate) value: ::fidl_next::wire::Uint32,
4463 }
4464
4465 impl ::fidl_next::Constrained for SagElement {
4466 type Constraint = ();
4467
4468 fn validate(
4469 _: ::fidl_next::Slot<'_, Self>,
4470 _: Self::Constraint,
4471 ) -> Result<(), ::fidl_next::ValidationError> {
4472 Ok(())
4473 }
4474 }
4475
4476 unsafe impl ::fidl_next::Wire for SagElement {
4477 type Narrowed<'de> = Self;
4478
4479 #[inline]
4480 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4481 }
4483 }
4484
4485 impl SagElement {
4486 pub const EXECUTION_STATE: SagElement = SagElement { value: ::fidl_next::wire::Uint32(1) };
4487
4488 pub const APPLICATION_ACTIVITY: SagElement =
4489 SagElement { value: ::fidl_next::wire::Uint32(4) };
4490 }
4491
4492 unsafe impl<___D> ::fidl_next::Decode<___D> for SagElement
4493 where
4494 ___D: ?Sized,
4495 {
4496 fn decode(
4497 slot: ::fidl_next::Slot<'_, Self>,
4498 _: &mut ___D,
4499 _: (),
4500 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4501 ::fidl_next::munge!(let Self { value } = slot);
4502
4503 match u32::from(*value) {
4504 1 | 4 => (),
4505 unknown => {
4506 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
4507 }
4508 }
4509
4510 Ok(())
4511 }
4512 }
4513
4514 impl ::core::convert::From<crate::natural::SagElement> for SagElement {
4515 fn from(natural: crate::natural::SagElement) -> Self {
4516 match natural {
4517 crate::natural::SagElement::ExecutionState => SagElement::EXECUTION_STATE,
4518
4519 crate::natural::SagElement::ApplicationActivity => SagElement::APPLICATION_ACTIVITY,
4520 }
4521 }
4522 }
4523
4524 impl ::fidl_next::IntoNatural for SagElement {
4525 type Natural = crate::natural::SagElement;
4526 }
4527
4528 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
4530 #[repr(transparent)]
4531 pub struct CpuPowerElement {
4532 pub(crate) value: ::fidl_next::wire::Uint32,
4533 }
4534
4535 impl ::fidl_next::Constrained for CpuPowerElement {
4536 type Constraint = ();
4537
4538 fn validate(
4539 _: ::fidl_next::Slot<'_, Self>,
4540 _: Self::Constraint,
4541 ) -> Result<(), ::fidl_next::ValidationError> {
4542 Ok(())
4543 }
4544 }
4545
4546 unsafe impl ::fidl_next::Wire for CpuPowerElement {
4547 type Narrowed<'de> = Self;
4548
4549 #[inline]
4550 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4551 }
4553 }
4554
4555 impl CpuPowerElement {
4556 pub const CPU: CpuPowerElement = CpuPowerElement { value: ::fidl_next::wire::Uint32(1) };
4557 }
4558
4559 unsafe impl<___D> ::fidl_next::Decode<___D> for CpuPowerElement
4560 where
4561 ___D: ?Sized,
4562 {
4563 fn decode(
4564 slot: ::fidl_next::Slot<'_, Self>,
4565 _: &mut ___D,
4566 _: (),
4567 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4568 ::fidl_next::munge!(let Self { value } = slot);
4569
4570 match u32::from(*value) {
4571 1 => (),
4572 unknown => {
4573 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
4574 }
4575 }
4576
4577 Ok(())
4578 }
4579 }
4580
4581 impl ::core::convert::From<crate::natural::CpuPowerElement> for CpuPowerElement {
4582 fn from(natural: crate::natural::CpuPowerElement) -> Self {
4583 match natural {
4584 crate::natural::CpuPowerElement::Cpu => CpuPowerElement::CPU,
4585 }
4586 }
4587 }
4588
4589 impl ::fidl_next::IntoNatural for CpuPowerElement {
4590 type Natural = crate::natural::CpuPowerElement;
4591 }
4592
4593 #[repr(transparent)]
4595 pub struct ParentElement<'de> {
4596 pub(crate) raw: ::fidl_next::wire::Union,
4597 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4598 }
4599
4600 impl<'de> Drop for ParentElement<'de> {
4601 fn drop(&mut self) {
4602 match self.raw.ordinal() {
4603 1 => {
4604 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::SagElement>() };
4605 }
4606
4607 2 => {
4608 let _ = unsafe {
4609 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
4610 };
4611 }
4612
4613 3 => {
4614 let _ =
4615 unsafe { self.raw.get().read_unchecked::<crate::wire::CpuPowerElement>() };
4616 }
4617
4618 _ => unsafe { ::core::hint::unreachable_unchecked() },
4619 }
4620 }
4621 }
4622
4623 impl ::fidl_next::Constrained for ParentElement<'_> {
4624 type Constraint = ();
4625
4626 fn validate(
4627 _: ::fidl_next::Slot<'_, Self>,
4628 _: Self::Constraint,
4629 ) -> Result<(), ::fidl_next::ValidationError> {
4630 Ok(())
4631 }
4632 }
4633
4634 unsafe impl ::fidl_next::Wire for ParentElement<'static> {
4635 type Narrowed<'de> = ParentElement<'de>;
4636
4637 #[inline]
4638 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4639 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4640 ::fidl_next::wire::Union::zero_padding(raw);
4641 }
4642 }
4643
4644 pub mod parent_element {
4645 pub enum Ref<'de> {
4646 Sag(&'de crate::wire::SagElement),
4647
4648 InstanceName(&'de ::fidl_next::wire::String<'de>),
4649
4650 CpuControl(&'de crate::wire::CpuPowerElement),
4651 }
4652
4653 pub enum Value<'de> {
4654 Sag(crate::wire::SagElement),
4655
4656 InstanceName(::fidl_next::wire::String<'de>),
4657
4658 CpuControl(crate::wire::CpuPowerElement),
4659 }
4660 }
4661
4662 impl<'de> ParentElement<'de> {
4663 pub fn as_ref(&self) -> crate::wire::parent_element::Ref<'_> {
4664 match self.raw.ordinal() {
4665 1 => crate::wire::parent_element::Ref::Sag(unsafe {
4666 self.raw.get().deref_unchecked::<crate::wire::SagElement>()
4667 }),
4668
4669 2 => crate::wire::parent_element::Ref::InstanceName(unsafe {
4670 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
4671 }),
4672
4673 3 => crate::wire::parent_element::Ref::CpuControl(unsafe {
4674 self.raw.get().deref_unchecked::<crate::wire::CpuPowerElement>()
4675 }),
4676
4677 _ => unsafe { ::core::hint::unreachable_unchecked() },
4678 }
4679 }
4680
4681 pub fn into_inner(self) -> crate::wire::parent_element::Value<'de> {
4682 let this = ::core::mem::ManuallyDrop::new(self);
4683
4684 match this.raw.ordinal() {
4685 1 => crate::wire::parent_element::Value::Sag(unsafe {
4686 this.raw.get().read_unchecked::<crate::wire::SagElement>()
4687 }),
4688
4689 2 => crate::wire::parent_element::Value::InstanceName(unsafe {
4690 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
4691 }),
4692
4693 3 => crate::wire::parent_element::Value::CpuControl(unsafe {
4694 this.raw.get().read_unchecked::<crate::wire::CpuPowerElement>()
4695 }),
4696
4697 _ => unsafe { ::core::hint::unreachable_unchecked() },
4698 }
4699 }
4700 }
4701
4702 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ParentElement<'de>
4703 where
4704 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4705 ___D: ::fidl_next::Decoder<'de>,
4706 {
4707 fn decode(
4708 mut slot: ::fidl_next::Slot<'_, Self>,
4709 decoder: &mut ___D,
4710 _: (),
4711 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4712 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4713 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
4714 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SagElement>(
4715 raw,
4716 decoder,
4717 (),
4718 )?,
4719
4720 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
4721 raw, decoder, 63,
4722 )?,
4723
4724 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CpuPowerElement>(
4725 raw,
4726 decoder,
4727 (),
4728 )?,
4729
4730 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
4731 }
4732
4733 Ok(())
4734 }
4735 }
4736
4737 impl<'de> ::core::fmt::Debug for ParentElement<'de> {
4738 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4739 match self.raw.ordinal() {
4740 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::SagElement>().fmt(f) },
4741 2 => unsafe {
4742 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
4743 },
4744 3 => unsafe {
4745 self.raw.get().deref_unchecked::<crate::wire::CpuPowerElement>().fmt(f)
4746 },
4747 _ => unsafe { ::core::hint::unreachable_unchecked() },
4748 }
4749 }
4750 }
4751
4752 impl<'de> ::fidl_next::IntoNatural for ParentElement<'de> {
4753 type Natural = crate::natural::ParentElement;
4754 }
4755
4756 #[repr(C)]
4758 pub struct LevelTuple<'de> {
4759 pub(crate) table: ::fidl_next::wire::Table<'de>,
4760 }
4761
4762 impl<'de> Drop for LevelTuple<'de> {
4763 fn drop(&mut self) {
4764 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
4765
4766 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
4767 }
4768 }
4769
4770 impl ::fidl_next::Constrained for LevelTuple<'_> {
4771 type Constraint = ();
4772
4773 fn validate(
4774 _: ::fidl_next::Slot<'_, Self>,
4775 _: Self::Constraint,
4776 ) -> Result<(), ::fidl_next::ValidationError> {
4777 Ok(())
4778 }
4779 }
4780
4781 unsafe impl ::fidl_next::Wire for LevelTuple<'static> {
4782 type Narrowed<'de> = LevelTuple<'de>;
4783
4784 #[inline]
4785 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4786 ::fidl_next::munge!(let Self { table } = out);
4787 ::fidl_next::wire::Table::zero_padding(table);
4788 }
4789 }
4790
4791 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LevelTuple<'de>
4792 where
4793 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4794 {
4795 fn decode(
4796 slot: ::fidl_next::Slot<'_, Self>,
4797 decoder: &mut ___D,
4798 _: (),
4799 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4800 ::fidl_next::munge!(let Self { table } = slot);
4801
4802 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4803 match ordinal {
4804 0 => unsafe { ::core::hint::unreachable_unchecked() },
4805
4806 1 => {
4807 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
4808 slot.as_mut(),
4809 decoder,
4810 (),
4811 )?;
4812
4813 Ok(())
4814 }
4815
4816 2 => {
4817 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
4818 slot.as_mut(),
4819 decoder,
4820 (),
4821 )?;
4822
4823 Ok(())
4824 }
4825
4826 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4827 }
4828 })
4829 }
4830 }
4831
4832 impl<'de> LevelTuple<'de> {
4833 pub fn child_level(&self) -> ::core::option::Option<&u8> {
4834 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4835 }
4836
4837 pub fn take_child_level(&mut self) -> ::core::option::Option<u8> {
4838 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
4839 }
4840
4841 pub fn parent_level(&self) -> ::core::option::Option<&u8> {
4842 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4843 }
4844
4845 pub fn take_parent_level(&mut self) -> ::core::option::Option<u8> {
4846 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
4847 }
4848 }
4849
4850 impl<'de> ::core::fmt::Debug for LevelTuple<'de> {
4851 fn fmt(
4852 &self,
4853 f: &mut ::core::fmt::Formatter<'_>,
4854 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4855 f.debug_struct("LevelTuple")
4856 .field("child_level", &self.child_level())
4857 .field("parent_level", &self.parent_level())
4858 .finish()
4859 }
4860 }
4861
4862 impl<'de> ::fidl_next::IntoNatural for LevelTuple<'de> {
4863 type Natural = crate::natural::LevelTuple;
4864 }
4865
4866 #[repr(C)]
4868 pub struct PowerDependency<'de> {
4869 pub(crate) table: ::fidl_next::wire::Table<'de>,
4870 }
4871
4872 impl<'de> Drop for PowerDependency<'de> {
4873 fn drop(&mut self) {
4874 let _ = self.table.get(1).map(|envelope| unsafe {
4875 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4876 });
4877
4878 let _ = self.table.get(2).map(|envelope| unsafe {
4879 envelope.read_unchecked::<crate::wire::ParentElement<'de>>()
4880 });
4881
4882 let _ = self.table.get(3).map(|envelope| unsafe {
4883 envelope
4884 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>>(
4885 )
4886 });
4887 }
4888 }
4889
4890 impl ::fidl_next::Constrained for PowerDependency<'_> {
4891 type Constraint = ();
4892
4893 fn validate(
4894 _: ::fidl_next::Slot<'_, Self>,
4895 _: Self::Constraint,
4896 ) -> Result<(), ::fidl_next::ValidationError> {
4897 Ok(())
4898 }
4899 }
4900
4901 unsafe impl ::fidl_next::Wire for PowerDependency<'static> {
4902 type Narrowed<'de> = PowerDependency<'de>;
4903
4904 #[inline]
4905 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4906 ::fidl_next::munge!(let Self { table } = out);
4907 ::fidl_next::wire::Table::zero_padding(table);
4908 }
4909 }
4910
4911 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerDependency<'de>
4912 where
4913 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4914 {
4915 fn decode(
4916 slot: ::fidl_next::Slot<'_, Self>,
4917 decoder: &mut ___D,
4918 _: (),
4919 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4920 ::fidl_next::munge!(let Self { table } = slot);
4921
4922 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4923 match ordinal {
4924 0 => unsafe { ::core::hint::unreachable_unchecked() },
4925
4926 1 => {
4927 ::fidl_next::wire::Envelope::decode_as::<
4928 ___D,
4929 ::fidl_next::wire::String<'de>,
4930 >(slot.as_mut(), decoder, 63)?;
4931
4932 let value = unsafe {
4933 slot.deref_unchecked()
4934 .deref_unchecked::<::fidl_next::wire::String<'_>>()
4935 };
4936
4937 if value.len() > 63 {
4938 return Err(::fidl_next::DecodeError::VectorTooLong {
4939 size: value.len() as u64,
4940 limit: 63,
4941 });
4942 }
4943
4944 Ok(())
4945 }
4946
4947 2 => {
4948 ::fidl_next::wire::Envelope::decode_as::<
4949 ___D,
4950 crate::wire::ParentElement<'de>,
4951 >(slot.as_mut(), decoder, ())?;
4952
4953 Ok(())
4954 }
4955
4956 3 => {
4957 ::fidl_next::wire::Envelope::decode_as::<
4958 ___D,
4959 ::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>,
4960 >(slot.as_mut(), decoder, (128, ()))?;
4961
4962 let value = unsafe {
4963 slot
4964 .deref_unchecked()
4965 .deref_unchecked::<
4966 ::fidl_next::wire::Vector<'_, crate::wire::LevelTuple<'_>>
4967 >()
4968 };
4969
4970 if value.len() > 128 {
4971 return Err(::fidl_next::DecodeError::VectorTooLong {
4972 size: value.len() as u64,
4973 limit: 128,
4974 });
4975 }
4976
4977 Ok(())
4978 }
4979
4980 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4981 }
4982 })
4983 }
4984 }
4985
4986 impl<'de> PowerDependency<'de> {
4987 pub fn child(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
4988 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4989 }
4990
4991 pub fn take_child(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
4992 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
4993 }
4994
4995 pub fn parent(&self) -> ::core::option::Option<&crate::wire::ParentElement<'de>> {
4996 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4997 }
4998
4999 pub fn take_parent(&mut self) -> ::core::option::Option<crate::wire::ParentElement<'de>> {
5000 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
5001 }
5002
5003 pub fn level_deps(
5004 &self,
5005 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>>
5006 {
5007 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5008 }
5009
5010 pub fn take_level_deps(
5011 &mut self,
5012 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::LevelTuple<'de>>>
5013 {
5014 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
5015 }
5016 }
5017
5018 impl<'de> ::core::fmt::Debug for PowerDependency<'de> {
5019 fn fmt(
5020 &self,
5021 f: &mut ::core::fmt::Formatter<'_>,
5022 ) -> ::core::result::Result<(), ::core::fmt::Error> {
5023 f.debug_struct("PowerDependency")
5024 .field("child", &self.child())
5025 .field("parent", &self.parent())
5026 .field("level_deps", &self.level_deps())
5027 .finish()
5028 }
5029 }
5030
5031 impl<'de> ::fidl_next::IntoNatural for PowerDependency<'de> {
5032 type Natural = crate::natural::PowerDependency;
5033 }
5034
5035 #[repr(C)]
5037 pub struct PowerElementConfiguration<'de> {
5038 pub(crate) table: ::fidl_next::wire::Table<'de>,
5039 }
5040
5041 impl<'de> Drop for PowerElementConfiguration<'de> {
5042 fn drop(&mut self) {
5043 let _ = self.table.get(1).map(|envelope| unsafe {
5044 envelope.read_unchecked::<crate::wire::PowerElement<'de>>()
5045 });
5046
5047 let _ = self.table.get(2)
5048 .map(|envelope| unsafe {
5049 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>>()
5050 });
5051 }
5052 }
5053
5054 impl ::fidl_next::Constrained for PowerElementConfiguration<'_> {
5055 type Constraint = ();
5056
5057 fn validate(
5058 _: ::fidl_next::Slot<'_, Self>,
5059 _: Self::Constraint,
5060 ) -> Result<(), ::fidl_next::ValidationError> {
5061 Ok(())
5062 }
5063 }
5064
5065 unsafe impl ::fidl_next::Wire for PowerElementConfiguration<'static> {
5066 type Narrowed<'de> = PowerElementConfiguration<'de>;
5067
5068 #[inline]
5069 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5070 ::fidl_next::munge!(let Self { table } = out);
5071 ::fidl_next::wire::Table::zero_padding(table);
5072 }
5073 }
5074
5075 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerElementConfiguration<'de>
5076 where
5077 ___D: ::fidl_next::Decoder<'de> + ?Sized,
5078 {
5079 fn decode(
5080 slot: ::fidl_next::Slot<'_, Self>,
5081 decoder: &mut ___D,
5082 _: (),
5083 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5084 ::fidl_next::munge!(let Self { table } = slot);
5085
5086 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5087 match ordinal {
5088 0 => unsafe { ::core::hint::unreachable_unchecked() },
5089
5090 1 => {
5091 ::fidl_next::wire::Envelope::decode_as::<
5092 ___D,
5093 crate::wire::PowerElement<'de>,
5094 >(slot.as_mut(), decoder, ())?;
5095
5096 Ok(())
5097 }
5098
5099 2 => {
5100 ::fidl_next::wire::Envelope::decode_as::<
5101 ___D,
5102 ::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>,
5103 >(slot.as_mut(), decoder, (128, ()))?;
5104
5105 let value = unsafe {
5106 slot
5107 .deref_unchecked()
5108 .deref_unchecked::<
5109 ::fidl_next::wire::Vector<'_, crate::wire::PowerDependency<'_>>
5110 >()
5111 };
5112
5113 if value.len() > 128 {
5114 return Err(::fidl_next::DecodeError::VectorTooLong {
5115 size: value.len() as u64,
5116 limit: 128,
5117 });
5118 }
5119
5120 Ok(())
5121 }
5122
5123 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
5124 }
5125 })
5126 }
5127 }
5128
5129 impl<'de> PowerElementConfiguration<'de> {
5130 pub fn element(&self) -> ::core::option::Option<&crate::wire::PowerElement<'de>> {
5131 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5132 }
5133
5134 pub fn take_element(&mut self) -> ::core::option::Option<crate::wire::PowerElement<'de>> {
5135 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
5136 }
5137
5138 pub fn dependencies(
5139 &self,
5140 ) -> ::core::option::Option<
5141 &::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>,
5142 > {
5143 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5144 }
5145
5146 pub fn take_dependencies(
5147 &mut self,
5148 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::PowerDependency<'de>>>
5149 {
5150 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
5151 }
5152 }
5153
5154 impl<'de> ::core::fmt::Debug for PowerElementConfiguration<'de> {
5155 fn fmt(
5156 &self,
5157 f: &mut ::core::fmt::Formatter<'_>,
5158 ) -> ::core::result::Result<(), ::core::fmt::Error> {
5159 f.debug_struct("PowerElementConfiguration")
5160 .field("element", &self.element())
5161 .field("dependencies", &self.dependencies())
5162 .finish()
5163 }
5164 }
5165
5166 impl<'de> ::fidl_next::IntoNatural for PowerElementConfiguration<'de> {
5167 type Natural = crate::natural::PowerElementConfiguration;
5168 }
5169
5170 #[derive(Debug)]
5172 #[repr(C)]
5173 pub struct ComponentPowerConfiguration<'de> {
5174 pub power_elements:
5175 ::fidl_next::wire::Vector<'de, crate::wire::PowerElementConfiguration<'de>>,
5176 }
5177
5178 static_assertions::const_assert_eq!(std::mem::size_of::<ComponentPowerConfiguration<'_>>(), 16);
5179 static_assertions::const_assert_eq!(std::mem::align_of::<ComponentPowerConfiguration<'_>>(), 8);
5180
5181 static_assertions::const_assert_eq!(
5182 std::mem::offset_of!(ComponentPowerConfiguration<'_>, power_elements),
5183 0
5184 );
5185
5186 impl ::fidl_next::Constrained for ComponentPowerConfiguration<'_> {
5187 type Constraint = ();
5188
5189 fn validate(
5190 _: ::fidl_next::Slot<'_, Self>,
5191 _: Self::Constraint,
5192 ) -> Result<(), ::fidl_next::ValidationError> {
5193 Ok(())
5194 }
5195 }
5196
5197 unsafe impl ::fidl_next::Wire for ComponentPowerConfiguration<'static> {
5198 type Narrowed<'de> = ComponentPowerConfiguration<'de>;
5199
5200 #[inline]
5201 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5202 ::fidl_next::munge! {
5203 let Self {
5204 power_elements,
5205
5206 } = &mut *out_;
5207 }
5208
5209 ::fidl_next::Wire::zero_padding(power_elements);
5210 }
5211 }
5212
5213 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentPowerConfiguration<'de>
5214 where
5215 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5216 ___D: ::fidl_next::Decoder<'de>,
5217 {
5218 fn decode(
5219 slot_: ::fidl_next::Slot<'_, Self>,
5220 decoder_: &mut ___D,
5221 _: (),
5222 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5223 ::fidl_next::munge! {
5224 let Self {
5225 mut power_elements,
5226
5227 } = slot_;
5228 }
5229
5230 let _field = power_elements.as_mut();
5231 ::fidl_next::Constrained::validate(_field, (32, ()))?;
5232 ::fidl_next::Decode::decode(power_elements.as_mut(), decoder_, (32, ()))?;
5233
5234 let power_elements = unsafe { power_elements.deref_unchecked() };
5235
5236 if power_elements.len() > 32 {
5237 return Err(::fidl_next::DecodeError::VectorTooLong {
5238 size: power_elements.len() as u64,
5239 limit: 32,
5240 });
5241 }
5242
5243 Ok(())
5244 }
5245 }
5246
5247 impl<'de> ::fidl_next::IntoNatural for ComponentPowerConfiguration<'de> {
5248 type Natural = crate::natural::ComponentPowerConfiguration;
5249 }
5250
5251 #[derive(Clone, Debug)]
5253 #[repr(C)]
5254 pub struct DeviceRegisterPowerDomainRequest {
5255 pub min_needed_voltage: ::fidl_next::wire::Uint32,
5256
5257 pub max_supported_voltage: ::fidl_next::wire::Uint32,
5258 }
5259
5260 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRegisterPowerDomainRequest>(), 8);
5261 static_assertions::const_assert_eq!(
5262 std::mem::align_of::<DeviceRegisterPowerDomainRequest>(),
5263 4
5264 );
5265
5266 static_assertions::const_assert_eq!(
5267 std::mem::offset_of!(DeviceRegisterPowerDomainRequest, min_needed_voltage),
5268 0
5269 );
5270
5271 static_assertions::const_assert_eq!(
5272 std::mem::offset_of!(DeviceRegisterPowerDomainRequest, max_supported_voltage),
5273 4
5274 );
5275
5276 impl ::fidl_next::Constrained for DeviceRegisterPowerDomainRequest {
5277 type Constraint = ();
5278
5279 fn validate(
5280 _: ::fidl_next::Slot<'_, Self>,
5281 _: Self::Constraint,
5282 ) -> Result<(), ::fidl_next::ValidationError> {
5283 Ok(())
5284 }
5285 }
5286
5287 unsafe impl ::fidl_next::Wire for DeviceRegisterPowerDomainRequest {
5288 type Narrowed<'de> = DeviceRegisterPowerDomainRequest;
5289
5290 #[inline]
5291 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5292 ::fidl_next::munge! {
5293 let Self {
5294 min_needed_voltage,
5295 max_supported_voltage,
5296
5297 } = &mut *out_;
5298 }
5299
5300 ::fidl_next::Wire::zero_padding(min_needed_voltage);
5301
5302 ::fidl_next::Wire::zero_padding(max_supported_voltage);
5303 }
5304 }
5305
5306 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceRegisterPowerDomainRequest
5307 where
5308 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5309 {
5310 fn decode(
5311 slot_: ::fidl_next::Slot<'_, Self>,
5312 decoder_: &mut ___D,
5313 _: (),
5314 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5315 ::fidl_next::munge! {
5316 let Self {
5317 mut min_needed_voltage,
5318 mut max_supported_voltage,
5319
5320 } = slot_;
5321 }
5322
5323 let _field = min_needed_voltage.as_mut();
5324
5325 ::fidl_next::Decode::decode(min_needed_voltage.as_mut(), decoder_, ())?;
5326
5327 let _field = max_supported_voltage.as_mut();
5328
5329 ::fidl_next::Decode::decode(max_supported_voltage.as_mut(), decoder_, ())?;
5330
5331 Ok(())
5332 }
5333 }
5334
5335 impl ::fidl_next::IntoNatural for DeviceRegisterPowerDomainRequest {
5336 type Natural = crate::natural::DeviceRegisterPowerDomainRequest;
5337 }
5338
5339 pub type DeviceRegisterPowerDomainResponse = ::fidl_next::wire::Unit;
5341
5342 pub type DeviceUnregisterPowerDomainResponse = ::fidl_next::wire::Unit;
5344
5345 #[derive(Clone, Debug)]
5347 #[repr(C)]
5348 pub struct DeviceGetSupportedVoltageRangeResponse {
5349 pub min: ::fidl_next::wire::Uint32,
5350
5351 pub max: ::fidl_next::wire::Uint32,
5352 }
5353
5354 static_assertions::const_assert_eq!(
5355 std::mem::size_of::<DeviceGetSupportedVoltageRangeResponse>(),
5356 8
5357 );
5358 static_assertions::const_assert_eq!(
5359 std::mem::align_of::<DeviceGetSupportedVoltageRangeResponse>(),
5360 4
5361 );
5362
5363 static_assertions::const_assert_eq!(
5364 std::mem::offset_of!(DeviceGetSupportedVoltageRangeResponse, min),
5365 0
5366 );
5367
5368 static_assertions::const_assert_eq!(
5369 std::mem::offset_of!(DeviceGetSupportedVoltageRangeResponse, max),
5370 4
5371 );
5372
5373 impl ::fidl_next::Constrained for DeviceGetSupportedVoltageRangeResponse {
5374 type Constraint = ();
5375
5376 fn validate(
5377 _: ::fidl_next::Slot<'_, Self>,
5378 _: Self::Constraint,
5379 ) -> Result<(), ::fidl_next::ValidationError> {
5380 Ok(())
5381 }
5382 }
5383
5384 unsafe impl ::fidl_next::Wire for DeviceGetSupportedVoltageRangeResponse {
5385 type Narrowed<'de> = DeviceGetSupportedVoltageRangeResponse;
5386
5387 #[inline]
5388 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5389 ::fidl_next::munge! {
5390 let Self {
5391 min,
5392 max,
5393
5394 } = &mut *out_;
5395 }
5396
5397 ::fidl_next::Wire::zero_padding(min);
5398
5399 ::fidl_next::Wire::zero_padding(max);
5400 }
5401 }
5402
5403 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetSupportedVoltageRangeResponse
5404 where
5405 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5406 {
5407 fn decode(
5408 slot_: ::fidl_next::Slot<'_, Self>,
5409 decoder_: &mut ___D,
5410 _: (),
5411 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5412 ::fidl_next::munge! {
5413 let Self {
5414 mut min,
5415 mut max,
5416
5417 } = slot_;
5418 }
5419
5420 let _field = min.as_mut();
5421
5422 ::fidl_next::Decode::decode(min.as_mut(), decoder_, ())?;
5423
5424 let _field = max.as_mut();
5425
5426 ::fidl_next::Decode::decode(max.as_mut(), decoder_, ())?;
5427
5428 Ok(())
5429 }
5430 }
5431
5432 impl ::fidl_next::IntoNatural for DeviceGetSupportedVoltageRangeResponse {
5433 type Natural = crate::natural::DeviceGetSupportedVoltageRangeResponse;
5434 }
5435
5436 #[derive(Clone, Debug)]
5438 #[repr(C)]
5439 pub struct DeviceRequestVoltageRequest {
5440 pub voltage: ::fidl_next::wire::Uint32,
5441 }
5442
5443 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRequestVoltageRequest>(), 4);
5444 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceRequestVoltageRequest>(), 4);
5445
5446 static_assertions::const_assert_eq!(
5447 std::mem::offset_of!(DeviceRequestVoltageRequest, voltage),
5448 0
5449 );
5450
5451 impl ::fidl_next::Constrained for DeviceRequestVoltageRequest {
5452 type Constraint = ();
5453
5454 fn validate(
5455 _: ::fidl_next::Slot<'_, Self>,
5456 _: Self::Constraint,
5457 ) -> Result<(), ::fidl_next::ValidationError> {
5458 Ok(())
5459 }
5460 }
5461
5462 unsafe impl ::fidl_next::Wire for DeviceRequestVoltageRequest {
5463 type Narrowed<'de> = DeviceRequestVoltageRequest;
5464
5465 #[inline]
5466 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5467 ::fidl_next::munge! {
5468 let Self {
5469 voltage,
5470
5471 } = &mut *out_;
5472 }
5473
5474 ::fidl_next::Wire::zero_padding(voltage);
5475 }
5476 }
5477
5478 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceRequestVoltageRequest
5479 where
5480 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5481 {
5482 fn decode(
5483 slot_: ::fidl_next::Slot<'_, Self>,
5484 decoder_: &mut ___D,
5485 _: (),
5486 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5487 ::fidl_next::munge! {
5488 let Self {
5489 mut voltage,
5490
5491 } = slot_;
5492 }
5493
5494 let _field = voltage.as_mut();
5495
5496 ::fidl_next::Decode::decode(voltage.as_mut(), decoder_, ())?;
5497
5498 Ok(())
5499 }
5500 }
5501
5502 impl ::fidl_next::IntoNatural for DeviceRequestVoltageRequest {
5503 type Natural = crate::natural::DeviceRequestVoltageRequest;
5504 }
5505
5506 #[derive(Clone, Debug)]
5508 #[repr(C)]
5509 pub struct DeviceRequestVoltageResponse {
5510 pub actual_voltage: ::fidl_next::wire::Uint32,
5511 }
5512
5513 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceRequestVoltageResponse>(), 4);
5514 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceRequestVoltageResponse>(), 4);
5515
5516 static_assertions::const_assert_eq!(
5517 std::mem::offset_of!(DeviceRequestVoltageResponse, actual_voltage),
5518 0
5519 );
5520
5521 impl ::fidl_next::Constrained for DeviceRequestVoltageResponse {
5522 type Constraint = ();
5523
5524 fn validate(
5525 _: ::fidl_next::Slot<'_, Self>,
5526 _: Self::Constraint,
5527 ) -> Result<(), ::fidl_next::ValidationError> {
5528 Ok(())
5529 }
5530 }
5531
5532 unsafe impl ::fidl_next::Wire for DeviceRequestVoltageResponse {
5533 type Narrowed<'de> = DeviceRequestVoltageResponse;
5534
5535 #[inline]
5536 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5537 ::fidl_next::munge! {
5538 let Self {
5539 actual_voltage,
5540
5541 } = &mut *out_;
5542 }
5543
5544 ::fidl_next::Wire::zero_padding(actual_voltage);
5545 }
5546 }
5547
5548 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceRequestVoltageResponse
5549 where
5550 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5551 {
5552 fn decode(
5553 slot_: ::fidl_next::Slot<'_, Self>,
5554 decoder_: &mut ___D,
5555 _: (),
5556 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5557 ::fidl_next::munge! {
5558 let Self {
5559 mut actual_voltage,
5560
5561 } = slot_;
5562 }
5563
5564 let _field = actual_voltage.as_mut();
5565
5566 ::fidl_next::Decode::decode(actual_voltage.as_mut(), decoder_, ())?;
5567
5568 Ok(())
5569 }
5570 }
5571
5572 impl ::fidl_next::IntoNatural for DeviceRequestVoltageResponse {
5573 type Natural = crate::natural::DeviceRequestVoltageResponse;
5574 }
5575
5576 #[derive(Clone, Debug)]
5578 #[repr(C)]
5579 pub struct DeviceGetCurrentVoltageRequest {
5580 pub index: ::fidl_next::wire::Uint32,
5581 }
5582
5583 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetCurrentVoltageRequest>(), 4);
5584 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetCurrentVoltageRequest>(), 4);
5585
5586 static_assertions::const_assert_eq!(
5587 std::mem::offset_of!(DeviceGetCurrentVoltageRequest, index),
5588 0
5589 );
5590
5591 impl ::fidl_next::Constrained for DeviceGetCurrentVoltageRequest {
5592 type Constraint = ();
5593
5594 fn validate(
5595 _: ::fidl_next::Slot<'_, Self>,
5596 _: Self::Constraint,
5597 ) -> Result<(), ::fidl_next::ValidationError> {
5598 Ok(())
5599 }
5600 }
5601
5602 unsafe impl ::fidl_next::Wire for DeviceGetCurrentVoltageRequest {
5603 type Narrowed<'de> = DeviceGetCurrentVoltageRequest;
5604
5605 #[inline]
5606 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5607 ::fidl_next::munge! {
5608 let Self {
5609 index,
5610
5611 } = &mut *out_;
5612 }
5613
5614 ::fidl_next::Wire::zero_padding(index);
5615 }
5616 }
5617
5618 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetCurrentVoltageRequest
5619 where
5620 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5621 {
5622 fn decode(
5623 slot_: ::fidl_next::Slot<'_, Self>,
5624 decoder_: &mut ___D,
5625 _: (),
5626 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5627 ::fidl_next::munge! {
5628 let Self {
5629 mut index,
5630
5631 } = slot_;
5632 }
5633
5634 let _field = index.as_mut();
5635
5636 ::fidl_next::Decode::decode(index.as_mut(), decoder_, ())?;
5637
5638 Ok(())
5639 }
5640 }
5641
5642 impl ::fidl_next::IntoNatural for DeviceGetCurrentVoltageRequest {
5643 type Natural = crate::natural::DeviceGetCurrentVoltageRequest;
5644 }
5645
5646 #[derive(Clone, Debug)]
5648 #[repr(C)]
5649 pub struct DeviceGetCurrentVoltageResponse {
5650 pub current_voltage: ::fidl_next::wire::Uint32,
5651 }
5652
5653 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetCurrentVoltageResponse>(), 4);
5654 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetCurrentVoltageResponse>(), 4);
5655
5656 static_assertions::const_assert_eq!(
5657 std::mem::offset_of!(DeviceGetCurrentVoltageResponse, current_voltage),
5658 0
5659 );
5660
5661 impl ::fidl_next::Constrained for DeviceGetCurrentVoltageResponse {
5662 type Constraint = ();
5663
5664 fn validate(
5665 _: ::fidl_next::Slot<'_, Self>,
5666 _: Self::Constraint,
5667 ) -> Result<(), ::fidl_next::ValidationError> {
5668 Ok(())
5669 }
5670 }
5671
5672 unsafe impl ::fidl_next::Wire for DeviceGetCurrentVoltageResponse {
5673 type Narrowed<'de> = DeviceGetCurrentVoltageResponse;
5674
5675 #[inline]
5676 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5677 ::fidl_next::munge! {
5678 let Self {
5679 current_voltage,
5680
5681 } = &mut *out_;
5682 }
5683
5684 ::fidl_next::Wire::zero_padding(current_voltage);
5685 }
5686 }
5687
5688 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetCurrentVoltageResponse
5689 where
5690 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5691 {
5692 fn decode(
5693 slot_: ::fidl_next::Slot<'_, Self>,
5694 decoder_: &mut ___D,
5695 _: (),
5696 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5697 ::fidl_next::munge! {
5698 let Self {
5699 mut current_voltage,
5700
5701 } = slot_;
5702 }
5703
5704 let _field = current_voltage.as_mut();
5705
5706 ::fidl_next::Decode::decode(current_voltage.as_mut(), decoder_, ())?;
5707
5708 Ok(())
5709 }
5710 }
5711
5712 impl ::fidl_next::IntoNatural for DeviceGetCurrentVoltageResponse {
5713 type Natural = crate::natural::DeviceGetCurrentVoltageResponse;
5714 }
5715
5716 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5718 #[repr(transparent)]
5719 pub struct PowerDomainStatus {
5720 pub(crate) value: u8,
5721 }
5722
5723 impl ::fidl_next::Constrained for PowerDomainStatus {
5724 type Constraint = ();
5725
5726 fn validate(
5727 _: ::fidl_next::Slot<'_, Self>,
5728 _: Self::Constraint,
5729 ) -> Result<(), ::fidl_next::ValidationError> {
5730 Ok(())
5731 }
5732 }
5733
5734 unsafe impl ::fidl_next::Wire for PowerDomainStatus {
5735 type Narrowed<'de> = Self;
5736
5737 #[inline]
5738 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5739 }
5741 }
5742
5743 impl PowerDomainStatus {
5744 pub const DISABLED: PowerDomainStatus = PowerDomainStatus { value: 1 };
5745
5746 pub const ENABLED: PowerDomainStatus = PowerDomainStatus { value: 2 };
5747 }
5748
5749 unsafe impl<___D> ::fidl_next::Decode<___D> for PowerDomainStatus
5750 where
5751 ___D: ?Sized,
5752 {
5753 fn decode(
5754 slot: ::fidl_next::Slot<'_, Self>,
5755 _: &mut ___D,
5756 _: (),
5757 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5758 ::fidl_next::munge!(let Self { value } = slot);
5759
5760 match u8::from(*value) {
5761 1 | 2 => (),
5762 unknown => {
5763 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
5764 }
5765 }
5766
5767 Ok(())
5768 }
5769 }
5770
5771 impl ::core::convert::From<crate::natural::PowerDomainStatus> for PowerDomainStatus {
5772 fn from(natural: crate::natural::PowerDomainStatus) -> Self {
5773 match natural {
5774 crate::natural::PowerDomainStatus::Disabled => PowerDomainStatus::DISABLED,
5775
5776 crate::natural::PowerDomainStatus::Enabled => PowerDomainStatus::ENABLED,
5777 }
5778 }
5779 }
5780
5781 impl ::fidl_next::IntoNatural for PowerDomainStatus {
5782 type Natural = crate::natural::PowerDomainStatus;
5783 }
5784
5785 #[derive(Clone, Debug)]
5787 #[repr(C)]
5788 pub struct DeviceGetPowerDomainStatusResponse {
5789 pub status: crate::wire::PowerDomainStatus,
5790 }
5791
5792 static_assertions::const_assert_eq!(
5793 std::mem::size_of::<DeviceGetPowerDomainStatusResponse>(),
5794 1
5795 );
5796 static_assertions::const_assert_eq!(
5797 std::mem::align_of::<DeviceGetPowerDomainStatusResponse>(),
5798 1
5799 );
5800
5801 static_assertions::const_assert_eq!(
5802 std::mem::offset_of!(DeviceGetPowerDomainStatusResponse, status),
5803 0
5804 );
5805
5806 impl ::fidl_next::Constrained for DeviceGetPowerDomainStatusResponse {
5807 type Constraint = ();
5808
5809 fn validate(
5810 _: ::fidl_next::Slot<'_, Self>,
5811 _: Self::Constraint,
5812 ) -> Result<(), ::fidl_next::ValidationError> {
5813 Ok(())
5814 }
5815 }
5816
5817 unsafe impl ::fidl_next::Wire for DeviceGetPowerDomainStatusResponse {
5818 type Narrowed<'de> = DeviceGetPowerDomainStatusResponse;
5819
5820 #[inline]
5821 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5822 ::fidl_next::munge! {
5823 let Self {
5824 status,
5825
5826 } = &mut *out_;
5827 }
5828
5829 ::fidl_next::Wire::zero_padding(status);
5830 }
5831 }
5832
5833 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetPowerDomainStatusResponse
5834 where
5835 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5836 {
5837 fn decode(
5838 slot_: ::fidl_next::Slot<'_, Self>,
5839 decoder_: &mut ___D,
5840 _: (),
5841 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5842 ::fidl_next::munge! {
5843 let Self {
5844 mut status,
5845
5846 } = slot_;
5847 }
5848
5849 let _field = status.as_mut();
5850
5851 ::fidl_next::Decode::decode(status.as_mut(), decoder_, ())?;
5852
5853 Ok(())
5854 }
5855 }
5856
5857 impl ::fidl_next::IntoNatural for DeviceGetPowerDomainStatusResponse {
5858 type Natural = crate::natural::DeviceGetPowerDomainStatusResponse;
5859 }
5860
5861 #[derive(Clone, Debug)]
5863 #[repr(C)]
5864 pub struct DeviceWritePmicCtrlRegRequest {
5865 pub reg_addr: ::fidl_next::wire::Uint32,
5866
5867 pub value: ::fidl_next::wire::Uint32,
5868 }
5869
5870 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceWritePmicCtrlRegRequest>(), 8);
5871 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceWritePmicCtrlRegRequest>(), 4);
5872
5873 static_assertions::const_assert_eq!(
5874 std::mem::offset_of!(DeviceWritePmicCtrlRegRequest, reg_addr),
5875 0
5876 );
5877
5878 static_assertions::const_assert_eq!(
5879 std::mem::offset_of!(DeviceWritePmicCtrlRegRequest, value),
5880 4
5881 );
5882
5883 impl ::fidl_next::Constrained for DeviceWritePmicCtrlRegRequest {
5884 type Constraint = ();
5885
5886 fn validate(
5887 _: ::fidl_next::Slot<'_, Self>,
5888 _: Self::Constraint,
5889 ) -> Result<(), ::fidl_next::ValidationError> {
5890 Ok(())
5891 }
5892 }
5893
5894 unsafe impl ::fidl_next::Wire for DeviceWritePmicCtrlRegRequest {
5895 type Narrowed<'de> = DeviceWritePmicCtrlRegRequest;
5896
5897 #[inline]
5898 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5899 ::fidl_next::munge! {
5900 let Self {
5901 reg_addr,
5902 value,
5903
5904 } = &mut *out_;
5905 }
5906
5907 ::fidl_next::Wire::zero_padding(reg_addr);
5908
5909 ::fidl_next::Wire::zero_padding(value);
5910 }
5911 }
5912
5913 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceWritePmicCtrlRegRequest
5914 where
5915 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5916 {
5917 fn decode(
5918 slot_: ::fidl_next::Slot<'_, Self>,
5919 decoder_: &mut ___D,
5920 _: (),
5921 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5922 ::fidl_next::munge! {
5923 let Self {
5924 mut reg_addr,
5925 mut value,
5926
5927 } = slot_;
5928 }
5929
5930 let _field = reg_addr.as_mut();
5931
5932 ::fidl_next::Decode::decode(reg_addr.as_mut(), decoder_, ())?;
5933
5934 let _field = value.as_mut();
5935
5936 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
5937
5938 Ok(())
5939 }
5940 }
5941
5942 impl ::fidl_next::IntoNatural for DeviceWritePmicCtrlRegRequest {
5943 type Natural = crate::natural::DeviceWritePmicCtrlRegRequest;
5944 }
5945
5946 pub type DeviceWritePmicCtrlRegResponse = ::fidl_next::wire::Unit;
5948
5949 #[derive(Clone, Debug)]
5951 #[repr(C)]
5952 pub struct DeviceReadPmicCtrlRegRequest {
5953 pub reg_addr: ::fidl_next::wire::Uint32,
5954 }
5955
5956 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceReadPmicCtrlRegRequest>(), 4);
5957 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceReadPmicCtrlRegRequest>(), 4);
5958
5959 static_assertions::const_assert_eq!(
5960 std::mem::offset_of!(DeviceReadPmicCtrlRegRequest, reg_addr),
5961 0
5962 );
5963
5964 impl ::fidl_next::Constrained for DeviceReadPmicCtrlRegRequest {
5965 type Constraint = ();
5966
5967 fn validate(
5968 _: ::fidl_next::Slot<'_, Self>,
5969 _: Self::Constraint,
5970 ) -> Result<(), ::fidl_next::ValidationError> {
5971 Ok(())
5972 }
5973 }
5974
5975 unsafe impl ::fidl_next::Wire for DeviceReadPmicCtrlRegRequest {
5976 type Narrowed<'de> = DeviceReadPmicCtrlRegRequest;
5977
5978 #[inline]
5979 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
5980 ::fidl_next::munge! {
5981 let Self {
5982 reg_addr,
5983
5984 } = &mut *out_;
5985 }
5986
5987 ::fidl_next::Wire::zero_padding(reg_addr);
5988 }
5989 }
5990
5991 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceReadPmicCtrlRegRequest
5992 where
5993 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5994 {
5995 fn decode(
5996 slot_: ::fidl_next::Slot<'_, Self>,
5997 decoder_: &mut ___D,
5998 _: (),
5999 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6000 ::fidl_next::munge! {
6001 let Self {
6002 mut reg_addr,
6003
6004 } = slot_;
6005 }
6006
6007 let _field = reg_addr.as_mut();
6008
6009 ::fidl_next::Decode::decode(reg_addr.as_mut(), decoder_, ())?;
6010
6011 Ok(())
6012 }
6013 }
6014
6015 impl ::fidl_next::IntoNatural for DeviceReadPmicCtrlRegRequest {
6016 type Natural = crate::natural::DeviceReadPmicCtrlRegRequest;
6017 }
6018
6019 #[derive(Clone, Debug)]
6021 #[repr(C)]
6022 pub struct DeviceReadPmicCtrlRegResponse {
6023 pub value: ::fidl_next::wire::Uint32,
6024 }
6025
6026 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceReadPmicCtrlRegResponse>(), 4);
6027 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceReadPmicCtrlRegResponse>(), 4);
6028
6029 static_assertions::const_assert_eq!(
6030 std::mem::offset_of!(DeviceReadPmicCtrlRegResponse, value),
6031 0
6032 );
6033
6034 impl ::fidl_next::Constrained for DeviceReadPmicCtrlRegResponse {
6035 type Constraint = ();
6036
6037 fn validate(
6038 _: ::fidl_next::Slot<'_, Self>,
6039 _: Self::Constraint,
6040 ) -> Result<(), ::fidl_next::ValidationError> {
6041 Ok(())
6042 }
6043 }
6044
6045 unsafe impl ::fidl_next::Wire for DeviceReadPmicCtrlRegResponse {
6046 type Narrowed<'de> = DeviceReadPmicCtrlRegResponse;
6047
6048 #[inline]
6049 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6050 ::fidl_next::munge! {
6051 let Self {
6052 value,
6053
6054 } = &mut *out_;
6055 }
6056
6057 ::fidl_next::Wire::zero_padding(value);
6058 }
6059 }
6060
6061 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceReadPmicCtrlRegResponse
6062 where
6063 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6064 {
6065 fn decode(
6066 slot_: ::fidl_next::Slot<'_, Self>,
6067 decoder_: &mut ___D,
6068 _: (),
6069 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6070 ::fidl_next::munge! {
6071 let Self {
6072 mut value,
6073
6074 } = slot_;
6075 }
6076
6077 let _field = value.as_mut();
6078
6079 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
6080
6081 Ok(())
6082 }
6083 }
6084
6085 impl ::fidl_next::IntoNatural for DeviceReadPmicCtrlRegResponse {
6086 type Natural = crate::natural::DeviceReadPmicCtrlRegResponse;
6087 }
6088
6089 #[repr(C)]
6091 pub struct Domain<'de> {
6092 pub(crate) table: ::fidl_next::wire::Table<'de>,
6093 }
6094
6095 impl<'de> Drop for Domain<'de> {
6096 fn drop(&mut self) {
6097 let _ = self
6098 .table
6099 .get(1)
6100 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
6101 }
6102 }
6103
6104 impl ::fidl_next::Constrained for Domain<'_> {
6105 type Constraint = ();
6106
6107 fn validate(
6108 _: ::fidl_next::Slot<'_, Self>,
6109 _: Self::Constraint,
6110 ) -> Result<(), ::fidl_next::ValidationError> {
6111 Ok(())
6112 }
6113 }
6114
6115 unsafe impl ::fidl_next::Wire for Domain<'static> {
6116 type Narrowed<'de> = Domain<'de>;
6117
6118 #[inline]
6119 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6120 ::fidl_next::munge!(let Self { table } = out);
6121 ::fidl_next::wire::Table::zero_padding(table);
6122 }
6123 }
6124
6125 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Domain<'de>
6126 where
6127 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6128 {
6129 fn decode(
6130 slot: ::fidl_next::Slot<'_, Self>,
6131 decoder: &mut ___D,
6132 _: (),
6133 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6134 ::fidl_next::munge!(let Self { table } = slot);
6135
6136 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6137 match ordinal {
6138 0 => unsafe { ::core::hint::unreachable_unchecked() },
6139
6140 1 => {
6141 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
6142 slot.as_mut(),
6143 decoder,
6144 (),
6145 )?;
6146
6147 Ok(())
6148 }
6149
6150 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6151 }
6152 })
6153 }
6154 }
6155
6156 impl<'de> Domain<'de> {
6157 pub fn id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
6158 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6159 }
6160
6161 pub fn take_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
6162 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6163 }
6164 }
6165
6166 impl<'de> ::core::fmt::Debug for Domain<'de> {
6167 fn fmt(
6168 &self,
6169 f: &mut ::core::fmt::Formatter<'_>,
6170 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6171 f.debug_struct("Domain").field("id", &self.id()).finish()
6172 }
6173 }
6174
6175 impl<'de> ::fidl_next::IntoNatural for Domain<'de> {
6176 type Natural = crate::natural::Domain;
6177 }
6178
6179 #[repr(C)]
6181 pub struct DomainMetadata<'de> {
6182 pub(crate) table: ::fidl_next::wire::Table<'de>,
6183 }
6184
6185 impl<'de> Drop for DomainMetadata<'de> {
6186 fn drop(&mut self) {
6187 let _ = self.table.get(1).map(|envelope| unsafe {
6188 envelope
6189 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>>()
6190 });
6191 }
6192 }
6193
6194 impl ::fidl_next::Constrained for DomainMetadata<'_> {
6195 type Constraint = ();
6196
6197 fn validate(
6198 _: ::fidl_next::Slot<'_, Self>,
6199 _: Self::Constraint,
6200 ) -> Result<(), ::fidl_next::ValidationError> {
6201 Ok(())
6202 }
6203 }
6204
6205 unsafe impl ::fidl_next::Wire for DomainMetadata<'static> {
6206 type Narrowed<'de> = DomainMetadata<'de>;
6207
6208 #[inline]
6209 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6210 ::fidl_next::munge!(let Self { table } = out);
6211 ::fidl_next::wire::Table::zero_padding(table);
6212 }
6213 }
6214
6215 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DomainMetadata<'de>
6216 where
6217 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6218 {
6219 fn decode(
6220 slot: ::fidl_next::Slot<'_, Self>,
6221 decoder: &mut ___D,
6222 _: (),
6223 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6224 ::fidl_next::munge!(let Self { table } = slot);
6225
6226 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6227 match ordinal {
6228 0 => unsafe { ::core::hint::unreachable_unchecked() },
6229
6230 1 => {
6231 ::fidl_next::wire::Envelope::decode_as::<
6232 ___D,
6233 ::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>,
6234 >(slot.as_mut(), decoder, (4294967295, ()))?;
6235
6236 Ok(())
6237 }
6238
6239 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6240 }
6241 })
6242 }
6243 }
6244
6245 impl<'de> DomainMetadata<'de> {
6246 pub fn domains(
6247 &self,
6248 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>>
6249 {
6250 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6251 }
6252
6253 pub fn take_domains(
6254 &mut self,
6255 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::Domain<'de>>>
6256 {
6257 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6258 }
6259 }
6260
6261 impl<'de> ::core::fmt::Debug for DomainMetadata<'de> {
6262 fn fmt(
6263 &self,
6264 f: &mut ::core::fmt::Formatter<'_>,
6265 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6266 f.debug_struct("DomainMetadata").field("domains", &self.domains()).finish()
6267 }
6268 }
6269
6270 impl<'de> ::fidl_next::IntoNatural for DomainMetadata<'de> {
6271 type Natural = crate::natural::DomainMetadata;
6272 }
6273
6274 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6276 #[repr(transparent)]
6277 pub struct FrameworkElementLevels {
6278 pub(crate) value: ::fidl_next::wire::Uint32,
6279 }
6280
6281 impl ::fidl_next::Constrained for FrameworkElementLevels {
6282 type Constraint = ();
6283
6284 fn validate(
6285 _: ::fidl_next::Slot<'_, Self>,
6286 _: Self::Constraint,
6287 ) -> Result<(), ::fidl_next::ValidationError> {
6288 Ok(())
6289 }
6290 }
6291
6292 unsafe impl ::fidl_next::Wire for FrameworkElementLevels {
6293 type Narrowed<'de> = Self;
6294
6295 #[inline]
6296 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6297 }
6299 }
6300
6301 impl FrameworkElementLevels {
6302 pub const OFF: FrameworkElementLevels =
6303 FrameworkElementLevels { value: ::fidl_next::wire::Uint32(0) };
6304
6305 pub const ON: FrameworkElementLevels =
6306 FrameworkElementLevels { value: ::fidl_next::wire::Uint32(1) };
6307 }
6308
6309 unsafe impl<___D> ::fidl_next::Decode<___D> for FrameworkElementLevels
6310 where
6311 ___D: ?Sized,
6312 {
6313 fn decode(
6314 slot: ::fidl_next::Slot<'_, Self>,
6315 _: &mut ___D,
6316 _: (),
6317 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6318 ::fidl_next::munge!(let Self { value } = slot);
6319
6320 match u32::from(*value) {
6321 0 | 1 => (),
6322 unknown => {
6323 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
6324 }
6325 }
6326
6327 Ok(())
6328 }
6329 }
6330
6331 impl ::core::convert::From<crate::natural::FrameworkElementLevels> for FrameworkElementLevels {
6332 fn from(natural: crate::natural::FrameworkElementLevels) -> Self {
6333 match natural {
6334 crate::natural::FrameworkElementLevels::Off => FrameworkElementLevels::OFF,
6335
6336 crate::natural::FrameworkElementLevels::On => FrameworkElementLevels::ON,
6337 }
6338 }
6339 }
6340
6341 impl ::fidl_next::IntoNatural for FrameworkElementLevels {
6342 type Natural = crate::natural::FrameworkElementLevels;
6343 }
6344}
6345
6346pub mod wire_optional {
6347
6348 #[repr(transparent)]
6349 pub struct ParentElement<'de> {
6350 pub(crate) raw: ::fidl_next::wire::Union,
6351 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6352 }
6353
6354 impl ::fidl_next::Constrained for ParentElement<'_> {
6355 type Constraint = ();
6356
6357 fn validate(
6358 _: ::fidl_next::Slot<'_, Self>,
6359 _: Self::Constraint,
6360 ) -> Result<(), ::fidl_next::ValidationError> {
6361 Ok(())
6362 }
6363 }
6364
6365 unsafe impl ::fidl_next::Wire for ParentElement<'static> {
6366 type Narrowed<'de> = ParentElement<'de>;
6367
6368 #[inline]
6369 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6370 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6371 ::fidl_next::wire::Union::zero_padding(raw);
6372 }
6373 }
6374
6375 impl<'de> ParentElement<'de> {
6376 pub fn is_some(&self) -> bool {
6377 self.raw.is_some()
6378 }
6379
6380 pub fn is_none(&self) -> bool {
6381 self.raw.is_none()
6382 }
6383
6384 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ParentElement<'de>> {
6385 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6386 }
6387
6388 pub fn into_option(self) -> ::core::option::Option<crate::wire::ParentElement<'de>> {
6389 if self.is_some() {
6390 Some(crate::wire::ParentElement {
6391 raw: self.raw,
6392 _phantom: ::core::marker::PhantomData,
6393 })
6394 } else {
6395 None
6396 }
6397 }
6398 }
6399
6400 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ParentElement<'de>
6401 where
6402 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6403 ___D: ::fidl_next::Decoder<'de>,
6404 {
6405 fn decode(
6406 mut slot: ::fidl_next::Slot<'_, Self>,
6407 decoder: &mut ___D,
6408 _: (),
6409 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6410 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6411 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
6412 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SagElement>(
6413 raw,
6414 decoder,
6415 (),
6416 )?,
6417
6418 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
6419 raw, decoder, 63,
6420 )?,
6421
6422 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CpuPowerElement>(
6423 raw,
6424 decoder,
6425 (),
6426 )?,
6427
6428 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
6429 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
6430 }
6431
6432 Ok(())
6433 }
6434 }
6435
6436 impl<'de> ::core::fmt::Debug for ParentElement<'de> {
6437 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6438 self.as_ref().fmt(f)
6439 }
6440 }
6441
6442 impl<'de> ::fidl_next::IntoNatural for ParentElement<'de> {
6443 type Natural = ::core::option::Option<crate::natural::ParentElement>;
6444 }
6445}
6446
6447pub mod generic {
6448
6449 pub struct ComponentPowerConfiguration<T0> {
6451 pub power_elements: T0,
6452 }
6453
6454 unsafe impl<___E, T0>
6455 ::fidl_next::Encode<crate::wire::ComponentPowerConfiguration<'static>, ___E>
6456 for ComponentPowerConfiguration<T0>
6457 where
6458 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6459 ___E: ::fidl_next::Encoder,
6460 T0: ::fidl_next::Encode<
6461 ::fidl_next::wire::Vector<'static, crate::wire::PowerElementConfiguration<'static>>,
6462 ___E,
6463 >,
6464 {
6465 #[inline]
6466 fn encode(
6467 self,
6468 encoder_: &mut ___E,
6469 out_: &mut ::core::mem::MaybeUninit<crate::wire::ComponentPowerConfiguration<'static>>,
6470 _: (),
6471 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6472 ::fidl_next::munge! {
6473 let crate::wire::ComponentPowerConfiguration {
6474 power_elements,
6475
6476 } = out_;
6477 }
6478
6479 ::fidl_next::Encode::encode(self.power_elements, encoder_, power_elements, (32, ()))?;
6480
6481 Ok(())
6482 }
6483 }
6484
6485 pub struct DeviceRegisterPowerDomainRequest<T0, T1> {
6487 pub min_needed_voltage: T0,
6488
6489 pub max_supported_voltage: T1,
6490 }
6491
6492 unsafe impl<___E, T0, T1>
6493 ::fidl_next::Encode<crate::wire::DeviceRegisterPowerDomainRequest, ___E>
6494 for DeviceRegisterPowerDomainRequest<T0, T1>
6495 where
6496 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6497 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6498 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6499 {
6500 #[inline]
6501 fn encode(
6502 self,
6503 encoder_: &mut ___E,
6504 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRegisterPowerDomainRequest>,
6505 _: (),
6506 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6507 ::fidl_next::munge! {
6508 let crate::wire::DeviceRegisterPowerDomainRequest {
6509 min_needed_voltage,
6510 max_supported_voltage,
6511
6512 } = out_;
6513 }
6514
6515 ::fidl_next::Encode::encode(self.min_needed_voltage, encoder_, min_needed_voltage, ())?;
6516
6517 ::fidl_next::Encode::encode(
6518 self.max_supported_voltage,
6519 encoder_,
6520 max_supported_voltage,
6521 (),
6522 )?;
6523
6524 Ok(())
6525 }
6526 }
6527
6528 pub type DeviceRegisterPowerDomainResponse = ();
6530
6531 pub type DeviceUnregisterPowerDomainResponse = ();
6533
6534 pub struct DeviceGetSupportedVoltageRangeResponse<T0, T1> {
6536 pub min: T0,
6537
6538 pub max: T1,
6539 }
6540
6541 unsafe impl<___E, T0, T1>
6542 ::fidl_next::Encode<crate::wire::DeviceGetSupportedVoltageRangeResponse, ___E>
6543 for DeviceGetSupportedVoltageRangeResponse<T0, T1>
6544 where
6545 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6546 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6547 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6548 {
6549 #[inline]
6550 fn encode(
6551 self,
6552 encoder_: &mut ___E,
6553 out_: &mut ::core::mem::MaybeUninit<
6554 crate::wire::DeviceGetSupportedVoltageRangeResponse,
6555 >,
6556 _: (),
6557 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6558 ::fidl_next::munge! {
6559 let crate::wire::DeviceGetSupportedVoltageRangeResponse {
6560 min,
6561 max,
6562
6563 } = out_;
6564 }
6565
6566 ::fidl_next::Encode::encode(self.min, encoder_, min, ())?;
6567
6568 ::fidl_next::Encode::encode(self.max, encoder_, max, ())?;
6569
6570 Ok(())
6571 }
6572 }
6573
6574 pub struct DeviceRequestVoltageRequest<T0> {
6576 pub voltage: T0,
6577 }
6578
6579 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageRequest, ___E>
6580 for DeviceRequestVoltageRequest<T0>
6581 where
6582 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6583 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6584 {
6585 #[inline]
6586 fn encode(
6587 self,
6588 encoder_: &mut ___E,
6589 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageRequest>,
6590 _: (),
6591 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6592 ::fidl_next::munge! {
6593 let crate::wire::DeviceRequestVoltageRequest {
6594 voltage,
6595
6596 } = out_;
6597 }
6598
6599 ::fidl_next::Encode::encode(self.voltage, encoder_, voltage, ())?;
6600
6601 Ok(())
6602 }
6603 }
6604
6605 pub struct DeviceRequestVoltageResponse<T0> {
6607 pub actual_voltage: T0,
6608 }
6609
6610 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceRequestVoltageResponse, ___E>
6611 for DeviceRequestVoltageResponse<T0>
6612 where
6613 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6614 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6615 {
6616 #[inline]
6617 fn encode(
6618 self,
6619 encoder_: &mut ___E,
6620 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceRequestVoltageResponse>,
6621 _: (),
6622 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6623 ::fidl_next::munge! {
6624 let crate::wire::DeviceRequestVoltageResponse {
6625 actual_voltage,
6626
6627 } = out_;
6628 }
6629
6630 ::fidl_next::Encode::encode(self.actual_voltage, encoder_, actual_voltage, ())?;
6631
6632 Ok(())
6633 }
6634 }
6635
6636 pub struct DeviceGetCurrentVoltageRequest<T0> {
6638 pub index: T0,
6639 }
6640
6641 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageRequest, ___E>
6642 for DeviceGetCurrentVoltageRequest<T0>
6643 where
6644 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6645 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6646 {
6647 #[inline]
6648 fn encode(
6649 self,
6650 encoder_: &mut ___E,
6651 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageRequest>,
6652 _: (),
6653 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6654 ::fidl_next::munge! {
6655 let crate::wire::DeviceGetCurrentVoltageRequest {
6656 index,
6657
6658 } = out_;
6659 }
6660
6661 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
6662
6663 Ok(())
6664 }
6665 }
6666
6667 pub struct DeviceGetCurrentVoltageResponse<T0> {
6669 pub current_voltage: T0,
6670 }
6671
6672 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetCurrentVoltageResponse, ___E>
6673 for DeviceGetCurrentVoltageResponse<T0>
6674 where
6675 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6676 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6677 {
6678 #[inline]
6679 fn encode(
6680 self,
6681 encoder_: &mut ___E,
6682 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetCurrentVoltageResponse>,
6683 _: (),
6684 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6685 ::fidl_next::munge! {
6686 let crate::wire::DeviceGetCurrentVoltageResponse {
6687 current_voltage,
6688
6689 } = out_;
6690 }
6691
6692 ::fidl_next::Encode::encode(self.current_voltage, encoder_, current_voltage, ())?;
6693
6694 Ok(())
6695 }
6696 }
6697
6698 pub struct DeviceGetPowerDomainStatusResponse<T0> {
6700 pub status: T0,
6701 }
6702
6703 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetPowerDomainStatusResponse, ___E>
6704 for DeviceGetPowerDomainStatusResponse<T0>
6705 where
6706 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6707 T0: ::fidl_next::Encode<crate::wire::PowerDomainStatus, ___E>,
6708 {
6709 #[inline]
6710 fn encode(
6711 self,
6712 encoder_: &mut ___E,
6713 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetPowerDomainStatusResponse>,
6714 _: (),
6715 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6716 ::fidl_next::munge! {
6717 let crate::wire::DeviceGetPowerDomainStatusResponse {
6718 status,
6719
6720 } = out_;
6721 }
6722
6723 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
6724
6725 Ok(())
6726 }
6727 }
6728
6729 pub struct DeviceWritePmicCtrlRegRequest<T0, T1> {
6731 pub reg_addr: T0,
6732
6733 pub value: T1,
6734 }
6735
6736 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::DeviceWritePmicCtrlRegRequest, ___E>
6737 for DeviceWritePmicCtrlRegRequest<T0, T1>
6738 where
6739 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6740 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6741 T1: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6742 {
6743 #[inline]
6744 fn encode(
6745 self,
6746 encoder_: &mut ___E,
6747 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceWritePmicCtrlRegRequest>,
6748 _: (),
6749 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6750 ::fidl_next::munge! {
6751 let crate::wire::DeviceWritePmicCtrlRegRequest {
6752 reg_addr,
6753 value,
6754
6755 } = out_;
6756 }
6757
6758 ::fidl_next::Encode::encode(self.reg_addr, encoder_, reg_addr, ())?;
6759
6760 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
6761
6762 Ok(())
6763 }
6764 }
6765
6766 pub type DeviceWritePmicCtrlRegResponse = ();
6768
6769 pub struct DeviceReadPmicCtrlRegRequest<T0> {
6771 pub reg_addr: T0,
6772 }
6773
6774 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegRequest, ___E>
6775 for DeviceReadPmicCtrlRegRequest<T0>
6776 where
6777 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6778 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6779 {
6780 #[inline]
6781 fn encode(
6782 self,
6783 encoder_: &mut ___E,
6784 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegRequest>,
6785 _: (),
6786 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6787 ::fidl_next::munge! {
6788 let crate::wire::DeviceReadPmicCtrlRegRequest {
6789 reg_addr,
6790
6791 } = out_;
6792 }
6793
6794 ::fidl_next::Encode::encode(self.reg_addr, encoder_, reg_addr, ())?;
6795
6796 Ok(())
6797 }
6798 }
6799
6800 pub struct DeviceReadPmicCtrlRegResponse<T0> {
6802 pub value: T0,
6803 }
6804
6805 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceReadPmicCtrlRegResponse, ___E>
6806 for DeviceReadPmicCtrlRegResponse<T0>
6807 where
6808 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6809 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
6810 {
6811 #[inline]
6812 fn encode(
6813 self,
6814 encoder_: &mut ___E,
6815 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceReadPmicCtrlRegResponse>,
6816 _: (),
6817 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6818 ::fidl_next::munge! {
6819 let crate::wire::DeviceReadPmicCtrlRegResponse {
6820 value,
6821
6822 } = out_;
6823 }
6824
6825 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
6826
6827 Ok(())
6828 }
6829 }
6830}
6831
6832pub use self::natural::*;
6833
6834pub const MAX_NAME_LENGTH: u16 = 63 as u16;
6835
6836#[doc = " This means we could have up to 128 power levels, which seems like more than\n enough.\n"]
6837pub const MAX_TRANSITIONS: u16 = 127 as u16;
6838
6839#[doc = " Should be MAX_TRANSITIONS + 1\n"]
6840pub const MAX_LEVELS: u16 = 128 as u16;
6841
6842pub const MAX_DEPENDENCIES: u16 = 128 as u16;
6843
6844pub const MAX_POWER_ELEMENTS: u16 = 32 as u16;
6845
6846#[derive(PartialEq, Debug)]
6848pub struct Device;
6849
6850impl ::fidl_next::Discoverable for Device {
6851 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.power.Device";
6852}
6853
6854#[cfg(target_os = "fuchsia")]
6855impl ::fidl_next::HasTransport for Device {
6856 type Transport = ::fidl_next::fuchsia::zx::Channel;
6857}
6858
6859pub mod device {
6860 pub mod prelude {
6861 pub use crate::{
6862 Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
6863 DeviceServerHandler, device,
6864 };
6865
6866 pub use crate::natural::DeviceGetCurrentVoltageRequest;
6867
6868 pub use crate::natural::DeviceReadPmicCtrlRegRequest;
6869
6870 pub use crate::natural::DeviceRegisterPowerDomainRequest;
6871
6872 pub use crate::natural::DeviceRequestVoltageRequest;
6873
6874 pub use crate::natural::DeviceWritePmicCtrlRegRequest;
6875
6876 pub use crate::natural::DeviceGetCurrentVoltageResponse;
6877
6878 pub use crate::natural::DeviceGetPowerDomainStatusResponse;
6879
6880 pub use crate::natural::DeviceGetSupportedVoltageRangeResponse;
6881
6882 pub use crate::natural::DeviceReadPmicCtrlRegResponse;
6883
6884 pub use crate::natural::DeviceRegisterPowerDomainResponse;
6885
6886 pub use crate::natural::DeviceRequestVoltageResponse;
6887
6888 pub use crate::natural::DeviceUnregisterPowerDomainResponse;
6889
6890 pub use crate::natural::DeviceWritePmicCtrlRegResponse;
6891 }
6892
6893 pub struct RegisterPowerDomain;
6894
6895 impl ::fidl_next::Method for RegisterPowerDomain {
6896 const ORDINAL: u64 = 4458069386545205468;
6897 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6898 ::fidl_next::protocol::Flexibility::Strict;
6899
6900 type Protocol = crate::Device;
6901
6902 type Request = crate::wire::DeviceRegisterPowerDomainRequest;
6903 }
6904
6905 impl ::fidl_next::TwoWayMethod for RegisterPowerDomain {
6906 type Response = ::fidl_next::wire::Result<
6907 'static,
6908 crate::wire::DeviceRegisterPowerDomainResponse,
6909 ::fidl_next::wire::fuchsia::Status,
6910 >;
6911 }
6912
6913 impl<___R> ::fidl_next::Respond<___R> for RegisterPowerDomain {
6914 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
6915
6916 fn respond(response: ___R) -> Self::Output {
6917 ::core::result::Result::Ok(response)
6918 }
6919 }
6920
6921 impl<___R> ::fidl_next::RespondErr<___R> for RegisterPowerDomain {
6922 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
6923
6924 fn respond_err(response: ___R) -> Self::Output {
6925 ::core::result::Result::Err(response)
6926 }
6927 }
6928
6929 pub struct UnregisterPowerDomain;
6930
6931 impl ::fidl_next::Method for UnregisterPowerDomain {
6932 const ORDINAL: u64 = 7717805237469023337;
6933 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6934 ::fidl_next::protocol::Flexibility::Strict;
6935
6936 type Protocol = crate::Device;
6937
6938 type Request = ::fidl_next::wire::EmptyMessageBody;
6939 }
6940
6941 impl ::fidl_next::TwoWayMethod for UnregisterPowerDomain {
6942 type Response = ::fidl_next::wire::Result<
6943 'static,
6944 crate::wire::DeviceUnregisterPowerDomainResponse,
6945 ::fidl_next::wire::fuchsia::Status,
6946 >;
6947 }
6948
6949 impl<___R> ::fidl_next::Respond<___R> for UnregisterPowerDomain {
6950 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
6951
6952 fn respond(response: ___R) -> Self::Output {
6953 ::core::result::Result::Ok(response)
6954 }
6955 }
6956
6957 impl<___R> ::fidl_next::RespondErr<___R> for UnregisterPowerDomain {
6958 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
6959
6960 fn respond_err(response: ___R) -> Self::Output {
6961 ::core::result::Result::Err(response)
6962 }
6963 }
6964
6965 pub struct GetSupportedVoltageRange;
6966
6967 impl ::fidl_next::Method for GetSupportedVoltageRange {
6968 const ORDINAL: u64 = 7887361504891407856;
6969 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
6970 ::fidl_next::protocol::Flexibility::Strict;
6971
6972 type Protocol = crate::Device;
6973
6974 type Request = ::fidl_next::wire::EmptyMessageBody;
6975 }
6976
6977 impl ::fidl_next::TwoWayMethod for GetSupportedVoltageRange {
6978 type Response = ::fidl_next::wire::Result<
6979 'static,
6980 crate::wire::DeviceGetSupportedVoltageRangeResponse,
6981 ::fidl_next::wire::fuchsia::Status,
6982 >;
6983 }
6984
6985 impl<___R> ::fidl_next::Respond<___R> for GetSupportedVoltageRange {
6986 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
6987
6988 fn respond(response: ___R) -> Self::Output {
6989 ::core::result::Result::Ok(response)
6990 }
6991 }
6992
6993 impl<___R> ::fidl_next::RespondErr<___R> for GetSupportedVoltageRange {
6994 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
6995
6996 fn respond_err(response: ___R) -> Self::Output {
6997 ::core::result::Result::Err(response)
6998 }
6999 }
7000
7001 pub struct RequestVoltage;
7002
7003 impl ::fidl_next::Method for RequestVoltage {
7004 const ORDINAL: u64 = 2578932345713622683;
7005 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7006 ::fidl_next::protocol::Flexibility::Strict;
7007
7008 type Protocol = crate::Device;
7009
7010 type Request = crate::wire::DeviceRequestVoltageRequest;
7011 }
7012
7013 impl ::fidl_next::TwoWayMethod for RequestVoltage {
7014 type Response = ::fidl_next::wire::Result<
7015 'static,
7016 crate::wire::DeviceRequestVoltageResponse,
7017 ::fidl_next::wire::fuchsia::Status,
7018 >;
7019 }
7020
7021 impl<___R> ::fidl_next::Respond<___R> for RequestVoltage {
7022 type Output = ::core::result::Result<
7023 crate::generic::DeviceRequestVoltageResponse<___R>,
7024 ::fidl_next::never::Never,
7025 >;
7026
7027 fn respond(response: ___R) -> Self::Output {
7028 ::core::result::Result::Ok(crate::generic::DeviceRequestVoltageResponse {
7029 actual_voltage: response,
7030 })
7031 }
7032 }
7033
7034 impl<___R> ::fidl_next::RespondErr<___R> for RequestVoltage {
7035 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
7036
7037 fn respond_err(response: ___R) -> Self::Output {
7038 ::core::result::Result::Err(response)
7039 }
7040 }
7041
7042 pub struct GetCurrentVoltage;
7043
7044 impl ::fidl_next::Method for GetCurrentVoltage {
7045 const ORDINAL: u64 = 7683000915093989729;
7046 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7047 ::fidl_next::protocol::Flexibility::Strict;
7048
7049 type Protocol = crate::Device;
7050
7051 type Request = crate::wire::DeviceGetCurrentVoltageRequest;
7052 }
7053
7054 impl ::fidl_next::TwoWayMethod for GetCurrentVoltage {
7055 type Response = ::fidl_next::wire::Result<
7056 'static,
7057 crate::wire::DeviceGetCurrentVoltageResponse,
7058 ::fidl_next::wire::fuchsia::Status,
7059 >;
7060 }
7061
7062 impl<___R> ::fidl_next::Respond<___R> for GetCurrentVoltage {
7063 type Output = ::core::result::Result<
7064 crate::generic::DeviceGetCurrentVoltageResponse<___R>,
7065 ::fidl_next::never::Never,
7066 >;
7067
7068 fn respond(response: ___R) -> Self::Output {
7069 ::core::result::Result::Ok(crate::generic::DeviceGetCurrentVoltageResponse {
7070 current_voltage: response,
7071 })
7072 }
7073 }
7074
7075 impl<___R> ::fidl_next::RespondErr<___R> for GetCurrentVoltage {
7076 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
7077
7078 fn respond_err(response: ___R) -> Self::Output {
7079 ::core::result::Result::Err(response)
7080 }
7081 }
7082
7083 pub struct GetPowerDomainStatus;
7084
7085 impl ::fidl_next::Method for GetPowerDomainStatus {
7086 const ORDINAL: u64 = 4178917272116294842;
7087 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7088 ::fidl_next::protocol::Flexibility::Strict;
7089
7090 type Protocol = crate::Device;
7091
7092 type Request = ::fidl_next::wire::EmptyMessageBody;
7093 }
7094
7095 impl ::fidl_next::TwoWayMethod for GetPowerDomainStatus {
7096 type Response = ::fidl_next::wire::Result<
7097 'static,
7098 crate::wire::DeviceGetPowerDomainStatusResponse,
7099 ::fidl_next::wire::fuchsia::Status,
7100 >;
7101 }
7102
7103 impl<___R> ::fidl_next::Respond<___R> for GetPowerDomainStatus {
7104 type Output = ::core::result::Result<
7105 crate::generic::DeviceGetPowerDomainStatusResponse<___R>,
7106 ::fidl_next::never::Never,
7107 >;
7108
7109 fn respond(response: ___R) -> Self::Output {
7110 ::core::result::Result::Ok(crate::generic::DeviceGetPowerDomainStatusResponse {
7111 status: response,
7112 })
7113 }
7114 }
7115
7116 impl<___R> ::fidl_next::RespondErr<___R> for GetPowerDomainStatus {
7117 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
7118
7119 fn respond_err(response: ___R) -> Self::Output {
7120 ::core::result::Result::Err(response)
7121 }
7122 }
7123
7124 pub struct WritePmicCtrlReg;
7125
7126 impl ::fidl_next::Method for WritePmicCtrlReg {
7127 const ORDINAL: u64 = 3749867380549091993;
7128 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7129 ::fidl_next::protocol::Flexibility::Strict;
7130
7131 type Protocol = crate::Device;
7132
7133 type Request = crate::wire::DeviceWritePmicCtrlRegRequest;
7134 }
7135
7136 impl ::fidl_next::TwoWayMethod for WritePmicCtrlReg {
7137 type Response = ::fidl_next::wire::Result<
7138 'static,
7139 crate::wire::DeviceWritePmicCtrlRegResponse,
7140 ::fidl_next::wire::fuchsia::Status,
7141 >;
7142 }
7143
7144 impl<___R> ::fidl_next::Respond<___R> for WritePmicCtrlReg {
7145 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
7146
7147 fn respond(response: ___R) -> Self::Output {
7148 ::core::result::Result::Ok(response)
7149 }
7150 }
7151
7152 impl<___R> ::fidl_next::RespondErr<___R> for WritePmicCtrlReg {
7153 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
7154
7155 fn respond_err(response: ___R) -> Self::Output {
7156 ::core::result::Result::Err(response)
7157 }
7158 }
7159
7160 pub struct ReadPmicCtrlReg;
7161
7162 impl ::fidl_next::Method for ReadPmicCtrlReg {
7163 const ORDINAL: u64 = 8281766978930618131;
7164 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7165 ::fidl_next::protocol::Flexibility::Strict;
7166
7167 type Protocol = crate::Device;
7168
7169 type Request = crate::wire::DeviceReadPmicCtrlRegRequest;
7170 }
7171
7172 impl ::fidl_next::TwoWayMethod for ReadPmicCtrlReg {
7173 type Response = ::fidl_next::wire::Result<
7174 'static,
7175 crate::wire::DeviceReadPmicCtrlRegResponse,
7176 ::fidl_next::wire::fuchsia::Status,
7177 >;
7178 }
7179
7180 impl<___R> ::fidl_next::Respond<___R> for ReadPmicCtrlReg {
7181 type Output = ::core::result::Result<
7182 crate::generic::DeviceReadPmicCtrlRegResponse<___R>,
7183 ::fidl_next::never::Never,
7184 >;
7185
7186 fn respond(response: ___R) -> Self::Output {
7187 ::core::result::Result::Ok(crate::generic::DeviceReadPmicCtrlRegResponse {
7188 value: response,
7189 })
7190 }
7191 }
7192
7193 impl<___R> ::fidl_next::RespondErr<___R> for ReadPmicCtrlReg {
7194 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
7195
7196 fn respond_err(response: ___R) -> Self::Output {
7197 ::core::result::Result::Err(response)
7198 }
7199 }
7200
7201 mod ___detail {
7202 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
7203 where
7204 ___T: ::fidl_next::Transport,
7205 {
7206 type Client = DeviceClient<___T>;
7207 type Server = DeviceServer<___T>;
7208 }
7209
7210 #[repr(transparent)]
7212 pub struct DeviceClient<___T: ::fidl_next::Transport> {
7213 #[allow(dead_code)]
7214 client: ::fidl_next::protocol::Client<___T>,
7215 }
7216
7217 impl<___T> DeviceClient<___T>
7218 where
7219 ___T: ::fidl_next::Transport,
7220 {
7221 #[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"]
7222 pub fn register_power_domain(
7223 &self,
7224
7225 min_needed_voltage: impl ::fidl_next::Encode<
7226 ::fidl_next::wire::Uint32,
7227 <___T as ::fidl_next::Transport>::SendBuffer,
7228 >,
7229
7230 max_supported_voltage: impl ::fidl_next::Encode<
7231 ::fidl_next::wire::Uint32,
7232 <___T as ::fidl_next::Transport>::SendBuffer,
7233 >,
7234 ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterPowerDomain, ___T>
7235 where
7236 <___T as ::fidl_next::Transport>::SendBuffer:
7237 ::fidl_next::encoder::InternalHandleEncoder,
7238 {
7239 self.register_power_domain_with(crate::generic::DeviceRegisterPowerDomainRequest {
7240 min_needed_voltage,
7241
7242 max_supported_voltage,
7243 })
7244 }
7245
7246 #[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"]
7247 pub fn register_power_domain_with<___R>(
7248 &self,
7249 request: ___R,
7250 ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterPowerDomain, ___T>
7251 where
7252 ___R: ::fidl_next::Encode<
7253 crate::wire::DeviceRegisterPowerDomainRequest,
7254 <___T as ::fidl_next::Transport>::SendBuffer,
7255 >,
7256 {
7257 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7258 4458069386545205468,
7259 <super::RegisterPowerDomain as ::fidl_next::Method>::FLEXIBILITY,
7260 request,
7261 ))
7262 }
7263
7264 #[doc = " Unregister the callee for this power domain. The callee will no longer be considered as\n a dependent of this power domain.\n"]
7265 pub fn unregister_power_domain(
7266 &self,
7267 ) -> ::fidl_next::TwoWayFuture<'_, super::UnregisterPowerDomain, ___T> {
7268 ::fidl_next::TwoWayFuture::from_untyped(
7269 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7270 7717805237469023337,
7271 <super::UnregisterPowerDomain as ::fidl_next::Method>::FLEXIBILITY,
7272 (),
7273 ),
7274 )
7275 }
7276
7277 #[doc = " Get Supported Voltage Range. min and max are in micorVolts(uV)\n"]
7278 pub fn get_supported_voltage_range(
7279 &self,
7280 ) -> ::fidl_next::TwoWayFuture<'_, super::GetSupportedVoltageRange, ___T> {
7281 ::fidl_next::TwoWayFuture::from_untyped(
7282 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7283 7887361504891407856,
7284 <super::GetSupportedVoltageRange as ::fidl_next::Method>::FLEXIBILITY,
7285 (),
7286 ),
7287 )
7288 }
7289
7290 #[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"]
7291 pub fn request_voltage(
7292 &self,
7293
7294 voltage: impl ::fidl_next::Encode<
7295 ::fidl_next::wire::Uint32,
7296 <___T as ::fidl_next::Transport>::SendBuffer,
7297 >,
7298 ) -> ::fidl_next::TwoWayFuture<'_, super::RequestVoltage, ___T>
7299 where
7300 <___T as ::fidl_next::Transport>::SendBuffer:
7301 ::fidl_next::encoder::InternalHandleEncoder,
7302 {
7303 self.request_voltage_with(crate::generic::DeviceRequestVoltageRequest { voltage })
7304 }
7305
7306 #[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"]
7307 pub fn request_voltage_with<___R>(
7308 &self,
7309 request: ___R,
7310 ) -> ::fidl_next::TwoWayFuture<'_, super::RequestVoltage, ___T>
7311 where
7312 ___R: ::fidl_next::Encode<
7313 crate::wire::DeviceRequestVoltageRequest,
7314 <___T as ::fidl_next::Transport>::SendBuffer,
7315 >,
7316 {
7317 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7318 2578932345713622683,
7319 <super::RequestVoltage as ::fidl_next::Method>::FLEXIBILITY,
7320 request,
7321 ))
7322 }
7323
7324 #[doc = " Get current voltage in uV.\n"]
7325 pub fn get_current_voltage(
7326 &self,
7327
7328 index: impl ::fidl_next::Encode<
7329 ::fidl_next::wire::Uint32,
7330 <___T as ::fidl_next::Transport>::SendBuffer,
7331 >,
7332 ) -> ::fidl_next::TwoWayFuture<'_, super::GetCurrentVoltage, ___T>
7333 where
7334 <___T as ::fidl_next::Transport>::SendBuffer:
7335 ::fidl_next::encoder::InternalHandleEncoder,
7336 {
7337 self.get_current_voltage_with(crate::generic::DeviceGetCurrentVoltageRequest {
7338 index,
7339 })
7340 }
7341
7342 #[doc = " Get current voltage in uV.\n"]
7343 pub fn get_current_voltage_with<___R>(
7344 &self,
7345 request: ___R,
7346 ) -> ::fidl_next::TwoWayFuture<'_, super::GetCurrentVoltage, ___T>
7347 where
7348 ___R: ::fidl_next::Encode<
7349 crate::wire::DeviceGetCurrentVoltageRequest,
7350 <___T as ::fidl_next::Transport>::SendBuffer,
7351 >,
7352 {
7353 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7354 7683000915093989729,
7355 <super::GetCurrentVoltage as ::fidl_next::Method>::FLEXIBILITY,
7356 request,
7357 ))
7358 }
7359
7360 #[doc = " Get power domain status\n"]
7361 pub fn get_power_domain_status(
7362 &self,
7363 ) -> ::fidl_next::TwoWayFuture<'_, super::GetPowerDomainStatus, ___T> {
7364 ::fidl_next::TwoWayFuture::from_untyped(
7365 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7366 4178917272116294842,
7367 <super::GetPowerDomainStatus as ::fidl_next::Method>::FLEXIBILITY,
7368 (),
7369 ),
7370 )
7371 }
7372
7373 #[doc = " Write to ctrl register of PMIC\n"]
7374 pub fn write_pmic_ctrl_reg(
7375 &self,
7376
7377 reg_addr: impl ::fidl_next::Encode<
7378 ::fidl_next::wire::Uint32,
7379 <___T as ::fidl_next::Transport>::SendBuffer,
7380 >,
7381
7382 value: impl ::fidl_next::Encode<
7383 ::fidl_next::wire::Uint32,
7384 <___T as ::fidl_next::Transport>::SendBuffer,
7385 >,
7386 ) -> ::fidl_next::TwoWayFuture<'_, super::WritePmicCtrlReg, ___T>
7387 where
7388 <___T as ::fidl_next::Transport>::SendBuffer:
7389 ::fidl_next::encoder::InternalHandleEncoder,
7390 {
7391 self.write_pmic_ctrl_reg_with(crate::generic::DeviceWritePmicCtrlRegRequest {
7392 reg_addr,
7393
7394 value,
7395 })
7396 }
7397
7398 #[doc = " Write to ctrl register of PMIC\n"]
7399 pub fn write_pmic_ctrl_reg_with<___R>(
7400 &self,
7401 request: ___R,
7402 ) -> ::fidl_next::TwoWayFuture<'_, super::WritePmicCtrlReg, ___T>
7403 where
7404 ___R: ::fidl_next::Encode<
7405 crate::wire::DeviceWritePmicCtrlRegRequest,
7406 <___T as ::fidl_next::Transport>::SendBuffer,
7407 >,
7408 {
7409 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7410 3749867380549091993,
7411 <super::WritePmicCtrlReg as ::fidl_next::Method>::FLEXIBILITY,
7412 request,
7413 ))
7414 }
7415
7416 #[doc = " Read ctrl register of PMIC\n"]
7417 pub fn read_pmic_ctrl_reg(
7418 &self,
7419
7420 reg_addr: impl ::fidl_next::Encode<
7421 ::fidl_next::wire::Uint32,
7422 <___T as ::fidl_next::Transport>::SendBuffer,
7423 >,
7424 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadPmicCtrlReg, ___T>
7425 where
7426 <___T as ::fidl_next::Transport>::SendBuffer:
7427 ::fidl_next::encoder::InternalHandleEncoder,
7428 {
7429 self.read_pmic_ctrl_reg_with(crate::generic::DeviceReadPmicCtrlRegRequest {
7430 reg_addr,
7431 })
7432 }
7433
7434 #[doc = " Read ctrl register of PMIC\n"]
7435 pub fn read_pmic_ctrl_reg_with<___R>(
7436 &self,
7437 request: ___R,
7438 ) -> ::fidl_next::TwoWayFuture<'_, super::ReadPmicCtrlReg, ___T>
7439 where
7440 ___R: ::fidl_next::Encode<
7441 crate::wire::DeviceReadPmicCtrlRegRequest,
7442 <___T as ::fidl_next::Transport>::SendBuffer,
7443 >,
7444 {
7445 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7446 8281766978930618131,
7447 <super::ReadPmicCtrlReg as ::fidl_next::Method>::FLEXIBILITY,
7448 request,
7449 ))
7450 }
7451 }
7452
7453 #[repr(transparent)]
7455 pub struct DeviceServer<___T: ::fidl_next::Transport> {
7456 server: ::fidl_next::protocol::Server<___T>,
7457 }
7458
7459 impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
7460 }
7461}
7462
7463#[diagnostic::on_unimplemented(
7464 note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
7465)]
7466
7467pub trait DeviceLocalClientHandler<
7471 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7472 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7473>
7474{
7475}
7476
7477impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
7478where
7479 ___H: DeviceLocalClientHandler<___T>,
7480 ___T: ::fidl_next::Transport,
7481{
7482 async fn on_event(
7483 handler: &mut ___H,
7484 mut message: ::fidl_next::Message<___T>,
7485 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7486 match *message.header().ordinal {
7487 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7488 }
7489 }
7490}
7491
7492#[diagnostic::on_unimplemented(
7493 note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
7494)]
7495
7496pub trait DeviceLocalServerHandler<
7500 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7501 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7502>
7503{
7504 #[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"]
7505 fn register_power_domain(
7506 &mut self,
7507
7508 request: ::fidl_next::Request<device::RegisterPowerDomain, ___T>,
7509
7510 responder: ::fidl_next::Responder<device::RegisterPowerDomain, ___T>,
7511 ) -> impl ::core::future::Future<Output = ()>;
7512
7513 #[doc = " Unregister the callee for this power domain. The callee will no longer be considered as\n a dependent of this power domain.\n"]
7514 fn unregister_power_domain(
7515 &mut self,
7516
7517 responder: ::fidl_next::Responder<device::UnregisterPowerDomain, ___T>,
7518 ) -> impl ::core::future::Future<Output = ()>;
7519
7520 #[doc = " Get Supported Voltage Range. min and max are in micorVolts(uV)\n"]
7521 fn get_supported_voltage_range(
7522 &mut self,
7523
7524 responder: ::fidl_next::Responder<device::GetSupportedVoltageRange, ___T>,
7525 ) -> impl ::core::future::Future<Output = ()>;
7526
7527 #[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"]
7528 fn request_voltage(
7529 &mut self,
7530
7531 request: ::fidl_next::Request<device::RequestVoltage, ___T>,
7532
7533 responder: ::fidl_next::Responder<device::RequestVoltage, ___T>,
7534 ) -> impl ::core::future::Future<Output = ()>;
7535
7536 #[doc = " Get current voltage in uV.\n"]
7537 fn get_current_voltage(
7538 &mut self,
7539
7540 request: ::fidl_next::Request<device::GetCurrentVoltage, ___T>,
7541
7542 responder: ::fidl_next::Responder<device::GetCurrentVoltage, ___T>,
7543 ) -> impl ::core::future::Future<Output = ()>;
7544
7545 #[doc = " Get power domain status\n"]
7546 fn get_power_domain_status(
7547 &mut self,
7548
7549 responder: ::fidl_next::Responder<device::GetPowerDomainStatus, ___T>,
7550 ) -> impl ::core::future::Future<Output = ()>;
7551
7552 #[doc = " Write to ctrl register of PMIC\n"]
7553 fn write_pmic_ctrl_reg(
7554 &mut self,
7555
7556 request: ::fidl_next::Request<device::WritePmicCtrlReg, ___T>,
7557
7558 responder: ::fidl_next::Responder<device::WritePmicCtrlReg, ___T>,
7559 ) -> impl ::core::future::Future<Output = ()>;
7560
7561 #[doc = " Read ctrl register of PMIC\n"]
7562 fn read_pmic_ctrl_reg(
7563 &mut self,
7564
7565 request: ::fidl_next::Request<device::ReadPmicCtrlReg, ___T>,
7566
7567 responder: ::fidl_next::Responder<device::ReadPmicCtrlReg, ___T>,
7568 ) -> impl ::core::future::Future<Output = ()>;
7569}
7570
7571impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
7572where
7573 ___H: DeviceLocalServerHandler<___T>,
7574 ___T: ::fidl_next::Transport,
7575 for<'de> crate::wire::DeviceRegisterPowerDomainRequest: ::fidl_next::Decode<
7576 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7577 Constraint = (),
7578 >,
7579 for<'de> crate::wire::DeviceRequestVoltageRequest: ::fidl_next::Decode<
7580 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7581 Constraint = (),
7582 >,
7583 for<'de> crate::wire::DeviceGetCurrentVoltageRequest: ::fidl_next::Decode<
7584 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7585 Constraint = (),
7586 >,
7587 for<'de> crate::wire::DeviceWritePmicCtrlRegRequest: ::fidl_next::Decode<
7588 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7589 Constraint = (),
7590 >,
7591 for<'de> crate::wire::DeviceReadPmicCtrlRegRequest: ::fidl_next::Decode<
7592 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7593 Constraint = (),
7594 >,
7595{
7596 async fn on_one_way(
7597 handler: &mut ___H,
7598 mut message: ::fidl_next::Message<___T>,
7599 ) -> ::core::result::Result<
7600 (),
7601 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7602 > {
7603 match *message.header().ordinal {
7604 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7605 }
7606 }
7607
7608 async fn on_two_way(
7609 handler: &mut ___H,
7610 mut message: ::fidl_next::Message<___T>,
7611 responder: ::fidl_next::protocol::Responder<___T>,
7612 ) -> ::core::result::Result<
7613 (),
7614 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7615 > {
7616 match *message.header().ordinal {
7617 4458069386545205468 => {
7618 let responder = ::fidl_next::Responder::from_untyped(responder);
7619
7620 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7621 Ok(decoded) => {
7622 handler
7623 .register_power_domain(
7624 ::fidl_next::Request::from_decoded(decoded),
7625 responder,
7626 )
7627 .await;
7628 Ok(())
7629 }
7630 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7631 ordinal: 4458069386545205468,
7632 error,
7633 }),
7634 }
7635 }
7636
7637 7717805237469023337 => {
7638 let responder = ::fidl_next::Responder::from_untyped(responder);
7639
7640 handler.unregister_power_domain(responder).await;
7641 Ok(())
7642 }
7643
7644 7887361504891407856 => {
7645 let responder = ::fidl_next::Responder::from_untyped(responder);
7646
7647 handler.get_supported_voltage_range(responder).await;
7648 Ok(())
7649 }
7650
7651 2578932345713622683 => {
7652 let responder = ::fidl_next::Responder::from_untyped(responder);
7653
7654 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7655 Ok(decoded) => {
7656 handler
7657 .request_voltage(::fidl_next::Request::from_decoded(decoded), responder)
7658 .await;
7659 Ok(())
7660 }
7661 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7662 ordinal: 2578932345713622683,
7663 error,
7664 }),
7665 }
7666 }
7667
7668 7683000915093989729 => {
7669 let responder = ::fidl_next::Responder::from_untyped(responder);
7670
7671 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7672 Ok(decoded) => {
7673 handler
7674 .get_current_voltage(
7675 ::fidl_next::Request::from_decoded(decoded),
7676 responder,
7677 )
7678 .await;
7679 Ok(())
7680 }
7681 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7682 ordinal: 7683000915093989729,
7683 error,
7684 }),
7685 }
7686 }
7687
7688 4178917272116294842 => {
7689 let responder = ::fidl_next::Responder::from_untyped(responder);
7690
7691 handler.get_power_domain_status(responder).await;
7692 Ok(())
7693 }
7694
7695 3749867380549091993 => {
7696 let responder = ::fidl_next::Responder::from_untyped(responder);
7697
7698 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7699 Ok(decoded) => {
7700 handler
7701 .write_pmic_ctrl_reg(
7702 ::fidl_next::Request::from_decoded(decoded),
7703 responder,
7704 )
7705 .await;
7706 Ok(())
7707 }
7708 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7709 ordinal: 3749867380549091993,
7710 error,
7711 }),
7712 }
7713 }
7714
7715 8281766978930618131 => {
7716 let responder = ::fidl_next::Responder::from_untyped(responder);
7717
7718 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7719 Ok(decoded) => {
7720 handler
7721 .read_pmic_ctrl_reg(
7722 ::fidl_next::Request::from_decoded(decoded),
7723 responder,
7724 )
7725 .await;
7726 Ok(())
7727 }
7728 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7729 ordinal: 8281766978930618131,
7730 error,
7731 }),
7732 }
7733 }
7734
7735 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7736 }
7737 }
7738}
7739
7740pub trait DeviceClientHandler<
7744 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7745 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7746>
7747{
7748}
7749
7750impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
7751where
7752 ___H: DeviceClientHandler<___T> + ::core::marker::Send,
7753 ___T: ::fidl_next::Transport,
7754{
7755 async fn on_event(
7756 handler: &mut ___H,
7757 mut message: ::fidl_next::Message<___T>,
7758 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7759 match *message.header().ordinal {
7760 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7761 }
7762 }
7763}
7764
7765pub trait DeviceServerHandler<
7769 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7770 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7771>
7772{
7773 #[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"]
7774 fn register_power_domain(
7775 &mut self,
7776
7777 request: ::fidl_next::Request<device::RegisterPowerDomain, ___T>,
7778
7779 responder: ::fidl_next::Responder<device::RegisterPowerDomain, ___T>,
7780 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7781
7782 #[doc = " Unregister the callee for this power domain. The callee will no longer be considered as\n a dependent of this power domain.\n"]
7783 fn unregister_power_domain(
7784 &mut self,
7785
7786 responder: ::fidl_next::Responder<device::UnregisterPowerDomain, ___T>,
7787 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7788
7789 #[doc = " Get Supported Voltage Range. min and max are in micorVolts(uV)\n"]
7790 fn get_supported_voltage_range(
7791 &mut self,
7792
7793 responder: ::fidl_next::Responder<device::GetSupportedVoltageRange, ___T>,
7794 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7795
7796 #[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"]
7797 fn request_voltage(
7798 &mut self,
7799
7800 request: ::fidl_next::Request<device::RequestVoltage, ___T>,
7801
7802 responder: ::fidl_next::Responder<device::RequestVoltage, ___T>,
7803 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7804
7805 #[doc = " Get current voltage in uV.\n"]
7806 fn get_current_voltage(
7807 &mut self,
7808
7809 request: ::fidl_next::Request<device::GetCurrentVoltage, ___T>,
7810
7811 responder: ::fidl_next::Responder<device::GetCurrentVoltage, ___T>,
7812 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7813
7814 #[doc = " Get power domain status\n"]
7815 fn get_power_domain_status(
7816 &mut self,
7817
7818 responder: ::fidl_next::Responder<device::GetPowerDomainStatus, ___T>,
7819 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7820
7821 #[doc = " Write to ctrl register of PMIC\n"]
7822 fn write_pmic_ctrl_reg(
7823 &mut self,
7824
7825 request: ::fidl_next::Request<device::WritePmicCtrlReg, ___T>,
7826
7827 responder: ::fidl_next::Responder<device::WritePmicCtrlReg, ___T>,
7828 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7829
7830 #[doc = " Read ctrl register of PMIC\n"]
7831 fn read_pmic_ctrl_reg(
7832 &mut self,
7833
7834 request: ::fidl_next::Request<device::ReadPmicCtrlReg, ___T>,
7835
7836 responder: ::fidl_next::Responder<device::ReadPmicCtrlReg, ___T>,
7837 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7838}
7839
7840impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
7841where
7842 ___H: DeviceServerHandler<___T> + ::core::marker::Send,
7843 ___T: ::fidl_next::Transport,
7844 for<'de> crate::wire::DeviceRegisterPowerDomainRequest: ::fidl_next::Decode<
7845 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7846 Constraint = (),
7847 >,
7848 for<'de> crate::wire::DeviceRequestVoltageRequest: ::fidl_next::Decode<
7849 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7850 Constraint = (),
7851 >,
7852 for<'de> crate::wire::DeviceGetCurrentVoltageRequest: ::fidl_next::Decode<
7853 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7854 Constraint = (),
7855 >,
7856 for<'de> crate::wire::DeviceWritePmicCtrlRegRequest: ::fidl_next::Decode<
7857 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7858 Constraint = (),
7859 >,
7860 for<'de> crate::wire::DeviceReadPmicCtrlRegRequest: ::fidl_next::Decode<
7861 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7862 Constraint = (),
7863 >,
7864{
7865 async fn on_one_way(
7866 handler: &mut ___H,
7867 mut message: ::fidl_next::Message<___T>,
7868 ) -> ::core::result::Result<
7869 (),
7870 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7871 > {
7872 match *message.header().ordinal {
7873 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7874 }
7875 }
7876
7877 async fn on_two_way(
7878 handler: &mut ___H,
7879 mut message: ::fidl_next::Message<___T>,
7880 responder: ::fidl_next::protocol::Responder<___T>,
7881 ) -> ::core::result::Result<
7882 (),
7883 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7884 > {
7885 match *message.header().ordinal {
7886 4458069386545205468 => {
7887 let responder = ::fidl_next::Responder::from_untyped(responder);
7888
7889 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7890 Ok(decoded) => {
7891 handler
7892 .register_power_domain(
7893 ::fidl_next::Request::from_decoded(decoded),
7894 responder,
7895 )
7896 .await;
7897 Ok(())
7898 }
7899 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7900 ordinal: 4458069386545205468,
7901 error,
7902 }),
7903 }
7904 }
7905
7906 7717805237469023337 => {
7907 let responder = ::fidl_next::Responder::from_untyped(responder);
7908
7909 handler.unregister_power_domain(responder).await;
7910 Ok(())
7911 }
7912
7913 7887361504891407856 => {
7914 let responder = ::fidl_next::Responder::from_untyped(responder);
7915
7916 handler.get_supported_voltage_range(responder).await;
7917 Ok(())
7918 }
7919
7920 2578932345713622683 => {
7921 let responder = ::fidl_next::Responder::from_untyped(responder);
7922
7923 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7924 Ok(decoded) => {
7925 handler
7926 .request_voltage(::fidl_next::Request::from_decoded(decoded), responder)
7927 .await;
7928 Ok(())
7929 }
7930 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7931 ordinal: 2578932345713622683,
7932 error,
7933 }),
7934 }
7935 }
7936
7937 7683000915093989729 => {
7938 let responder = ::fidl_next::Responder::from_untyped(responder);
7939
7940 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7941 Ok(decoded) => {
7942 handler
7943 .get_current_voltage(
7944 ::fidl_next::Request::from_decoded(decoded),
7945 responder,
7946 )
7947 .await;
7948 Ok(())
7949 }
7950 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7951 ordinal: 7683000915093989729,
7952 error,
7953 }),
7954 }
7955 }
7956
7957 4178917272116294842 => {
7958 let responder = ::fidl_next::Responder::from_untyped(responder);
7959
7960 handler.get_power_domain_status(responder).await;
7961 Ok(())
7962 }
7963
7964 3749867380549091993 => {
7965 let responder = ::fidl_next::Responder::from_untyped(responder);
7966
7967 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7968 Ok(decoded) => {
7969 handler
7970 .write_pmic_ctrl_reg(
7971 ::fidl_next::Request::from_decoded(decoded),
7972 responder,
7973 )
7974 .await;
7975 Ok(())
7976 }
7977 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7978 ordinal: 3749867380549091993,
7979 error,
7980 }),
7981 }
7982 }
7983
7984 8281766978930618131 => {
7985 let responder = ::fidl_next::Responder::from_untyped(responder);
7986
7987 match ::fidl_next::AsDecoderExt::into_decoded(message) {
7988 Ok(decoded) => {
7989 handler
7990 .read_pmic_ctrl_reg(
7991 ::fidl_next::Request::from_decoded(decoded),
7992 responder,
7993 )
7994 .await;
7995 Ok(())
7996 }
7997 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
7998 ordinal: 8281766978930618131,
7999 error,
8000 }),
8001 }
8002 }
8003
8004 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8005 }
8006 }
8007}
8008
8009impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
8010{}
8011
8012impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
8013where
8014 ___H: DeviceClientHandler<___T>,
8015 ___T: ::fidl_next::Transport,
8016{
8017}
8018
8019impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
8020where
8021 ___H: DeviceServerHandler<___T>,
8022 ___T: ::fidl_next::Transport,
8023{
8024 async fn register_power_domain(
8025 &mut self,
8026
8027 request: ::fidl_next::Request<device::RegisterPowerDomain, ___T>,
8028
8029 responder: ::fidl_next::Responder<device::RegisterPowerDomain, ___T>,
8030 ) {
8031 ___H::register_power_domain(&mut self.0, request, responder).await
8032 }
8033
8034 async fn unregister_power_domain(
8035 &mut self,
8036
8037 responder: ::fidl_next::Responder<device::UnregisterPowerDomain, ___T>,
8038 ) {
8039 ___H::unregister_power_domain(&mut self.0, responder).await
8040 }
8041
8042 async fn get_supported_voltage_range(
8043 &mut self,
8044
8045 responder: ::fidl_next::Responder<device::GetSupportedVoltageRange, ___T>,
8046 ) {
8047 ___H::get_supported_voltage_range(&mut self.0, responder).await
8048 }
8049
8050 async fn request_voltage(
8051 &mut self,
8052
8053 request: ::fidl_next::Request<device::RequestVoltage, ___T>,
8054
8055 responder: ::fidl_next::Responder<device::RequestVoltage, ___T>,
8056 ) {
8057 ___H::request_voltage(&mut self.0, request, responder).await
8058 }
8059
8060 async fn get_current_voltage(
8061 &mut self,
8062
8063 request: ::fidl_next::Request<device::GetCurrentVoltage, ___T>,
8064
8065 responder: ::fidl_next::Responder<device::GetCurrentVoltage, ___T>,
8066 ) {
8067 ___H::get_current_voltage(&mut self.0, request, responder).await
8068 }
8069
8070 async fn get_power_domain_status(
8071 &mut self,
8072
8073 responder: ::fidl_next::Responder<device::GetPowerDomainStatus, ___T>,
8074 ) {
8075 ___H::get_power_domain_status(&mut self.0, responder).await
8076 }
8077
8078 async fn write_pmic_ctrl_reg(
8079 &mut self,
8080
8081 request: ::fidl_next::Request<device::WritePmicCtrlReg, ___T>,
8082
8083 responder: ::fidl_next::Responder<device::WritePmicCtrlReg, ___T>,
8084 ) {
8085 ___H::write_pmic_ctrl_reg(&mut self.0, request, responder).await
8086 }
8087
8088 async fn read_pmic_ctrl_reg(
8089 &mut self,
8090
8091 request: ::fidl_next::Request<device::ReadPmicCtrlReg, ___T>,
8092
8093 responder: ::fidl_next::Responder<device::ReadPmicCtrlReg, ___T>,
8094 ) {
8095 ___H::read_pmic_ctrl_reg(&mut self.0, request, responder).await
8096 }
8097}