1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct ConfigReceiverPuppetGetConfigResponse {
13 pub config: ReceiverConfig,
14}
15
16impl fidl::Persistable for ConfigReceiverPuppetGetConfigResponse {}
17
18#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct ReceiverConfig {
20 pub my_flag: bool,
21 pub my_int16: i16,
22 pub my_int32: i32,
23 pub my_int64: i64,
24 pub my_int8: i8,
25 pub my_string: String,
26 pub my_uint16: u16,
27 pub my_uint32: u32,
28 pub my_uint64: u64,
29 pub my_uint8: u8,
30 pub my_vector_of_flag: Vec<bool>,
31 pub my_vector_of_int16: Vec<i16>,
32 pub my_vector_of_int32: Vec<i32>,
33 pub my_vector_of_int64: Vec<i64>,
34 pub my_vector_of_int8: Vec<i8>,
35 pub my_vector_of_string: Vec<String>,
36 pub my_vector_of_uint16: Vec<u16>,
37 pub my_vector_of_uint32: Vec<u32>,
38 pub my_vector_of_uint64: Vec<u64>,
39 pub my_vector_of_uint8: Vec<u8>,
40}
41
42impl fidl::Persistable for ReceiverConfig {}
43
44mod internal {
45 use super::*;
46
47 impl fidl::encoding::ValueTypeMarker for ConfigReceiverPuppetGetConfigResponse {
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 ConfigReceiverPuppetGetConfigResponse {
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 224
65 }
66 }
67
68 unsafe impl<D: fidl::encoding::ResourceDialect>
69 fidl::encoding::Encode<ConfigReceiverPuppetGetConfigResponse, D>
70 for &ConfigReceiverPuppetGetConfigResponse
71 {
72 #[inline]
73 unsafe fn encode(
74 self,
75 encoder: &mut fidl::encoding::Encoder<'_, D>,
76 offset: usize,
77 _depth: fidl::encoding::Depth,
78 ) -> fidl::Result<()> {
79 encoder.debug_check_bounds::<ConfigReceiverPuppetGetConfigResponse>(offset);
80 fidl::encoding::Encode::<ConfigReceiverPuppetGetConfigResponse, D>::encode(
82 (<ReceiverConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
83 encoder,
84 offset,
85 _depth,
86 )
87 }
88 }
89 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ReceiverConfig, D>>
90 fidl::encoding::Encode<ConfigReceiverPuppetGetConfigResponse, D> for (T0,)
91 {
92 #[inline]
93 unsafe fn encode(
94 self,
95 encoder: &mut fidl::encoding::Encoder<'_, D>,
96 offset: usize,
97 depth: fidl::encoding::Depth,
98 ) -> fidl::Result<()> {
99 encoder.debug_check_bounds::<ConfigReceiverPuppetGetConfigResponse>(offset);
100 self.0.encode(encoder, offset + 0, depth)?;
104 Ok(())
105 }
106 }
107
108 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
109 for ConfigReceiverPuppetGetConfigResponse
110 {
111 #[inline(always)]
112 fn new_empty() -> Self {
113 Self { config: fidl::new_empty!(ReceiverConfig, D) }
114 }
115
116 #[inline]
117 unsafe fn decode(
118 &mut self,
119 decoder: &mut fidl::encoding::Decoder<'_, D>,
120 offset: usize,
121 _depth: fidl::encoding::Depth,
122 ) -> fidl::Result<()> {
123 decoder.debug_check_bounds::<Self>(offset);
124 fidl::decode!(ReceiverConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
126 Ok(())
127 }
128 }
129
130 impl fidl::encoding::ValueTypeMarker for ReceiverConfig {
131 type Borrowed<'a> = &'a Self;
132 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
133 value
134 }
135 }
136
137 unsafe impl fidl::encoding::TypeMarker for ReceiverConfig {
138 type Owned = Self;
139
140 #[inline(always)]
141 fn inline_align(_context: fidl::encoding::Context) -> usize {
142 8
143 }
144
145 #[inline(always)]
146 fn inline_size(_context: fidl::encoding::Context) -> usize {
147 224
148 }
149 }
150
151 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReceiverConfig, D>
152 for &ReceiverConfig
153 {
154 #[inline]
155 unsafe fn encode(
156 self,
157 encoder: &mut fidl::encoding::Encoder<'_, D>,
158 offset: usize,
159 _depth: fidl::encoding::Depth,
160 ) -> fidl::Result<()> {
161 encoder.debug_check_bounds::<ReceiverConfig>(offset);
162 fidl::encoding::Encode::<ReceiverConfig, D>::encode(
164 (
165 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.my_flag),
166 <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_int16),
167 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_int32),
168 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_int64),
169 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_int8),
170 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_string),
171 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_uint16),
172 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_uint32),
173 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_uint64),
174 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.my_uint8),
175 <fidl::encoding::Vector<bool, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_flag),
176 <fidl::encoding::Vector<i16, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_int16),
177 <fidl::encoding::Vector<i32, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_int32),
178 <fidl::encoding::Vector<i64, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_int64),
179 <fidl::encoding::Vector<i8, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_int8),
180 <fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_string),
181 <fidl::encoding::Vector<u16, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_uint16),
182 <fidl::encoding::Vector<u32, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_uint32),
183 <fidl::encoding::Vector<u64, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_uint64),
184 <fidl::encoding::Vector<u8, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.my_vector_of_uint8),
185 ),
186 encoder, offset, _depth
187 )
188 }
189 }
190 unsafe impl<
191 D: fidl::encoding::ResourceDialect,
192 T0: fidl::encoding::Encode<bool, D>,
193 T1: fidl::encoding::Encode<i16, D>,
194 T2: fidl::encoding::Encode<i32, D>,
195 T3: fidl::encoding::Encode<i64, D>,
196 T4: fidl::encoding::Encode<i8, D>,
197 T5: fidl::encoding::Encode<fidl::encoding::BoundedString<100>, D>,
198 T6: fidl::encoding::Encode<u16, D>,
199 T7: fidl::encoding::Encode<u32, D>,
200 T8: fidl::encoding::Encode<u64, D>,
201 T9: fidl::encoding::Encode<u8, D>,
202 T10: fidl::encoding::Encode<fidl::encoding::Vector<bool, 100>, D>,
203 T11: fidl::encoding::Encode<fidl::encoding::Vector<i16, 100>, D>,
204 T12: fidl::encoding::Encode<fidl::encoding::Vector<i32, 100>, D>,
205 T13: fidl::encoding::Encode<fidl::encoding::Vector<i64, 100>, D>,
206 T14: fidl::encoding::Encode<fidl::encoding::Vector<i8, 100>, D>,
207 T15: fidl::encoding::Encode<
208 fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 100>,
209 D,
210 >,
211 T16: fidl::encoding::Encode<fidl::encoding::Vector<u16, 100>, D>,
212 T17: fidl::encoding::Encode<fidl::encoding::Vector<u32, 100>, D>,
213 T18: fidl::encoding::Encode<fidl::encoding::Vector<u64, 100>, D>,
214 T19: fidl::encoding::Encode<fidl::encoding::Vector<u8, 100>, D>,
215 > fidl::encoding::Encode<ReceiverConfig, D>
216 for (
217 T0,
218 T1,
219 T2,
220 T3,
221 T4,
222 T5,
223 T6,
224 T7,
225 T8,
226 T9,
227 T10,
228 T11,
229 T12,
230 T13,
231 T14,
232 T15,
233 T16,
234 T17,
235 T18,
236 T19,
237 )
238 {
239 #[inline]
240 unsafe fn encode(
241 self,
242 encoder: &mut fidl::encoding::Encoder<'_, D>,
243 offset: usize,
244 depth: fidl::encoding::Depth,
245 ) -> fidl::Result<()> {
246 encoder.debug_check_bounds::<ReceiverConfig>(offset);
247 unsafe {
250 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
251 (ptr as *mut u64).write_unaligned(0);
252 }
253 unsafe {
254 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
255 (ptr as *mut u64).write_unaligned(0);
256 }
257 unsafe {
258 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
259 (ptr as *mut u64).write_unaligned(0);
260 }
261 unsafe {
262 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
263 (ptr as *mut u64).write_unaligned(0);
264 }
265 self.0.encode(encoder, offset + 0, depth)?;
267 self.1.encode(encoder, offset + 2, depth)?;
268 self.2.encode(encoder, offset + 4, depth)?;
269 self.3.encode(encoder, offset + 8, depth)?;
270 self.4.encode(encoder, offset + 16, depth)?;
271 self.5.encode(encoder, offset + 24, depth)?;
272 self.6.encode(encoder, offset + 40, depth)?;
273 self.7.encode(encoder, offset + 44, depth)?;
274 self.8.encode(encoder, offset + 48, depth)?;
275 self.9.encode(encoder, offset + 56, depth)?;
276 self.10.encode(encoder, offset + 64, depth)?;
277 self.11.encode(encoder, offset + 80, depth)?;
278 self.12.encode(encoder, offset + 96, depth)?;
279 self.13.encode(encoder, offset + 112, depth)?;
280 self.14.encode(encoder, offset + 128, depth)?;
281 self.15.encode(encoder, offset + 144, depth)?;
282 self.16.encode(encoder, offset + 160, depth)?;
283 self.17.encode(encoder, offset + 176, depth)?;
284 self.18.encode(encoder, offset + 192, depth)?;
285 self.19.encode(encoder, offset + 208, depth)?;
286 Ok(())
287 }
288 }
289
290 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReceiverConfig {
291 #[inline(always)]
292 fn new_empty() -> Self {
293 Self {
294 my_flag: fidl::new_empty!(bool, D),
295 my_int16: fidl::new_empty!(i16, D),
296 my_int32: fidl::new_empty!(i32, D),
297 my_int64: fidl::new_empty!(i64, D),
298 my_int8: fidl::new_empty!(i8, D),
299 my_string: fidl::new_empty!(fidl::encoding::BoundedString<100>, D),
300 my_uint16: fidl::new_empty!(u16, D),
301 my_uint32: fidl::new_empty!(u32, D),
302 my_uint64: fidl::new_empty!(u64, D),
303 my_uint8: fidl::new_empty!(u8, D),
304 my_vector_of_flag: fidl::new_empty!(fidl::encoding::Vector<bool, 100>, D),
305 my_vector_of_int16: fidl::new_empty!(fidl::encoding::Vector<i16, 100>, D),
306 my_vector_of_int32: fidl::new_empty!(fidl::encoding::Vector<i32, 100>, D),
307 my_vector_of_int64: fidl::new_empty!(fidl::encoding::Vector<i64, 100>, D),
308 my_vector_of_int8: fidl::new_empty!(fidl::encoding::Vector<i8, 100>, D),
309 my_vector_of_string: fidl::new_empty!(
310 fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 100>,
311 D
312 ),
313 my_vector_of_uint16: fidl::new_empty!(fidl::encoding::Vector<u16, 100>, D),
314 my_vector_of_uint32: fidl::new_empty!(fidl::encoding::Vector<u32, 100>, D),
315 my_vector_of_uint64: fidl::new_empty!(fidl::encoding::Vector<u64, 100>, D),
316 my_vector_of_uint8: fidl::new_empty!(fidl::encoding::Vector<u8, 100>, D),
317 }
318 }
319
320 #[inline]
321 unsafe fn decode(
322 &mut self,
323 decoder: &mut fidl::encoding::Decoder<'_, D>,
324 offset: usize,
325 _depth: fidl::encoding::Depth,
326 ) -> fidl::Result<()> {
327 decoder.debug_check_bounds::<Self>(offset);
328 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
330 let padval = unsafe { (ptr as *const u64).read_unaligned() };
331 let mask = 0xff00u64;
332 let maskedval = padval & mask;
333 if maskedval != 0 {
334 return Err(fidl::Error::NonZeroPadding {
335 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
336 });
337 }
338 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
339 let padval = unsafe { (ptr as *const u64).read_unaligned() };
340 let mask = 0xffffffffffffff00u64;
341 let maskedval = padval & mask;
342 if maskedval != 0 {
343 return Err(fidl::Error::NonZeroPadding {
344 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
345 });
346 }
347 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
348 let padval = unsafe { (ptr as *const u64).read_unaligned() };
349 let mask = 0xffff0000u64;
350 let maskedval = padval & mask;
351 if maskedval != 0 {
352 return Err(fidl::Error::NonZeroPadding {
353 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
354 });
355 }
356 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
357 let padval = unsafe { (ptr as *const u64).read_unaligned() };
358 let mask = 0xffffffffffffff00u64;
359 let maskedval = padval & mask;
360 if maskedval != 0 {
361 return Err(fidl::Error::NonZeroPadding {
362 padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
363 });
364 }
365 fidl::decode!(bool, D, &mut self.my_flag, decoder, offset + 0, _depth)?;
366 fidl::decode!(i16, D, &mut self.my_int16, decoder, offset + 2, _depth)?;
367 fidl::decode!(i32, D, &mut self.my_int32, decoder, offset + 4, _depth)?;
368 fidl::decode!(i64, D, &mut self.my_int64, decoder, offset + 8, _depth)?;
369 fidl::decode!(i8, D, &mut self.my_int8, decoder, offset + 16, _depth)?;
370 fidl::decode!(
371 fidl::encoding::BoundedString<100>,
372 D,
373 &mut self.my_string,
374 decoder,
375 offset + 24,
376 _depth
377 )?;
378 fidl::decode!(u16, D, &mut self.my_uint16, decoder, offset + 40, _depth)?;
379 fidl::decode!(u32, D, &mut self.my_uint32, decoder, offset + 44, _depth)?;
380 fidl::decode!(u64, D, &mut self.my_uint64, decoder, offset + 48, _depth)?;
381 fidl::decode!(u8, D, &mut self.my_uint8, decoder, offset + 56, _depth)?;
382 fidl::decode!(fidl::encoding::Vector<bool, 100>, D, &mut self.my_vector_of_flag, decoder, offset + 64, _depth)?;
383 fidl::decode!(fidl::encoding::Vector<i16, 100>, D, &mut self.my_vector_of_int16, decoder, offset + 80, _depth)?;
384 fidl::decode!(fidl::encoding::Vector<i32, 100>, D, &mut self.my_vector_of_int32, decoder, offset + 96, _depth)?;
385 fidl::decode!(fidl::encoding::Vector<i64, 100>, D, &mut self.my_vector_of_int64, decoder, offset + 112, _depth)?;
386 fidl::decode!(fidl::encoding::Vector<i8, 100>, D, &mut self.my_vector_of_int8, decoder, offset + 128, _depth)?;
387 fidl::decode!(
388 fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 100>,
389 D,
390 &mut self.my_vector_of_string,
391 decoder,
392 offset + 144,
393 _depth
394 )?;
395 fidl::decode!(fidl::encoding::Vector<u16, 100>, D, &mut self.my_vector_of_uint16, decoder, offset + 160, _depth)?;
396 fidl::decode!(fidl::encoding::Vector<u32, 100>, D, &mut self.my_vector_of_uint32, decoder, offset + 176, _depth)?;
397 fidl::decode!(fidl::encoding::Vector<u64, 100>, D, &mut self.my_vector_of_uint64, decoder, offset + 192, _depth)?;
398 fidl::decode!(fidl::encoding::Vector<u8, 100>, D, &mut self.my_vector_of_uint8, decoder, offset + 208, _depth)?;
399 Ok(())
400 }
401 }
402}