fidl_fuchsia_recovery_policy_common/
fidl_fuchsia_recovery_policy_common.rs1#![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
25mod internal {
26 use super::*;
27
28 impl fidl::encoding::ValueTypeMarker for DeviceSetIsLocalResetAllowedRequest {
29 type Borrowed<'a> = &'a Self;
30 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
31 value
32 }
33 }
34
35 unsafe impl fidl::encoding::TypeMarker for DeviceSetIsLocalResetAllowedRequest {
36 type Owned = Self;
37
38 #[inline(always)]
39 fn inline_align(_context: fidl::encoding::Context) -> usize {
40 1
41 }
42
43 #[inline(always)]
44 fn inline_size(_context: fidl::encoding::Context) -> usize {
45 1
46 }
47 }
48
49 unsafe impl<D: fidl::encoding::ResourceDialect>
50 fidl::encoding::Encode<DeviceSetIsLocalResetAllowedRequest, D>
51 for &DeviceSetIsLocalResetAllowedRequest
52 {
53 #[inline]
54 unsafe fn encode(
55 self,
56 encoder: &mut fidl::encoding::Encoder<'_, D>,
57 offset: usize,
58 _depth: fidl::encoding::Depth,
59 ) -> fidl::Result<()> {
60 encoder.debug_check_bounds::<DeviceSetIsLocalResetAllowedRequest>(offset);
61 fidl::encoding::Encode::<DeviceSetIsLocalResetAllowedRequest, D>::encode(
63 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allowed),),
64 encoder,
65 offset,
66 _depth,
67 )
68 }
69 }
70 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
71 fidl::encoding::Encode<DeviceSetIsLocalResetAllowedRequest, D> for (T0,)
72 {
73 #[inline]
74 unsafe fn encode(
75 self,
76 encoder: &mut fidl::encoding::Encoder<'_, D>,
77 offset: usize,
78 depth: fidl::encoding::Depth,
79 ) -> fidl::Result<()> {
80 encoder.debug_check_bounds::<DeviceSetIsLocalResetAllowedRequest>(offset);
81 self.0.encode(encoder, offset + 0, depth)?;
85 Ok(())
86 }
87 }
88
89 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
90 for DeviceSetIsLocalResetAllowedRequest
91 {
92 #[inline(always)]
93 fn new_empty() -> Self {
94 Self { allowed: fidl::new_empty!(bool, D) }
95 }
96
97 #[inline]
98 unsafe fn decode(
99 &mut self,
100 decoder: &mut fidl::encoding::Decoder<'_, D>,
101 offset: usize,
102 _depth: fidl::encoding::Depth,
103 ) -> fidl::Result<()> {
104 decoder.debug_check_bounds::<Self>(offset);
105 fidl::decode!(bool, D, &mut self.allowed, decoder, offset + 0, _depth)?;
107 Ok(())
108 }
109 }
110
111 impl fidl::encoding::ValueTypeMarker for FactoryResetGetEnabledResponse {
112 type Borrowed<'a> = &'a Self;
113 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
114 value
115 }
116 }
117
118 unsafe impl fidl::encoding::TypeMarker for FactoryResetGetEnabledResponse {
119 type Owned = Self;
120
121 #[inline(always)]
122 fn inline_align(_context: fidl::encoding::Context) -> usize {
123 1
124 }
125
126 #[inline(always)]
127 fn inline_size(_context: fidl::encoding::Context) -> usize {
128 1
129 }
130 }
131
132 unsafe impl<D: fidl::encoding::ResourceDialect>
133 fidl::encoding::Encode<FactoryResetGetEnabledResponse, D>
134 for &FactoryResetGetEnabledResponse
135 {
136 #[inline]
137 unsafe fn encode(
138 self,
139 encoder: &mut fidl::encoding::Encoder<'_, D>,
140 offset: usize,
141 _depth: fidl::encoding::Depth,
142 ) -> fidl::Result<()> {
143 encoder.debug_check_bounds::<FactoryResetGetEnabledResponse>(offset);
144 fidl::encoding::Encode::<FactoryResetGetEnabledResponse, D>::encode(
146 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.fdr_enabled),),
147 encoder,
148 offset,
149 _depth,
150 )
151 }
152 }
153 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
154 fidl::encoding::Encode<FactoryResetGetEnabledResponse, D> for (T0,)
155 {
156 #[inline]
157 unsafe fn encode(
158 self,
159 encoder: &mut fidl::encoding::Encoder<'_, D>,
160 offset: usize,
161 depth: fidl::encoding::Depth,
162 ) -> fidl::Result<()> {
163 encoder.debug_check_bounds::<FactoryResetGetEnabledResponse>(offset);
164 self.0.encode(encoder, offset + 0, depth)?;
168 Ok(())
169 }
170 }
171
172 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
173 for FactoryResetGetEnabledResponse
174 {
175 #[inline(always)]
176 fn new_empty() -> Self {
177 Self { fdr_enabled: fidl::new_empty!(bool, D) }
178 }
179
180 #[inline]
181 unsafe fn decode(
182 &mut self,
183 decoder: &mut fidl::encoding::Decoder<'_, D>,
184 offset: usize,
185 _depth: fidl::encoding::Depth,
186 ) -> fidl::Result<()> {
187 decoder.debug_check_bounds::<Self>(offset);
188 fidl::decode!(bool, D, &mut self.fdr_enabled, decoder, offset + 0, _depth)?;
190 Ok(())
191 }
192 }
193}