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<fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>, D>,
87    > fidl::encoding::Encode<ChannelControlGetTargetListResponse, D> for (T0,)
88    {
89        #[inline]
90        unsafe fn encode(
91            self,
92            encoder: &mut fidl::encoding::Encoder<'_, D>,
93            offset: usize,
94            depth: fidl::encoding::Depth,
95        ) -> fidl::Result<()> {
96            encoder.debug_check_bounds::<ChannelControlGetTargetListResponse>(offset);
97            // Zero out padding regions. There's no need to apply masks
98            // because the unmasked parts will be overwritten by fields.
99            // Write the fields.
100            self.0.encode(encoder, offset + 0, depth)?;
101            Ok(())
102        }
103    }
104
105    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
106        for ChannelControlGetTargetListResponse
107    {
108        #[inline(always)]
109        fn new_empty() -> Self {
110            Self {
111                channels: fidl::new_empty!(
112                    fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
113                    D
114                ),
115            }
116        }
117
118        #[inline]
119        unsafe fn decode(
120            &mut self,
121            decoder: &mut fidl::encoding::Decoder<'_, D>,
122            offset: usize,
123            _depth: fidl::encoding::Depth,
124        ) -> fidl::Result<()> {
125            decoder.debug_check_bounds::<Self>(offset);
126            // Verify that padding bytes are zero.
127            fidl::decode!(
128                fidl::encoding::Vector<fidl::encoding::BoundedString<128>, 100>,
129                D,
130                &mut self.channels,
131                decoder,
132                offset + 0,
133                _depth
134            )?;
135            Ok(())
136        }
137    }
138
139    impl fidl::encoding::ValueTypeMarker for ChannelControlGetTargetResponse {
140        type Borrowed<'a> = &'a Self;
141        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
142            value
143        }
144    }
145
146    unsafe impl fidl::encoding::TypeMarker for ChannelControlGetTargetResponse {
147        type Owned = Self;
148
149        #[inline(always)]
150        fn inline_align(_context: fidl::encoding::Context) -> usize {
151            8
152        }
153
154        #[inline(always)]
155        fn inline_size(_context: fidl::encoding::Context) -> usize {
156            16
157        }
158    }
159
160    unsafe impl<D: fidl::encoding::ResourceDialect>
161        fidl::encoding::Encode<ChannelControlGetTargetResponse, D>
162        for &ChannelControlGetTargetResponse
163    {
164        #[inline]
165        unsafe fn encode(
166            self,
167            encoder: &mut fidl::encoding::Encoder<'_, D>,
168            offset: usize,
169            _depth: fidl::encoding::Depth,
170        ) -> fidl::Result<()> {
171            encoder.debug_check_bounds::<ChannelControlGetTargetResponse>(offset);
172            // Delegate to tuple encoding.
173            fidl::encoding::Encode::<ChannelControlGetTargetResponse, D>::encode(
174                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
175                    &self.channel,
176                ),),
177                encoder,
178                offset,
179                _depth,
180            )
181        }
182    }
183    unsafe impl<
184        D: fidl::encoding::ResourceDialect,
185        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
186    > fidl::encoding::Encode<ChannelControlGetTargetResponse, D> for (T0,)
187    {
188        #[inline]
189        unsafe fn encode(
190            self,
191            encoder: &mut fidl::encoding::Encoder<'_, D>,
192            offset: usize,
193            depth: fidl::encoding::Depth,
194        ) -> fidl::Result<()> {
195            encoder.debug_check_bounds::<ChannelControlGetTargetResponse>(offset);
196            // Zero out padding regions. There's no need to apply masks
197            // because the unmasked parts will be overwritten by fields.
198            // Write the fields.
199            self.0.encode(encoder, offset + 0, depth)?;
200            Ok(())
201        }
202    }
203
204    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
205        for ChannelControlGetTargetResponse
206    {
207        #[inline(always)]
208        fn new_empty() -> Self {
209            Self { channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
210        }
211
212        #[inline]
213        unsafe fn decode(
214            &mut self,
215            decoder: &mut fidl::encoding::Decoder<'_, D>,
216            offset: usize,
217            _depth: fidl::encoding::Depth,
218        ) -> fidl::Result<()> {
219            decoder.debug_check_bounds::<Self>(offset);
220            // Verify that padding bytes are zero.
221            fidl::decode!(
222                fidl::encoding::BoundedString<128>,
223                D,
224                &mut self.channel,
225                decoder,
226                offset + 0,
227                _depth
228            )?;
229            Ok(())
230        }
231    }
232
233    impl fidl::encoding::ValueTypeMarker for ChannelControlSetTargetRequest {
234        type Borrowed<'a> = &'a Self;
235        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
236            value
237        }
238    }
239
240    unsafe impl fidl::encoding::TypeMarker for ChannelControlSetTargetRequest {
241        type Owned = Self;
242
243        #[inline(always)]
244        fn inline_align(_context: fidl::encoding::Context) -> usize {
245            8
246        }
247
248        #[inline(always)]
249        fn inline_size(_context: fidl::encoding::Context) -> usize {
250            16
251        }
252    }
253
254    unsafe impl<D: fidl::encoding::ResourceDialect>
255        fidl::encoding::Encode<ChannelControlSetTargetRequest, D>
256        for &ChannelControlSetTargetRequest
257    {
258        #[inline]
259        unsafe fn encode(
260            self,
261            encoder: &mut fidl::encoding::Encoder<'_, D>,
262            offset: usize,
263            _depth: fidl::encoding::Depth,
264        ) -> fidl::Result<()> {
265            encoder.debug_check_bounds::<ChannelControlSetTargetRequest>(offset);
266            // Delegate to tuple encoding.
267            fidl::encoding::Encode::<ChannelControlSetTargetRequest, D>::encode(
268                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
269                    &self.channel,
270                ),),
271                encoder,
272                offset,
273                _depth,
274            )
275        }
276    }
277    unsafe impl<
278        D: fidl::encoding::ResourceDialect,
279        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
280    > fidl::encoding::Encode<ChannelControlSetTargetRequest, D> for (T0,)
281    {
282        #[inline]
283        unsafe fn encode(
284            self,
285            encoder: &mut fidl::encoding::Encoder<'_, D>,
286            offset: usize,
287            depth: fidl::encoding::Depth,
288        ) -> fidl::Result<()> {
289            encoder.debug_check_bounds::<ChannelControlSetTargetRequest>(offset);
290            // Zero out padding regions. There's no need to apply masks
291            // because the unmasked parts will be overwritten by fields.
292            // Write the fields.
293            self.0.encode(encoder, offset + 0, depth)?;
294            Ok(())
295        }
296    }
297
298    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
299        for ChannelControlSetTargetRequest
300    {
301        #[inline(always)]
302        fn new_empty() -> Self {
303            Self { channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
304        }
305
306        #[inline]
307        unsafe fn decode(
308            &mut self,
309            decoder: &mut fidl::encoding::Decoder<'_, D>,
310            offset: usize,
311            _depth: fidl::encoding::Depth,
312        ) -> fidl::Result<()> {
313            decoder.debug_check_bounds::<Self>(offset);
314            // Verify that padding bytes are zero.
315            fidl::decode!(
316                fidl::encoding::BoundedString<128>,
317                D,
318                &mut self.channel,
319                decoder,
320                offset + 0,
321                _depth
322            )?;
323            Ok(())
324        }
325    }
326}