fidl_fuchsia_recovery_policy__common/
fidl_fuchsia_recovery_policy__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, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct DeviceSetIsLocalResetAllowedRequest {
13    pub allowed: bool,
14}
15
16impl fidl::Persistable for DeviceSetIsLocalResetAllowedRequest {}
17
18#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct FactoryResetGetEnabledResponse {
20    pub fdr_enabled: bool,
21}
22
23impl fidl::Persistable for FactoryResetGetEnabledResponse {}
24
25pub mod device_ordinals {
26    pub const SET_IS_LOCAL_RESET_ALLOWED: u64 = 0x7a0343d0fccb7ac7;
27}
28
29pub mod factory_reset_ordinals {
30    pub const GET_ENABLED: u64 = 0x46b4c73b3d6be123;
31}
32
33mod internal {
34    use super::*;
35
36    impl fidl::encoding::ValueTypeMarker for DeviceSetIsLocalResetAllowedRequest {
37        type Borrowed<'a> = &'a Self;
38        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
39            value
40        }
41    }
42
43    unsafe impl fidl::encoding::TypeMarker for DeviceSetIsLocalResetAllowedRequest {
44        type Owned = Self;
45
46        #[inline(always)]
47        fn inline_align(_context: fidl::encoding::Context) -> usize {
48            1
49        }
50
51        #[inline(always)]
52        fn inline_size(_context: fidl::encoding::Context) -> usize {
53            1
54        }
55    }
56
57    unsafe impl<D: fidl::encoding::ResourceDialect>
58        fidl::encoding::Encode<DeviceSetIsLocalResetAllowedRequest, D>
59        for &DeviceSetIsLocalResetAllowedRequest
60    {
61        #[inline]
62        unsafe fn encode(
63            self,
64            encoder: &mut fidl::encoding::Encoder<'_, D>,
65            offset: usize,
66            _depth: fidl::encoding::Depth,
67        ) -> fidl::Result<()> {
68            encoder.debug_check_bounds::<DeviceSetIsLocalResetAllowedRequest>(offset);
69            // Delegate to tuple encoding.
70            fidl::encoding::Encode::<DeviceSetIsLocalResetAllowedRequest, D>::encode(
71                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allowed),),
72                encoder,
73                offset,
74                _depth,
75            )
76        }
77    }
78    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
79        fidl::encoding::Encode<DeviceSetIsLocalResetAllowedRequest, D> for (T0,)
80    {
81        #[inline]
82        unsafe fn encode(
83            self,
84            encoder: &mut fidl::encoding::Encoder<'_, D>,
85            offset: usize,
86            depth: fidl::encoding::Depth,
87        ) -> fidl::Result<()> {
88            encoder.debug_check_bounds::<DeviceSetIsLocalResetAllowedRequest>(offset);
89            // Zero out padding regions. There's no need to apply masks
90            // because the unmasked parts will be overwritten by fields.
91            // Write the fields.
92            self.0.encode(encoder, offset + 0, depth)?;
93            Ok(())
94        }
95    }
96
97    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
98        for DeviceSetIsLocalResetAllowedRequest
99    {
100        #[inline(always)]
101        fn new_empty() -> Self {
102            Self { allowed: fidl::new_empty!(bool, D) }
103        }
104
105        #[inline]
106        unsafe fn decode(
107            &mut self,
108            decoder: &mut fidl::encoding::Decoder<'_, D>,
109            offset: usize,
110            _depth: fidl::encoding::Depth,
111        ) -> fidl::Result<()> {
112            decoder.debug_check_bounds::<Self>(offset);
113            // Verify that padding bytes are zero.
114            fidl::decode!(bool, D, &mut self.allowed, decoder, offset + 0, _depth)?;
115            Ok(())
116        }
117    }
118
119    impl fidl::encoding::ValueTypeMarker for FactoryResetGetEnabledResponse {
120        type Borrowed<'a> = &'a Self;
121        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
122            value
123        }
124    }
125
126    unsafe impl fidl::encoding::TypeMarker for FactoryResetGetEnabledResponse {
127        type Owned = Self;
128
129        #[inline(always)]
130        fn inline_align(_context: fidl::encoding::Context) -> usize {
131            1
132        }
133
134        #[inline(always)]
135        fn inline_size(_context: fidl::encoding::Context) -> usize {
136            1
137        }
138    }
139
140    unsafe impl<D: fidl::encoding::ResourceDialect>
141        fidl::encoding::Encode<FactoryResetGetEnabledResponse, D>
142        for &FactoryResetGetEnabledResponse
143    {
144        #[inline]
145        unsafe fn encode(
146            self,
147            encoder: &mut fidl::encoding::Encoder<'_, D>,
148            offset: usize,
149            _depth: fidl::encoding::Depth,
150        ) -> fidl::Result<()> {
151            encoder.debug_check_bounds::<FactoryResetGetEnabledResponse>(offset);
152            // Delegate to tuple encoding.
153            fidl::encoding::Encode::<FactoryResetGetEnabledResponse, D>::encode(
154                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.fdr_enabled),),
155                encoder,
156                offset,
157                _depth,
158            )
159        }
160    }
161    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
162        fidl::encoding::Encode<FactoryResetGetEnabledResponse, D> for (T0,)
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::<FactoryResetGetEnabledResponse>(offset);
172            // Zero out padding regions. There's no need to apply masks
173            // because the unmasked parts will be overwritten by fields.
174            // Write the fields.
175            self.0.encode(encoder, offset + 0, depth)?;
176            Ok(())
177        }
178    }
179
180    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
181        for FactoryResetGetEnabledResponse
182    {
183        #[inline(always)]
184        fn new_empty() -> Self {
185            Self { fdr_enabled: fidl::new_empty!(bool, D) }
186        }
187
188        #[inline]
189        unsafe fn decode(
190            &mut self,
191            decoder: &mut fidl::encoding::Decoder<'_, D>,
192            offset: usize,
193            _depth: fidl::encoding::Depth,
194        ) -> fidl::Result<()> {
195            decoder.debug_check_bounds::<Self>(offset);
196            // Verify that padding bytes are zero.
197            fidl::decode!(bool, D, &mut self.fdr_enabled, decoder, offset + 0, _depth)?;
198            Ok(())
199        }
200    }
201}