fidl_fuchsia_update_channelcontrol_common/
fidl_fuchsia_update_channelcontrol_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct ChannelControlGetTargetListResponse {
13    pub channels: Vec<String>,
14}
15
16impl fidl::Persistable for ChannelControlGetTargetListResponse {}
17
18#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct ChannelControlGetTargetResponse {
20    pub channel: String,
21}
22
23impl fidl::Persistable for ChannelControlGetTargetResponse {}
24
25#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct ChannelControlSetTargetRequest {
27    pub channel: String,
28}
29
30impl fidl::Persistable for ChannelControlSetTargetRequest {}
31
32mod internal {
33    use super::*;
34
35    impl fidl::encoding::ValueTypeMarker for ChannelControlGetTargetListResponse {
36        type Borrowed<'a> = &'a Self;
37        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
38            value
39        }
40    }
41
42    unsafe impl fidl::encoding::TypeMarker for ChannelControlGetTargetListResponse {
43        type Owned = Self;
44
45        #[inline(always)]
46        fn inline_align(_context: fidl::encoding::Context) -> usize {
47            8
48        }
49
50        #[inline(always)]
51        fn inline_size(_context: fidl::encoding::Context) -> usize {
52            16
53        }
54    }
55
56    unsafe impl<D: fidl::encoding::ResourceDialect>
57        fidl::encoding::Encode<ChannelControlGetTargetListResponse, D>
58        for &ChannelControlGetTargetListResponse
59    {
60        #[inline]
61        unsafe fn encode(
62            self,
63            encoder: &mut fidl::encoding::Encoder<'_, D>,
64            offset: usize,
65            _depth: fidl::encoding::Depth,
66        ) -> fidl::Result<()> {
67            encoder.debug_check_bounds::<ChannelControlGetTargetListResponse>(offset);
68            // Delegate to tuple encoding.
69            fidl::encoding::Encode::<ChannelControlGetTargetListResponse, D>::encode(
70                (
71                    <fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.channels),
72                ),
73                encoder, offset, _depth
74            )
75        }
76    }
77    unsafe impl<
78            D: fidl::encoding::ResourceDialect,
79            T0: fidl::encoding::Encode<
80                fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
81                D,
82            >,
83        > fidl::encoding::Encode<ChannelControlGetTargetListResponse, D> for (T0,)
84    {
85        #[inline]
86        unsafe fn encode(
87            self,
88            encoder: &mut fidl::encoding::Encoder<'_, D>,
89            offset: usize,
90            depth: fidl::encoding::Depth,
91        ) -> fidl::Result<()> {
92            encoder.debug_check_bounds::<ChannelControlGetTargetListResponse>(offset);
93            // Zero out padding regions. There's no need to apply masks
94            // because the unmasked parts will be overwritten by fields.
95            // Write the fields.
96            self.0.encode(encoder, offset + 0, depth)?;
97            Ok(())
98        }
99    }
100
101    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
102        for ChannelControlGetTargetListResponse
103    {
104        #[inline(always)]
105        fn new_empty() -> Self {
106            Self {
107                channels: fidl::new_empty!(
108                    fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
109                    D
110                ),
111            }
112        }
113
114        #[inline]
115        unsafe fn decode(
116            &mut self,
117            decoder: &mut fidl::encoding::Decoder<'_, D>,
118            offset: usize,
119            _depth: fidl::encoding::Depth,
120        ) -> fidl::Result<()> {
121            decoder.debug_check_bounds::<Self>(offset);
122            // Verify that padding bytes are zero.
123            fidl::decode!(
124                fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
125                D,
126                &mut self.channels,
127                decoder,
128                offset + 0,
129                _depth
130            )?;
131            Ok(())
132        }
133    }
134
135    impl fidl::encoding::ValueTypeMarker for ChannelControlGetTargetResponse {
136        type Borrowed<'a> = &'a Self;
137        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
138            value
139        }
140    }
141
142    unsafe impl fidl::encoding::TypeMarker for ChannelControlGetTargetResponse {
143        type Owned = Self;
144
145        #[inline(always)]
146        fn inline_align(_context: fidl::encoding::Context) -> usize {
147            8
148        }
149
150        #[inline(always)]
151        fn inline_size(_context: fidl::encoding::Context) -> usize {
152            16
153        }
154    }
155
156    unsafe impl<D: fidl::encoding::ResourceDialect>
157        fidl::encoding::Encode<ChannelControlGetTargetResponse, D>
158        for &ChannelControlGetTargetResponse
159    {
160        #[inline]
161        unsafe fn encode(
162            self,
163            encoder: &mut fidl::encoding::Encoder<'_, D>,
164            offset: usize,
165            _depth: fidl::encoding::Depth,
166        ) -> fidl::Result<()> {
167            encoder.debug_check_bounds::<ChannelControlGetTargetResponse>(offset);
168            // Delegate to tuple encoding.
169            fidl::encoding::Encode::<ChannelControlGetTargetResponse, D>::encode(
170                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
171                    &self.channel,
172                ),),
173                encoder,
174                offset,
175                _depth,
176            )
177        }
178    }
179    unsafe impl<
180            D: fidl::encoding::ResourceDialect,
181            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
182        > fidl::encoding::Encode<ChannelControlGetTargetResponse, D> for (T0,)
183    {
184        #[inline]
185        unsafe fn encode(
186            self,
187            encoder: &mut fidl::encoding::Encoder<'_, D>,
188            offset: usize,
189            depth: fidl::encoding::Depth,
190        ) -> fidl::Result<()> {
191            encoder.debug_check_bounds::<ChannelControlGetTargetResponse>(offset);
192            // Zero out padding regions. There's no need to apply masks
193            // because the unmasked parts will be overwritten by fields.
194            // Write the fields.
195            self.0.encode(encoder, offset + 0, depth)?;
196            Ok(())
197        }
198    }
199
200    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
201        for ChannelControlGetTargetResponse
202    {
203        #[inline(always)]
204        fn new_empty() -> Self {
205            Self { channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
206        }
207
208        #[inline]
209        unsafe fn decode(
210            &mut self,
211            decoder: &mut fidl::encoding::Decoder<'_, D>,
212            offset: usize,
213            _depth: fidl::encoding::Depth,
214        ) -> fidl::Result<()> {
215            decoder.debug_check_bounds::<Self>(offset);
216            // Verify that padding bytes are zero.
217            fidl::decode!(
218                fidl::encoding::BoundedString<128>,
219                D,
220                &mut self.channel,
221                decoder,
222                offset + 0,
223                _depth
224            )?;
225            Ok(())
226        }
227    }
228
229    impl fidl::encoding::ValueTypeMarker for ChannelControlSetTargetRequest {
230        type Borrowed<'a> = &'a Self;
231        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
232            value
233        }
234    }
235
236    unsafe impl fidl::encoding::TypeMarker for ChannelControlSetTargetRequest {
237        type Owned = Self;
238
239        #[inline(always)]
240        fn inline_align(_context: fidl::encoding::Context) -> usize {
241            8
242        }
243
244        #[inline(always)]
245        fn inline_size(_context: fidl::encoding::Context) -> usize {
246            16
247        }
248    }
249
250    unsafe impl<D: fidl::encoding::ResourceDialect>
251        fidl::encoding::Encode<ChannelControlSetTargetRequest, D>
252        for &ChannelControlSetTargetRequest
253    {
254        #[inline]
255        unsafe fn encode(
256            self,
257            encoder: &mut fidl::encoding::Encoder<'_, D>,
258            offset: usize,
259            _depth: fidl::encoding::Depth,
260        ) -> fidl::Result<()> {
261            encoder.debug_check_bounds::<ChannelControlSetTargetRequest>(offset);
262            // Delegate to tuple encoding.
263            fidl::encoding::Encode::<ChannelControlSetTargetRequest, D>::encode(
264                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
265                    &self.channel,
266                ),),
267                encoder,
268                offset,
269                _depth,
270            )
271        }
272    }
273    unsafe impl<
274            D: fidl::encoding::ResourceDialect,
275            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
276        > fidl::encoding::Encode<ChannelControlSetTargetRequest, D> for (T0,)
277    {
278        #[inline]
279        unsafe fn encode(
280            self,
281            encoder: &mut fidl::encoding::Encoder<'_, D>,
282            offset: usize,
283            depth: fidl::encoding::Depth,
284        ) -> fidl::Result<()> {
285            encoder.debug_check_bounds::<ChannelControlSetTargetRequest>(offset);
286            // Zero out padding regions. There's no need to apply masks
287            // because the unmasked parts will be overwritten by fields.
288            // Write the fields.
289            self.0.encode(encoder, offset + 0, depth)?;
290            Ok(())
291        }
292    }
293
294    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
295        for ChannelControlSetTargetRequest
296    {
297        #[inline(always)]
298        fn new_empty() -> Self {
299            Self { channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
300        }
301
302        #[inline]
303        unsafe fn decode(
304            &mut self,
305            decoder: &mut fidl::encoding::Decoder<'_, D>,
306            offset: usize,
307            _depth: fidl::encoding::Depth,
308        ) -> fidl::Result<()> {
309            decoder.debug_check_bounds::<Self>(offset);
310            // Verify that padding bytes are zero.
311            fidl::decode!(
312                fidl::encoding::BoundedString<128>,
313                D,
314                &mut self.channel,
315                decoder,
316                offset + 0,
317                _depth
318            )?;
319            Ok(())
320        }
321    }
322}