fidl_fuchsia_hardware_cpu_ctrl/
fidl_fuchsia_hardware_cpu_ctrl.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::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13pub const DEVICE_OPERATING_POINT_P0: u32 = 0;
14
15/// CpuOperatingPointInfo::frequency_hz and CpuOperatingPointInfo::voltage_uv
16/// are set to this if the frequency and voltage for the given operating point
17/// are unknown respectively.
18pub const FREQUENCY_UNKNOWN: i64 = -1;
19
20pub const VOLTAGE_UNKNOWN: i64 = -1;
21
22/// A collection of some basic information for a given operating point.
23#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24#[repr(C)]
25pub struct CpuOperatingPointInfo {
26    pub frequency_hz: i64,
27    pub voltage_uv: i64,
28}
29
30impl fidl::Persistable for CpuOperatingPointInfo {}
31
32#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33#[repr(C)]
34pub struct DeviceGetCurrentOperatingPointResponse {
35    pub out_opp: u32,
36}
37
38impl fidl::Persistable for DeviceGetCurrentOperatingPointResponse {}
39
40#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41#[repr(C)]
42pub struct DeviceGetDomainIdResponse {
43    pub domain_id: u32,
44}
45
46impl fidl::Persistable for DeviceGetDomainIdResponse {}
47
48#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
49#[repr(C)]
50pub struct DeviceGetLogicalCoreIdRequest {
51    pub index: u64,
52}
53
54impl fidl::Persistable for DeviceGetLogicalCoreIdRequest {}
55
56#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
57#[repr(C)]
58pub struct DeviceGetLogicalCoreIdResponse {
59    pub id: u64,
60}
61
62impl fidl::Persistable for DeviceGetLogicalCoreIdResponse {}
63
64#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65#[repr(C)]
66pub struct DeviceGetNumLogicalCoresResponse {
67    pub count: u64,
68}
69
70impl fidl::Persistable for DeviceGetNumLogicalCoresResponse {}
71
72#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73#[repr(C)]
74pub struct DeviceGetOperatingPointInfoRequest {
75    pub opp: u32,
76}
77
78impl fidl::Persistable for DeviceGetOperatingPointInfoRequest {}
79
80#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81#[repr(C)]
82pub struct DeviceSetCurrentOperatingPointRequest {
83    pub requested_opp: u32,
84}
85
86impl fidl::Persistable for DeviceSetCurrentOperatingPointRequest {}
87
88#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
89#[repr(C)]
90pub struct DeviceGetOperatingPointCountResponse {
91    pub count: u32,
92}
93
94impl fidl::Persistable for DeviceGetOperatingPointCountResponse {}
95
96#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
97#[repr(C)]
98pub struct DeviceGetOperatingPointInfoResponse {
99    pub info: CpuOperatingPointInfo,
100}
101
102impl fidl::Persistable for DeviceGetOperatingPointInfoResponse {}
103
104#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105#[repr(C)]
106pub struct DeviceGetRelativePerformanceResponse {
107    pub relative_performance: u8,
108}
109
110impl fidl::Persistable for DeviceGetRelativePerformanceResponse {}
111
112#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
113#[repr(C)]
114pub struct DeviceSetCurrentOperatingPointResponse {
115    pub out_opp: u32,
116}
117
118impl fidl::Persistable for DeviceSetCurrentOperatingPointResponse {}
119
120#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
121pub struct DeviceMarker;
122
123impl fidl::endpoints::ProtocolMarker for DeviceMarker {
124    type Proxy = DeviceProxy;
125    type RequestStream = DeviceRequestStream;
126    #[cfg(target_os = "fuchsia")]
127    type SynchronousProxy = DeviceSynchronousProxy;
128
129    const DEBUG_NAME: &'static str = "(anonymous) Device";
130}
131pub type DeviceGetOperatingPointInfoResult = Result<CpuOperatingPointInfo, i32>;
132pub type DeviceSetCurrentOperatingPointResult = Result<u32, i32>;
133pub type DeviceGetOperatingPointCountResult = Result<u32, i32>;
134pub type DeviceGetRelativePerformanceResult = Result<u8, i32>;
135
136pub trait DeviceProxyInterface: Send + Sync {
137    type GetOperatingPointInfoResponseFut: std::future::Future<Output = Result<DeviceGetOperatingPointInfoResult, fidl::Error>>
138        + Send;
139    fn r#get_operating_point_info(&self, opp: u32) -> Self::GetOperatingPointInfoResponseFut;
140    type GetCurrentOperatingPointResponseFut: std::future::Future<Output = Result<u32, fidl::Error>>
141        + Send;
142    fn r#get_current_operating_point(&self) -> Self::GetCurrentOperatingPointResponseFut;
143    type SetCurrentOperatingPointResponseFut: std::future::Future<Output = Result<DeviceSetCurrentOperatingPointResult, fidl::Error>>
144        + Send;
145    fn r#set_current_operating_point(
146        &self,
147        requested_opp: u32,
148    ) -> Self::SetCurrentOperatingPointResponseFut;
149    type GetOperatingPointCountResponseFut: std::future::Future<Output = Result<DeviceGetOperatingPointCountResult, fidl::Error>>
150        + Send;
151    fn r#get_operating_point_count(&self) -> Self::GetOperatingPointCountResponseFut;
152    type GetNumLogicalCoresResponseFut: std::future::Future<Output = Result<u64, fidl::Error>>
153        + Send;
154    fn r#get_num_logical_cores(&self) -> Self::GetNumLogicalCoresResponseFut;
155    type GetLogicalCoreIdResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
156    fn r#get_logical_core_id(&self, index: u64) -> Self::GetLogicalCoreIdResponseFut;
157    type GetDomainIdResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
158    fn r#get_domain_id(&self) -> Self::GetDomainIdResponseFut;
159    type GetRelativePerformanceResponseFut: std::future::Future<Output = Result<DeviceGetRelativePerformanceResult, fidl::Error>>
160        + Send;
161    fn r#get_relative_performance(&self) -> Self::GetRelativePerformanceResponseFut;
162}
163#[derive(Debug)]
164#[cfg(target_os = "fuchsia")]
165pub struct DeviceSynchronousProxy {
166    client: fidl::client::sync::Client,
167}
168
169#[cfg(target_os = "fuchsia")]
170impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
171    type Proxy = DeviceProxy;
172    type Protocol = DeviceMarker;
173
174    fn from_channel(inner: fidl::Channel) -> Self {
175        Self::new(inner)
176    }
177
178    fn into_channel(self) -> fidl::Channel {
179        self.client.into_channel()
180    }
181
182    fn as_channel(&self) -> &fidl::Channel {
183        self.client.as_channel()
184    }
185}
186
187#[cfg(target_os = "fuchsia")]
188impl DeviceSynchronousProxy {
189    pub fn new(channel: fidl::Channel) -> Self {
190        let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
191        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
192    }
193
194    pub fn into_channel(self) -> fidl::Channel {
195        self.client.into_channel()
196    }
197
198    /// Waits until an event arrives and returns it. It is safe for other
199    /// threads to make concurrent requests while waiting for an event.
200    pub fn wait_for_event(
201        &self,
202        deadline: zx::MonotonicInstant,
203    ) -> Result<DeviceEvent, fidl::Error> {
204        DeviceEvent::decode(self.client.wait_for_event(deadline)?)
205    }
206
207    /// Returns information about a given operating point for this performance
208    /// domain.
209    pub fn r#get_operating_point_info(
210        &self,
211        mut opp: u32,
212        ___deadline: zx::MonotonicInstant,
213    ) -> Result<DeviceGetOperatingPointInfoResult, fidl::Error> {
214        let _response = self.client.send_query::<
215            DeviceGetOperatingPointInfoRequest,
216            fidl::encoding::ResultType<DeviceGetOperatingPointInfoResponse, i32>,
217        >(
218            (opp,),
219            0x6594a9234fc958e2,
220            fidl::encoding::DynamicFlags::empty(),
221            ___deadline,
222        )?;
223        Ok(_response.map(|x| x.info))
224    }
225
226    /// Gets the current operating point of the device.
227    pub fn r#get_current_operating_point(
228        &self,
229        ___deadline: zx::MonotonicInstant,
230    ) -> Result<u32, fidl::Error> {
231        let _response = self
232            .client
233            .send_query::<fidl::encoding::EmptyPayload, DeviceGetCurrentOperatingPointResponse>(
234                (),
235                0x52de67a5993f5fe1,
236                fidl::encoding::DynamicFlags::empty(),
237                ___deadline,
238            )?;
239        Ok(_response.out_opp)
240    }
241
242    /// Set the operating point of this device to the requested operating point.
243    /// Returns ZX_OK, if the device is in a working state and the operating point is changed to
244    /// requested_opp successfully. out_opp will be same as requested_opp.
245    /// Returns error status, if switching to the requested_opp was unsuccessful. out_opp
246    /// is the operating performance point (OPP) that the device is currently in.
247    pub fn r#set_current_operating_point(
248        &self,
249        mut requested_opp: u32,
250        ___deadline: zx::MonotonicInstant,
251    ) -> Result<DeviceSetCurrentOperatingPointResult, fidl::Error> {
252        let _response = self.client.send_query::<
253            DeviceSetCurrentOperatingPointRequest,
254            fidl::encoding::ResultType<DeviceSetCurrentOperatingPointResponse, i32>,
255        >(
256            (requested_opp,),
257            0x34a7828b5ca53fd,
258            fidl::encoding::DynamicFlags::empty(),
259            ___deadline,
260        )?;
261        Ok(_response.map(|x| x.out_opp))
262    }
263
264    /// Returns the number of operating points within this performance domain.
265    pub fn r#get_operating_point_count(
266        &self,
267        ___deadline: zx::MonotonicInstant,
268    ) -> Result<DeviceGetOperatingPointCountResult, fidl::Error> {
269        let _response = self.client.send_query::<
270            fidl::encoding::EmptyPayload,
271            fidl::encoding::ResultType<DeviceGetOperatingPointCountResponse, i32>,
272        >(
273            (),
274            0x13e70ec7131889ba,
275            fidl::encoding::DynamicFlags::empty(),
276            ___deadline,
277        )?;
278        Ok(_response.map(|x| x.count))
279    }
280
281    /// Returns the number of logical cores contained within this performance
282    /// domain.
283    pub fn r#get_num_logical_cores(
284        &self,
285        ___deadline: zx::MonotonicInstant,
286    ) -> Result<u64, fidl::Error> {
287        let _response = self
288            .client
289            .send_query::<fidl::encoding::EmptyPayload, DeviceGetNumLogicalCoresResponse>(
290                (),
291                0x74e304c90ca165c5,
292                fidl::encoding::DynamicFlags::empty(),
293                ___deadline,
294            )?;
295        Ok(_response.count)
296    }
297
298    /// Returns a global system-wide core ID for the nth core in this
299    /// performance domain. `index` must be a value in the range [0, n) where
300    /// n is the value returned by GetNumLogicalCores().
301    pub fn r#get_logical_core_id(
302        &self,
303        mut index: u64,
304        ___deadline: zx::MonotonicInstant,
305    ) -> Result<u64, fidl::Error> {
306        let _response = self
307            .client
308            .send_query::<DeviceGetLogicalCoreIdRequest, DeviceGetLogicalCoreIdResponse>(
309                (index,),
310                0x7168f98ddbd26058,
311                fidl::encoding::DynamicFlags::empty(),
312                ___deadline,
313            )?;
314        Ok(_response.id)
315    }
316
317    /// Returns the id of this performance domain within its package. This
318    /// number should be stable across boots, but clients should prefer to use
319    /// GetRelativePerformance to differentiate cores if possible.
320    pub fn r#get_domain_id(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
321        let _response =
322            self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetDomainIdResponse>(
323                (),
324                0x3030f85bdc1ef321,
325                fidl::encoding::DynamicFlags::empty(),
326                ___deadline,
327            )?;
328        Ok(_response.domain_id)
329    }
330
331    /// The relative performance of this domain as configured by the platform,
332    /// if known. The highest performance domain should return 255, while others
333    /// should return N/255 fractional values relative to that domain.
334    /// Returns ZX_ERR_NOT_SUPPORTED if the performance level is unknown.
335    pub fn r#get_relative_performance(
336        &self,
337        ___deadline: zx::MonotonicInstant,
338    ) -> Result<DeviceGetRelativePerformanceResult, fidl::Error> {
339        let _response = self.client.send_query::<
340            fidl::encoding::EmptyPayload,
341            fidl::encoding::ResultType<DeviceGetRelativePerformanceResponse, i32>,
342        >(
343            (),
344            0x41c37eaf0c26a3d3,
345            fidl::encoding::DynamicFlags::empty(),
346            ___deadline,
347        )?;
348        Ok(_response.map(|x| x.relative_performance))
349    }
350}
351
352#[derive(Debug, Clone)]
353pub struct DeviceProxy {
354    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
355}
356
357impl fidl::endpoints::Proxy for DeviceProxy {
358    type Protocol = DeviceMarker;
359
360    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
361        Self::new(inner)
362    }
363
364    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
365        self.client.into_channel().map_err(|client| Self { client })
366    }
367
368    fn as_channel(&self) -> &::fidl::AsyncChannel {
369        self.client.as_channel()
370    }
371}
372
373impl DeviceProxy {
374    /// Create a new Proxy for fuchsia.hardware.cpu.ctrl/Device.
375    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
376        let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
377        Self { client: fidl::client::Client::new(channel, protocol_name) }
378    }
379
380    /// Get a Stream of events from the remote end of the protocol.
381    ///
382    /// # Panics
383    ///
384    /// Panics if the event stream was already taken.
385    pub fn take_event_stream(&self) -> DeviceEventStream {
386        DeviceEventStream { event_receiver: self.client.take_event_receiver() }
387    }
388
389    /// Returns information about a given operating point for this performance
390    /// domain.
391    pub fn r#get_operating_point_info(
392        &self,
393        mut opp: u32,
394    ) -> fidl::client::QueryResponseFut<
395        DeviceGetOperatingPointInfoResult,
396        fidl::encoding::DefaultFuchsiaResourceDialect,
397    > {
398        DeviceProxyInterface::r#get_operating_point_info(self, opp)
399    }
400
401    /// Gets the current operating point of the device.
402    pub fn r#get_current_operating_point(
403        &self,
404    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
405        DeviceProxyInterface::r#get_current_operating_point(self)
406    }
407
408    /// Set the operating point of this device to the requested operating point.
409    /// Returns ZX_OK, if the device is in a working state and the operating point is changed to
410    /// requested_opp successfully. out_opp will be same as requested_opp.
411    /// Returns error status, if switching to the requested_opp was unsuccessful. out_opp
412    /// is the operating performance point (OPP) that the device is currently in.
413    pub fn r#set_current_operating_point(
414        &self,
415        mut requested_opp: u32,
416    ) -> fidl::client::QueryResponseFut<
417        DeviceSetCurrentOperatingPointResult,
418        fidl::encoding::DefaultFuchsiaResourceDialect,
419    > {
420        DeviceProxyInterface::r#set_current_operating_point(self, requested_opp)
421    }
422
423    /// Returns the number of operating points within this performance domain.
424    pub fn r#get_operating_point_count(
425        &self,
426    ) -> fidl::client::QueryResponseFut<
427        DeviceGetOperatingPointCountResult,
428        fidl::encoding::DefaultFuchsiaResourceDialect,
429    > {
430        DeviceProxyInterface::r#get_operating_point_count(self)
431    }
432
433    /// Returns the number of logical cores contained within this performance
434    /// domain.
435    pub fn r#get_num_logical_cores(
436        &self,
437    ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
438        DeviceProxyInterface::r#get_num_logical_cores(self)
439    }
440
441    /// Returns a global system-wide core ID for the nth core in this
442    /// performance domain. `index` must be a value in the range [0, n) where
443    /// n is the value returned by GetNumLogicalCores().
444    pub fn r#get_logical_core_id(
445        &self,
446        mut index: u64,
447    ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
448        DeviceProxyInterface::r#get_logical_core_id(self, index)
449    }
450
451    /// Returns the id of this performance domain within its package. This
452    /// number should be stable across boots, but clients should prefer to use
453    /// GetRelativePerformance to differentiate cores if possible.
454    pub fn r#get_domain_id(
455        &self,
456    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
457        DeviceProxyInterface::r#get_domain_id(self)
458    }
459
460    /// The relative performance of this domain as configured by the platform,
461    /// if known. The highest performance domain should return 255, while others
462    /// should return N/255 fractional values relative to that domain.
463    /// Returns ZX_ERR_NOT_SUPPORTED if the performance level is unknown.
464    pub fn r#get_relative_performance(
465        &self,
466    ) -> fidl::client::QueryResponseFut<
467        DeviceGetRelativePerformanceResult,
468        fidl::encoding::DefaultFuchsiaResourceDialect,
469    > {
470        DeviceProxyInterface::r#get_relative_performance(self)
471    }
472}
473
474impl DeviceProxyInterface for DeviceProxy {
475    type GetOperatingPointInfoResponseFut = fidl::client::QueryResponseFut<
476        DeviceGetOperatingPointInfoResult,
477        fidl::encoding::DefaultFuchsiaResourceDialect,
478    >;
479    fn r#get_operating_point_info(&self, mut opp: u32) -> Self::GetOperatingPointInfoResponseFut {
480        fn _decode(
481            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
482        ) -> Result<DeviceGetOperatingPointInfoResult, fidl::Error> {
483            let _response = fidl::client::decode_transaction_body::<
484                fidl::encoding::ResultType<DeviceGetOperatingPointInfoResponse, i32>,
485                fidl::encoding::DefaultFuchsiaResourceDialect,
486                0x6594a9234fc958e2,
487            >(_buf?)?;
488            Ok(_response.map(|x| x.info))
489        }
490        self.client.send_query_and_decode::<
491            DeviceGetOperatingPointInfoRequest,
492            DeviceGetOperatingPointInfoResult,
493        >(
494            (opp,),
495            0x6594a9234fc958e2,
496            fidl::encoding::DynamicFlags::empty(),
497            _decode,
498        )
499    }
500
501    type GetCurrentOperatingPointResponseFut =
502        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
503    fn r#get_current_operating_point(&self) -> Self::GetCurrentOperatingPointResponseFut {
504        fn _decode(
505            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
506        ) -> Result<u32, fidl::Error> {
507            let _response = fidl::client::decode_transaction_body::<
508                DeviceGetCurrentOperatingPointResponse,
509                fidl::encoding::DefaultFuchsiaResourceDialect,
510                0x52de67a5993f5fe1,
511            >(_buf?)?;
512            Ok(_response.out_opp)
513        }
514        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
515            (),
516            0x52de67a5993f5fe1,
517            fidl::encoding::DynamicFlags::empty(),
518            _decode,
519        )
520    }
521
522    type SetCurrentOperatingPointResponseFut = fidl::client::QueryResponseFut<
523        DeviceSetCurrentOperatingPointResult,
524        fidl::encoding::DefaultFuchsiaResourceDialect,
525    >;
526    fn r#set_current_operating_point(
527        &self,
528        mut requested_opp: u32,
529    ) -> Self::SetCurrentOperatingPointResponseFut {
530        fn _decode(
531            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
532        ) -> Result<DeviceSetCurrentOperatingPointResult, fidl::Error> {
533            let _response = fidl::client::decode_transaction_body::<
534                fidl::encoding::ResultType<DeviceSetCurrentOperatingPointResponse, i32>,
535                fidl::encoding::DefaultFuchsiaResourceDialect,
536                0x34a7828b5ca53fd,
537            >(_buf?)?;
538            Ok(_response.map(|x| x.out_opp))
539        }
540        self.client.send_query_and_decode::<
541            DeviceSetCurrentOperatingPointRequest,
542            DeviceSetCurrentOperatingPointResult,
543        >(
544            (requested_opp,),
545            0x34a7828b5ca53fd,
546            fidl::encoding::DynamicFlags::empty(),
547            _decode,
548        )
549    }
550
551    type GetOperatingPointCountResponseFut = fidl::client::QueryResponseFut<
552        DeviceGetOperatingPointCountResult,
553        fidl::encoding::DefaultFuchsiaResourceDialect,
554    >;
555    fn r#get_operating_point_count(&self) -> Self::GetOperatingPointCountResponseFut {
556        fn _decode(
557            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
558        ) -> Result<DeviceGetOperatingPointCountResult, fidl::Error> {
559            let _response = fidl::client::decode_transaction_body::<
560                fidl::encoding::ResultType<DeviceGetOperatingPointCountResponse, i32>,
561                fidl::encoding::DefaultFuchsiaResourceDialect,
562                0x13e70ec7131889ba,
563            >(_buf?)?;
564            Ok(_response.map(|x| x.count))
565        }
566        self.client.send_query_and_decode::<
567            fidl::encoding::EmptyPayload,
568            DeviceGetOperatingPointCountResult,
569        >(
570            (),
571            0x13e70ec7131889ba,
572            fidl::encoding::DynamicFlags::empty(),
573            _decode,
574        )
575    }
576
577    type GetNumLogicalCoresResponseFut =
578        fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
579    fn r#get_num_logical_cores(&self) -> Self::GetNumLogicalCoresResponseFut {
580        fn _decode(
581            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
582        ) -> Result<u64, fidl::Error> {
583            let _response = fidl::client::decode_transaction_body::<
584                DeviceGetNumLogicalCoresResponse,
585                fidl::encoding::DefaultFuchsiaResourceDialect,
586                0x74e304c90ca165c5,
587            >(_buf?)?;
588            Ok(_response.count)
589        }
590        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
591            (),
592            0x74e304c90ca165c5,
593            fidl::encoding::DynamicFlags::empty(),
594            _decode,
595        )
596    }
597
598    type GetLogicalCoreIdResponseFut =
599        fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
600    fn r#get_logical_core_id(&self, mut index: u64) -> Self::GetLogicalCoreIdResponseFut {
601        fn _decode(
602            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
603        ) -> Result<u64, fidl::Error> {
604            let _response = fidl::client::decode_transaction_body::<
605                DeviceGetLogicalCoreIdResponse,
606                fidl::encoding::DefaultFuchsiaResourceDialect,
607                0x7168f98ddbd26058,
608            >(_buf?)?;
609            Ok(_response.id)
610        }
611        self.client.send_query_and_decode::<DeviceGetLogicalCoreIdRequest, u64>(
612            (index,),
613            0x7168f98ddbd26058,
614            fidl::encoding::DynamicFlags::empty(),
615            _decode,
616        )
617    }
618
619    type GetDomainIdResponseFut =
620        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
621    fn r#get_domain_id(&self) -> Self::GetDomainIdResponseFut {
622        fn _decode(
623            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
624        ) -> Result<u32, fidl::Error> {
625            let _response = fidl::client::decode_transaction_body::<
626                DeviceGetDomainIdResponse,
627                fidl::encoding::DefaultFuchsiaResourceDialect,
628                0x3030f85bdc1ef321,
629            >(_buf?)?;
630            Ok(_response.domain_id)
631        }
632        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
633            (),
634            0x3030f85bdc1ef321,
635            fidl::encoding::DynamicFlags::empty(),
636            _decode,
637        )
638    }
639
640    type GetRelativePerformanceResponseFut = fidl::client::QueryResponseFut<
641        DeviceGetRelativePerformanceResult,
642        fidl::encoding::DefaultFuchsiaResourceDialect,
643    >;
644    fn r#get_relative_performance(&self) -> Self::GetRelativePerformanceResponseFut {
645        fn _decode(
646            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
647        ) -> Result<DeviceGetRelativePerformanceResult, fidl::Error> {
648            let _response = fidl::client::decode_transaction_body::<
649                fidl::encoding::ResultType<DeviceGetRelativePerformanceResponse, i32>,
650                fidl::encoding::DefaultFuchsiaResourceDialect,
651                0x41c37eaf0c26a3d3,
652            >(_buf?)?;
653            Ok(_response.map(|x| x.relative_performance))
654        }
655        self.client.send_query_and_decode::<
656            fidl::encoding::EmptyPayload,
657            DeviceGetRelativePerformanceResult,
658        >(
659            (),
660            0x41c37eaf0c26a3d3,
661            fidl::encoding::DynamicFlags::empty(),
662            _decode,
663        )
664    }
665}
666
667pub struct DeviceEventStream {
668    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
669}
670
671impl std::marker::Unpin for DeviceEventStream {}
672
673impl futures::stream::FusedStream for DeviceEventStream {
674    fn is_terminated(&self) -> bool {
675        self.event_receiver.is_terminated()
676    }
677}
678
679impl futures::Stream for DeviceEventStream {
680    type Item = Result<DeviceEvent, fidl::Error>;
681
682    fn poll_next(
683        mut self: std::pin::Pin<&mut Self>,
684        cx: &mut std::task::Context<'_>,
685    ) -> std::task::Poll<Option<Self::Item>> {
686        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
687            &mut self.event_receiver,
688            cx
689        )?) {
690            Some(buf) => std::task::Poll::Ready(Some(DeviceEvent::decode(buf))),
691            None => std::task::Poll::Ready(None),
692        }
693    }
694}
695
696#[derive(Debug)]
697pub enum DeviceEvent {}
698
699impl DeviceEvent {
700    /// Decodes a message buffer as a [`DeviceEvent`].
701    fn decode(
702        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
703    ) -> Result<DeviceEvent, fidl::Error> {
704        let (bytes, _handles) = buf.split_mut();
705        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
706        debug_assert_eq!(tx_header.tx_id, 0);
707        match tx_header.ordinal {
708            _ => Err(fidl::Error::UnknownOrdinal {
709                ordinal: tx_header.ordinal,
710                protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
711            }),
712        }
713    }
714}
715
716/// A Stream of incoming requests for fuchsia.hardware.cpu.ctrl/Device.
717pub struct DeviceRequestStream {
718    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
719    is_terminated: bool,
720}
721
722impl std::marker::Unpin for DeviceRequestStream {}
723
724impl futures::stream::FusedStream for DeviceRequestStream {
725    fn is_terminated(&self) -> bool {
726        self.is_terminated
727    }
728}
729
730impl fidl::endpoints::RequestStream for DeviceRequestStream {
731    type Protocol = DeviceMarker;
732    type ControlHandle = DeviceControlHandle;
733
734    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
735        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
736    }
737
738    fn control_handle(&self) -> Self::ControlHandle {
739        DeviceControlHandle { inner: self.inner.clone() }
740    }
741
742    fn into_inner(
743        self,
744    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
745    {
746        (self.inner, self.is_terminated)
747    }
748
749    fn from_inner(
750        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
751        is_terminated: bool,
752    ) -> Self {
753        Self { inner, is_terminated }
754    }
755}
756
757impl futures::Stream for DeviceRequestStream {
758    type Item = Result<DeviceRequest, fidl::Error>;
759
760    fn poll_next(
761        mut self: std::pin::Pin<&mut Self>,
762        cx: &mut std::task::Context<'_>,
763    ) -> std::task::Poll<Option<Self::Item>> {
764        let this = &mut *self;
765        if this.inner.check_shutdown(cx) {
766            this.is_terminated = true;
767            return std::task::Poll::Ready(None);
768        }
769        if this.is_terminated {
770            panic!("polled DeviceRequestStream after completion");
771        }
772        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
773            |bytes, handles| {
774                match this.inner.channel().read_etc(cx, bytes, handles) {
775                    std::task::Poll::Ready(Ok(())) => {}
776                    std::task::Poll::Pending => return std::task::Poll::Pending,
777                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
778                        this.is_terminated = true;
779                        return std::task::Poll::Ready(None);
780                    }
781                    std::task::Poll::Ready(Err(e)) => {
782                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
783                            e.into(),
784                        ))))
785                    }
786                }
787
788                // A message has been received from the channel
789                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
790
791                std::task::Poll::Ready(Some(match header.ordinal {
792                    0x6594a9234fc958e2 => {
793                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
794                        let mut req = fidl::new_empty!(
795                            DeviceGetOperatingPointInfoRequest,
796                            fidl::encoding::DefaultFuchsiaResourceDialect
797                        );
798                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceGetOperatingPointInfoRequest>(&header, _body_bytes, handles, &mut req)?;
799                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
800                        Ok(DeviceRequest::GetOperatingPointInfo {
801                            opp: req.opp,
802
803                            responder: DeviceGetOperatingPointInfoResponder {
804                                control_handle: std::mem::ManuallyDrop::new(control_handle),
805                                tx_id: header.tx_id,
806                            },
807                        })
808                    }
809                    0x52de67a5993f5fe1 => {
810                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
811                        let mut req = fidl::new_empty!(
812                            fidl::encoding::EmptyPayload,
813                            fidl::encoding::DefaultFuchsiaResourceDialect
814                        );
815                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
816                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
817                        Ok(DeviceRequest::GetCurrentOperatingPoint {
818                            responder: DeviceGetCurrentOperatingPointResponder {
819                                control_handle: std::mem::ManuallyDrop::new(control_handle),
820                                tx_id: header.tx_id,
821                            },
822                        })
823                    }
824                    0x34a7828b5ca53fd => {
825                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
826                        let mut req = fidl::new_empty!(
827                            DeviceSetCurrentOperatingPointRequest,
828                            fidl::encoding::DefaultFuchsiaResourceDialect
829                        );
830                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceSetCurrentOperatingPointRequest>(&header, _body_bytes, handles, &mut req)?;
831                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
832                        Ok(DeviceRequest::SetCurrentOperatingPoint {
833                            requested_opp: req.requested_opp,
834
835                            responder: DeviceSetCurrentOperatingPointResponder {
836                                control_handle: std::mem::ManuallyDrop::new(control_handle),
837                                tx_id: header.tx_id,
838                            },
839                        })
840                    }
841                    0x13e70ec7131889ba => {
842                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
843                        let mut req = fidl::new_empty!(
844                            fidl::encoding::EmptyPayload,
845                            fidl::encoding::DefaultFuchsiaResourceDialect
846                        );
847                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
848                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
849                        Ok(DeviceRequest::GetOperatingPointCount {
850                            responder: DeviceGetOperatingPointCountResponder {
851                                control_handle: std::mem::ManuallyDrop::new(control_handle),
852                                tx_id: header.tx_id,
853                            },
854                        })
855                    }
856                    0x74e304c90ca165c5 => {
857                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
858                        let mut req = fidl::new_empty!(
859                            fidl::encoding::EmptyPayload,
860                            fidl::encoding::DefaultFuchsiaResourceDialect
861                        );
862                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
863                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
864                        Ok(DeviceRequest::GetNumLogicalCores {
865                            responder: DeviceGetNumLogicalCoresResponder {
866                                control_handle: std::mem::ManuallyDrop::new(control_handle),
867                                tx_id: header.tx_id,
868                            },
869                        })
870                    }
871                    0x7168f98ddbd26058 => {
872                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
873                        let mut req = fidl::new_empty!(
874                            DeviceGetLogicalCoreIdRequest,
875                            fidl::encoding::DefaultFuchsiaResourceDialect
876                        );
877                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceGetLogicalCoreIdRequest>(&header, _body_bytes, handles, &mut req)?;
878                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
879                        Ok(DeviceRequest::GetLogicalCoreId {
880                            index: req.index,
881
882                            responder: DeviceGetLogicalCoreIdResponder {
883                                control_handle: std::mem::ManuallyDrop::new(control_handle),
884                                tx_id: header.tx_id,
885                            },
886                        })
887                    }
888                    0x3030f85bdc1ef321 => {
889                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
890                        let mut req = fidl::new_empty!(
891                            fidl::encoding::EmptyPayload,
892                            fidl::encoding::DefaultFuchsiaResourceDialect
893                        );
894                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
895                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
896                        Ok(DeviceRequest::GetDomainId {
897                            responder: DeviceGetDomainIdResponder {
898                                control_handle: std::mem::ManuallyDrop::new(control_handle),
899                                tx_id: header.tx_id,
900                            },
901                        })
902                    }
903                    0x41c37eaf0c26a3d3 => {
904                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
905                        let mut req = fidl::new_empty!(
906                            fidl::encoding::EmptyPayload,
907                            fidl::encoding::DefaultFuchsiaResourceDialect
908                        );
909                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
910                        let control_handle = DeviceControlHandle { inner: this.inner.clone() };
911                        Ok(DeviceRequest::GetRelativePerformance {
912                            responder: DeviceGetRelativePerformanceResponder {
913                                control_handle: std::mem::ManuallyDrop::new(control_handle),
914                                tx_id: header.tx_id,
915                            },
916                        })
917                    }
918                    _ => Err(fidl::Error::UnknownOrdinal {
919                        ordinal: header.ordinal,
920                        protocol_name:
921                            <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
922                    }),
923                }))
924            },
925        )
926    }
927}
928
929#[derive(Debug)]
930pub enum DeviceRequest {
931    /// Returns information about a given operating point for this performance
932    /// domain.
933    GetOperatingPointInfo { opp: u32, responder: DeviceGetOperatingPointInfoResponder },
934    /// Gets the current operating point of the device.
935    GetCurrentOperatingPoint { responder: DeviceGetCurrentOperatingPointResponder },
936    /// Set the operating point of this device to the requested operating point.
937    /// Returns ZX_OK, if the device is in a working state and the operating point is changed to
938    /// requested_opp successfully. out_opp will be same as requested_opp.
939    /// Returns error status, if switching to the requested_opp was unsuccessful. out_opp
940    /// is the operating performance point (OPP) that the device is currently in.
941    SetCurrentOperatingPoint {
942        requested_opp: u32,
943        responder: DeviceSetCurrentOperatingPointResponder,
944    },
945    /// Returns the number of operating points within this performance domain.
946    GetOperatingPointCount { responder: DeviceGetOperatingPointCountResponder },
947    /// Returns the number of logical cores contained within this performance
948    /// domain.
949    GetNumLogicalCores { responder: DeviceGetNumLogicalCoresResponder },
950    /// Returns a global system-wide core ID for the nth core in this
951    /// performance domain. `index` must be a value in the range [0, n) where
952    /// n is the value returned by GetNumLogicalCores().
953    GetLogicalCoreId { index: u64, responder: DeviceGetLogicalCoreIdResponder },
954    /// Returns the id of this performance domain within its package. This
955    /// number should be stable across boots, but clients should prefer to use
956    /// GetRelativePerformance to differentiate cores if possible.
957    GetDomainId { responder: DeviceGetDomainIdResponder },
958    /// The relative performance of this domain as configured by the platform,
959    /// if known. The highest performance domain should return 255, while others
960    /// should return N/255 fractional values relative to that domain.
961    /// Returns ZX_ERR_NOT_SUPPORTED if the performance level is unknown.
962    GetRelativePerformance { responder: DeviceGetRelativePerformanceResponder },
963}
964
965impl DeviceRequest {
966    #[allow(irrefutable_let_patterns)]
967    pub fn into_get_operating_point_info(
968        self,
969    ) -> Option<(u32, DeviceGetOperatingPointInfoResponder)> {
970        if let DeviceRequest::GetOperatingPointInfo { opp, responder } = self {
971            Some((opp, responder))
972        } else {
973            None
974        }
975    }
976
977    #[allow(irrefutable_let_patterns)]
978    pub fn into_get_current_operating_point(
979        self,
980    ) -> Option<(DeviceGetCurrentOperatingPointResponder)> {
981        if let DeviceRequest::GetCurrentOperatingPoint { responder } = self {
982            Some((responder))
983        } else {
984            None
985        }
986    }
987
988    #[allow(irrefutable_let_patterns)]
989    pub fn into_set_current_operating_point(
990        self,
991    ) -> Option<(u32, DeviceSetCurrentOperatingPointResponder)> {
992        if let DeviceRequest::SetCurrentOperatingPoint { requested_opp, responder } = self {
993            Some((requested_opp, responder))
994        } else {
995            None
996        }
997    }
998
999    #[allow(irrefutable_let_patterns)]
1000    pub fn into_get_operating_point_count(self) -> Option<(DeviceGetOperatingPointCountResponder)> {
1001        if let DeviceRequest::GetOperatingPointCount { responder } = self {
1002            Some((responder))
1003        } else {
1004            None
1005        }
1006    }
1007
1008    #[allow(irrefutable_let_patterns)]
1009    pub fn into_get_num_logical_cores(self) -> Option<(DeviceGetNumLogicalCoresResponder)> {
1010        if let DeviceRequest::GetNumLogicalCores { responder } = self {
1011            Some((responder))
1012        } else {
1013            None
1014        }
1015    }
1016
1017    #[allow(irrefutable_let_patterns)]
1018    pub fn into_get_logical_core_id(self) -> Option<(u64, DeviceGetLogicalCoreIdResponder)> {
1019        if let DeviceRequest::GetLogicalCoreId { index, responder } = self {
1020            Some((index, responder))
1021        } else {
1022            None
1023        }
1024    }
1025
1026    #[allow(irrefutable_let_patterns)]
1027    pub fn into_get_domain_id(self) -> Option<(DeviceGetDomainIdResponder)> {
1028        if let DeviceRequest::GetDomainId { responder } = self {
1029            Some((responder))
1030        } else {
1031            None
1032        }
1033    }
1034
1035    #[allow(irrefutable_let_patterns)]
1036    pub fn into_get_relative_performance(self) -> Option<(DeviceGetRelativePerformanceResponder)> {
1037        if let DeviceRequest::GetRelativePerformance { responder } = self {
1038            Some((responder))
1039        } else {
1040            None
1041        }
1042    }
1043
1044    /// Name of the method defined in FIDL
1045    pub fn method_name(&self) -> &'static str {
1046        match *self {
1047            DeviceRequest::GetOperatingPointInfo { .. } => "get_operating_point_info",
1048            DeviceRequest::GetCurrentOperatingPoint { .. } => "get_current_operating_point",
1049            DeviceRequest::SetCurrentOperatingPoint { .. } => "set_current_operating_point",
1050            DeviceRequest::GetOperatingPointCount { .. } => "get_operating_point_count",
1051            DeviceRequest::GetNumLogicalCores { .. } => "get_num_logical_cores",
1052            DeviceRequest::GetLogicalCoreId { .. } => "get_logical_core_id",
1053            DeviceRequest::GetDomainId { .. } => "get_domain_id",
1054            DeviceRequest::GetRelativePerformance { .. } => "get_relative_performance",
1055        }
1056    }
1057}
1058
1059#[derive(Debug, Clone)]
1060pub struct DeviceControlHandle {
1061    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1062}
1063
1064impl fidl::endpoints::ControlHandle for DeviceControlHandle {
1065    fn shutdown(&self) {
1066        self.inner.shutdown()
1067    }
1068    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1069        self.inner.shutdown_with_epitaph(status)
1070    }
1071
1072    fn is_closed(&self) -> bool {
1073        self.inner.channel().is_closed()
1074    }
1075    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1076        self.inner.channel().on_closed()
1077    }
1078
1079    #[cfg(target_os = "fuchsia")]
1080    fn signal_peer(
1081        &self,
1082        clear_mask: zx::Signals,
1083        set_mask: zx::Signals,
1084    ) -> Result<(), zx_status::Status> {
1085        use fidl::Peered;
1086        self.inner.channel().signal_peer(clear_mask, set_mask)
1087    }
1088}
1089
1090impl DeviceControlHandle {}
1091
1092#[must_use = "FIDL methods require a response to be sent"]
1093#[derive(Debug)]
1094pub struct DeviceGetOperatingPointInfoResponder {
1095    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1096    tx_id: u32,
1097}
1098
1099/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1100/// if the responder is dropped without sending a response, so that the client
1101/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1102impl std::ops::Drop for DeviceGetOperatingPointInfoResponder {
1103    fn drop(&mut self) {
1104        self.control_handle.shutdown();
1105        // Safety: drops once, never accessed again
1106        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1107    }
1108}
1109
1110impl fidl::endpoints::Responder for DeviceGetOperatingPointInfoResponder {
1111    type ControlHandle = DeviceControlHandle;
1112
1113    fn control_handle(&self) -> &DeviceControlHandle {
1114        &self.control_handle
1115    }
1116
1117    fn drop_without_shutdown(mut self) {
1118        // Safety: drops once, never accessed again due to mem::forget
1119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1120        // Prevent Drop from running (which would shut down the channel)
1121        std::mem::forget(self);
1122    }
1123}
1124
1125impl DeviceGetOperatingPointInfoResponder {
1126    /// Sends a response to the FIDL transaction.
1127    ///
1128    /// Sets the channel to shutdown if an error occurs.
1129    pub fn send(self, mut result: Result<&CpuOperatingPointInfo, i32>) -> Result<(), fidl::Error> {
1130        let _result = self.send_raw(result);
1131        if _result.is_err() {
1132            self.control_handle.shutdown();
1133        }
1134        self.drop_without_shutdown();
1135        _result
1136    }
1137
1138    /// Similar to "send" but does not shutdown the channel if an error occurs.
1139    pub fn send_no_shutdown_on_err(
1140        self,
1141        mut result: Result<&CpuOperatingPointInfo, i32>,
1142    ) -> Result<(), fidl::Error> {
1143        let _result = self.send_raw(result);
1144        self.drop_without_shutdown();
1145        _result
1146    }
1147
1148    fn send_raw(&self, mut result: Result<&CpuOperatingPointInfo, i32>) -> Result<(), fidl::Error> {
1149        self.control_handle.inner.send::<fidl::encoding::ResultType<
1150            DeviceGetOperatingPointInfoResponse,
1151            i32,
1152        >>(
1153            result.map(|info| (info,)),
1154            self.tx_id,
1155            0x6594a9234fc958e2,
1156            fidl::encoding::DynamicFlags::empty(),
1157        )
1158    }
1159}
1160
1161#[must_use = "FIDL methods require a response to be sent"]
1162#[derive(Debug)]
1163pub struct DeviceGetCurrentOperatingPointResponder {
1164    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1165    tx_id: u32,
1166}
1167
1168/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1169/// if the responder is dropped without sending a response, so that the client
1170/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1171impl std::ops::Drop for DeviceGetCurrentOperatingPointResponder {
1172    fn drop(&mut self) {
1173        self.control_handle.shutdown();
1174        // Safety: drops once, never accessed again
1175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1176    }
1177}
1178
1179impl fidl::endpoints::Responder for DeviceGetCurrentOperatingPointResponder {
1180    type ControlHandle = DeviceControlHandle;
1181
1182    fn control_handle(&self) -> &DeviceControlHandle {
1183        &self.control_handle
1184    }
1185
1186    fn drop_without_shutdown(mut self) {
1187        // Safety: drops once, never accessed again due to mem::forget
1188        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1189        // Prevent Drop from running (which would shut down the channel)
1190        std::mem::forget(self);
1191    }
1192}
1193
1194impl DeviceGetCurrentOperatingPointResponder {
1195    /// Sends a response to the FIDL transaction.
1196    ///
1197    /// Sets the channel to shutdown if an error occurs.
1198    pub fn send(self, mut out_opp: u32) -> Result<(), fidl::Error> {
1199        let _result = self.send_raw(out_opp);
1200        if _result.is_err() {
1201            self.control_handle.shutdown();
1202        }
1203        self.drop_without_shutdown();
1204        _result
1205    }
1206
1207    /// Similar to "send" but does not shutdown the channel if an error occurs.
1208    pub fn send_no_shutdown_on_err(self, mut out_opp: u32) -> Result<(), fidl::Error> {
1209        let _result = self.send_raw(out_opp);
1210        self.drop_without_shutdown();
1211        _result
1212    }
1213
1214    fn send_raw(&self, mut out_opp: u32) -> Result<(), fidl::Error> {
1215        self.control_handle.inner.send::<DeviceGetCurrentOperatingPointResponse>(
1216            (out_opp,),
1217            self.tx_id,
1218            0x52de67a5993f5fe1,
1219            fidl::encoding::DynamicFlags::empty(),
1220        )
1221    }
1222}
1223
1224#[must_use = "FIDL methods require a response to be sent"]
1225#[derive(Debug)]
1226pub struct DeviceSetCurrentOperatingPointResponder {
1227    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1228    tx_id: u32,
1229}
1230
1231/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1232/// if the responder is dropped without sending a response, so that the client
1233/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1234impl std::ops::Drop for DeviceSetCurrentOperatingPointResponder {
1235    fn drop(&mut self) {
1236        self.control_handle.shutdown();
1237        // Safety: drops once, never accessed again
1238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1239    }
1240}
1241
1242impl fidl::endpoints::Responder for DeviceSetCurrentOperatingPointResponder {
1243    type ControlHandle = DeviceControlHandle;
1244
1245    fn control_handle(&self) -> &DeviceControlHandle {
1246        &self.control_handle
1247    }
1248
1249    fn drop_without_shutdown(mut self) {
1250        // Safety: drops once, never accessed again due to mem::forget
1251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1252        // Prevent Drop from running (which would shut down the channel)
1253        std::mem::forget(self);
1254    }
1255}
1256
1257impl DeviceSetCurrentOperatingPointResponder {
1258    /// Sends a response to the FIDL transaction.
1259    ///
1260    /// Sets the channel to shutdown if an error occurs.
1261    pub fn send(self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
1262        let _result = self.send_raw(result);
1263        if _result.is_err() {
1264            self.control_handle.shutdown();
1265        }
1266        self.drop_without_shutdown();
1267        _result
1268    }
1269
1270    /// Similar to "send" but does not shutdown the channel if an error occurs.
1271    pub fn send_no_shutdown_on_err(self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
1272        let _result = self.send_raw(result);
1273        self.drop_without_shutdown();
1274        _result
1275    }
1276
1277    fn send_raw(&self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
1278        self.control_handle.inner.send::<fidl::encoding::ResultType<
1279            DeviceSetCurrentOperatingPointResponse,
1280            i32,
1281        >>(
1282            result.map(|out_opp| (out_opp,)),
1283            self.tx_id,
1284            0x34a7828b5ca53fd,
1285            fidl::encoding::DynamicFlags::empty(),
1286        )
1287    }
1288}
1289
1290#[must_use = "FIDL methods require a response to be sent"]
1291#[derive(Debug)]
1292pub struct DeviceGetOperatingPointCountResponder {
1293    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1294    tx_id: u32,
1295}
1296
1297/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1298/// if the responder is dropped without sending a response, so that the client
1299/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1300impl std::ops::Drop for DeviceGetOperatingPointCountResponder {
1301    fn drop(&mut self) {
1302        self.control_handle.shutdown();
1303        // Safety: drops once, never accessed again
1304        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1305    }
1306}
1307
1308impl fidl::endpoints::Responder for DeviceGetOperatingPointCountResponder {
1309    type ControlHandle = DeviceControlHandle;
1310
1311    fn control_handle(&self) -> &DeviceControlHandle {
1312        &self.control_handle
1313    }
1314
1315    fn drop_without_shutdown(mut self) {
1316        // Safety: drops once, never accessed again due to mem::forget
1317        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1318        // Prevent Drop from running (which would shut down the channel)
1319        std::mem::forget(self);
1320    }
1321}
1322
1323impl DeviceGetOperatingPointCountResponder {
1324    /// Sends a response to the FIDL transaction.
1325    ///
1326    /// Sets the channel to shutdown if an error occurs.
1327    pub fn send(self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
1328        let _result = self.send_raw(result);
1329        if _result.is_err() {
1330            self.control_handle.shutdown();
1331        }
1332        self.drop_without_shutdown();
1333        _result
1334    }
1335
1336    /// Similar to "send" but does not shutdown the channel if an error occurs.
1337    pub fn send_no_shutdown_on_err(self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
1338        let _result = self.send_raw(result);
1339        self.drop_without_shutdown();
1340        _result
1341    }
1342
1343    fn send_raw(&self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
1344        self.control_handle.inner.send::<fidl::encoding::ResultType<
1345            DeviceGetOperatingPointCountResponse,
1346            i32,
1347        >>(
1348            result.map(|count| (count,)),
1349            self.tx_id,
1350            0x13e70ec7131889ba,
1351            fidl::encoding::DynamicFlags::empty(),
1352        )
1353    }
1354}
1355
1356#[must_use = "FIDL methods require a response to be sent"]
1357#[derive(Debug)]
1358pub struct DeviceGetNumLogicalCoresResponder {
1359    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1360    tx_id: u32,
1361}
1362
1363/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1364/// if the responder is dropped without sending a response, so that the client
1365/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1366impl std::ops::Drop for DeviceGetNumLogicalCoresResponder {
1367    fn drop(&mut self) {
1368        self.control_handle.shutdown();
1369        // Safety: drops once, never accessed again
1370        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1371    }
1372}
1373
1374impl fidl::endpoints::Responder for DeviceGetNumLogicalCoresResponder {
1375    type ControlHandle = DeviceControlHandle;
1376
1377    fn control_handle(&self) -> &DeviceControlHandle {
1378        &self.control_handle
1379    }
1380
1381    fn drop_without_shutdown(mut self) {
1382        // Safety: drops once, never accessed again due to mem::forget
1383        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1384        // Prevent Drop from running (which would shut down the channel)
1385        std::mem::forget(self);
1386    }
1387}
1388
1389impl DeviceGetNumLogicalCoresResponder {
1390    /// Sends a response to the FIDL transaction.
1391    ///
1392    /// Sets the channel to shutdown if an error occurs.
1393    pub fn send(self, mut count: u64) -> Result<(), fidl::Error> {
1394        let _result = self.send_raw(count);
1395        if _result.is_err() {
1396            self.control_handle.shutdown();
1397        }
1398        self.drop_without_shutdown();
1399        _result
1400    }
1401
1402    /// Similar to "send" but does not shutdown the channel if an error occurs.
1403    pub fn send_no_shutdown_on_err(self, mut count: u64) -> Result<(), fidl::Error> {
1404        let _result = self.send_raw(count);
1405        self.drop_without_shutdown();
1406        _result
1407    }
1408
1409    fn send_raw(&self, mut count: u64) -> Result<(), fidl::Error> {
1410        self.control_handle.inner.send::<DeviceGetNumLogicalCoresResponse>(
1411            (count,),
1412            self.tx_id,
1413            0x74e304c90ca165c5,
1414            fidl::encoding::DynamicFlags::empty(),
1415        )
1416    }
1417}
1418
1419#[must_use = "FIDL methods require a response to be sent"]
1420#[derive(Debug)]
1421pub struct DeviceGetLogicalCoreIdResponder {
1422    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1423    tx_id: u32,
1424}
1425
1426/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1427/// if the responder is dropped without sending a response, so that the client
1428/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1429impl std::ops::Drop for DeviceGetLogicalCoreIdResponder {
1430    fn drop(&mut self) {
1431        self.control_handle.shutdown();
1432        // Safety: drops once, never accessed again
1433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1434    }
1435}
1436
1437impl fidl::endpoints::Responder for DeviceGetLogicalCoreIdResponder {
1438    type ControlHandle = DeviceControlHandle;
1439
1440    fn control_handle(&self) -> &DeviceControlHandle {
1441        &self.control_handle
1442    }
1443
1444    fn drop_without_shutdown(mut self) {
1445        // Safety: drops once, never accessed again due to mem::forget
1446        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1447        // Prevent Drop from running (which would shut down the channel)
1448        std::mem::forget(self);
1449    }
1450}
1451
1452impl DeviceGetLogicalCoreIdResponder {
1453    /// Sends a response to the FIDL transaction.
1454    ///
1455    /// Sets the channel to shutdown if an error occurs.
1456    pub fn send(self, mut id: u64) -> Result<(), fidl::Error> {
1457        let _result = self.send_raw(id);
1458        if _result.is_err() {
1459            self.control_handle.shutdown();
1460        }
1461        self.drop_without_shutdown();
1462        _result
1463    }
1464
1465    /// Similar to "send" but does not shutdown the channel if an error occurs.
1466    pub fn send_no_shutdown_on_err(self, mut id: u64) -> Result<(), fidl::Error> {
1467        let _result = self.send_raw(id);
1468        self.drop_without_shutdown();
1469        _result
1470    }
1471
1472    fn send_raw(&self, mut id: u64) -> Result<(), fidl::Error> {
1473        self.control_handle.inner.send::<DeviceGetLogicalCoreIdResponse>(
1474            (id,),
1475            self.tx_id,
1476            0x7168f98ddbd26058,
1477            fidl::encoding::DynamicFlags::empty(),
1478        )
1479    }
1480}
1481
1482#[must_use = "FIDL methods require a response to be sent"]
1483#[derive(Debug)]
1484pub struct DeviceGetDomainIdResponder {
1485    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1486    tx_id: u32,
1487}
1488
1489/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1490/// if the responder is dropped without sending a response, so that the client
1491/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1492impl std::ops::Drop for DeviceGetDomainIdResponder {
1493    fn drop(&mut self) {
1494        self.control_handle.shutdown();
1495        // Safety: drops once, never accessed again
1496        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1497    }
1498}
1499
1500impl fidl::endpoints::Responder for DeviceGetDomainIdResponder {
1501    type ControlHandle = DeviceControlHandle;
1502
1503    fn control_handle(&self) -> &DeviceControlHandle {
1504        &self.control_handle
1505    }
1506
1507    fn drop_without_shutdown(mut self) {
1508        // Safety: drops once, never accessed again due to mem::forget
1509        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1510        // Prevent Drop from running (which would shut down the channel)
1511        std::mem::forget(self);
1512    }
1513}
1514
1515impl DeviceGetDomainIdResponder {
1516    /// Sends a response to the FIDL transaction.
1517    ///
1518    /// Sets the channel to shutdown if an error occurs.
1519    pub fn send(self, mut domain_id: u32) -> Result<(), fidl::Error> {
1520        let _result = self.send_raw(domain_id);
1521        if _result.is_err() {
1522            self.control_handle.shutdown();
1523        }
1524        self.drop_without_shutdown();
1525        _result
1526    }
1527
1528    /// Similar to "send" but does not shutdown the channel if an error occurs.
1529    pub fn send_no_shutdown_on_err(self, mut domain_id: u32) -> Result<(), fidl::Error> {
1530        let _result = self.send_raw(domain_id);
1531        self.drop_without_shutdown();
1532        _result
1533    }
1534
1535    fn send_raw(&self, mut domain_id: u32) -> Result<(), fidl::Error> {
1536        self.control_handle.inner.send::<DeviceGetDomainIdResponse>(
1537            (domain_id,),
1538            self.tx_id,
1539            0x3030f85bdc1ef321,
1540            fidl::encoding::DynamicFlags::empty(),
1541        )
1542    }
1543}
1544
1545#[must_use = "FIDL methods require a response to be sent"]
1546#[derive(Debug)]
1547pub struct DeviceGetRelativePerformanceResponder {
1548    control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
1549    tx_id: u32,
1550}
1551
1552/// Set the the channel to be shutdown (see [`DeviceControlHandle::shutdown`])
1553/// if the responder is dropped without sending a response, so that the client
1554/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1555impl std::ops::Drop for DeviceGetRelativePerformanceResponder {
1556    fn drop(&mut self) {
1557        self.control_handle.shutdown();
1558        // Safety: drops once, never accessed again
1559        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1560    }
1561}
1562
1563impl fidl::endpoints::Responder for DeviceGetRelativePerformanceResponder {
1564    type ControlHandle = DeviceControlHandle;
1565
1566    fn control_handle(&self) -> &DeviceControlHandle {
1567        &self.control_handle
1568    }
1569
1570    fn drop_without_shutdown(mut self) {
1571        // Safety: drops once, never accessed again due to mem::forget
1572        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1573        // Prevent Drop from running (which would shut down the channel)
1574        std::mem::forget(self);
1575    }
1576}
1577
1578impl DeviceGetRelativePerformanceResponder {
1579    /// Sends a response to the FIDL transaction.
1580    ///
1581    /// Sets the channel to shutdown if an error occurs.
1582    pub fn send(self, mut result: Result<u8, i32>) -> Result<(), fidl::Error> {
1583        let _result = self.send_raw(result);
1584        if _result.is_err() {
1585            self.control_handle.shutdown();
1586        }
1587        self.drop_without_shutdown();
1588        _result
1589    }
1590
1591    /// Similar to "send" but does not shutdown the channel if an error occurs.
1592    pub fn send_no_shutdown_on_err(self, mut result: Result<u8, i32>) -> Result<(), fidl::Error> {
1593        let _result = self.send_raw(result);
1594        self.drop_without_shutdown();
1595        _result
1596    }
1597
1598    fn send_raw(&self, mut result: Result<u8, i32>) -> Result<(), fidl::Error> {
1599        self.control_handle.inner.send::<fidl::encoding::ResultType<
1600            DeviceGetRelativePerformanceResponse,
1601            i32,
1602        >>(
1603            result.map(|relative_performance| (relative_performance,)),
1604            self.tx_id,
1605            0x41c37eaf0c26a3d3,
1606            fidl::encoding::DynamicFlags::empty(),
1607        )
1608    }
1609}
1610
1611#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1612pub struct ServiceMarker;
1613
1614#[cfg(target_os = "fuchsia")]
1615impl fidl::endpoints::ServiceMarker for ServiceMarker {
1616    type Proxy = ServiceProxy;
1617    type Request = ServiceRequest;
1618    const SERVICE_NAME: &'static str = "fuchsia.hardware.cpu.ctrl.Service";
1619}
1620
1621/// A request for one of the member protocols of Service.
1622///
1623#[cfg(target_os = "fuchsia")]
1624pub enum ServiceRequest {
1625    Device(DeviceRequestStream),
1626}
1627
1628#[cfg(target_os = "fuchsia")]
1629impl fidl::endpoints::ServiceRequest for ServiceRequest {
1630    type Service = ServiceMarker;
1631
1632    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
1633        match name {
1634            "device" => Self::Device(
1635                <DeviceRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
1636            ),
1637            _ => panic!("no such member protocol name for service Service"),
1638        }
1639    }
1640
1641    fn member_names() -> &'static [&'static str] {
1642        &["device"]
1643    }
1644}
1645#[cfg(target_os = "fuchsia")]
1646pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
1647
1648#[cfg(target_os = "fuchsia")]
1649impl fidl::endpoints::ServiceProxy for ServiceProxy {
1650    type Service = ServiceMarker;
1651
1652    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
1653        Self(opener)
1654    }
1655}
1656
1657#[cfg(target_os = "fuchsia")]
1658impl ServiceProxy {
1659    pub fn connect_to_device(&self) -> Result<DeviceProxy, fidl::Error> {
1660        let (proxy, server_end) = fidl::endpoints::create_proxy::<DeviceMarker>();
1661        self.connect_channel_to_device(server_end)?;
1662        Ok(proxy)
1663    }
1664
1665    /// Like `connect_to_device`, but returns a sync proxy.
1666    /// See [`Self::connect_to_device`] for more details.
1667    pub fn connect_to_device_sync(&self) -> Result<DeviceSynchronousProxy, fidl::Error> {
1668        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DeviceMarker>();
1669        self.connect_channel_to_device(server_end)?;
1670        Ok(proxy)
1671    }
1672
1673    /// Like `connect_to_device`, but accepts a server end.
1674    /// See [`Self::connect_to_device`] for more details.
1675    pub fn connect_channel_to_device(
1676        &self,
1677        server_end: fidl::endpoints::ServerEnd<DeviceMarker>,
1678    ) -> Result<(), fidl::Error> {
1679        self.0.open_member("device", server_end.into_channel())
1680    }
1681
1682    pub fn instance_name(&self) -> &str {
1683        self.0.instance_name()
1684    }
1685}
1686
1687mod internal {
1688    use super::*;
1689
1690    impl fidl::encoding::ValueTypeMarker for CpuOperatingPointInfo {
1691        type Borrowed<'a> = &'a Self;
1692        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1693            value
1694        }
1695    }
1696
1697    unsafe impl fidl::encoding::TypeMarker for CpuOperatingPointInfo {
1698        type Owned = Self;
1699
1700        #[inline(always)]
1701        fn inline_align(_context: fidl::encoding::Context) -> usize {
1702            8
1703        }
1704
1705        #[inline(always)]
1706        fn inline_size(_context: fidl::encoding::Context) -> usize {
1707            16
1708        }
1709        #[inline(always)]
1710        fn encode_is_copy() -> bool {
1711            true
1712        }
1713
1714        #[inline(always)]
1715        fn decode_is_copy() -> bool {
1716            true
1717        }
1718    }
1719
1720    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CpuOperatingPointInfo, D>
1721        for &CpuOperatingPointInfo
1722    {
1723        #[inline]
1724        unsafe fn encode(
1725            self,
1726            encoder: &mut fidl::encoding::Encoder<'_, D>,
1727            offset: usize,
1728            _depth: fidl::encoding::Depth,
1729        ) -> fidl::Result<()> {
1730            encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
1731            unsafe {
1732                // Copy the object into the buffer.
1733                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1734                (buf_ptr as *mut CpuOperatingPointInfo)
1735                    .write_unaligned((self as *const CpuOperatingPointInfo).read());
1736                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1737                // done second because the memcpy will write garbage to these bytes.
1738            }
1739            Ok(())
1740        }
1741    }
1742    unsafe impl<
1743            D: fidl::encoding::ResourceDialect,
1744            T0: fidl::encoding::Encode<i64, D>,
1745            T1: fidl::encoding::Encode<i64, D>,
1746        > fidl::encoding::Encode<CpuOperatingPointInfo, D> for (T0, T1)
1747    {
1748        #[inline]
1749        unsafe fn encode(
1750            self,
1751            encoder: &mut fidl::encoding::Encoder<'_, D>,
1752            offset: usize,
1753            depth: fidl::encoding::Depth,
1754        ) -> fidl::Result<()> {
1755            encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
1756            // Zero out padding regions. There's no need to apply masks
1757            // because the unmasked parts will be overwritten by fields.
1758            // Write the fields.
1759            self.0.encode(encoder, offset + 0, depth)?;
1760            self.1.encode(encoder, offset + 8, depth)?;
1761            Ok(())
1762        }
1763    }
1764
1765    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuOperatingPointInfo {
1766        #[inline(always)]
1767        fn new_empty() -> Self {
1768            Self { frequency_hz: fidl::new_empty!(i64, D), voltage_uv: fidl::new_empty!(i64, D) }
1769        }
1770
1771        #[inline]
1772        unsafe fn decode(
1773            &mut self,
1774            decoder: &mut fidl::encoding::Decoder<'_, D>,
1775            offset: usize,
1776            _depth: fidl::encoding::Depth,
1777        ) -> fidl::Result<()> {
1778            decoder.debug_check_bounds::<Self>(offset);
1779            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1780            // Verify that padding bytes are zero.
1781            // Copy from the buffer into the object.
1782            unsafe {
1783                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1784            }
1785            Ok(())
1786        }
1787    }
1788
1789    impl fidl::encoding::ValueTypeMarker for DeviceGetCurrentOperatingPointResponse {
1790        type Borrowed<'a> = &'a Self;
1791        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1792            value
1793        }
1794    }
1795
1796    unsafe impl fidl::encoding::TypeMarker for DeviceGetCurrentOperatingPointResponse {
1797        type Owned = Self;
1798
1799        #[inline(always)]
1800        fn inline_align(_context: fidl::encoding::Context) -> usize {
1801            4
1802        }
1803
1804        #[inline(always)]
1805        fn inline_size(_context: fidl::encoding::Context) -> usize {
1806            4
1807        }
1808        #[inline(always)]
1809        fn encode_is_copy() -> bool {
1810            true
1811        }
1812
1813        #[inline(always)]
1814        fn decode_is_copy() -> bool {
1815            true
1816        }
1817    }
1818
1819    unsafe impl<D: fidl::encoding::ResourceDialect>
1820        fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D>
1821        for &DeviceGetCurrentOperatingPointResponse
1822    {
1823        #[inline]
1824        unsafe fn encode(
1825            self,
1826            encoder: &mut fidl::encoding::Encoder<'_, D>,
1827            offset: usize,
1828            _depth: fidl::encoding::Depth,
1829        ) -> fidl::Result<()> {
1830            encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
1831            unsafe {
1832                // Copy the object into the buffer.
1833                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1834                (buf_ptr as *mut DeviceGetCurrentOperatingPointResponse).write_unaligned(
1835                    (self as *const DeviceGetCurrentOperatingPointResponse).read(),
1836                );
1837                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1838                // done second because the memcpy will write garbage to these bytes.
1839            }
1840            Ok(())
1841        }
1842    }
1843    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1844        fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D> for (T0,)
1845    {
1846        #[inline]
1847        unsafe fn encode(
1848            self,
1849            encoder: &mut fidl::encoding::Encoder<'_, D>,
1850            offset: usize,
1851            depth: fidl::encoding::Depth,
1852        ) -> fidl::Result<()> {
1853            encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
1854            // Zero out padding regions. There's no need to apply masks
1855            // because the unmasked parts will be overwritten by fields.
1856            // Write the fields.
1857            self.0.encode(encoder, offset + 0, depth)?;
1858            Ok(())
1859        }
1860    }
1861
1862    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1863        for DeviceGetCurrentOperatingPointResponse
1864    {
1865        #[inline(always)]
1866        fn new_empty() -> Self {
1867            Self { out_opp: fidl::new_empty!(u32, D) }
1868        }
1869
1870        #[inline]
1871        unsafe fn decode(
1872            &mut self,
1873            decoder: &mut fidl::encoding::Decoder<'_, D>,
1874            offset: usize,
1875            _depth: fidl::encoding::Depth,
1876        ) -> fidl::Result<()> {
1877            decoder.debug_check_bounds::<Self>(offset);
1878            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1879            // Verify that padding bytes are zero.
1880            // Copy from the buffer into the object.
1881            unsafe {
1882                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1883            }
1884            Ok(())
1885        }
1886    }
1887
1888    impl fidl::encoding::ValueTypeMarker for DeviceGetDomainIdResponse {
1889        type Borrowed<'a> = &'a Self;
1890        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1891            value
1892        }
1893    }
1894
1895    unsafe impl fidl::encoding::TypeMarker for DeviceGetDomainIdResponse {
1896        type Owned = Self;
1897
1898        #[inline(always)]
1899        fn inline_align(_context: fidl::encoding::Context) -> usize {
1900            4
1901        }
1902
1903        #[inline(always)]
1904        fn inline_size(_context: fidl::encoding::Context) -> usize {
1905            4
1906        }
1907        #[inline(always)]
1908        fn encode_is_copy() -> bool {
1909            true
1910        }
1911
1912        #[inline(always)]
1913        fn decode_is_copy() -> bool {
1914            true
1915        }
1916    }
1917
1918    unsafe impl<D: fidl::encoding::ResourceDialect>
1919        fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for &DeviceGetDomainIdResponse
1920    {
1921        #[inline]
1922        unsafe fn encode(
1923            self,
1924            encoder: &mut fidl::encoding::Encoder<'_, D>,
1925            offset: usize,
1926            _depth: fidl::encoding::Depth,
1927        ) -> fidl::Result<()> {
1928            encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
1929            unsafe {
1930                // Copy the object into the buffer.
1931                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1932                (buf_ptr as *mut DeviceGetDomainIdResponse)
1933                    .write_unaligned((self as *const DeviceGetDomainIdResponse).read());
1934                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1935                // done second because the memcpy will write garbage to these bytes.
1936            }
1937            Ok(())
1938        }
1939    }
1940    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1941        fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for (T0,)
1942    {
1943        #[inline]
1944        unsafe fn encode(
1945            self,
1946            encoder: &mut fidl::encoding::Encoder<'_, D>,
1947            offset: usize,
1948            depth: fidl::encoding::Depth,
1949        ) -> fidl::Result<()> {
1950            encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
1951            // Zero out padding regions. There's no need to apply masks
1952            // because the unmasked parts will be overwritten by fields.
1953            // Write the fields.
1954            self.0.encode(encoder, offset + 0, depth)?;
1955            Ok(())
1956        }
1957    }
1958
1959    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1960        for DeviceGetDomainIdResponse
1961    {
1962        #[inline(always)]
1963        fn new_empty() -> Self {
1964            Self { domain_id: fidl::new_empty!(u32, D) }
1965        }
1966
1967        #[inline]
1968        unsafe fn decode(
1969            &mut self,
1970            decoder: &mut fidl::encoding::Decoder<'_, D>,
1971            offset: usize,
1972            _depth: fidl::encoding::Depth,
1973        ) -> fidl::Result<()> {
1974            decoder.debug_check_bounds::<Self>(offset);
1975            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1976            // Verify that padding bytes are zero.
1977            // Copy from the buffer into the object.
1978            unsafe {
1979                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1980            }
1981            Ok(())
1982        }
1983    }
1984
1985    impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdRequest {
1986        type Borrowed<'a> = &'a Self;
1987        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1988            value
1989        }
1990    }
1991
1992    unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdRequest {
1993        type Owned = Self;
1994
1995        #[inline(always)]
1996        fn inline_align(_context: fidl::encoding::Context) -> usize {
1997            8
1998        }
1999
2000        #[inline(always)]
2001        fn inline_size(_context: fidl::encoding::Context) -> usize {
2002            8
2003        }
2004        #[inline(always)]
2005        fn encode_is_copy() -> bool {
2006            true
2007        }
2008
2009        #[inline(always)]
2010        fn decode_is_copy() -> bool {
2011            true
2012        }
2013    }
2014
2015    unsafe impl<D: fidl::encoding::ResourceDialect>
2016        fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D>
2017        for &DeviceGetLogicalCoreIdRequest
2018    {
2019        #[inline]
2020        unsafe fn encode(
2021            self,
2022            encoder: &mut fidl::encoding::Encoder<'_, D>,
2023            offset: usize,
2024            _depth: fidl::encoding::Depth,
2025        ) -> fidl::Result<()> {
2026            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
2027            unsafe {
2028                // Copy the object into the buffer.
2029                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2030                (buf_ptr as *mut DeviceGetLogicalCoreIdRequest)
2031                    .write_unaligned((self as *const DeviceGetLogicalCoreIdRequest).read());
2032                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2033                // done second because the memcpy will write garbage to these bytes.
2034            }
2035            Ok(())
2036        }
2037    }
2038    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2039        fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D> for (T0,)
2040    {
2041        #[inline]
2042        unsafe fn encode(
2043            self,
2044            encoder: &mut fidl::encoding::Encoder<'_, D>,
2045            offset: usize,
2046            depth: fidl::encoding::Depth,
2047        ) -> fidl::Result<()> {
2048            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
2049            // Zero out padding regions. There's no need to apply masks
2050            // because the unmasked parts will be overwritten by fields.
2051            // Write the fields.
2052            self.0.encode(encoder, offset + 0, depth)?;
2053            Ok(())
2054        }
2055    }
2056
2057    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2058        for DeviceGetLogicalCoreIdRequest
2059    {
2060        #[inline(always)]
2061        fn new_empty() -> Self {
2062            Self { index: fidl::new_empty!(u64, D) }
2063        }
2064
2065        #[inline]
2066        unsafe fn decode(
2067            &mut self,
2068            decoder: &mut fidl::encoding::Decoder<'_, D>,
2069            offset: usize,
2070            _depth: fidl::encoding::Depth,
2071        ) -> fidl::Result<()> {
2072            decoder.debug_check_bounds::<Self>(offset);
2073            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2074            // Verify that padding bytes are zero.
2075            // Copy from the buffer into the object.
2076            unsafe {
2077                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2078            }
2079            Ok(())
2080        }
2081    }
2082
2083    impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdResponse {
2084        type Borrowed<'a> = &'a Self;
2085        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2086            value
2087        }
2088    }
2089
2090    unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdResponse {
2091        type Owned = Self;
2092
2093        #[inline(always)]
2094        fn inline_align(_context: fidl::encoding::Context) -> usize {
2095            8
2096        }
2097
2098        #[inline(always)]
2099        fn inline_size(_context: fidl::encoding::Context) -> usize {
2100            8
2101        }
2102        #[inline(always)]
2103        fn encode_is_copy() -> bool {
2104            true
2105        }
2106
2107        #[inline(always)]
2108        fn decode_is_copy() -> bool {
2109            true
2110        }
2111    }
2112
2113    unsafe impl<D: fidl::encoding::ResourceDialect>
2114        fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D>
2115        for &DeviceGetLogicalCoreIdResponse
2116    {
2117        #[inline]
2118        unsafe fn encode(
2119            self,
2120            encoder: &mut fidl::encoding::Encoder<'_, D>,
2121            offset: usize,
2122            _depth: fidl::encoding::Depth,
2123        ) -> fidl::Result<()> {
2124            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
2125            unsafe {
2126                // Copy the object into the buffer.
2127                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2128                (buf_ptr as *mut DeviceGetLogicalCoreIdResponse)
2129                    .write_unaligned((self as *const DeviceGetLogicalCoreIdResponse).read());
2130                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2131                // done second because the memcpy will write garbage to these bytes.
2132            }
2133            Ok(())
2134        }
2135    }
2136    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2137        fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D> for (T0,)
2138    {
2139        #[inline]
2140        unsafe fn encode(
2141            self,
2142            encoder: &mut fidl::encoding::Encoder<'_, D>,
2143            offset: usize,
2144            depth: fidl::encoding::Depth,
2145        ) -> fidl::Result<()> {
2146            encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
2147            // Zero out padding regions. There's no need to apply masks
2148            // because the unmasked parts will be overwritten by fields.
2149            // Write the fields.
2150            self.0.encode(encoder, offset + 0, depth)?;
2151            Ok(())
2152        }
2153    }
2154
2155    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2156        for DeviceGetLogicalCoreIdResponse
2157    {
2158        #[inline(always)]
2159        fn new_empty() -> Self {
2160            Self { id: fidl::new_empty!(u64, D) }
2161        }
2162
2163        #[inline]
2164        unsafe fn decode(
2165            &mut self,
2166            decoder: &mut fidl::encoding::Decoder<'_, D>,
2167            offset: usize,
2168            _depth: fidl::encoding::Depth,
2169        ) -> fidl::Result<()> {
2170            decoder.debug_check_bounds::<Self>(offset);
2171            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2172            // Verify that padding bytes are zero.
2173            // Copy from the buffer into the object.
2174            unsafe {
2175                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2176            }
2177            Ok(())
2178        }
2179    }
2180
2181    impl fidl::encoding::ValueTypeMarker for DeviceGetNumLogicalCoresResponse {
2182        type Borrowed<'a> = &'a Self;
2183        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2184            value
2185        }
2186    }
2187
2188    unsafe impl fidl::encoding::TypeMarker for DeviceGetNumLogicalCoresResponse {
2189        type Owned = Self;
2190
2191        #[inline(always)]
2192        fn inline_align(_context: fidl::encoding::Context) -> usize {
2193            8
2194        }
2195
2196        #[inline(always)]
2197        fn inline_size(_context: fidl::encoding::Context) -> usize {
2198            8
2199        }
2200        #[inline(always)]
2201        fn encode_is_copy() -> bool {
2202            true
2203        }
2204
2205        #[inline(always)]
2206        fn decode_is_copy() -> bool {
2207            true
2208        }
2209    }
2210
2211    unsafe impl<D: fidl::encoding::ResourceDialect>
2212        fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D>
2213        for &DeviceGetNumLogicalCoresResponse
2214    {
2215        #[inline]
2216        unsafe fn encode(
2217            self,
2218            encoder: &mut fidl::encoding::Encoder<'_, D>,
2219            offset: usize,
2220            _depth: fidl::encoding::Depth,
2221        ) -> fidl::Result<()> {
2222            encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
2223            unsafe {
2224                // Copy the object into the buffer.
2225                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2226                (buf_ptr as *mut DeviceGetNumLogicalCoresResponse)
2227                    .write_unaligned((self as *const DeviceGetNumLogicalCoresResponse).read());
2228                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2229                // done second because the memcpy will write garbage to these bytes.
2230            }
2231            Ok(())
2232        }
2233    }
2234    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2235        fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D> for (T0,)
2236    {
2237        #[inline]
2238        unsafe fn encode(
2239            self,
2240            encoder: &mut fidl::encoding::Encoder<'_, D>,
2241            offset: usize,
2242            depth: fidl::encoding::Depth,
2243        ) -> fidl::Result<()> {
2244            encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
2245            // Zero out padding regions. There's no need to apply masks
2246            // because the unmasked parts will be overwritten by fields.
2247            // Write the fields.
2248            self.0.encode(encoder, offset + 0, depth)?;
2249            Ok(())
2250        }
2251    }
2252
2253    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2254        for DeviceGetNumLogicalCoresResponse
2255    {
2256        #[inline(always)]
2257        fn new_empty() -> Self {
2258            Self { count: fidl::new_empty!(u64, D) }
2259        }
2260
2261        #[inline]
2262        unsafe fn decode(
2263            &mut self,
2264            decoder: &mut fidl::encoding::Decoder<'_, D>,
2265            offset: usize,
2266            _depth: fidl::encoding::Depth,
2267        ) -> fidl::Result<()> {
2268            decoder.debug_check_bounds::<Self>(offset);
2269            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2270            // Verify that padding bytes are zero.
2271            // Copy from the buffer into the object.
2272            unsafe {
2273                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2274            }
2275            Ok(())
2276        }
2277    }
2278
2279    impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoRequest {
2280        type Borrowed<'a> = &'a Self;
2281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2282            value
2283        }
2284    }
2285
2286    unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoRequest {
2287        type Owned = Self;
2288
2289        #[inline(always)]
2290        fn inline_align(_context: fidl::encoding::Context) -> usize {
2291            4
2292        }
2293
2294        #[inline(always)]
2295        fn inline_size(_context: fidl::encoding::Context) -> usize {
2296            4
2297        }
2298        #[inline(always)]
2299        fn encode_is_copy() -> bool {
2300            true
2301        }
2302
2303        #[inline(always)]
2304        fn decode_is_copy() -> bool {
2305            true
2306        }
2307    }
2308
2309    unsafe impl<D: fidl::encoding::ResourceDialect>
2310        fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D>
2311        for &DeviceGetOperatingPointInfoRequest
2312    {
2313        #[inline]
2314        unsafe fn encode(
2315            self,
2316            encoder: &mut fidl::encoding::Encoder<'_, D>,
2317            offset: usize,
2318            _depth: fidl::encoding::Depth,
2319        ) -> fidl::Result<()> {
2320            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
2321            unsafe {
2322                // Copy the object into the buffer.
2323                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2324                (buf_ptr as *mut DeviceGetOperatingPointInfoRequest)
2325                    .write_unaligned((self as *const DeviceGetOperatingPointInfoRequest).read());
2326                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2327                // done second because the memcpy will write garbage to these bytes.
2328            }
2329            Ok(())
2330        }
2331    }
2332    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2333        fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D> for (T0,)
2334    {
2335        #[inline]
2336        unsafe fn encode(
2337            self,
2338            encoder: &mut fidl::encoding::Encoder<'_, D>,
2339            offset: usize,
2340            depth: fidl::encoding::Depth,
2341        ) -> fidl::Result<()> {
2342            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
2343            // Zero out padding regions. There's no need to apply masks
2344            // because the unmasked parts will be overwritten by fields.
2345            // Write the fields.
2346            self.0.encode(encoder, offset + 0, depth)?;
2347            Ok(())
2348        }
2349    }
2350
2351    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2352        for DeviceGetOperatingPointInfoRequest
2353    {
2354        #[inline(always)]
2355        fn new_empty() -> Self {
2356            Self { opp: fidl::new_empty!(u32, D) }
2357        }
2358
2359        #[inline]
2360        unsafe fn decode(
2361            &mut self,
2362            decoder: &mut fidl::encoding::Decoder<'_, D>,
2363            offset: usize,
2364            _depth: fidl::encoding::Depth,
2365        ) -> fidl::Result<()> {
2366            decoder.debug_check_bounds::<Self>(offset);
2367            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2368            // Verify that padding bytes are zero.
2369            // Copy from the buffer into the object.
2370            unsafe {
2371                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2372            }
2373            Ok(())
2374        }
2375    }
2376
2377    impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointRequest {
2378        type Borrowed<'a> = &'a Self;
2379        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2380            value
2381        }
2382    }
2383
2384    unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointRequest {
2385        type Owned = Self;
2386
2387        #[inline(always)]
2388        fn inline_align(_context: fidl::encoding::Context) -> usize {
2389            4
2390        }
2391
2392        #[inline(always)]
2393        fn inline_size(_context: fidl::encoding::Context) -> usize {
2394            4
2395        }
2396        #[inline(always)]
2397        fn encode_is_copy() -> bool {
2398            true
2399        }
2400
2401        #[inline(always)]
2402        fn decode_is_copy() -> bool {
2403            true
2404        }
2405    }
2406
2407    unsafe impl<D: fidl::encoding::ResourceDialect>
2408        fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D>
2409        for &DeviceSetCurrentOperatingPointRequest
2410    {
2411        #[inline]
2412        unsafe fn encode(
2413            self,
2414            encoder: &mut fidl::encoding::Encoder<'_, D>,
2415            offset: usize,
2416            _depth: fidl::encoding::Depth,
2417        ) -> fidl::Result<()> {
2418            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
2419            unsafe {
2420                // Copy the object into the buffer.
2421                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2422                (buf_ptr as *mut DeviceSetCurrentOperatingPointRequest)
2423                    .write_unaligned((self as *const DeviceSetCurrentOperatingPointRequest).read());
2424                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2425                // done second because the memcpy will write garbage to these bytes.
2426            }
2427            Ok(())
2428        }
2429    }
2430    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2431        fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D> for (T0,)
2432    {
2433        #[inline]
2434        unsafe fn encode(
2435            self,
2436            encoder: &mut fidl::encoding::Encoder<'_, D>,
2437            offset: usize,
2438            depth: fidl::encoding::Depth,
2439        ) -> fidl::Result<()> {
2440            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
2441            // Zero out padding regions. There's no need to apply masks
2442            // because the unmasked parts will be overwritten by fields.
2443            // Write the fields.
2444            self.0.encode(encoder, offset + 0, depth)?;
2445            Ok(())
2446        }
2447    }
2448
2449    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2450        for DeviceSetCurrentOperatingPointRequest
2451    {
2452        #[inline(always)]
2453        fn new_empty() -> Self {
2454            Self { requested_opp: fidl::new_empty!(u32, D) }
2455        }
2456
2457        #[inline]
2458        unsafe fn decode(
2459            &mut self,
2460            decoder: &mut fidl::encoding::Decoder<'_, D>,
2461            offset: usize,
2462            _depth: fidl::encoding::Depth,
2463        ) -> fidl::Result<()> {
2464            decoder.debug_check_bounds::<Self>(offset);
2465            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2466            // Verify that padding bytes are zero.
2467            // Copy from the buffer into the object.
2468            unsafe {
2469                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2470            }
2471            Ok(())
2472        }
2473    }
2474
2475    impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointCountResponse {
2476        type Borrowed<'a> = &'a Self;
2477        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2478            value
2479        }
2480    }
2481
2482    unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointCountResponse {
2483        type Owned = Self;
2484
2485        #[inline(always)]
2486        fn inline_align(_context: fidl::encoding::Context) -> usize {
2487            4
2488        }
2489
2490        #[inline(always)]
2491        fn inline_size(_context: fidl::encoding::Context) -> usize {
2492            4
2493        }
2494        #[inline(always)]
2495        fn encode_is_copy() -> bool {
2496            true
2497        }
2498
2499        #[inline(always)]
2500        fn decode_is_copy() -> bool {
2501            true
2502        }
2503    }
2504
2505    unsafe impl<D: fidl::encoding::ResourceDialect>
2506        fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D>
2507        for &DeviceGetOperatingPointCountResponse
2508    {
2509        #[inline]
2510        unsafe fn encode(
2511            self,
2512            encoder: &mut fidl::encoding::Encoder<'_, D>,
2513            offset: usize,
2514            _depth: fidl::encoding::Depth,
2515        ) -> fidl::Result<()> {
2516            encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
2517            unsafe {
2518                // Copy the object into the buffer.
2519                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2520                (buf_ptr as *mut DeviceGetOperatingPointCountResponse)
2521                    .write_unaligned((self as *const DeviceGetOperatingPointCountResponse).read());
2522                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2523                // done second because the memcpy will write garbage to these bytes.
2524            }
2525            Ok(())
2526        }
2527    }
2528    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2529        fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D> for (T0,)
2530    {
2531        #[inline]
2532        unsafe fn encode(
2533            self,
2534            encoder: &mut fidl::encoding::Encoder<'_, D>,
2535            offset: usize,
2536            depth: fidl::encoding::Depth,
2537        ) -> fidl::Result<()> {
2538            encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
2539            // Zero out padding regions. There's no need to apply masks
2540            // because the unmasked parts will be overwritten by fields.
2541            // Write the fields.
2542            self.0.encode(encoder, offset + 0, depth)?;
2543            Ok(())
2544        }
2545    }
2546
2547    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2548        for DeviceGetOperatingPointCountResponse
2549    {
2550        #[inline(always)]
2551        fn new_empty() -> Self {
2552            Self { count: fidl::new_empty!(u32, D) }
2553        }
2554
2555        #[inline]
2556        unsafe fn decode(
2557            &mut self,
2558            decoder: &mut fidl::encoding::Decoder<'_, D>,
2559            offset: usize,
2560            _depth: fidl::encoding::Depth,
2561        ) -> fidl::Result<()> {
2562            decoder.debug_check_bounds::<Self>(offset);
2563            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2564            // Verify that padding bytes are zero.
2565            // Copy from the buffer into the object.
2566            unsafe {
2567                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2568            }
2569            Ok(())
2570        }
2571    }
2572
2573    impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoResponse {
2574        type Borrowed<'a> = &'a Self;
2575        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2576            value
2577        }
2578    }
2579
2580    unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoResponse {
2581        type Owned = Self;
2582
2583        #[inline(always)]
2584        fn inline_align(_context: fidl::encoding::Context) -> usize {
2585            8
2586        }
2587
2588        #[inline(always)]
2589        fn inline_size(_context: fidl::encoding::Context) -> usize {
2590            16
2591        }
2592        #[inline(always)]
2593        fn encode_is_copy() -> bool {
2594            true
2595        }
2596
2597        #[inline(always)]
2598        fn decode_is_copy() -> bool {
2599            true
2600        }
2601    }
2602
2603    unsafe impl<D: fidl::encoding::ResourceDialect>
2604        fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D>
2605        for &DeviceGetOperatingPointInfoResponse
2606    {
2607        #[inline]
2608        unsafe fn encode(
2609            self,
2610            encoder: &mut fidl::encoding::Encoder<'_, D>,
2611            offset: usize,
2612            _depth: fidl::encoding::Depth,
2613        ) -> fidl::Result<()> {
2614            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
2615            unsafe {
2616                // Copy the object into the buffer.
2617                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2618                (buf_ptr as *mut DeviceGetOperatingPointInfoResponse)
2619                    .write_unaligned((self as *const DeviceGetOperatingPointInfoResponse).read());
2620                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2621                // done second because the memcpy will write garbage to these bytes.
2622            }
2623            Ok(())
2624        }
2625    }
2626    unsafe impl<
2627            D: fidl::encoding::ResourceDialect,
2628            T0: fidl::encoding::Encode<CpuOperatingPointInfo, D>,
2629        > fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D> for (T0,)
2630    {
2631        #[inline]
2632        unsafe fn encode(
2633            self,
2634            encoder: &mut fidl::encoding::Encoder<'_, D>,
2635            offset: usize,
2636            depth: fidl::encoding::Depth,
2637        ) -> fidl::Result<()> {
2638            encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
2639            // Zero out padding regions. There's no need to apply masks
2640            // because the unmasked parts will be overwritten by fields.
2641            // Write the fields.
2642            self.0.encode(encoder, offset + 0, depth)?;
2643            Ok(())
2644        }
2645    }
2646
2647    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2648        for DeviceGetOperatingPointInfoResponse
2649    {
2650        #[inline(always)]
2651        fn new_empty() -> Self {
2652            Self { info: fidl::new_empty!(CpuOperatingPointInfo, D) }
2653        }
2654
2655        #[inline]
2656        unsafe fn decode(
2657            &mut self,
2658            decoder: &mut fidl::encoding::Decoder<'_, D>,
2659            offset: usize,
2660            _depth: fidl::encoding::Depth,
2661        ) -> fidl::Result<()> {
2662            decoder.debug_check_bounds::<Self>(offset);
2663            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2664            // Verify that padding bytes are zero.
2665            // Copy from the buffer into the object.
2666            unsafe {
2667                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2668            }
2669            Ok(())
2670        }
2671    }
2672
2673    impl fidl::encoding::ValueTypeMarker for DeviceGetRelativePerformanceResponse {
2674        type Borrowed<'a> = &'a Self;
2675        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2676            value
2677        }
2678    }
2679
2680    unsafe impl fidl::encoding::TypeMarker for DeviceGetRelativePerformanceResponse {
2681        type Owned = Self;
2682
2683        #[inline(always)]
2684        fn inline_align(_context: fidl::encoding::Context) -> usize {
2685            1
2686        }
2687
2688        #[inline(always)]
2689        fn inline_size(_context: fidl::encoding::Context) -> usize {
2690            1
2691        }
2692        #[inline(always)]
2693        fn encode_is_copy() -> bool {
2694            true
2695        }
2696
2697        #[inline(always)]
2698        fn decode_is_copy() -> bool {
2699            true
2700        }
2701    }
2702
2703    unsafe impl<D: fidl::encoding::ResourceDialect>
2704        fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D>
2705        for &DeviceGetRelativePerformanceResponse
2706    {
2707        #[inline]
2708        unsafe fn encode(
2709            self,
2710            encoder: &mut fidl::encoding::Encoder<'_, D>,
2711            offset: usize,
2712            _depth: fidl::encoding::Depth,
2713        ) -> fidl::Result<()> {
2714            encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
2715            unsafe {
2716                // Copy the object into the buffer.
2717                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2718                (buf_ptr as *mut DeviceGetRelativePerformanceResponse)
2719                    .write_unaligned((self as *const DeviceGetRelativePerformanceResponse).read());
2720                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2721                // done second because the memcpy will write garbage to these bytes.
2722            }
2723            Ok(())
2724        }
2725    }
2726    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
2727        fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D> for (T0,)
2728    {
2729        #[inline]
2730        unsafe fn encode(
2731            self,
2732            encoder: &mut fidl::encoding::Encoder<'_, D>,
2733            offset: usize,
2734            depth: fidl::encoding::Depth,
2735        ) -> fidl::Result<()> {
2736            encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
2737            // Zero out padding regions. There's no need to apply masks
2738            // because the unmasked parts will be overwritten by fields.
2739            // Write the fields.
2740            self.0.encode(encoder, offset + 0, depth)?;
2741            Ok(())
2742        }
2743    }
2744
2745    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2746        for DeviceGetRelativePerformanceResponse
2747    {
2748        #[inline(always)]
2749        fn new_empty() -> Self {
2750            Self { relative_performance: fidl::new_empty!(u8, D) }
2751        }
2752
2753        #[inline]
2754        unsafe fn decode(
2755            &mut self,
2756            decoder: &mut fidl::encoding::Decoder<'_, D>,
2757            offset: usize,
2758            _depth: fidl::encoding::Depth,
2759        ) -> fidl::Result<()> {
2760            decoder.debug_check_bounds::<Self>(offset);
2761            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2762            // Verify that padding bytes are zero.
2763            // Copy from the buffer into the object.
2764            unsafe {
2765                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
2766            }
2767            Ok(())
2768        }
2769    }
2770
2771    impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointResponse {
2772        type Borrowed<'a> = &'a Self;
2773        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2774            value
2775        }
2776    }
2777
2778    unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointResponse {
2779        type Owned = Self;
2780
2781        #[inline(always)]
2782        fn inline_align(_context: fidl::encoding::Context) -> usize {
2783            4
2784        }
2785
2786        #[inline(always)]
2787        fn inline_size(_context: fidl::encoding::Context) -> usize {
2788            4
2789        }
2790        #[inline(always)]
2791        fn encode_is_copy() -> bool {
2792            true
2793        }
2794
2795        #[inline(always)]
2796        fn decode_is_copy() -> bool {
2797            true
2798        }
2799    }
2800
2801    unsafe impl<D: fidl::encoding::ResourceDialect>
2802        fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D>
2803        for &DeviceSetCurrentOperatingPointResponse
2804    {
2805        #[inline]
2806        unsafe fn encode(
2807            self,
2808            encoder: &mut fidl::encoding::Encoder<'_, D>,
2809            offset: usize,
2810            _depth: fidl::encoding::Depth,
2811        ) -> fidl::Result<()> {
2812            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
2813            unsafe {
2814                // Copy the object into the buffer.
2815                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2816                (buf_ptr as *mut DeviceSetCurrentOperatingPointResponse).write_unaligned(
2817                    (self as *const DeviceSetCurrentOperatingPointResponse).read(),
2818                );
2819                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2820                // done second because the memcpy will write garbage to these bytes.
2821            }
2822            Ok(())
2823        }
2824    }
2825    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2826        fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D> for (T0,)
2827    {
2828        #[inline]
2829        unsafe fn encode(
2830            self,
2831            encoder: &mut fidl::encoding::Encoder<'_, D>,
2832            offset: usize,
2833            depth: fidl::encoding::Depth,
2834        ) -> fidl::Result<()> {
2835            encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
2836            // Zero out padding regions. There's no need to apply masks
2837            // because the unmasked parts will be overwritten by fields.
2838            // Write the fields.
2839            self.0.encode(encoder, offset + 0, depth)?;
2840            Ok(())
2841        }
2842    }
2843
2844    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2845        for DeviceSetCurrentOperatingPointResponse
2846    {
2847        #[inline(always)]
2848        fn new_empty() -> Self {
2849            Self { out_opp: fidl::new_empty!(u32, D) }
2850        }
2851
2852        #[inline]
2853        unsafe fn decode(
2854            &mut self,
2855            decoder: &mut fidl::encoding::Decoder<'_, D>,
2856            offset: usize,
2857            _depth: fidl::encoding::Depth,
2858        ) -> fidl::Result<()> {
2859            decoder.debug_check_bounds::<Self>(offset);
2860            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2861            // Verify that padding bytes are zero.
2862            // Copy from the buffer into the object.
2863            unsafe {
2864                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2865            }
2866            Ok(())
2867        }
2868    }
2869}