fidl_fuchsia_hardware_cpu_ctrl__common/
fidl_fuchsia_hardware_cpu_ctrl__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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
13/// CpuOperatingPointInfo::frequency_hz and CpuOperatingPointInfo::voltage_uv
14/// are set to this if the frequency and voltage for the given operating point
15/// are unknown respectively.
16pub const FREQUENCY_UNKNOWN: i64 = -1;
17
18pub const VOLTAGE_UNKNOWN: i64 = -1;
19
20/// A collection of some basic information for a given operating point.
21#[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 DeviceSetMaximumOperatingPointLimitRequest {
89    pub maximum_opp: u32,
90}
91
92impl fidl::Persistable for DeviceSetMaximumOperatingPointLimitRequest {}
93
94#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95#[repr(C)]
96pub struct DeviceSetMinimumOperatingPointLimitRequest {
97    pub minimum_opp: u32,
98}
99
100impl fidl::Persistable for DeviceSetMinimumOperatingPointLimitRequest {}
101
102#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103#[repr(C)]
104pub struct DeviceSetOperatingPointLimitsRequest {
105    pub minimum_opp: u32,
106    pub maximum_opp: u32,
107}
108
109impl fidl::Persistable for DeviceSetOperatingPointLimitsRequest {}
110
111#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
112#[repr(C)]
113pub struct DeviceGetCurrentOperatingPointLimitsResponse {
114    pub minimum_opp: u32,
115    pub maximum_opp: u32,
116}
117
118impl fidl::Persistable for DeviceGetCurrentOperatingPointLimitsResponse {}
119
120#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121#[repr(C)]
122pub struct DeviceGetOperatingPointCountResponse {
123    pub count: u32,
124}
125
126impl fidl::Persistable for DeviceGetOperatingPointCountResponse {}
127
128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
129#[repr(C)]
130pub struct DeviceGetOperatingPointInfoResponse {
131    pub info: CpuOperatingPointInfo,
132}
133
134impl fidl::Persistable for DeviceGetOperatingPointInfoResponse {}
135
136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137#[repr(C)]
138pub struct DeviceGetRelativePerformanceResponse {
139    pub relative_performance: u8,
140}
141
142impl fidl::Persistable for DeviceGetRelativePerformanceResponse {}
143
144#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145#[repr(C)]
146pub struct DeviceSetCurrentOperatingPointResponse {
147    pub out_opp: u32,
148}
149
150impl fidl::Persistable for DeviceSetCurrentOperatingPointResponse {}
151
152pub mod device_ordinals {
153    pub const GET_OPERATING_POINT_INFO: u64 = 0x6594a9234fc958e2;
154    pub const GET_CURRENT_OPERATING_POINT: u64 = 0x52de67a5993f5fe1;
155    pub const SET_CURRENT_OPERATING_POINT: u64 = 0x34a7828b5ca53fd;
156    pub const SET_MINIMUM_OPERATING_POINT_LIMIT: u64 = 0x5467de86fa3fdfe7;
157    pub const SET_MAXIMUM_OPERATING_POINT_LIMIT: u64 = 0x385fa4d74481fbfd;
158    pub const SET_OPERATING_POINT_LIMITS: u64 = 0x30aa7514dd598b23;
159    pub const GET_CURRENT_OPERATING_POINT_LIMITS: u64 = 0x7aefe3d765cfc6a7;
160    pub const GET_OPERATING_POINT_COUNT: u64 = 0x13e70ec7131889ba;
161    pub const GET_NUM_LOGICAL_CORES: u64 = 0x74e304c90ca165c5;
162    pub const GET_LOGICAL_CORE_ID: u64 = 0x7168f98ddbd26058;
163    pub const GET_DOMAIN_ID: u64 = 0x3030f85bdc1ef321;
164    pub const GET_RELATIVE_PERFORMANCE: u64 = 0x41c37eaf0c26a3d3;
165}
166
167mod internal {
168    use super::*;
169
170    impl fidl::encoding::ValueTypeMarker for CpuOperatingPointInfo {
171        type Borrowed<'a> = &'a Self;
172        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
173            value
174        }
175    }
176
177    unsafe impl fidl::encoding::TypeMarker for CpuOperatingPointInfo {
178        type Owned = Self;
179
180        #[inline(always)]
181        fn inline_align(_context: fidl::encoding::Context) -> usize {
182            8
183        }
184
185        #[inline(always)]
186        fn inline_size(_context: fidl::encoding::Context) -> usize {
187            16
188        }
189        #[inline(always)]
190        fn encode_is_copy() -> bool {
191            true
192        }
193
194        #[inline(always)]
195        fn decode_is_copy() -> bool {
196            true
197        }
198    }
199
200    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CpuOperatingPointInfo, D>
201        for &CpuOperatingPointInfo
202    {
203        #[inline]
204        unsafe fn encode(
205            self,
206            encoder: &mut fidl::encoding::Encoder<'_, D>,
207            offset: usize,
208            _depth: fidl::encoding::Depth,
209        ) -> fidl::Result<()> {
210            encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
211            unsafe {
212                // Copy the object into the buffer.
213                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
214                (buf_ptr as *mut CpuOperatingPointInfo)
215                    .write_unaligned((self as *const CpuOperatingPointInfo).read());
216                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
217                // done second because the memcpy will write garbage to these bytes.
218            }
219            Ok(())
220        }
221    }
222    unsafe impl<
223        D: fidl::encoding::ResourceDialect,
224        T0: fidl::encoding::Encode<i64, D>,
225        T1: fidl::encoding::Encode<i64, D>,
226    > fidl::encoding::Encode<CpuOperatingPointInfo, D> for (T0, T1)
227    {
228        #[inline]
229        unsafe fn encode(
230            self,
231            encoder: &mut fidl::encoding::Encoder<'_, D>,
232            offset: usize,
233            depth: fidl::encoding::Depth,
234        ) -> fidl::Result<()> {
235            encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
236            // Zero out padding regions. There's no need to apply masks
237            // because the unmasked parts will be overwritten by fields.
238            // Write the fields.
239            self.0.encode(encoder, offset + 0, depth)?;
240            self.1.encode(encoder, offset + 8, depth)?;
241            Ok(())
242        }
243    }
244
245    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuOperatingPointInfo {
246        #[inline(always)]
247        fn new_empty() -> Self {
248            Self { frequency_hz: fidl::new_empty!(i64, D), voltage_uv: fidl::new_empty!(i64, D) }
249        }
250
251        #[inline]
252        unsafe fn decode(
253            &mut self,
254            decoder: &mut fidl::encoding::Decoder<'_, D>,
255            offset: usize,
256            _depth: fidl::encoding::Depth,
257        ) -> fidl::Result<()> {
258            decoder.debug_check_bounds::<Self>(offset);
259            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
260            // Verify that padding bytes are zero.
261            // Copy from the buffer into the object.
262            unsafe {
263                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
264            }
265            Ok(())
266        }
267    }
268
269    impl fidl::encoding::ValueTypeMarker for DeviceGetCurrentOperatingPointResponse {
270        type Borrowed<'a> = &'a Self;
271        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
272            value
273        }
274    }
275
276    unsafe impl fidl::encoding::TypeMarker for DeviceGetCurrentOperatingPointResponse {
277        type Owned = Self;
278
279        #[inline(always)]
280        fn inline_align(_context: fidl::encoding::Context) -> usize {
281            4
282        }
283
284        #[inline(always)]
285        fn inline_size(_context: fidl::encoding::Context) -> usize {
286            4
287        }
288        #[inline(always)]
289        fn encode_is_copy() -> bool {
290            true
291        }
292
293        #[inline(always)]
294        fn decode_is_copy() -> bool {
295            true
296        }
297    }
298
299    unsafe impl<D: fidl::encoding::ResourceDialect>
300        fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D>
301        for &DeviceGetCurrentOperatingPointResponse
302    {
303        #[inline]
304        unsafe fn encode(
305            self,
306            encoder: &mut fidl::encoding::Encoder<'_, D>,
307            offset: usize,
308            _depth: fidl::encoding::Depth,
309        ) -> fidl::Result<()> {
310            encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
311            unsafe {
312                // Copy the object into the buffer.
313                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
314                (buf_ptr as *mut DeviceGetCurrentOperatingPointResponse).write_unaligned(
315                    (self as *const DeviceGetCurrentOperatingPointResponse).read(),
316                );
317                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
318                // done second because the memcpy will write garbage to these bytes.
319            }
320            Ok(())
321        }
322    }
323    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
324        fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D> for (T0,)
325    {
326        #[inline]
327        unsafe fn encode(
328            self,
329            encoder: &mut fidl::encoding::Encoder<'_, D>,
330            offset: usize,
331            depth: fidl::encoding::Depth,
332        ) -> fidl::Result<()> {
333            encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
334            // Zero out padding regions. There's no need to apply masks
335            // because the unmasked parts will be overwritten by fields.
336            // Write the fields.
337            self.0.encode(encoder, offset + 0, depth)?;
338            Ok(())
339        }
340    }
341
342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
343        for DeviceGetCurrentOperatingPointResponse
344    {
345        #[inline(always)]
346        fn new_empty() -> Self {
347            Self { out_opp: fidl::new_empty!(u32, D) }
348        }
349
350        #[inline]
351        unsafe fn decode(
352            &mut self,
353            decoder: &mut fidl::encoding::Decoder<'_, D>,
354            offset: usize,
355            _depth: fidl::encoding::Depth,
356        ) -> fidl::Result<()> {
357            decoder.debug_check_bounds::<Self>(offset);
358            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
359            // Verify that padding bytes are zero.
360            // Copy from the buffer into the object.
361            unsafe {
362                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
363            }
364            Ok(())
365        }
366    }
367
368    impl fidl::encoding::ValueTypeMarker for DeviceGetDomainIdResponse {
369        type Borrowed<'a> = &'a Self;
370        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
371            value
372        }
373    }
374
375    unsafe impl fidl::encoding::TypeMarker for DeviceGetDomainIdResponse {
376        type Owned = Self;
377
378        #[inline(always)]
379        fn inline_align(_context: fidl::encoding::Context) -> usize {
380            4
381        }
382
383        #[inline(always)]
384        fn inline_size(_context: fidl::encoding::Context) -> usize {
385            4
386        }
387        #[inline(always)]
388        fn encode_is_copy() -> bool {
389            true
390        }
391
392        #[inline(always)]
393        fn decode_is_copy() -> bool {
394            true
395        }
396    }
397
398    unsafe impl<D: fidl::encoding::ResourceDialect>
399        fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for &DeviceGetDomainIdResponse
400    {
401        #[inline]
402        unsafe fn encode(
403            self,
404            encoder: &mut fidl::encoding::Encoder<'_, D>,
405            offset: usize,
406            _depth: fidl::encoding::Depth,
407        ) -> fidl::Result<()> {
408            encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
409            unsafe {
410                // Copy the object into the buffer.
411                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
412                (buf_ptr as *mut DeviceGetDomainIdResponse)
413                    .write_unaligned((self as *const DeviceGetDomainIdResponse).read());
414                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
415                // done second because the memcpy will write garbage to these bytes.
416            }
417            Ok(())
418        }
419    }
420    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
421        fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for (T0,)
422    {
423        #[inline]
424        unsafe fn encode(
425            self,
426            encoder: &mut fidl::encoding::Encoder<'_, D>,
427            offset: usize,
428            depth: fidl::encoding::Depth,
429        ) -> fidl::Result<()> {
430            encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
431            // Zero out padding regions. There's no need to apply masks
432            // because the unmasked parts will be overwritten by fields.
433            // Write the fields.
434            self.0.encode(encoder, offset + 0, depth)?;
435            Ok(())
436        }
437    }
438
439    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
440        for DeviceGetDomainIdResponse
441    {
442        #[inline(always)]
443        fn new_empty() -> Self {
444            Self { domain_id: fidl::new_empty!(u32, D) }
445        }
446
447        #[inline]
448        unsafe fn decode(
449            &mut self,
450            decoder: &mut fidl::encoding::Decoder<'_, D>,
451            offset: usize,
452            _depth: fidl::encoding::Depth,
453        ) -> fidl::Result<()> {
454            decoder.debug_check_bounds::<Self>(offset);
455            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
456            // Verify that padding bytes are zero.
457            // Copy from the buffer into the object.
458            unsafe {
459                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
460            }
461            Ok(())
462        }
463    }
464
465    impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdRequest {
466        type Borrowed<'a> = &'a Self;
467        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
468            value
469        }
470    }
471
472    unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdRequest {
473        type Owned = Self;
474
475        #[inline(always)]
476        fn inline_align(_context: fidl::encoding::Context) -> usize {
477            8
478        }
479
480        #[inline(always)]
481        fn inline_size(_context: fidl::encoding::Context) -> usize {
482            8
483        }
484        #[inline(always)]
485        fn encode_is_copy() -> bool {
486            true
487        }
488
489        #[inline(always)]
490        fn decode_is_copy() -> bool {
491            true
492        }
493    }
494
495    unsafe impl<D: fidl::encoding::ResourceDialect>
496        fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D>
497        for &DeviceGetLogicalCoreIdRequest
498    {
499        #[inline]
500        unsafe fn encode(
501            self,
502            encoder: &mut fidl::encoding::Encoder<'_, D>,
503            offset: usize,
504            _depth: fidl::encoding::Depth,
505        ) -> fidl::Result<()> {
506            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
507            unsafe {
508                // Copy the object into the buffer.
509                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
510                (buf_ptr as *mut DeviceGetLogicalCoreIdRequest)
511                    .write_unaligned((self as *const DeviceGetLogicalCoreIdRequest).read());
512                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
513                // done second because the memcpy will write garbage to these bytes.
514            }
515            Ok(())
516        }
517    }
518    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
519        fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D> for (T0,)
520    {
521        #[inline]
522        unsafe fn encode(
523            self,
524            encoder: &mut fidl::encoding::Encoder<'_, D>,
525            offset: usize,
526            depth: fidl::encoding::Depth,
527        ) -> fidl::Result<()> {
528            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
529            // Zero out padding regions. There's no need to apply masks
530            // because the unmasked parts will be overwritten by fields.
531            // Write the fields.
532            self.0.encode(encoder, offset + 0, depth)?;
533            Ok(())
534        }
535    }
536
537    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
538        for DeviceGetLogicalCoreIdRequest
539    {
540        #[inline(always)]
541        fn new_empty() -> Self {
542            Self { index: fidl::new_empty!(u64, D) }
543        }
544
545        #[inline]
546        unsafe fn decode(
547            &mut self,
548            decoder: &mut fidl::encoding::Decoder<'_, D>,
549            offset: usize,
550            _depth: fidl::encoding::Depth,
551        ) -> fidl::Result<()> {
552            decoder.debug_check_bounds::<Self>(offset);
553            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
554            // Verify that padding bytes are zero.
555            // Copy from the buffer into the object.
556            unsafe {
557                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
558            }
559            Ok(())
560        }
561    }
562
563    impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdResponse {
564        type Borrowed<'a> = &'a Self;
565        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
566            value
567        }
568    }
569
570    unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdResponse {
571        type Owned = Self;
572
573        #[inline(always)]
574        fn inline_align(_context: fidl::encoding::Context) -> usize {
575            8
576        }
577
578        #[inline(always)]
579        fn inline_size(_context: fidl::encoding::Context) -> usize {
580            8
581        }
582        #[inline(always)]
583        fn encode_is_copy() -> bool {
584            true
585        }
586
587        #[inline(always)]
588        fn decode_is_copy() -> bool {
589            true
590        }
591    }
592
593    unsafe impl<D: fidl::encoding::ResourceDialect>
594        fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D>
595        for &DeviceGetLogicalCoreIdResponse
596    {
597        #[inline]
598        unsafe fn encode(
599            self,
600            encoder: &mut fidl::encoding::Encoder<'_, D>,
601            offset: usize,
602            _depth: fidl::encoding::Depth,
603        ) -> fidl::Result<()> {
604            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
605            unsafe {
606                // Copy the object into the buffer.
607                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
608                (buf_ptr as *mut DeviceGetLogicalCoreIdResponse)
609                    .write_unaligned((self as *const DeviceGetLogicalCoreIdResponse).read());
610                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
611                // done second because the memcpy will write garbage to these bytes.
612            }
613            Ok(())
614        }
615    }
616    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
617        fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D> for (T0,)
618    {
619        #[inline]
620        unsafe fn encode(
621            self,
622            encoder: &mut fidl::encoding::Encoder<'_, D>,
623            offset: usize,
624            depth: fidl::encoding::Depth,
625        ) -> fidl::Result<()> {
626            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
627            // Zero out padding regions. There's no need to apply masks
628            // because the unmasked parts will be overwritten by fields.
629            // Write the fields.
630            self.0.encode(encoder, offset + 0, depth)?;
631            Ok(())
632        }
633    }
634
635    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
636        for DeviceGetLogicalCoreIdResponse
637    {
638        #[inline(always)]
639        fn new_empty() -> Self {
640            Self { id: fidl::new_empty!(u64, D) }
641        }
642
643        #[inline]
644        unsafe fn decode(
645            &mut self,
646            decoder: &mut fidl::encoding::Decoder<'_, D>,
647            offset: usize,
648            _depth: fidl::encoding::Depth,
649        ) -> fidl::Result<()> {
650            decoder.debug_check_bounds::<Self>(offset);
651            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
652            // Verify that padding bytes are zero.
653            // Copy from the buffer into the object.
654            unsafe {
655                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
656            }
657            Ok(())
658        }
659    }
660
661    impl fidl::encoding::ValueTypeMarker for DeviceGetNumLogicalCoresResponse {
662        type Borrowed<'a> = &'a Self;
663        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
664            value
665        }
666    }
667
668    unsafe impl fidl::encoding::TypeMarker for DeviceGetNumLogicalCoresResponse {
669        type Owned = Self;
670
671        #[inline(always)]
672        fn inline_align(_context: fidl::encoding::Context) -> usize {
673            8
674        }
675
676        #[inline(always)]
677        fn inline_size(_context: fidl::encoding::Context) -> usize {
678            8
679        }
680        #[inline(always)]
681        fn encode_is_copy() -> bool {
682            true
683        }
684
685        #[inline(always)]
686        fn decode_is_copy() -> bool {
687            true
688        }
689    }
690
691    unsafe impl<D: fidl::encoding::ResourceDialect>
692        fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D>
693        for &DeviceGetNumLogicalCoresResponse
694    {
695        #[inline]
696        unsafe fn encode(
697            self,
698            encoder: &mut fidl::encoding::Encoder<'_, D>,
699            offset: usize,
700            _depth: fidl::encoding::Depth,
701        ) -> fidl::Result<()> {
702            encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
703            unsafe {
704                // Copy the object into the buffer.
705                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
706                (buf_ptr as *mut DeviceGetNumLogicalCoresResponse)
707                    .write_unaligned((self as *const DeviceGetNumLogicalCoresResponse).read());
708                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
709                // done second because the memcpy will write garbage to these bytes.
710            }
711            Ok(())
712        }
713    }
714    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
715        fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D> for (T0,)
716    {
717        #[inline]
718        unsafe fn encode(
719            self,
720            encoder: &mut fidl::encoding::Encoder<'_, D>,
721            offset: usize,
722            depth: fidl::encoding::Depth,
723        ) -> fidl::Result<()> {
724            encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
725            // Zero out padding regions. There's no need to apply masks
726            // because the unmasked parts will be overwritten by fields.
727            // Write the fields.
728            self.0.encode(encoder, offset + 0, depth)?;
729            Ok(())
730        }
731    }
732
733    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
734        for DeviceGetNumLogicalCoresResponse
735    {
736        #[inline(always)]
737        fn new_empty() -> Self {
738            Self { count: fidl::new_empty!(u64, D) }
739        }
740
741        #[inline]
742        unsafe fn decode(
743            &mut self,
744            decoder: &mut fidl::encoding::Decoder<'_, D>,
745            offset: usize,
746            _depth: fidl::encoding::Depth,
747        ) -> fidl::Result<()> {
748            decoder.debug_check_bounds::<Self>(offset);
749            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
750            // Verify that padding bytes are zero.
751            // Copy from the buffer into the object.
752            unsafe {
753                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
754            }
755            Ok(())
756        }
757    }
758
759    impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoRequest {
760        type Borrowed<'a> = &'a Self;
761        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
762            value
763        }
764    }
765
766    unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoRequest {
767        type Owned = Self;
768
769        #[inline(always)]
770        fn inline_align(_context: fidl::encoding::Context) -> usize {
771            4
772        }
773
774        #[inline(always)]
775        fn inline_size(_context: fidl::encoding::Context) -> usize {
776            4
777        }
778        #[inline(always)]
779        fn encode_is_copy() -> bool {
780            true
781        }
782
783        #[inline(always)]
784        fn decode_is_copy() -> bool {
785            true
786        }
787    }
788
789    unsafe impl<D: fidl::encoding::ResourceDialect>
790        fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D>
791        for &DeviceGetOperatingPointInfoRequest
792    {
793        #[inline]
794        unsafe fn encode(
795            self,
796            encoder: &mut fidl::encoding::Encoder<'_, D>,
797            offset: usize,
798            _depth: fidl::encoding::Depth,
799        ) -> fidl::Result<()> {
800            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
801            unsafe {
802                // Copy the object into the buffer.
803                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
804                (buf_ptr as *mut DeviceGetOperatingPointInfoRequest)
805                    .write_unaligned((self as *const DeviceGetOperatingPointInfoRequest).read());
806                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
807                // done second because the memcpy will write garbage to these bytes.
808            }
809            Ok(())
810        }
811    }
812    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
813        fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D> for (T0,)
814    {
815        #[inline]
816        unsafe fn encode(
817            self,
818            encoder: &mut fidl::encoding::Encoder<'_, D>,
819            offset: usize,
820            depth: fidl::encoding::Depth,
821        ) -> fidl::Result<()> {
822            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
823            // Zero out padding regions. There's no need to apply masks
824            // because the unmasked parts will be overwritten by fields.
825            // Write the fields.
826            self.0.encode(encoder, offset + 0, depth)?;
827            Ok(())
828        }
829    }
830
831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
832        for DeviceGetOperatingPointInfoRequest
833    {
834        #[inline(always)]
835        fn new_empty() -> Self {
836            Self { opp: fidl::new_empty!(u32, D) }
837        }
838
839        #[inline]
840        unsafe fn decode(
841            &mut self,
842            decoder: &mut fidl::encoding::Decoder<'_, D>,
843            offset: usize,
844            _depth: fidl::encoding::Depth,
845        ) -> fidl::Result<()> {
846            decoder.debug_check_bounds::<Self>(offset);
847            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
848            // Verify that padding bytes are zero.
849            // Copy from the buffer into the object.
850            unsafe {
851                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
852            }
853            Ok(())
854        }
855    }
856
857    impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointRequest {
858        type Borrowed<'a> = &'a Self;
859        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
860            value
861        }
862    }
863
864    unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointRequest {
865        type Owned = Self;
866
867        #[inline(always)]
868        fn inline_align(_context: fidl::encoding::Context) -> usize {
869            4
870        }
871
872        #[inline(always)]
873        fn inline_size(_context: fidl::encoding::Context) -> usize {
874            4
875        }
876        #[inline(always)]
877        fn encode_is_copy() -> bool {
878            true
879        }
880
881        #[inline(always)]
882        fn decode_is_copy() -> bool {
883            true
884        }
885    }
886
887    unsafe impl<D: fidl::encoding::ResourceDialect>
888        fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D>
889        for &DeviceSetCurrentOperatingPointRequest
890    {
891        #[inline]
892        unsafe fn encode(
893            self,
894            encoder: &mut fidl::encoding::Encoder<'_, D>,
895            offset: usize,
896            _depth: fidl::encoding::Depth,
897        ) -> fidl::Result<()> {
898            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
899            unsafe {
900                // Copy the object into the buffer.
901                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
902                (buf_ptr as *mut DeviceSetCurrentOperatingPointRequest)
903                    .write_unaligned((self as *const DeviceSetCurrentOperatingPointRequest).read());
904                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
905                // done second because the memcpy will write garbage to these bytes.
906            }
907            Ok(())
908        }
909    }
910    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
911        fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D> for (T0,)
912    {
913        #[inline]
914        unsafe fn encode(
915            self,
916            encoder: &mut fidl::encoding::Encoder<'_, D>,
917            offset: usize,
918            depth: fidl::encoding::Depth,
919        ) -> fidl::Result<()> {
920            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
921            // Zero out padding regions. There's no need to apply masks
922            // because the unmasked parts will be overwritten by fields.
923            // Write the fields.
924            self.0.encode(encoder, offset + 0, depth)?;
925            Ok(())
926        }
927    }
928
929    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
930        for DeviceSetCurrentOperatingPointRequest
931    {
932        #[inline(always)]
933        fn new_empty() -> Self {
934            Self { requested_opp: fidl::new_empty!(u32, D) }
935        }
936
937        #[inline]
938        unsafe fn decode(
939            &mut self,
940            decoder: &mut fidl::encoding::Decoder<'_, D>,
941            offset: usize,
942            _depth: fidl::encoding::Depth,
943        ) -> fidl::Result<()> {
944            decoder.debug_check_bounds::<Self>(offset);
945            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
946            // Verify that padding bytes are zero.
947            // Copy from the buffer into the object.
948            unsafe {
949                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
950            }
951            Ok(())
952        }
953    }
954
955    impl fidl::encoding::ValueTypeMarker for DeviceSetMaximumOperatingPointLimitRequest {
956        type Borrowed<'a> = &'a Self;
957        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
958            value
959        }
960    }
961
962    unsafe impl fidl::encoding::TypeMarker for DeviceSetMaximumOperatingPointLimitRequest {
963        type Owned = Self;
964
965        #[inline(always)]
966        fn inline_align(_context: fidl::encoding::Context) -> usize {
967            4
968        }
969
970        #[inline(always)]
971        fn inline_size(_context: fidl::encoding::Context) -> usize {
972            4
973        }
974        #[inline(always)]
975        fn encode_is_copy() -> bool {
976            true
977        }
978
979        #[inline(always)]
980        fn decode_is_copy() -> bool {
981            true
982        }
983    }
984
985    unsafe impl<D: fidl::encoding::ResourceDialect>
986        fidl::encoding::Encode<DeviceSetMaximumOperatingPointLimitRequest, D>
987        for &DeviceSetMaximumOperatingPointLimitRequest
988    {
989        #[inline]
990        unsafe fn encode(
991            self,
992            encoder: &mut fidl::encoding::Encoder<'_, D>,
993            offset: usize,
994            _depth: fidl::encoding::Depth,
995        ) -> fidl::Result<()> {
996            encoder.debug_check_bounds::<DeviceSetMaximumOperatingPointLimitRequest>(offset);
997            unsafe {
998                // Copy the object into the buffer.
999                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1000                (buf_ptr as *mut DeviceSetMaximumOperatingPointLimitRequest).write_unaligned(
1001                    (self as *const DeviceSetMaximumOperatingPointLimitRequest).read(),
1002                );
1003                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1004                // done second because the memcpy will write garbage to these bytes.
1005            }
1006            Ok(())
1007        }
1008    }
1009    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1010        fidl::encoding::Encode<DeviceSetMaximumOperatingPointLimitRequest, D> for (T0,)
1011    {
1012        #[inline]
1013        unsafe fn encode(
1014            self,
1015            encoder: &mut fidl::encoding::Encoder<'_, D>,
1016            offset: usize,
1017            depth: fidl::encoding::Depth,
1018        ) -> fidl::Result<()> {
1019            encoder.debug_check_bounds::<DeviceSetMaximumOperatingPointLimitRequest>(offset);
1020            // Zero out padding regions. There's no need to apply masks
1021            // because the unmasked parts will be overwritten by fields.
1022            // Write the fields.
1023            self.0.encode(encoder, offset + 0, depth)?;
1024            Ok(())
1025        }
1026    }
1027
1028    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1029        for DeviceSetMaximumOperatingPointLimitRequest
1030    {
1031        #[inline(always)]
1032        fn new_empty() -> Self {
1033            Self { maximum_opp: fidl::new_empty!(u32, D) }
1034        }
1035
1036        #[inline]
1037        unsafe fn decode(
1038            &mut self,
1039            decoder: &mut fidl::encoding::Decoder<'_, D>,
1040            offset: usize,
1041            _depth: fidl::encoding::Depth,
1042        ) -> fidl::Result<()> {
1043            decoder.debug_check_bounds::<Self>(offset);
1044            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1045            // Verify that padding bytes are zero.
1046            // Copy from the buffer into the object.
1047            unsafe {
1048                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1049            }
1050            Ok(())
1051        }
1052    }
1053
1054    impl fidl::encoding::ValueTypeMarker for DeviceSetMinimumOperatingPointLimitRequest {
1055        type Borrowed<'a> = &'a Self;
1056        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1057            value
1058        }
1059    }
1060
1061    unsafe impl fidl::encoding::TypeMarker for DeviceSetMinimumOperatingPointLimitRequest {
1062        type Owned = Self;
1063
1064        #[inline(always)]
1065        fn inline_align(_context: fidl::encoding::Context) -> usize {
1066            4
1067        }
1068
1069        #[inline(always)]
1070        fn inline_size(_context: fidl::encoding::Context) -> usize {
1071            4
1072        }
1073        #[inline(always)]
1074        fn encode_is_copy() -> bool {
1075            true
1076        }
1077
1078        #[inline(always)]
1079        fn decode_is_copy() -> bool {
1080            true
1081        }
1082    }
1083
1084    unsafe impl<D: fidl::encoding::ResourceDialect>
1085        fidl::encoding::Encode<DeviceSetMinimumOperatingPointLimitRequest, D>
1086        for &DeviceSetMinimumOperatingPointLimitRequest
1087    {
1088        #[inline]
1089        unsafe fn encode(
1090            self,
1091            encoder: &mut fidl::encoding::Encoder<'_, D>,
1092            offset: usize,
1093            _depth: fidl::encoding::Depth,
1094        ) -> fidl::Result<()> {
1095            encoder.debug_check_bounds::<DeviceSetMinimumOperatingPointLimitRequest>(offset);
1096            unsafe {
1097                // Copy the object into the buffer.
1098                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1099                (buf_ptr as *mut DeviceSetMinimumOperatingPointLimitRequest).write_unaligned(
1100                    (self as *const DeviceSetMinimumOperatingPointLimitRequest).read(),
1101                );
1102                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1103                // done second because the memcpy will write garbage to these bytes.
1104            }
1105            Ok(())
1106        }
1107    }
1108    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1109        fidl::encoding::Encode<DeviceSetMinimumOperatingPointLimitRequest, D> for (T0,)
1110    {
1111        #[inline]
1112        unsafe fn encode(
1113            self,
1114            encoder: &mut fidl::encoding::Encoder<'_, D>,
1115            offset: usize,
1116            depth: fidl::encoding::Depth,
1117        ) -> fidl::Result<()> {
1118            encoder.debug_check_bounds::<DeviceSetMinimumOperatingPointLimitRequest>(offset);
1119            // Zero out padding regions. There's no need to apply masks
1120            // because the unmasked parts will be overwritten by fields.
1121            // Write the fields.
1122            self.0.encode(encoder, offset + 0, depth)?;
1123            Ok(())
1124        }
1125    }
1126
1127    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1128        for DeviceSetMinimumOperatingPointLimitRequest
1129    {
1130        #[inline(always)]
1131        fn new_empty() -> Self {
1132            Self { minimum_opp: fidl::new_empty!(u32, D) }
1133        }
1134
1135        #[inline]
1136        unsafe fn decode(
1137            &mut self,
1138            decoder: &mut fidl::encoding::Decoder<'_, D>,
1139            offset: usize,
1140            _depth: fidl::encoding::Depth,
1141        ) -> fidl::Result<()> {
1142            decoder.debug_check_bounds::<Self>(offset);
1143            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1144            // Verify that padding bytes are zero.
1145            // Copy from the buffer into the object.
1146            unsafe {
1147                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1148            }
1149            Ok(())
1150        }
1151    }
1152
1153    impl fidl::encoding::ValueTypeMarker for DeviceSetOperatingPointLimitsRequest {
1154        type Borrowed<'a> = &'a Self;
1155        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1156            value
1157        }
1158    }
1159
1160    unsafe impl fidl::encoding::TypeMarker for DeviceSetOperatingPointLimitsRequest {
1161        type Owned = Self;
1162
1163        #[inline(always)]
1164        fn inline_align(_context: fidl::encoding::Context) -> usize {
1165            4
1166        }
1167
1168        #[inline(always)]
1169        fn inline_size(_context: fidl::encoding::Context) -> usize {
1170            8
1171        }
1172        #[inline(always)]
1173        fn encode_is_copy() -> bool {
1174            true
1175        }
1176
1177        #[inline(always)]
1178        fn decode_is_copy() -> bool {
1179            true
1180        }
1181    }
1182
1183    unsafe impl<D: fidl::encoding::ResourceDialect>
1184        fidl::encoding::Encode<DeviceSetOperatingPointLimitsRequest, D>
1185        for &DeviceSetOperatingPointLimitsRequest
1186    {
1187        #[inline]
1188        unsafe fn encode(
1189            self,
1190            encoder: &mut fidl::encoding::Encoder<'_, D>,
1191            offset: usize,
1192            _depth: fidl::encoding::Depth,
1193        ) -> fidl::Result<()> {
1194            encoder.debug_check_bounds::<DeviceSetOperatingPointLimitsRequest>(offset);
1195            unsafe {
1196                // Copy the object into the buffer.
1197                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1198                (buf_ptr as *mut DeviceSetOperatingPointLimitsRequest)
1199                    .write_unaligned((self as *const DeviceSetOperatingPointLimitsRequest).read());
1200                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1201                // done second because the memcpy will write garbage to these bytes.
1202            }
1203            Ok(())
1204        }
1205    }
1206    unsafe impl<
1207        D: fidl::encoding::ResourceDialect,
1208        T0: fidl::encoding::Encode<u32, D>,
1209        T1: fidl::encoding::Encode<u32, D>,
1210    > fidl::encoding::Encode<DeviceSetOperatingPointLimitsRequest, D> for (T0, T1)
1211    {
1212        #[inline]
1213        unsafe fn encode(
1214            self,
1215            encoder: &mut fidl::encoding::Encoder<'_, D>,
1216            offset: usize,
1217            depth: fidl::encoding::Depth,
1218        ) -> fidl::Result<()> {
1219            encoder.debug_check_bounds::<DeviceSetOperatingPointLimitsRequest>(offset);
1220            // Zero out padding regions. There's no need to apply masks
1221            // because the unmasked parts will be overwritten by fields.
1222            // Write the fields.
1223            self.0.encode(encoder, offset + 0, depth)?;
1224            self.1.encode(encoder, offset + 4, depth)?;
1225            Ok(())
1226        }
1227    }
1228
1229    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1230        for DeviceSetOperatingPointLimitsRequest
1231    {
1232        #[inline(always)]
1233        fn new_empty() -> Self {
1234            Self { minimum_opp: fidl::new_empty!(u32, D), maximum_opp: fidl::new_empty!(u32, D) }
1235        }
1236
1237        #[inline]
1238        unsafe fn decode(
1239            &mut self,
1240            decoder: &mut fidl::encoding::Decoder<'_, D>,
1241            offset: usize,
1242            _depth: fidl::encoding::Depth,
1243        ) -> fidl::Result<()> {
1244            decoder.debug_check_bounds::<Self>(offset);
1245            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1246            // Verify that padding bytes are zero.
1247            // Copy from the buffer into the object.
1248            unsafe {
1249                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1250            }
1251            Ok(())
1252        }
1253    }
1254
1255    impl fidl::encoding::ValueTypeMarker for DeviceGetCurrentOperatingPointLimitsResponse {
1256        type Borrowed<'a> = &'a Self;
1257        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1258            value
1259        }
1260    }
1261
1262    unsafe impl fidl::encoding::TypeMarker for DeviceGetCurrentOperatingPointLimitsResponse {
1263        type Owned = Self;
1264
1265        #[inline(always)]
1266        fn inline_align(_context: fidl::encoding::Context) -> usize {
1267            4
1268        }
1269
1270        #[inline(always)]
1271        fn inline_size(_context: fidl::encoding::Context) -> usize {
1272            8
1273        }
1274        #[inline(always)]
1275        fn encode_is_copy() -> bool {
1276            true
1277        }
1278
1279        #[inline(always)]
1280        fn decode_is_copy() -> bool {
1281            true
1282        }
1283    }
1284
1285    unsafe impl<D: fidl::encoding::ResourceDialect>
1286        fidl::encoding::Encode<DeviceGetCurrentOperatingPointLimitsResponse, D>
1287        for &DeviceGetCurrentOperatingPointLimitsResponse
1288    {
1289        #[inline]
1290        unsafe fn encode(
1291            self,
1292            encoder: &mut fidl::encoding::Encoder<'_, D>,
1293            offset: usize,
1294            _depth: fidl::encoding::Depth,
1295        ) -> fidl::Result<()> {
1296            encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointLimitsResponse>(offset);
1297            unsafe {
1298                // Copy the object into the buffer.
1299                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1300                (buf_ptr as *mut DeviceGetCurrentOperatingPointLimitsResponse).write_unaligned(
1301                    (self as *const DeviceGetCurrentOperatingPointLimitsResponse).read(),
1302                );
1303                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1304                // done second because the memcpy will write garbage to these bytes.
1305            }
1306            Ok(())
1307        }
1308    }
1309    unsafe impl<
1310        D: fidl::encoding::ResourceDialect,
1311        T0: fidl::encoding::Encode<u32, D>,
1312        T1: fidl::encoding::Encode<u32, D>,
1313    > fidl::encoding::Encode<DeviceGetCurrentOperatingPointLimitsResponse, D> for (T0, T1)
1314    {
1315        #[inline]
1316        unsafe fn encode(
1317            self,
1318            encoder: &mut fidl::encoding::Encoder<'_, D>,
1319            offset: usize,
1320            depth: fidl::encoding::Depth,
1321        ) -> fidl::Result<()> {
1322            encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointLimitsResponse>(offset);
1323            // Zero out padding regions. There's no need to apply masks
1324            // because the unmasked parts will be overwritten by fields.
1325            // Write the fields.
1326            self.0.encode(encoder, offset + 0, depth)?;
1327            self.1.encode(encoder, offset + 4, depth)?;
1328            Ok(())
1329        }
1330    }
1331
1332    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1333        for DeviceGetCurrentOperatingPointLimitsResponse
1334    {
1335        #[inline(always)]
1336        fn new_empty() -> Self {
1337            Self { minimum_opp: fidl::new_empty!(u32, D), maximum_opp: fidl::new_empty!(u32, D) }
1338        }
1339
1340        #[inline]
1341        unsafe fn decode(
1342            &mut self,
1343            decoder: &mut fidl::encoding::Decoder<'_, D>,
1344            offset: usize,
1345            _depth: fidl::encoding::Depth,
1346        ) -> fidl::Result<()> {
1347            decoder.debug_check_bounds::<Self>(offset);
1348            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1349            // Verify that padding bytes are zero.
1350            // Copy from the buffer into the object.
1351            unsafe {
1352                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1353            }
1354            Ok(())
1355        }
1356    }
1357
1358    impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointCountResponse {
1359        type Borrowed<'a> = &'a Self;
1360        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1361            value
1362        }
1363    }
1364
1365    unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointCountResponse {
1366        type Owned = Self;
1367
1368        #[inline(always)]
1369        fn inline_align(_context: fidl::encoding::Context) -> usize {
1370            4
1371        }
1372
1373        #[inline(always)]
1374        fn inline_size(_context: fidl::encoding::Context) -> usize {
1375            4
1376        }
1377        #[inline(always)]
1378        fn encode_is_copy() -> bool {
1379            true
1380        }
1381
1382        #[inline(always)]
1383        fn decode_is_copy() -> bool {
1384            true
1385        }
1386    }
1387
1388    unsafe impl<D: fidl::encoding::ResourceDialect>
1389        fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D>
1390        for &DeviceGetOperatingPointCountResponse
1391    {
1392        #[inline]
1393        unsafe fn encode(
1394            self,
1395            encoder: &mut fidl::encoding::Encoder<'_, D>,
1396            offset: usize,
1397            _depth: fidl::encoding::Depth,
1398        ) -> fidl::Result<()> {
1399            encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
1400            unsafe {
1401                // Copy the object into the buffer.
1402                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1403                (buf_ptr as *mut DeviceGetOperatingPointCountResponse)
1404                    .write_unaligned((self as *const DeviceGetOperatingPointCountResponse).read());
1405                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1406                // done second because the memcpy will write garbage to these bytes.
1407            }
1408            Ok(())
1409        }
1410    }
1411    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1412        fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D> for (T0,)
1413    {
1414        #[inline]
1415        unsafe fn encode(
1416            self,
1417            encoder: &mut fidl::encoding::Encoder<'_, D>,
1418            offset: usize,
1419            depth: fidl::encoding::Depth,
1420        ) -> fidl::Result<()> {
1421            encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
1422            // Zero out padding regions. There's no need to apply masks
1423            // because the unmasked parts will be overwritten by fields.
1424            // Write the fields.
1425            self.0.encode(encoder, offset + 0, depth)?;
1426            Ok(())
1427        }
1428    }
1429
1430    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1431        for DeviceGetOperatingPointCountResponse
1432    {
1433        #[inline(always)]
1434        fn new_empty() -> Self {
1435            Self { count: fidl::new_empty!(u32, D) }
1436        }
1437
1438        #[inline]
1439        unsafe fn decode(
1440            &mut self,
1441            decoder: &mut fidl::encoding::Decoder<'_, D>,
1442            offset: usize,
1443            _depth: fidl::encoding::Depth,
1444        ) -> fidl::Result<()> {
1445            decoder.debug_check_bounds::<Self>(offset);
1446            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1447            // Verify that padding bytes are zero.
1448            // Copy from the buffer into the object.
1449            unsafe {
1450                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1451            }
1452            Ok(())
1453        }
1454    }
1455
1456    impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoResponse {
1457        type Borrowed<'a> = &'a Self;
1458        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1459            value
1460        }
1461    }
1462
1463    unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoResponse {
1464        type Owned = Self;
1465
1466        #[inline(always)]
1467        fn inline_align(_context: fidl::encoding::Context) -> usize {
1468            8
1469        }
1470
1471        #[inline(always)]
1472        fn inline_size(_context: fidl::encoding::Context) -> usize {
1473            16
1474        }
1475        #[inline(always)]
1476        fn encode_is_copy() -> bool {
1477            true
1478        }
1479
1480        #[inline(always)]
1481        fn decode_is_copy() -> bool {
1482            true
1483        }
1484    }
1485
1486    unsafe impl<D: fidl::encoding::ResourceDialect>
1487        fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D>
1488        for &DeviceGetOperatingPointInfoResponse
1489    {
1490        #[inline]
1491        unsafe fn encode(
1492            self,
1493            encoder: &mut fidl::encoding::Encoder<'_, D>,
1494            offset: usize,
1495            _depth: fidl::encoding::Depth,
1496        ) -> fidl::Result<()> {
1497            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
1498            unsafe {
1499                // Copy the object into the buffer.
1500                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1501                (buf_ptr as *mut DeviceGetOperatingPointInfoResponse)
1502                    .write_unaligned((self as *const DeviceGetOperatingPointInfoResponse).read());
1503                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1504                // done second because the memcpy will write garbage to these bytes.
1505            }
1506            Ok(())
1507        }
1508    }
1509    unsafe impl<
1510        D: fidl::encoding::ResourceDialect,
1511        T0: fidl::encoding::Encode<CpuOperatingPointInfo, D>,
1512    > fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D> for (T0,)
1513    {
1514        #[inline]
1515        unsafe fn encode(
1516            self,
1517            encoder: &mut fidl::encoding::Encoder<'_, D>,
1518            offset: usize,
1519            depth: fidl::encoding::Depth,
1520        ) -> fidl::Result<()> {
1521            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
1522            // Zero out padding regions. There's no need to apply masks
1523            // because the unmasked parts will be overwritten by fields.
1524            // Write the fields.
1525            self.0.encode(encoder, offset + 0, depth)?;
1526            Ok(())
1527        }
1528    }
1529
1530    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1531        for DeviceGetOperatingPointInfoResponse
1532    {
1533        #[inline(always)]
1534        fn new_empty() -> Self {
1535            Self { info: fidl::new_empty!(CpuOperatingPointInfo, D) }
1536        }
1537
1538        #[inline]
1539        unsafe fn decode(
1540            &mut self,
1541            decoder: &mut fidl::encoding::Decoder<'_, D>,
1542            offset: usize,
1543            _depth: fidl::encoding::Depth,
1544        ) -> fidl::Result<()> {
1545            decoder.debug_check_bounds::<Self>(offset);
1546            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1547            // Verify that padding bytes are zero.
1548            // Copy from the buffer into the object.
1549            unsafe {
1550                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1551            }
1552            Ok(())
1553        }
1554    }
1555
1556    impl fidl::encoding::ValueTypeMarker for DeviceGetRelativePerformanceResponse {
1557        type Borrowed<'a> = &'a Self;
1558        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1559            value
1560        }
1561    }
1562
1563    unsafe impl fidl::encoding::TypeMarker for DeviceGetRelativePerformanceResponse {
1564        type Owned = Self;
1565
1566        #[inline(always)]
1567        fn inline_align(_context: fidl::encoding::Context) -> usize {
1568            1
1569        }
1570
1571        #[inline(always)]
1572        fn inline_size(_context: fidl::encoding::Context) -> usize {
1573            1
1574        }
1575        #[inline(always)]
1576        fn encode_is_copy() -> bool {
1577            true
1578        }
1579
1580        #[inline(always)]
1581        fn decode_is_copy() -> bool {
1582            true
1583        }
1584    }
1585
1586    unsafe impl<D: fidl::encoding::ResourceDialect>
1587        fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D>
1588        for &DeviceGetRelativePerformanceResponse
1589    {
1590        #[inline]
1591        unsafe fn encode(
1592            self,
1593            encoder: &mut fidl::encoding::Encoder<'_, D>,
1594            offset: usize,
1595            _depth: fidl::encoding::Depth,
1596        ) -> fidl::Result<()> {
1597            encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
1598            unsafe {
1599                // Copy the object into the buffer.
1600                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1601                (buf_ptr as *mut DeviceGetRelativePerformanceResponse)
1602                    .write_unaligned((self as *const DeviceGetRelativePerformanceResponse).read());
1603                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1604                // done second because the memcpy will write garbage to these bytes.
1605            }
1606            Ok(())
1607        }
1608    }
1609    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1610        fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D> for (T0,)
1611    {
1612        #[inline]
1613        unsafe fn encode(
1614            self,
1615            encoder: &mut fidl::encoding::Encoder<'_, D>,
1616            offset: usize,
1617            depth: fidl::encoding::Depth,
1618        ) -> fidl::Result<()> {
1619            encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
1620            // Zero out padding regions. There's no need to apply masks
1621            // because the unmasked parts will be overwritten by fields.
1622            // Write the fields.
1623            self.0.encode(encoder, offset + 0, depth)?;
1624            Ok(())
1625        }
1626    }
1627
1628    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1629        for DeviceGetRelativePerformanceResponse
1630    {
1631        #[inline(always)]
1632        fn new_empty() -> Self {
1633            Self { relative_performance: fidl::new_empty!(u8, D) }
1634        }
1635
1636        #[inline]
1637        unsafe fn decode(
1638            &mut self,
1639            decoder: &mut fidl::encoding::Decoder<'_, D>,
1640            offset: usize,
1641            _depth: fidl::encoding::Depth,
1642        ) -> fidl::Result<()> {
1643            decoder.debug_check_bounds::<Self>(offset);
1644            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1645            // Verify that padding bytes are zero.
1646            // Copy from the buffer into the object.
1647            unsafe {
1648                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1649            }
1650            Ok(())
1651        }
1652    }
1653
1654    impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointResponse {
1655        type Borrowed<'a> = &'a Self;
1656        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1657            value
1658        }
1659    }
1660
1661    unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointResponse {
1662        type Owned = Self;
1663
1664        #[inline(always)]
1665        fn inline_align(_context: fidl::encoding::Context) -> usize {
1666            4
1667        }
1668
1669        #[inline(always)]
1670        fn inline_size(_context: fidl::encoding::Context) -> usize {
1671            4
1672        }
1673        #[inline(always)]
1674        fn encode_is_copy() -> bool {
1675            true
1676        }
1677
1678        #[inline(always)]
1679        fn decode_is_copy() -> bool {
1680            true
1681        }
1682    }
1683
1684    unsafe impl<D: fidl::encoding::ResourceDialect>
1685        fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D>
1686        for &DeviceSetCurrentOperatingPointResponse
1687    {
1688        #[inline]
1689        unsafe fn encode(
1690            self,
1691            encoder: &mut fidl::encoding::Encoder<'_, D>,
1692            offset: usize,
1693            _depth: fidl::encoding::Depth,
1694        ) -> fidl::Result<()> {
1695            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
1696            unsafe {
1697                // Copy the object into the buffer.
1698                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1699                (buf_ptr as *mut DeviceSetCurrentOperatingPointResponse).write_unaligned(
1700                    (self as *const DeviceSetCurrentOperatingPointResponse).read(),
1701                );
1702                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1703                // done second because the memcpy will write garbage to these bytes.
1704            }
1705            Ok(())
1706        }
1707    }
1708    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1709        fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D> for (T0,)
1710    {
1711        #[inline]
1712        unsafe fn encode(
1713            self,
1714            encoder: &mut fidl::encoding::Encoder<'_, D>,
1715            offset: usize,
1716            depth: fidl::encoding::Depth,
1717        ) -> fidl::Result<()> {
1718            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
1719            // Zero out padding regions. There's no need to apply masks
1720            // because the unmasked parts will be overwritten by fields.
1721            // Write the fields.
1722            self.0.encode(encoder, offset + 0, depth)?;
1723            Ok(())
1724        }
1725    }
1726
1727    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1728        for DeviceSetCurrentOperatingPointResponse
1729    {
1730        #[inline(always)]
1731        fn new_empty() -> Self {
1732            Self { out_opp: fidl::new_empty!(u32, D) }
1733        }
1734
1735        #[inline]
1736        unsafe fn decode(
1737            &mut self,
1738            decoder: &mut fidl::encoding::Decoder<'_, D>,
1739            offset: usize,
1740            _depth: fidl::encoding::Depth,
1741        ) -> fidl::Result<()> {
1742            decoder.debug_check_bounds::<Self>(offset);
1743            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1744            // Verify that padding bytes are zero.
1745            // Copy from the buffer into the object.
1746            unsafe {
1747                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1748            }
1749            Ok(())
1750        }
1751    }
1752}