1#![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)]
12#[repr(C)]
13pub struct AdminGetDevicePathRequest {
14 pub fs_id: u64,
15}
16
17impl fidl::Persistable for AdminGetDevicePathRequest {}
18
19#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
20pub struct AdminStorageHostEnabledResponse {
21 pub enabled: bool,
22}
23
24impl fidl::Persistable for AdminStorageHostEnabledResponse {}
25
26#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27pub struct AdminUnmountRequest {
28 pub name: String,
29}
30
31impl fidl::Persistable for AdminUnmountRequest {}
32
33#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct AdminGetDevicePathResponse {
35 pub path: String,
36}
37
38impl fidl::Persistable for AdminGetDevicePathResponse {}
39
40#[derive(Clone, Debug, PartialEq)]
41pub struct RecoveryInitSystemPartitionTableRequest {
42 pub partitions: Vec<fidl_fuchsia_storage_partitions::PartitionInfo>,
43}
44
45impl fidl::Persistable for RecoveryInitSystemPartitionTableRequest {}
46
47mod internal {
48 use super::*;
49
50 impl fidl::encoding::ValueTypeMarker for AdminGetDevicePathRequest {
51 type Borrowed<'a> = &'a Self;
52 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
53 value
54 }
55 }
56
57 unsafe impl fidl::encoding::TypeMarker for AdminGetDevicePathRequest {
58 type Owned = Self;
59
60 #[inline(always)]
61 fn inline_align(_context: fidl::encoding::Context) -> usize {
62 8
63 }
64
65 #[inline(always)]
66 fn inline_size(_context: fidl::encoding::Context) -> usize {
67 8
68 }
69 #[inline(always)]
70 fn encode_is_copy() -> bool {
71 true
72 }
73
74 #[inline(always)]
75 fn decode_is_copy() -> bool {
76 true
77 }
78 }
79
80 unsafe impl<D: fidl::encoding::ResourceDialect>
81 fidl::encoding::Encode<AdminGetDevicePathRequest, D> for &AdminGetDevicePathRequest
82 {
83 #[inline]
84 unsafe fn encode(
85 self,
86 encoder: &mut fidl::encoding::Encoder<'_, D>,
87 offset: usize,
88 _depth: fidl::encoding::Depth,
89 ) -> fidl::Result<()> {
90 encoder.debug_check_bounds::<AdminGetDevicePathRequest>(offset);
91 unsafe {
92 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
94 (buf_ptr as *mut AdminGetDevicePathRequest)
95 .write_unaligned((self as *const AdminGetDevicePathRequest).read());
96 }
99 Ok(())
100 }
101 }
102 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
103 fidl::encoding::Encode<AdminGetDevicePathRequest, D> for (T0,)
104 {
105 #[inline]
106 unsafe fn encode(
107 self,
108 encoder: &mut fidl::encoding::Encoder<'_, D>,
109 offset: usize,
110 depth: fidl::encoding::Depth,
111 ) -> fidl::Result<()> {
112 encoder.debug_check_bounds::<AdminGetDevicePathRequest>(offset);
113 self.0.encode(encoder, offset + 0, depth)?;
117 Ok(())
118 }
119 }
120
121 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
122 for AdminGetDevicePathRequest
123 {
124 #[inline(always)]
125 fn new_empty() -> Self {
126 Self { fs_id: fidl::new_empty!(u64, D) }
127 }
128
129 #[inline]
130 unsafe fn decode(
131 &mut self,
132 decoder: &mut fidl::encoding::Decoder<'_, D>,
133 offset: usize,
134 _depth: fidl::encoding::Depth,
135 ) -> fidl::Result<()> {
136 decoder.debug_check_bounds::<Self>(offset);
137 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
138 unsafe {
141 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
142 }
143 Ok(())
144 }
145 }
146
147 impl fidl::encoding::ValueTypeMarker for AdminStorageHostEnabledResponse {
148 type Borrowed<'a> = &'a Self;
149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
150 value
151 }
152 }
153
154 unsafe impl fidl::encoding::TypeMarker for AdminStorageHostEnabledResponse {
155 type Owned = Self;
156
157 #[inline(always)]
158 fn inline_align(_context: fidl::encoding::Context) -> usize {
159 1
160 }
161
162 #[inline(always)]
163 fn inline_size(_context: fidl::encoding::Context) -> usize {
164 1
165 }
166 }
167
168 unsafe impl<D: fidl::encoding::ResourceDialect>
169 fidl::encoding::Encode<AdminStorageHostEnabledResponse, D>
170 for &AdminStorageHostEnabledResponse
171 {
172 #[inline]
173 unsafe fn encode(
174 self,
175 encoder: &mut fidl::encoding::Encoder<'_, D>,
176 offset: usize,
177 _depth: fidl::encoding::Depth,
178 ) -> fidl::Result<()> {
179 encoder.debug_check_bounds::<AdminStorageHostEnabledResponse>(offset);
180 fidl::encoding::Encode::<AdminStorageHostEnabledResponse, D>::encode(
182 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
183 encoder,
184 offset,
185 _depth,
186 )
187 }
188 }
189 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
190 fidl::encoding::Encode<AdminStorageHostEnabledResponse, D> for (T0,)
191 {
192 #[inline]
193 unsafe fn encode(
194 self,
195 encoder: &mut fidl::encoding::Encoder<'_, D>,
196 offset: usize,
197 depth: fidl::encoding::Depth,
198 ) -> fidl::Result<()> {
199 encoder.debug_check_bounds::<AdminStorageHostEnabledResponse>(offset);
200 self.0.encode(encoder, offset + 0, depth)?;
204 Ok(())
205 }
206 }
207
208 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
209 for AdminStorageHostEnabledResponse
210 {
211 #[inline(always)]
212 fn new_empty() -> Self {
213 Self { enabled: fidl::new_empty!(bool, D) }
214 }
215
216 #[inline]
217 unsafe fn decode(
218 &mut self,
219 decoder: &mut fidl::encoding::Decoder<'_, D>,
220 offset: usize,
221 _depth: fidl::encoding::Depth,
222 ) -> fidl::Result<()> {
223 decoder.debug_check_bounds::<Self>(offset);
224 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
226 Ok(())
227 }
228 }
229
230 impl fidl::encoding::ValueTypeMarker for AdminUnmountRequest {
231 type Borrowed<'a> = &'a Self;
232 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
233 value
234 }
235 }
236
237 unsafe impl fidl::encoding::TypeMarker for AdminUnmountRequest {
238 type Owned = Self;
239
240 #[inline(always)]
241 fn inline_align(_context: fidl::encoding::Context) -> usize {
242 8
243 }
244
245 #[inline(always)]
246 fn inline_size(_context: fidl::encoding::Context) -> usize {
247 16
248 }
249 }
250
251 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AdminUnmountRequest, D>
252 for &AdminUnmountRequest
253 {
254 #[inline]
255 unsafe fn encode(
256 self,
257 encoder: &mut fidl::encoding::Encoder<'_, D>,
258 offset: usize,
259 _depth: fidl::encoding::Depth,
260 ) -> fidl::Result<()> {
261 encoder.debug_check_bounds::<AdminUnmountRequest>(offset);
262 fidl::encoding::Encode::<AdminUnmountRequest, D>::encode(
264 (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
265 &self.name,
266 ),),
267 encoder,
268 offset,
269 _depth,
270 )
271 }
272 }
273 unsafe impl<
274 D: fidl::encoding::ResourceDialect,
275 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
276 > fidl::encoding::Encode<AdminUnmountRequest, D> for (T0,)
277 {
278 #[inline]
279 unsafe fn encode(
280 self,
281 encoder: &mut fidl::encoding::Encoder<'_, D>,
282 offset: usize,
283 depth: fidl::encoding::Depth,
284 ) -> fidl::Result<()> {
285 encoder.debug_check_bounds::<AdminUnmountRequest>(offset);
286 self.0.encode(encoder, offset + 0, depth)?;
290 Ok(())
291 }
292 }
293
294 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdminUnmountRequest {
295 #[inline(always)]
296 fn new_empty() -> Self {
297 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
298 }
299
300 #[inline]
301 unsafe fn decode(
302 &mut self,
303 decoder: &mut fidl::encoding::Decoder<'_, D>,
304 offset: usize,
305 _depth: fidl::encoding::Depth,
306 ) -> fidl::Result<()> {
307 decoder.debug_check_bounds::<Self>(offset);
308 fidl::decode!(
310 fidl::encoding::BoundedString<255>,
311 D,
312 &mut self.name,
313 decoder,
314 offset + 0,
315 _depth
316 )?;
317 Ok(())
318 }
319 }
320
321 impl fidl::encoding::ValueTypeMarker for AdminGetDevicePathResponse {
322 type Borrowed<'a> = &'a Self;
323 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
324 value
325 }
326 }
327
328 unsafe impl fidl::encoding::TypeMarker for AdminGetDevicePathResponse {
329 type Owned = Self;
330
331 #[inline(always)]
332 fn inline_align(_context: fidl::encoding::Context) -> usize {
333 8
334 }
335
336 #[inline(always)]
337 fn inline_size(_context: fidl::encoding::Context) -> usize {
338 16
339 }
340 }
341
342 unsafe impl<D: fidl::encoding::ResourceDialect>
343 fidl::encoding::Encode<AdminGetDevicePathResponse, D> for &AdminGetDevicePathResponse
344 {
345 #[inline]
346 unsafe fn encode(
347 self,
348 encoder: &mut fidl::encoding::Encoder<'_, D>,
349 offset: usize,
350 _depth: fidl::encoding::Depth,
351 ) -> fidl::Result<()> {
352 encoder.debug_check_bounds::<AdminGetDevicePathResponse>(offset);
353 fidl::encoding::Encode::<AdminGetDevicePathResponse, D>::encode(
355 (<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(
356 &self.path,
357 ),),
358 encoder,
359 offset,
360 _depth,
361 )
362 }
363 }
364 unsafe impl<
365 D: fidl::encoding::ResourceDialect,
366 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4095>, D>,
367 > fidl::encoding::Encode<AdminGetDevicePathResponse, D> for (T0,)
368 {
369 #[inline]
370 unsafe fn encode(
371 self,
372 encoder: &mut fidl::encoding::Encoder<'_, D>,
373 offset: usize,
374 depth: fidl::encoding::Depth,
375 ) -> fidl::Result<()> {
376 encoder.debug_check_bounds::<AdminGetDevicePathResponse>(offset);
377 self.0.encode(encoder, offset + 0, depth)?;
381 Ok(())
382 }
383 }
384
385 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
386 for AdminGetDevicePathResponse
387 {
388 #[inline(always)]
389 fn new_empty() -> Self {
390 Self { path: fidl::new_empty!(fidl::encoding::BoundedString<4095>, D) }
391 }
392
393 #[inline]
394 unsafe fn decode(
395 &mut self,
396 decoder: &mut fidl::encoding::Decoder<'_, D>,
397 offset: usize,
398 _depth: fidl::encoding::Depth,
399 ) -> fidl::Result<()> {
400 decoder.debug_check_bounds::<Self>(offset);
401 fidl::decode!(
403 fidl::encoding::BoundedString<4095>,
404 D,
405 &mut self.path,
406 decoder,
407 offset + 0,
408 _depth
409 )?;
410 Ok(())
411 }
412 }
413
414 impl fidl::encoding::ValueTypeMarker for RecoveryInitSystemPartitionTableRequest {
415 type Borrowed<'a> = &'a Self;
416 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
417 value
418 }
419 }
420
421 unsafe impl fidl::encoding::TypeMarker for RecoveryInitSystemPartitionTableRequest {
422 type Owned = Self;
423
424 #[inline(always)]
425 fn inline_align(_context: fidl::encoding::Context) -> usize {
426 8
427 }
428
429 #[inline(always)]
430 fn inline_size(_context: fidl::encoding::Context) -> usize {
431 16
432 }
433 }
434
435 unsafe impl<D: fidl::encoding::ResourceDialect>
436 fidl::encoding::Encode<RecoveryInitSystemPartitionTableRequest, D>
437 for &RecoveryInitSystemPartitionTableRequest
438 {
439 #[inline]
440 unsafe fn encode(
441 self,
442 encoder: &mut fidl::encoding::Encoder<'_, D>,
443 offset: usize,
444 _depth: fidl::encoding::Depth,
445 ) -> fidl::Result<()> {
446 encoder.debug_check_bounds::<RecoveryInitSystemPartitionTableRequest>(offset);
447 fidl::encoding::Encode::<RecoveryInitSystemPartitionTableRequest, D>::encode(
449 (
450 <fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.partitions),
451 ),
452 encoder, offset, _depth
453 )
454 }
455 }
456 unsafe impl<
457 D: fidl::encoding::ResourceDialect,
458 T0: fidl::encoding::Encode<
459 fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128>,
460 D,
461 >,
462 > fidl::encoding::Encode<RecoveryInitSystemPartitionTableRequest, D> for (T0,)
463 {
464 #[inline]
465 unsafe fn encode(
466 self,
467 encoder: &mut fidl::encoding::Encoder<'_, D>,
468 offset: usize,
469 depth: fidl::encoding::Depth,
470 ) -> fidl::Result<()> {
471 encoder.debug_check_bounds::<RecoveryInitSystemPartitionTableRequest>(offset);
472 self.0.encode(encoder, offset + 0, depth)?;
476 Ok(())
477 }
478 }
479
480 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
481 for RecoveryInitSystemPartitionTableRequest
482 {
483 #[inline(always)]
484 fn new_empty() -> Self {
485 Self {
486 partitions: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128>, D),
487 }
488 }
489
490 #[inline]
491 unsafe fn decode(
492 &mut self,
493 decoder: &mut fidl::encoding::Decoder<'_, D>,
494 offset: usize,
495 _depth: fidl::encoding::Depth,
496 ) -> fidl::Result<()> {
497 decoder.debug_check_bounds::<Self>(offset);
498 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_storage_partitions::PartitionInfo, 128>, D, &mut self.partitions, decoder, offset + 0, _depth)?;
500 Ok(())
501 }
502 }
503}