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
36pub mod client_state_connector_ordinals {
37 pub const CONNECT: u64 = 0x65abd3ba57ddaa1d;
38}
39
40pub mod client_state_watcher_ordinals {
41 pub const WATCH: u64 = 0x44831316a9942f7e;
42}
43
44mod internal {
45 use super::*;
46
47 impl fidl::encoding::ValueTypeMarker for ClientStateWatcherWatchResponse {
48 type Borrowed<'a> = &'a Self;
49 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
50 value
51 }
52 }
53
54 unsafe impl fidl::encoding::TypeMarker for ClientStateWatcherWatchResponse {
55 type Owned = Self;
56
57 #[inline(always)]
58 fn inline_align(_context: fidl::encoding::Context) -> usize {
59 8
60 }
61
62 #[inline(always)]
63 fn inline_size(_context: fidl::encoding::Context) -> usize {
64 8
65 }
66 #[inline(always)]
67 fn encode_is_copy() -> bool {
68 true
69 }
70
71 #[inline(always)]
72 fn decode_is_copy() -> bool {
73 true
74 }
75 }
76
77 unsafe impl<D: fidl::encoding::ResourceDialect>
78 fidl::encoding::Encode<ClientStateWatcherWatchResponse, D>
79 for &ClientStateWatcherWatchResponse
80 {
81 #[inline]
82 unsafe fn encode(
83 self,
84 encoder: &mut fidl::encoding::Encoder<'_, D>,
85 offset: usize,
86 _depth: fidl::encoding::Depth,
87 ) -> fidl::Result<()> {
88 encoder.debug_check_bounds::<ClientStateWatcherWatchResponse>(offset);
89 unsafe {
90 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
92 (buf_ptr as *mut ClientStateWatcherWatchResponse)
93 .write_unaligned((self as *const ClientStateWatcherWatchResponse).read());
94 }
97 Ok(())
98 }
99 }
100 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
101 fidl::encoding::Encode<ClientStateWatcherWatchResponse, D> for (T0,)
102 {
103 #[inline]
104 unsafe fn encode(
105 self,
106 encoder: &mut fidl::encoding::Encoder<'_, D>,
107 offset: usize,
108 depth: fidl::encoding::Depth,
109 ) -> fidl::Result<()> {
110 encoder.debug_check_bounds::<ClientStateWatcherWatchResponse>(offset);
111 self.0.encode(encoder, offset + 0, depth)?;
115 Ok(())
116 }
117 }
118
119 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
120 for ClientStateWatcherWatchResponse
121 {
122 #[inline(always)]
123 fn new_empty() -> Self {
124 Self { state: fidl::new_empty!(u64, D) }
125 }
126
127 #[inline]
128 unsafe fn decode(
129 &mut self,
130 decoder: &mut fidl::encoding::Decoder<'_, D>,
131 offset: usize,
132 _depth: fidl::encoding::Depth,
133 ) -> fidl::Result<()> {
134 decoder.debug_check_bounds::<Self>(offset);
135 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
136 unsafe {
139 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
140 }
141 Ok(())
142 }
143 }
144}