fidl_next_common_fuchsia_hardware_inlineencryption/
fidl_next_common_fuchsia_hardware_inlineencryption.rs1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8 #[repr(C)]
9 pub struct ControllerProgramKeySlotResponse {
10 pub slot: u8,
11 }
12
13 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotResponse, ___E>
14 for ControllerProgramKeySlotResponse
15 where
16 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17 {
18 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
19 Self,
20 crate::wire::ControllerProgramKeySlotResponse,
21 > = unsafe {
22 ::fidl_next::CopyOptimization::enable_if(
23 true && <u8 as ::fidl_next::Encode<u8, ___E>>::COPY_OPTIMIZATION.is_enabled(),
24 )
25 };
26
27 #[inline]
28 fn encode(
29 self,
30 encoder_: &mut ___E,
31 out_: &mut ::core::mem::MaybeUninit<crate::wire::ControllerProgramKeySlotResponse>,
32 _: (),
33 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
34 ::fidl_next::munge! {
35 let crate::wire::ControllerProgramKeySlotResponse {
36 slot,
37
38 } = out_;
39 }
40
41 ::fidl_next::Encode::encode(self.slot, encoder_, slot, ())?;
42
43 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(slot.as_mut_ptr()) };
44
45 Ok(())
46 }
47 }
48
49 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotResponse, ___E>
50 for &'a ControllerProgramKeySlotResponse
51 where
52 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
53 {
54 #[inline]
55 fn encode(
56 self,
57 encoder_: &mut ___E,
58 out_: &mut ::core::mem::MaybeUninit<crate::wire::ControllerProgramKeySlotResponse>,
59 _: (),
60 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
61 ::fidl_next::munge! {
62 let crate::wire::ControllerProgramKeySlotResponse {
63 slot,
64
65 } = out_;
66 }
67
68 ::fidl_next::Encode::encode(&self.slot, encoder_, slot, ())?;
69
70 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(slot.as_mut_ptr()) };
71
72 Ok(())
73 }
74 }
75
76 unsafe impl<___E>
77 ::fidl_next::EncodeOption<
78 ::fidl_next::wire::Box<'static, crate::wire::ControllerProgramKeySlotResponse>,
79 ___E,
80 > for ControllerProgramKeySlotResponse
81 where
82 ___E: ::fidl_next::Encoder + ?Sized,
83 ControllerProgramKeySlotResponse:
84 ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotResponse, ___E>,
85 {
86 #[inline]
87 fn encode_option(
88 this: ::core::option::Option<Self>,
89 encoder: &mut ___E,
90 out: &mut ::core::mem::MaybeUninit<
91 ::fidl_next::wire::Box<'static, crate::wire::ControllerProgramKeySlotResponse>,
92 >,
93 _: (),
94 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
95 if let Some(inner) = this {
96 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
97 ::fidl_next::wire::Box::encode_present(out);
98 } else {
99 ::fidl_next::wire::Box::encode_absent(out);
100 }
101
102 Ok(())
103 }
104 }
105
106 unsafe impl<'a, ___E>
107 ::fidl_next::EncodeOption<
108 ::fidl_next::wire::Box<'static, crate::wire::ControllerProgramKeySlotResponse>,
109 ___E,
110 > for &'a ControllerProgramKeySlotResponse
111 where
112 ___E: ::fidl_next::Encoder + ?Sized,
113 &'a ControllerProgramKeySlotResponse:
114 ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotResponse, ___E>,
115 {
116 #[inline]
117 fn encode_option(
118 this: ::core::option::Option<Self>,
119 encoder: &mut ___E,
120 out: &mut ::core::mem::MaybeUninit<
121 ::fidl_next::wire::Box<'static, crate::wire::ControllerProgramKeySlotResponse>,
122 >,
123 _: (),
124 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
125 if let Some(inner) = this {
126 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
127 ::fidl_next::wire::Box::encode_present(out);
128 } else {
129 ::fidl_next::wire::Box::encode_absent(out);
130 }
131
132 Ok(())
133 }
134 }
135
136 impl ::fidl_next::FromWire<crate::wire::ControllerProgramKeySlotResponse>
137 for ControllerProgramKeySlotResponse
138 {
139 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
140 crate::wire::ControllerProgramKeySlotResponse,
141 Self,
142 > = unsafe {
143 ::fidl_next::CopyOptimization::enable_if(
144 true && <u8 as ::fidl_next::FromWire<u8>>::COPY_OPTIMIZATION.is_enabled(),
145 )
146 };
147
148 #[inline]
149 fn from_wire(wire: crate::wire::ControllerProgramKeySlotResponse) -> Self {
150 Self { slot: ::fidl_next::FromWire::from_wire(wire.slot) }
151 }
152 }
153
154 impl ::fidl_next::FromWireRef<crate::wire::ControllerProgramKeySlotResponse>
155 for ControllerProgramKeySlotResponse
156 {
157 #[inline]
158 fn from_wire_ref(wire: &crate::wire::ControllerProgramKeySlotResponse) -> Self {
159 Self { slot: ::fidl_next::FromWireRef::from_wire_ref(&wire.slot) }
160 }
161 }
162}
163
164pub mod wire {
165
166 #[derive(Clone, Debug)]
168 #[repr(C)]
169 pub struct ControllerProgramKeySlotResponse {
170 pub slot: u8,
171 }
172
173 static_assertions::const_assert_eq!(std::mem::size_of::<ControllerProgramKeySlotResponse>(), 1);
174 static_assertions::const_assert_eq!(
175 std::mem::align_of::<ControllerProgramKeySlotResponse>(),
176 1
177 );
178
179 static_assertions::const_assert_eq!(
180 std::mem::offset_of!(ControllerProgramKeySlotResponse, slot),
181 0
182 );
183
184 impl ::fidl_next::Constrained for ControllerProgramKeySlotResponse {
185 type Constraint = ();
186
187 fn validate(
188 _: ::fidl_next::Slot<'_, Self>,
189 _: Self::Constraint,
190 ) -> Result<(), ::fidl_next::ValidationError> {
191 Ok(())
192 }
193 }
194
195 unsafe impl ::fidl_next::Wire for ControllerProgramKeySlotResponse {
196 type Narrowed<'de> = ControllerProgramKeySlotResponse;
197
198 #[inline]
199 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
200 ::fidl_next::munge! {
201 let Self {
202 slot,
203
204 } = &mut *out_;
205 }
206
207 ::fidl_next::Wire::zero_padding(slot);
208 }
209 }
210
211 unsafe impl<___D> ::fidl_next::Decode<___D> for ControllerProgramKeySlotResponse
212 where
213 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
214 {
215 fn decode(
216 slot_: ::fidl_next::Slot<'_, Self>,
217 decoder_: &mut ___D,
218 _: (),
219 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
220 ::fidl_next::munge! {
221 let Self {
222 mut slot,
223
224 } = slot_;
225 }
226
227 let _field = slot.as_mut();
228
229 ::fidl_next::Decode::decode(slot.as_mut(), decoder_, ())?;
230
231 Ok(())
232 }
233 }
234
235 impl ::fidl_next::IntoNatural for ControllerProgramKeySlotResponse {
236 type Natural = crate::natural::ControllerProgramKeySlotResponse;
237 }
238}
239
240pub mod wire_optional {}
241
242pub mod generic {
243
244 pub struct ControllerProgramKeySlotResponse<T0> {
246 pub slot: T0,
247 }
248
249 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ControllerProgramKeySlotResponse, ___E>
250 for ControllerProgramKeySlotResponse<T0>
251 where
252 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
253 T0: ::fidl_next::Encode<u8, ___E>,
254 {
255 #[inline]
256 fn encode(
257 self,
258 encoder_: &mut ___E,
259 out_: &mut ::core::mem::MaybeUninit<crate::wire::ControllerProgramKeySlotResponse>,
260 _: (),
261 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
262 ::fidl_next::munge! {
263 let crate::wire::ControllerProgramKeySlotResponse {
264 slot,
265
266 } = out_;
267 }
268
269 ::fidl_next::Encode::encode(self.slot, encoder_, slot, ())?;
270
271 Ok(())
272 }
273 }
274}
275
276pub use self::natural::*;