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
32pub mod channel_control_ordinals {
33    pub const GET_CURRENT: u64 = 0x15af055da76e5016;
34    pub const SET_TARGET: u64 = 0x45f0a54099a1752e;
35    pub const GET_TARGET: u64 = 0x3602953dfbabe7a2;
36    pub const GET_TARGET_LIST: u64 = 0x727a95a911d8db11;
37}
38
39mod internal {
40    use super::*;
41
42    impl fidl::encoding::ValueTypeMarker for ChannelControlGetTargetListResponse {
43        type Borrowed<'a> = &'a Self;
44        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
45            value
46        }
47    }
48
49    unsafe impl fidl::encoding::TypeMarker for ChannelControlGetTargetListResponse {
50        type Owned = Self;
51
52        #[inline(always)]
53        fn inline_align(_context: fidl::encoding::Context) -> usize {
54            8
55        }
56
57        #[inline(always)]
58        fn inline_size(_context: fidl::encoding::Context) -> usize {
59            16
60        }
61    }
62
63    unsafe impl<D: fidl::encoding::ResourceDialect>
64        fidl::encoding::Encode<ChannelControlGetTargetListResponse, D>
65        for &ChannelControlGetTargetListResponse
66    {
67        #[inline]
68        unsafe fn encode(
69            self,
70            encoder: &mut fidl::encoding::Encoder<'_, D>,
71            offset: usize,
72            _depth: fidl::encoding::Depth,
73        ) -> fidl::Result<()> {
74            encoder.debug_check_bounds::<ChannelControlGetTargetListResponse>(offset);
75            // Delegate to tuple encoding.
76            fidl::encoding::Encode::<ChannelControlGetTargetListResponse, D>::encode(
77                (
78                    <fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.channels),
79                ),
80                encoder, offset, _depth
81            )
82        }
83    }
84    unsafe impl<
85            D: fidl::encoding::ResourceDialect,
86            T0: fidl::encoding::Encode<
87                fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
88                D,
89            >,
90        > fidl::encoding::Encode<ChannelControlGetTargetListResponse, 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::<ChannelControlGetTargetListResponse>(offset);
100            // Zero out padding regions. There's no need to apply masks
101            // because the unmasked parts will be overwritten by fields.
102            // Write the fields.
103            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 ChannelControlGetTargetListResponse
110    {
111        #[inline(always)]
112        fn new_empty() -> Self {
113            Self {
114                channels: fidl::new_empty!(
115                    fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
116                    D
117                ),
118            }
119        }
120
121        #[inline]
122        unsafe fn decode(
123            &mut self,
124            decoder: &mut fidl::encoding::Decoder<'_, D>,
125            offset: usize,
126            _depth: fidl::encoding::Depth,
127        ) -> fidl::Result<()> {
128            decoder.debug_check_bounds::<Self>(offset);
129            // Verify that padding bytes are zero.
130            fidl::decode!(
131                fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
132                D,
133                &mut self.channels,
134                decoder,
135                offset + 0,
136                _depth
137            )?;
138            Ok(())
139        }
140    }
141
142    impl fidl::encoding::ValueTypeMarker for ChannelControlGetTargetResponse {
143        type Borrowed<'a> = &'a Self;
144        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
145            value
146        }
147    }
148
149    unsafe impl fidl::encoding::TypeMarker for ChannelControlGetTargetResponse {
150        type Owned = Self;
151
152        #[inline(always)]
153        fn inline_align(_context: fidl::encoding::Context) -> usize {
154            8
155        }
156
157        #[inline(always)]
158        fn inline_size(_context: fidl::encoding::Context) -> usize {
159            16
160        }
161    }
162
163    unsafe impl<D: fidl::encoding::ResourceDialect>
164        fidl::encoding::Encode<ChannelControlGetTargetResponse, D>
165        for &ChannelControlGetTargetResponse
166    {
167        #[inline]
168        unsafe fn encode(
169            self,
170            encoder: &mut fidl::encoding::Encoder<'_, D>,
171            offset: usize,
172            _depth: fidl::encoding::Depth,
173        ) -> fidl::Result<()> {
174            encoder.debug_check_bounds::<ChannelControlGetTargetResponse>(offset);
175            // Delegate to tuple encoding.
176            fidl::encoding::Encode::<ChannelControlGetTargetResponse, D>::encode(
177                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
178                    &self.channel,
179                ),),
180                encoder,
181                offset,
182                _depth,
183            )
184        }
185    }
186    unsafe impl<
187            D: fidl::encoding::ResourceDialect,
188            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
189        > fidl::encoding::Encode<ChannelControlGetTargetResponse, D> for (T0,)
190    {
191        #[inline]
192        unsafe fn encode(
193            self,
194            encoder: &mut fidl::encoding::Encoder<'_, D>,
195            offset: usize,
196            depth: fidl::encoding::Depth,
197        ) -> fidl::Result<()> {
198            encoder.debug_check_bounds::<ChannelControlGetTargetResponse>(offset);
199            // Zero out padding regions. There's no need to apply masks
200            // because the unmasked parts will be overwritten by fields.
201            // Write the fields.
202            self.0.encode(encoder, offset + 0, depth)?;
203            Ok(())
204        }
205    }
206
207    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
208        for ChannelControlGetTargetResponse
209    {
210        #[inline(always)]
211        fn new_empty() -> Self {
212            Self { channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
213        }
214
215        #[inline]
216        unsafe fn decode(
217            &mut self,
218            decoder: &mut fidl::encoding::Decoder<'_, D>,
219            offset: usize,
220            _depth: fidl::encoding::Depth,
221        ) -> fidl::Result<()> {
222            decoder.debug_check_bounds::<Self>(offset);
223            // Verify that padding bytes are zero.
224            fidl::decode!(
225                fidl::encoding::BoundedString<128>,
226                D,
227                &mut self.channel,
228                decoder,
229                offset + 0,
230                _depth
231            )?;
232            Ok(())
233        }
234    }
235
236    impl fidl::encoding::ValueTypeMarker for ChannelControlSetTargetRequest {
237        type Borrowed<'a> = &'a Self;
238        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
239            value
240        }
241    }
242
243    unsafe impl fidl::encoding::TypeMarker for ChannelControlSetTargetRequest {
244        type Owned = Self;
245
246        #[inline(always)]
247        fn inline_align(_context: fidl::encoding::Context) -> usize {
248            8
249        }
250
251        #[inline(always)]
252        fn inline_size(_context: fidl::encoding::Context) -> usize {
253            16
254        }
255    }
256
257    unsafe impl<D: fidl::encoding::ResourceDialect>
258        fidl::encoding::Encode<ChannelControlSetTargetRequest, D>
259        for &ChannelControlSetTargetRequest
260    {
261        #[inline]
262        unsafe fn encode(
263            self,
264            encoder: &mut fidl::encoding::Encoder<'_, D>,
265            offset: usize,
266            _depth: fidl::encoding::Depth,
267        ) -> fidl::Result<()> {
268            encoder.debug_check_bounds::<ChannelControlSetTargetRequest>(offset);
269            // Delegate to tuple encoding.
270            fidl::encoding::Encode::<ChannelControlSetTargetRequest, D>::encode(
271                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
272                    &self.channel,
273                ),),
274                encoder,
275                offset,
276                _depth,
277            )
278        }
279    }
280    unsafe impl<
281            D: fidl::encoding::ResourceDialect,
282            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
283        > fidl::encoding::Encode<ChannelControlSetTargetRequest, D> for (T0,)
284    {
285        #[inline]
286        unsafe fn encode(
287            self,
288            encoder: &mut fidl::encoding::Encoder<'_, D>,
289            offset: usize,
290            depth: fidl::encoding::Depth,
291        ) -> fidl::Result<()> {
292            encoder.debug_check_bounds::<ChannelControlSetTargetRequest>(offset);
293            // Zero out padding regions. There's no need to apply masks
294            // because the unmasked parts will be overwritten by fields.
295            // Write the fields.
296            self.0.encode(encoder, offset + 0, depth)?;
297            Ok(())
298        }
299    }
300
301    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
302        for ChannelControlSetTargetRequest
303    {
304        #[inline(always)]
305        fn new_empty() -> Self {
306            Self { channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
307        }
308
309        #[inline]
310        unsafe fn decode(
311            &mut self,
312            decoder: &mut fidl::encoding::Decoder<'_, D>,
313            offset: usize,
314            _depth: fidl::encoding::Depth,
315        ) -> fidl::Result<()> {
316            decoder.debug_check_bounds::<Self>(offset);
317            // Verify that padding bytes are zero.
318            fidl::decode!(
319                fidl::encoding::BoundedString<128>,
320                D,
321                &mut self.channel,
322                decoder,
323                offset + 0,
324                _depth
325            )?;
326            Ok(())
327        }
328    }
329}