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