fidl_fuchsia_thermal_common/
fidl_fuchsia_thermal_common.rs1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type ClientType = String;
22
23pub const MAX_THERMAL_LOAD: u32 = 100;
27
28#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29#[repr(C)]
30pub struct ClientStateWatcherWatchResponse {
31 pub state: u64,
32}
33
34impl fidl::Persistable for ClientStateWatcherWatchResponse {}
35
36mod internal {
37 use super::*;
38
39 impl fidl::encoding::ValueTypeMarker for ClientStateWatcherWatchResponse {
40 type Borrowed<'a> = &'a Self;
41 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
42 value
43 }
44 }
45
46 unsafe impl fidl::encoding::TypeMarker for ClientStateWatcherWatchResponse {
47 type Owned = Self;
48
49 #[inline(always)]
50 fn inline_align(_context: fidl::encoding::Context) -> usize {
51 8
52 }
53
54 #[inline(always)]
55 fn inline_size(_context: fidl::encoding::Context) -> usize {
56 8
57 }
58 #[inline(always)]
59 fn encode_is_copy() -> bool {
60 true
61 }
62
63 #[inline(always)]
64 fn decode_is_copy() -> bool {
65 true
66 }
67 }
68
69 unsafe impl<D: fidl::encoding::ResourceDialect>
70 fidl::encoding::Encode<ClientStateWatcherWatchResponse, D>
71 for &ClientStateWatcherWatchResponse
72 {
73 #[inline]
74 unsafe fn encode(
75 self,
76 encoder: &mut fidl::encoding::Encoder<'_, D>,
77 offset: usize,
78 _depth: fidl::encoding::Depth,
79 ) -> fidl::Result<()> {
80 encoder.debug_check_bounds::<ClientStateWatcherWatchResponse>(offset);
81 unsafe {
82 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
84 (buf_ptr as *mut ClientStateWatcherWatchResponse)
85 .write_unaligned((self as *const ClientStateWatcherWatchResponse).read());
86 }
89 Ok(())
90 }
91 }
92 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
93 fidl::encoding::Encode<ClientStateWatcherWatchResponse, D> for (T0,)
94 {
95 #[inline]
96 unsafe fn encode(
97 self,
98 encoder: &mut fidl::encoding::Encoder<'_, D>,
99 offset: usize,
100 depth: fidl::encoding::Depth,
101 ) -> fidl::Result<()> {
102 encoder.debug_check_bounds::<ClientStateWatcherWatchResponse>(offset);
103 self.0.encode(encoder, offset + 0, depth)?;
107 Ok(())
108 }
109 }
110
111 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
112 for ClientStateWatcherWatchResponse
113 {
114 #[inline(always)]
115 fn new_empty() -> Self {
116 Self { state: fidl::new_empty!(u64, D) }
117 }
118
119 #[inline]
120 unsafe fn decode(
121 &mut self,
122 decoder: &mut fidl::encoding::Decoder<'_, D>,
123 offset: usize,
124 _depth: fidl::encoding::Depth,
125 ) -> fidl::Result<()> {
126 decoder.debug_check_bounds::<Self>(offset);
127 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
128 unsafe {
131 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
132 }
133 Ok(())
134 }
135 }
136}