1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const DEVICE_OPERATING_POINT_P0: u32 = 0;
12
13pub const FREQUENCY_UNKNOWN: i64 = -1;
17
18pub const VOLTAGE_UNKNOWN: i64 = -1;
19
20#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22#[repr(C)]
23pub struct CpuOperatingPointInfo {
24 pub frequency_hz: i64,
25 pub voltage_uv: i64,
26}
27
28impl fidl::Persistable for CpuOperatingPointInfo {}
29
30#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31#[repr(C)]
32pub struct DeviceGetCurrentOperatingPointResponse {
33 pub out_opp: u32,
34}
35
36impl fidl::Persistable for DeviceGetCurrentOperatingPointResponse {}
37
38#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39#[repr(C)]
40pub struct DeviceGetDomainIdResponse {
41 pub domain_id: u32,
42}
43
44impl fidl::Persistable for DeviceGetDomainIdResponse {}
45
46#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
47#[repr(C)]
48pub struct DeviceGetLogicalCoreIdRequest {
49 pub index: u64,
50}
51
52impl fidl::Persistable for DeviceGetLogicalCoreIdRequest {}
53
54#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
55#[repr(C)]
56pub struct DeviceGetLogicalCoreIdResponse {
57 pub id: u64,
58}
59
60impl fidl::Persistable for DeviceGetLogicalCoreIdResponse {}
61
62#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
63#[repr(C)]
64pub struct DeviceGetNumLogicalCoresResponse {
65 pub count: u64,
66}
67
68impl fidl::Persistable for DeviceGetNumLogicalCoresResponse {}
69
70#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
71#[repr(C)]
72pub struct DeviceGetOperatingPointInfoRequest {
73 pub opp: u32,
74}
75
76impl fidl::Persistable for DeviceGetOperatingPointInfoRequest {}
77
78#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79#[repr(C)]
80pub struct DeviceSetCurrentOperatingPointRequest {
81 pub requested_opp: u32,
82}
83
84impl fidl::Persistable for DeviceSetCurrentOperatingPointRequest {}
85
86#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
87#[repr(C)]
88pub struct DeviceGetOperatingPointCountResponse {
89 pub count: u32,
90}
91
92impl fidl::Persistable for DeviceGetOperatingPointCountResponse {}
93
94#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95#[repr(C)]
96pub struct DeviceGetOperatingPointInfoResponse {
97 pub info: CpuOperatingPointInfo,
98}
99
100impl fidl::Persistable for DeviceGetOperatingPointInfoResponse {}
101
102#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103#[repr(C)]
104pub struct DeviceGetRelativePerformanceResponse {
105 pub relative_performance: u8,
106}
107
108impl fidl::Persistable for DeviceGetRelativePerformanceResponse {}
109
110#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111#[repr(C)]
112pub struct DeviceSetCurrentOperatingPointResponse {
113 pub out_opp: u32,
114}
115
116impl fidl::Persistable for DeviceSetCurrentOperatingPointResponse {}
117
118mod internal {
119 use super::*;
120
121 impl fidl::encoding::ValueTypeMarker for CpuOperatingPointInfo {
122 type Borrowed<'a> = &'a Self;
123 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
124 value
125 }
126 }
127
128 unsafe impl fidl::encoding::TypeMarker for CpuOperatingPointInfo {
129 type Owned = Self;
130
131 #[inline(always)]
132 fn inline_align(_context: fidl::encoding::Context) -> usize {
133 8
134 }
135
136 #[inline(always)]
137 fn inline_size(_context: fidl::encoding::Context) -> usize {
138 16
139 }
140 #[inline(always)]
141 fn encode_is_copy() -> bool {
142 true
143 }
144
145 #[inline(always)]
146 fn decode_is_copy() -> bool {
147 true
148 }
149 }
150
151 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CpuOperatingPointInfo, D>
152 for &CpuOperatingPointInfo
153 {
154 #[inline]
155 unsafe fn encode(
156 self,
157 encoder: &mut fidl::encoding::Encoder<'_, D>,
158 offset: usize,
159 _depth: fidl::encoding::Depth,
160 ) -> fidl::Result<()> {
161 encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
162 unsafe {
163 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
165 (buf_ptr as *mut CpuOperatingPointInfo)
166 .write_unaligned((self as *const CpuOperatingPointInfo).read());
167 }
170 Ok(())
171 }
172 }
173 unsafe impl<
174 D: fidl::encoding::ResourceDialect,
175 T0: fidl::encoding::Encode<i64, D>,
176 T1: fidl::encoding::Encode<i64, D>,
177 > fidl::encoding::Encode<CpuOperatingPointInfo, D> for (T0, T1)
178 {
179 #[inline]
180 unsafe fn encode(
181 self,
182 encoder: &mut fidl::encoding::Encoder<'_, D>,
183 offset: usize,
184 depth: fidl::encoding::Depth,
185 ) -> fidl::Result<()> {
186 encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
187 self.0.encode(encoder, offset + 0, depth)?;
191 self.1.encode(encoder, offset + 8, depth)?;
192 Ok(())
193 }
194 }
195
196 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuOperatingPointInfo {
197 #[inline(always)]
198 fn new_empty() -> Self {
199 Self { frequency_hz: fidl::new_empty!(i64, D), voltage_uv: fidl::new_empty!(i64, D) }
200 }
201
202 #[inline]
203 unsafe fn decode(
204 &mut self,
205 decoder: &mut fidl::encoding::Decoder<'_, D>,
206 offset: usize,
207 _depth: fidl::encoding::Depth,
208 ) -> fidl::Result<()> {
209 decoder.debug_check_bounds::<Self>(offset);
210 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
211 unsafe {
214 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
215 }
216 Ok(())
217 }
218 }
219
220 impl fidl::encoding::ValueTypeMarker for DeviceGetCurrentOperatingPointResponse {
221 type Borrowed<'a> = &'a Self;
222 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
223 value
224 }
225 }
226
227 unsafe impl fidl::encoding::TypeMarker for DeviceGetCurrentOperatingPointResponse {
228 type Owned = Self;
229
230 #[inline(always)]
231 fn inline_align(_context: fidl::encoding::Context) -> usize {
232 4
233 }
234
235 #[inline(always)]
236 fn inline_size(_context: fidl::encoding::Context) -> usize {
237 4
238 }
239 #[inline(always)]
240 fn encode_is_copy() -> bool {
241 true
242 }
243
244 #[inline(always)]
245 fn decode_is_copy() -> bool {
246 true
247 }
248 }
249
250 unsafe impl<D: fidl::encoding::ResourceDialect>
251 fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D>
252 for &DeviceGetCurrentOperatingPointResponse
253 {
254 #[inline]
255 unsafe fn encode(
256 self,
257 encoder: &mut fidl::encoding::Encoder<'_, D>,
258 offset: usize,
259 _depth: fidl::encoding::Depth,
260 ) -> fidl::Result<()> {
261 encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
262 unsafe {
263 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
265 (buf_ptr as *mut DeviceGetCurrentOperatingPointResponse).write_unaligned(
266 (self as *const DeviceGetCurrentOperatingPointResponse).read(),
267 );
268 }
271 Ok(())
272 }
273 }
274 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
275 fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D> for (T0,)
276 {
277 #[inline]
278 unsafe fn encode(
279 self,
280 encoder: &mut fidl::encoding::Encoder<'_, D>,
281 offset: usize,
282 depth: fidl::encoding::Depth,
283 ) -> fidl::Result<()> {
284 encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
285 self.0.encode(encoder, offset + 0, depth)?;
289 Ok(())
290 }
291 }
292
293 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
294 for DeviceGetCurrentOperatingPointResponse
295 {
296 #[inline(always)]
297 fn new_empty() -> Self {
298 Self { out_opp: fidl::new_empty!(u32, D) }
299 }
300
301 #[inline]
302 unsafe fn decode(
303 &mut self,
304 decoder: &mut fidl::encoding::Decoder<'_, D>,
305 offset: usize,
306 _depth: fidl::encoding::Depth,
307 ) -> fidl::Result<()> {
308 decoder.debug_check_bounds::<Self>(offset);
309 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
310 unsafe {
313 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
314 }
315 Ok(())
316 }
317 }
318
319 impl fidl::encoding::ValueTypeMarker for DeviceGetDomainIdResponse {
320 type Borrowed<'a> = &'a Self;
321 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
322 value
323 }
324 }
325
326 unsafe impl fidl::encoding::TypeMarker for DeviceGetDomainIdResponse {
327 type Owned = Self;
328
329 #[inline(always)]
330 fn inline_align(_context: fidl::encoding::Context) -> usize {
331 4
332 }
333
334 #[inline(always)]
335 fn inline_size(_context: fidl::encoding::Context) -> usize {
336 4
337 }
338 #[inline(always)]
339 fn encode_is_copy() -> bool {
340 true
341 }
342
343 #[inline(always)]
344 fn decode_is_copy() -> bool {
345 true
346 }
347 }
348
349 unsafe impl<D: fidl::encoding::ResourceDialect>
350 fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for &DeviceGetDomainIdResponse
351 {
352 #[inline]
353 unsafe fn encode(
354 self,
355 encoder: &mut fidl::encoding::Encoder<'_, D>,
356 offset: usize,
357 _depth: fidl::encoding::Depth,
358 ) -> fidl::Result<()> {
359 encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
360 unsafe {
361 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
363 (buf_ptr as *mut DeviceGetDomainIdResponse)
364 .write_unaligned((self as *const DeviceGetDomainIdResponse).read());
365 }
368 Ok(())
369 }
370 }
371 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
372 fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for (T0,)
373 {
374 #[inline]
375 unsafe fn encode(
376 self,
377 encoder: &mut fidl::encoding::Encoder<'_, D>,
378 offset: usize,
379 depth: fidl::encoding::Depth,
380 ) -> fidl::Result<()> {
381 encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
382 self.0.encode(encoder, offset + 0, depth)?;
386 Ok(())
387 }
388 }
389
390 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
391 for DeviceGetDomainIdResponse
392 {
393 #[inline(always)]
394 fn new_empty() -> Self {
395 Self { domain_id: fidl::new_empty!(u32, D) }
396 }
397
398 #[inline]
399 unsafe fn decode(
400 &mut self,
401 decoder: &mut fidl::encoding::Decoder<'_, D>,
402 offset: usize,
403 _depth: fidl::encoding::Depth,
404 ) -> fidl::Result<()> {
405 decoder.debug_check_bounds::<Self>(offset);
406 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
407 unsafe {
410 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
411 }
412 Ok(())
413 }
414 }
415
416 impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdRequest {
417 type Borrowed<'a> = &'a Self;
418 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
419 value
420 }
421 }
422
423 unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdRequest {
424 type Owned = Self;
425
426 #[inline(always)]
427 fn inline_align(_context: fidl::encoding::Context) -> usize {
428 8
429 }
430
431 #[inline(always)]
432 fn inline_size(_context: fidl::encoding::Context) -> usize {
433 8
434 }
435 #[inline(always)]
436 fn encode_is_copy() -> bool {
437 true
438 }
439
440 #[inline(always)]
441 fn decode_is_copy() -> bool {
442 true
443 }
444 }
445
446 unsafe impl<D: fidl::encoding::ResourceDialect>
447 fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D>
448 for &DeviceGetLogicalCoreIdRequest
449 {
450 #[inline]
451 unsafe fn encode(
452 self,
453 encoder: &mut fidl::encoding::Encoder<'_, D>,
454 offset: usize,
455 _depth: fidl::encoding::Depth,
456 ) -> fidl::Result<()> {
457 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
458 unsafe {
459 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
461 (buf_ptr as *mut DeviceGetLogicalCoreIdRequest)
462 .write_unaligned((self as *const DeviceGetLogicalCoreIdRequest).read());
463 }
466 Ok(())
467 }
468 }
469 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
470 fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D> for (T0,)
471 {
472 #[inline]
473 unsafe fn encode(
474 self,
475 encoder: &mut fidl::encoding::Encoder<'_, D>,
476 offset: usize,
477 depth: fidl::encoding::Depth,
478 ) -> fidl::Result<()> {
479 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
480 self.0.encode(encoder, offset + 0, depth)?;
484 Ok(())
485 }
486 }
487
488 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
489 for DeviceGetLogicalCoreIdRequest
490 {
491 #[inline(always)]
492 fn new_empty() -> Self {
493 Self { index: fidl::new_empty!(u64, D) }
494 }
495
496 #[inline]
497 unsafe fn decode(
498 &mut self,
499 decoder: &mut fidl::encoding::Decoder<'_, D>,
500 offset: usize,
501 _depth: fidl::encoding::Depth,
502 ) -> fidl::Result<()> {
503 decoder.debug_check_bounds::<Self>(offset);
504 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
505 unsafe {
508 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
509 }
510 Ok(())
511 }
512 }
513
514 impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdResponse {
515 type Borrowed<'a> = &'a Self;
516 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
517 value
518 }
519 }
520
521 unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdResponse {
522 type Owned = Self;
523
524 #[inline(always)]
525 fn inline_align(_context: fidl::encoding::Context) -> usize {
526 8
527 }
528
529 #[inline(always)]
530 fn inline_size(_context: fidl::encoding::Context) -> usize {
531 8
532 }
533 #[inline(always)]
534 fn encode_is_copy() -> bool {
535 true
536 }
537
538 #[inline(always)]
539 fn decode_is_copy() -> bool {
540 true
541 }
542 }
543
544 unsafe impl<D: fidl::encoding::ResourceDialect>
545 fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D>
546 for &DeviceGetLogicalCoreIdResponse
547 {
548 #[inline]
549 unsafe fn encode(
550 self,
551 encoder: &mut fidl::encoding::Encoder<'_, D>,
552 offset: usize,
553 _depth: fidl::encoding::Depth,
554 ) -> fidl::Result<()> {
555 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
556 unsafe {
557 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
559 (buf_ptr as *mut DeviceGetLogicalCoreIdResponse)
560 .write_unaligned((self as *const DeviceGetLogicalCoreIdResponse).read());
561 }
564 Ok(())
565 }
566 }
567 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
568 fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D> for (T0,)
569 {
570 #[inline]
571 unsafe fn encode(
572 self,
573 encoder: &mut fidl::encoding::Encoder<'_, D>,
574 offset: usize,
575 depth: fidl::encoding::Depth,
576 ) -> fidl::Result<()> {
577 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
578 self.0.encode(encoder, offset + 0, depth)?;
582 Ok(())
583 }
584 }
585
586 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
587 for DeviceGetLogicalCoreIdResponse
588 {
589 #[inline(always)]
590 fn new_empty() -> Self {
591 Self { id: fidl::new_empty!(u64, D) }
592 }
593
594 #[inline]
595 unsafe fn decode(
596 &mut self,
597 decoder: &mut fidl::encoding::Decoder<'_, D>,
598 offset: usize,
599 _depth: fidl::encoding::Depth,
600 ) -> fidl::Result<()> {
601 decoder.debug_check_bounds::<Self>(offset);
602 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
603 unsafe {
606 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
607 }
608 Ok(())
609 }
610 }
611
612 impl fidl::encoding::ValueTypeMarker for DeviceGetNumLogicalCoresResponse {
613 type Borrowed<'a> = &'a Self;
614 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
615 value
616 }
617 }
618
619 unsafe impl fidl::encoding::TypeMarker for DeviceGetNumLogicalCoresResponse {
620 type Owned = Self;
621
622 #[inline(always)]
623 fn inline_align(_context: fidl::encoding::Context) -> usize {
624 8
625 }
626
627 #[inline(always)]
628 fn inline_size(_context: fidl::encoding::Context) -> usize {
629 8
630 }
631 #[inline(always)]
632 fn encode_is_copy() -> bool {
633 true
634 }
635
636 #[inline(always)]
637 fn decode_is_copy() -> bool {
638 true
639 }
640 }
641
642 unsafe impl<D: fidl::encoding::ResourceDialect>
643 fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D>
644 for &DeviceGetNumLogicalCoresResponse
645 {
646 #[inline]
647 unsafe fn encode(
648 self,
649 encoder: &mut fidl::encoding::Encoder<'_, D>,
650 offset: usize,
651 _depth: fidl::encoding::Depth,
652 ) -> fidl::Result<()> {
653 encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
654 unsafe {
655 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
657 (buf_ptr as *mut DeviceGetNumLogicalCoresResponse)
658 .write_unaligned((self as *const DeviceGetNumLogicalCoresResponse).read());
659 }
662 Ok(())
663 }
664 }
665 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
666 fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D> for (T0,)
667 {
668 #[inline]
669 unsafe fn encode(
670 self,
671 encoder: &mut fidl::encoding::Encoder<'_, D>,
672 offset: usize,
673 depth: fidl::encoding::Depth,
674 ) -> fidl::Result<()> {
675 encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
676 self.0.encode(encoder, offset + 0, depth)?;
680 Ok(())
681 }
682 }
683
684 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
685 for DeviceGetNumLogicalCoresResponse
686 {
687 #[inline(always)]
688 fn new_empty() -> Self {
689 Self { count: fidl::new_empty!(u64, D) }
690 }
691
692 #[inline]
693 unsafe fn decode(
694 &mut self,
695 decoder: &mut fidl::encoding::Decoder<'_, D>,
696 offset: usize,
697 _depth: fidl::encoding::Depth,
698 ) -> fidl::Result<()> {
699 decoder.debug_check_bounds::<Self>(offset);
700 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
701 unsafe {
704 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
705 }
706 Ok(())
707 }
708 }
709
710 impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoRequest {
711 type Borrowed<'a> = &'a Self;
712 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
713 value
714 }
715 }
716
717 unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoRequest {
718 type Owned = Self;
719
720 #[inline(always)]
721 fn inline_align(_context: fidl::encoding::Context) -> usize {
722 4
723 }
724
725 #[inline(always)]
726 fn inline_size(_context: fidl::encoding::Context) -> usize {
727 4
728 }
729 #[inline(always)]
730 fn encode_is_copy() -> bool {
731 true
732 }
733
734 #[inline(always)]
735 fn decode_is_copy() -> bool {
736 true
737 }
738 }
739
740 unsafe impl<D: fidl::encoding::ResourceDialect>
741 fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D>
742 for &DeviceGetOperatingPointInfoRequest
743 {
744 #[inline]
745 unsafe fn encode(
746 self,
747 encoder: &mut fidl::encoding::Encoder<'_, D>,
748 offset: usize,
749 _depth: fidl::encoding::Depth,
750 ) -> fidl::Result<()> {
751 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
752 unsafe {
753 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
755 (buf_ptr as *mut DeviceGetOperatingPointInfoRequest)
756 .write_unaligned((self as *const DeviceGetOperatingPointInfoRequest).read());
757 }
760 Ok(())
761 }
762 }
763 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
764 fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D> for (T0,)
765 {
766 #[inline]
767 unsafe fn encode(
768 self,
769 encoder: &mut fidl::encoding::Encoder<'_, D>,
770 offset: usize,
771 depth: fidl::encoding::Depth,
772 ) -> fidl::Result<()> {
773 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
774 self.0.encode(encoder, offset + 0, depth)?;
778 Ok(())
779 }
780 }
781
782 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
783 for DeviceGetOperatingPointInfoRequest
784 {
785 #[inline(always)]
786 fn new_empty() -> Self {
787 Self { opp: fidl::new_empty!(u32, D) }
788 }
789
790 #[inline]
791 unsafe fn decode(
792 &mut self,
793 decoder: &mut fidl::encoding::Decoder<'_, D>,
794 offset: usize,
795 _depth: fidl::encoding::Depth,
796 ) -> fidl::Result<()> {
797 decoder.debug_check_bounds::<Self>(offset);
798 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
799 unsafe {
802 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
803 }
804 Ok(())
805 }
806 }
807
808 impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointRequest {
809 type Borrowed<'a> = &'a Self;
810 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
811 value
812 }
813 }
814
815 unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointRequest {
816 type Owned = Self;
817
818 #[inline(always)]
819 fn inline_align(_context: fidl::encoding::Context) -> usize {
820 4
821 }
822
823 #[inline(always)]
824 fn inline_size(_context: fidl::encoding::Context) -> usize {
825 4
826 }
827 #[inline(always)]
828 fn encode_is_copy() -> bool {
829 true
830 }
831
832 #[inline(always)]
833 fn decode_is_copy() -> bool {
834 true
835 }
836 }
837
838 unsafe impl<D: fidl::encoding::ResourceDialect>
839 fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D>
840 for &DeviceSetCurrentOperatingPointRequest
841 {
842 #[inline]
843 unsafe fn encode(
844 self,
845 encoder: &mut fidl::encoding::Encoder<'_, D>,
846 offset: usize,
847 _depth: fidl::encoding::Depth,
848 ) -> fidl::Result<()> {
849 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
850 unsafe {
851 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
853 (buf_ptr as *mut DeviceSetCurrentOperatingPointRequest)
854 .write_unaligned((self as *const DeviceSetCurrentOperatingPointRequest).read());
855 }
858 Ok(())
859 }
860 }
861 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
862 fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D> for (T0,)
863 {
864 #[inline]
865 unsafe fn encode(
866 self,
867 encoder: &mut fidl::encoding::Encoder<'_, D>,
868 offset: usize,
869 depth: fidl::encoding::Depth,
870 ) -> fidl::Result<()> {
871 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
872 self.0.encode(encoder, offset + 0, depth)?;
876 Ok(())
877 }
878 }
879
880 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
881 for DeviceSetCurrentOperatingPointRequest
882 {
883 #[inline(always)]
884 fn new_empty() -> Self {
885 Self { requested_opp: fidl::new_empty!(u32, D) }
886 }
887
888 #[inline]
889 unsafe fn decode(
890 &mut self,
891 decoder: &mut fidl::encoding::Decoder<'_, D>,
892 offset: usize,
893 _depth: fidl::encoding::Depth,
894 ) -> fidl::Result<()> {
895 decoder.debug_check_bounds::<Self>(offset);
896 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
897 unsafe {
900 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
901 }
902 Ok(())
903 }
904 }
905
906 impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointCountResponse {
907 type Borrowed<'a> = &'a Self;
908 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
909 value
910 }
911 }
912
913 unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointCountResponse {
914 type Owned = Self;
915
916 #[inline(always)]
917 fn inline_align(_context: fidl::encoding::Context) -> usize {
918 4
919 }
920
921 #[inline(always)]
922 fn inline_size(_context: fidl::encoding::Context) -> usize {
923 4
924 }
925 #[inline(always)]
926 fn encode_is_copy() -> bool {
927 true
928 }
929
930 #[inline(always)]
931 fn decode_is_copy() -> bool {
932 true
933 }
934 }
935
936 unsafe impl<D: fidl::encoding::ResourceDialect>
937 fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D>
938 for &DeviceGetOperatingPointCountResponse
939 {
940 #[inline]
941 unsafe fn encode(
942 self,
943 encoder: &mut fidl::encoding::Encoder<'_, D>,
944 offset: usize,
945 _depth: fidl::encoding::Depth,
946 ) -> fidl::Result<()> {
947 encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
948 unsafe {
949 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
951 (buf_ptr as *mut DeviceGetOperatingPointCountResponse)
952 .write_unaligned((self as *const DeviceGetOperatingPointCountResponse).read());
953 }
956 Ok(())
957 }
958 }
959 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
960 fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D> for (T0,)
961 {
962 #[inline]
963 unsafe fn encode(
964 self,
965 encoder: &mut fidl::encoding::Encoder<'_, D>,
966 offset: usize,
967 depth: fidl::encoding::Depth,
968 ) -> fidl::Result<()> {
969 encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
970 self.0.encode(encoder, offset + 0, depth)?;
974 Ok(())
975 }
976 }
977
978 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
979 for DeviceGetOperatingPointCountResponse
980 {
981 #[inline(always)]
982 fn new_empty() -> Self {
983 Self { count: fidl::new_empty!(u32, D) }
984 }
985
986 #[inline]
987 unsafe fn decode(
988 &mut self,
989 decoder: &mut fidl::encoding::Decoder<'_, D>,
990 offset: usize,
991 _depth: fidl::encoding::Depth,
992 ) -> fidl::Result<()> {
993 decoder.debug_check_bounds::<Self>(offset);
994 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
995 unsafe {
998 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
999 }
1000 Ok(())
1001 }
1002 }
1003
1004 impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoResponse {
1005 type Borrowed<'a> = &'a Self;
1006 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1007 value
1008 }
1009 }
1010
1011 unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoResponse {
1012 type Owned = Self;
1013
1014 #[inline(always)]
1015 fn inline_align(_context: fidl::encoding::Context) -> usize {
1016 8
1017 }
1018
1019 #[inline(always)]
1020 fn inline_size(_context: fidl::encoding::Context) -> usize {
1021 16
1022 }
1023 #[inline(always)]
1024 fn encode_is_copy() -> bool {
1025 true
1026 }
1027
1028 #[inline(always)]
1029 fn decode_is_copy() -> bool {
1030 true
1031 }
1032 }
1033
1034 unsafe impl<D: fidl::encoding::ResourceDialect>
1035 fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D>
1036 for &DeviceGetOperatingPointInfoResponse
1037 {
1038 #[inline]
1039 unsafe fn encode(
1040 self,
1041 encoder: &mut fidl::encoding::Encoder<'_, D>,
1042 offset: usize,
1043 _depth: fidl::encoding::Depth,
1044 ) -> fidl::Result<()> {
1045 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
1046 unsafe {
1047 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1049 (buf_ptr as *mut DeviceGetOperatingPointInfoResponse)
1050 .write_unaligned((self as *const DeviceGetOperatingPointInfoResponse).read());
1051 }
1054 Ok(())
1055 }
1056 }
1057 unsafe impl<
1058 D: fidl::encoding::ResourceDialect,
1059 T0: fidl::encoding::Encode<CpuOperatingPointInfo, D>,
1060 > fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D> for (T0,)
1061 {
1062 #[inline]
1063 unsafe fn encode(
1064 self,
1065 encoder: &mut fidl::encoding::Encoder<'_, D>,
1066 offset: usize,
1067 depth: fidl::encoding::Depth,
1068 ) -> fidl::Result<()> {
1069 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
1070 self.0.encode(encoder, offset + 0, depth)?;
1074 Ok(())
1075 }
1076 }
1077
1078 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1079 for DeviceGetOperatingPointInfoResponse
1080 {
1081 #[inline(always)]
1082 fn new_empty() -> Self {
1083 Self { info: fidl::new_empty!(CpuOperatingPointInfo, D) }
1084 }
1085
1086 #[inline]
1087 unsafe fn decode(
1088 &mut self,
1089 decoder: &mut fidl::encoding::Decoder<'_, D>,
1090 offset: usize,
1091 _depth: fidl::encoding::Depth,
1092 ) -> fidl::Result<()> {
1093 decoder.debug_check_bounds::<Self>(offset);
1094 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1095 unsafe {
1098 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1099 }
1100 Ok(())
1101 }
1102 }
1103
1104 impl fidl::encoding::ValueTypeMarker for DeviceGetRelativePerformanceResponse {
1105 type Borrowed<'a> = &'a Self;
1106 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1107 value
1108 }
1109 }
1110
1111 unsafe impl fidl::encoding::TypeMarker for DeviceGetRelativePerformanceResponse {
1112 type Owned = Self;
1113
1114 #[inline(always)]
1115 fn inline_align(_context: fidl::encoding::Context) -> usize {
1116 1
1117 }
1118
1119 #[inline(always)]
1120 fn inline_size(_context: fidl::encoding::Context) -> usize {
1121 1
1122 }
1123 #[inline(always)]
1124 fn encode_is_copy() -> bool {
1125 true
1126 }
1127
1128 #[inline(always)]
1129 fn decode_is_copy() -> bool {
1130 true
1131 }
1132 }
1133
1134 unsafe impl<D: fidl::encoding::ResourceDialect>
1135 fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D>
1136 for &DeviceGetRelativePerformanceResponse
1137 {
1138 #[inline]
1139 unsafe fn encode(
1140 self,
1141 encoder: &mut fidl::encoding::Encoder<'_, D>,
1142 offset: usize,
1143 _depth: fidl::encoding::Depth,
1144 ) -> fidl::Result<()> {
1145 encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
1146 unsafe {
1147 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1149 (buf_ptr as *mut DeviceGetRelativePerformanceResponse)
1150 .write_unaligned((self as *const DeviceGetRelativePerformanceResponse).read());
1151 }
1154 Ok(())
1155 }
1156 }
1157 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1158 fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D> for (T0,)
1159 {
1160 #[inline]
1161 unsafe fn encode(
1162 self,
1163 encoder: &mut fidl::encoding::Encoder<'_, D>,
1164 offset: usize,
1165 depth: fidl::encoding::Depth,
1166 ) -> fidl::Result<()> {
1167 encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
1168 self.0.encode(encoder, offset + 0, depth)?;
1172 Ok(())
1173 }
1174 }
1175
1176 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1177 for DeviceGetRelativePerformanceResponse
1178 {
1179 #[inline(always)]
1180 fn new_empty() -> Self {
1181 Self { relative_performance: fidl::new_empty!(u8, D) }
1182 }
1183
1184 #[inline]
1185 unsafe fn decode(
1186 &mut self,
1187 decoder: &mut fidl::encoding::Decoder<'_, D>,
1188 offset: usize,
1189 _depth: fidl::encoding::Depth,
1190 ) -> fidl::Result<()> {
1191 decoder.debug_check_bounds::<Self>(offset);
1192 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1193 unsafe {
1196 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1197 }
1198 Ok(())
1199 }
1200 }
1201
1202 impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointResponse {
1203 type Borrowed<'a> = &'a Self;
1204 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1205 value
1206 }
1207 }
1208
1209 unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointResponse {
1210 type Owned = Self;
1211
1212 #[inline(always)]
1213 fn inline_align(_context: fidl::encoding::Context) -> usize {
1214 4
1215 }
1216
1217 #[inline(always)]
1218 fn inline_size(_context: fidl::encoding::Context) -> usize {
1219 4
1220 }
1221 #[inline(always)]
1222 fn encode_is_copy() -> bool {
1223 true
1224 }
1225
1226 #[inline(always)]
1227 fn decode_is_copy() -> bool {
1228 true
1229 }
1230 }
1231
1232 unsafe impl<D: fidl::encoding::ResourceDialect>
1233 fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D>
1234 for &DeviceSetCurrentOperatingPointResponse
1235 {
1236 #[inline]
1237 unsafe fn encode(
1238 self,
1239 encoder: &mut fidl::encoding::Encoder<'_, D>,
1240 offset: usize,
1241 _depth: fidl::encoding::Depth,
1242 ) -> fidl::Result<()> {
1243 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
1244 unsafe {
1245 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1247 (buf_ptr as *mut DeviceSetCurrentOperatingPointResponse).write_unaligned(
1248 (self as *const DeviceSetCurrentOperatingPointResponse).read(),
1249 );
1250 }
1253 Ok(())
1254 }
1255 }
1256 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1257 fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D> for (T0,)
1258 {
1259 #[inline]
1260 unsafe fn encode(
1261 self,
1262 encoder: &mut fidl::encoding::Encoder<'_, D>,
1263 offset: usize,
1264 depth: fidl::encoding::Depth,
1265 ) -> fidl::Result<()> {
1266 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
1267 self.0.encode(encoder, offset + 0, depth)?;
1271 Ok(())
1272 }
1273 }
1274
1275 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1276 for DeviceSetCurrentOperatingPointResponse
1277 {
1278 #[inline(always)]
1279 fn new_empty() -> Self {
1280 Self { out_opp: fidl::new_empty!(u32, D) }
1281 }
1282
1283 #[inline]
1284 unsafe fn decode(
1285 &mut self,
1286 decoder: &mut fidl::encoding::Decoder<'_, D>,
1287 offset: usize,
1288 _depth: fidl::encoding::Depth,
1289 ) -> fidl::Result<()> {
1290 decoder.debug_check_bounds::<Self>(offset);
1291 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1292 unsafe {
1295 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1296 }
1297 Ok(())
1298 }
1299 }
1300}