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
11pub const ALLOCATE_PARTITION_FLAG_INACTIVE: u32 = 1;
14
15pub const MAX_SLICE_REQUESTS: u32 = 16;
18
19#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
20#[repr(C)]
21pub struct VolumeDestroyResponse {
22 pub status: i32,
23}
24
25impl fidl::Persistable for VolumeDestroyResponse {}
26
27#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28#[repr(C)]
29pub struct VolumeExtendRequest {
30 pub start_slice: u64,
31 pub slice_count: u64,
32}
33
34impl fidl::Persistable for VolumeExtendRequest {}
35
36#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37#[repr(C)]
38pub struct VolumeExtendResponse {
39 pub status: i32,
40}
41
42impl fidl::Persistable for VolumeExtendResponse {}
43
44#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
45pub struct VolumeGetVolumeInfoResponse {
46 pub status: i32,
47 pub manager: Option<Box<VolumeManagerInfo>>,
48 pub volume: Option<Box<VolumeInfo>>,
49}
50
51impl fidl::Persistable for VolumeGetVolumeInfoResponse {}
52
53#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
54#[repr(C)]
55pub struct VolumeInfo {
56 pub partition_slice_count: u64,
58 pub slice_limit: u64,
68}
69
70impl fidl::Persistable for VolumeInfo {}
71
72#[derive(Clone, Debug, PartialEq)]
73pub struct VolumeManagerActivateRequest {
74 pub old_guid: fidl_fuchsia_hardware_block_partition::Guid,
75 pub new_guid: fidl_fuchsia_hardware_block_partition::Guid,
76}
77
78impl fidl::Persistable for VolumeManagerActivateRequest {}
79
80#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81#[repr(C)]
82pub struct VolumeManagerActivateResponse {
83 pub status: i32,
84}
85
86impl fidl::Persistable for VolumeManagerActivateResponse {}
87
88#[derive(Clone, Debug, PartialEq)]
89pub struct VolumeManagerAllocatePartitionRequest {
90 pub slice_count: u64,
91 pub type_: fidl_fuchsia_hardware_block_partition::Guid,
92 pub instance: fidl_fuchsia_hardware_block_partition::Guid,
93 pub name: String,
94 pub flags: u32,
95}
96
97impl fidl::Persistable for VolumeManagerAllocatePartitionRequest {}
98
99#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100#[repr(C)]
101pub struct VolumeManagerAllocatePartitionResponse {
102 pub status: i32,
103}
104
105impl fidl::Persistable for VolumeManagerAllocatePartitionResponse {}
106
107#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108pub struct VolumeManagerGetInfoResponse {
109 pub status: i32,
110 pub info: Option<Box<VolumeManagerInfo>>,
111}
112
113impl fidl::Persistable for VolumeManagerGetInfoResponse {}
114
115#[derive(Clone, Debug, PartialEq)]
116pub struct VolumeManagerGetPartitionLimitRequest {
117 pub guid: fidl_fuchsia_hardware_block_partition::Guid,
118}
119
120impl fidl::Persistable for VolumeManagerGetPartitionLimitRequest {}
121
122#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
123#[repr(C)]
124pub struct VolumeManagerGetPartitionLimitResponse {
125 pub status: i32,
126 pub slice_count: u64,
127}
128
129impl fidl::Persistable for VolumeManagerGetPartitionLimitResponse {}
130
131#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
133#[repr(C)]
134pub struct VolumeManagerInfo {
135 pub slice_size: u64,
137 pub slice_count: u64,
140 pub assigned_slice_count: u64,
142 pub maximum_slice_count: u64,
148 pub max_virtual_slice: u64,
150}
151
152impl fidl::Persistable for VolumeManagerInfo {}
153
154#[derive(Clone, Debug, PartialEq)]
155pub struct VolumeManagerSetPartitionLimitRequest {
156 pub guid: fidl_fuchsia_hardware_block_partition::Guid,
157 pub slice_count: u64,
158}
159
160impl fidl::Persistable for VolumeManagerSetPartitionLimitRequest {}
161
162#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163#[repr(C)]
164pub struct VolumeManagerSetPartitionLimitResponse {
165 pub status: i32,
166}
167
168impl fidl::Persistable for VolumeManagerSetPartitionLimitResponse {}
169
170#[derive(Clone, Debug, PartialEq)]
171pub struct VolumeManagerSetPartitionNameRequest {
172 pub guid: fidl_fuchsia_hardware_block_partition::Guid,
173 pub name: String,
174}
175
176impl fidl::Persistable for VolumeManagerSetPartitionNameRequest {}
177
178#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
179pub struct VolumeQuerySlicesRequest {
180 pub start_slices: Vec<u64>,
181}
182
183impl fidl::Persistable for VolumeQuerySlicesRequest {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct VolumeQuerySlicesResponse {
187 pub status: i32,
188 pub response: [VsliceRange; 16],
189 pub response_count: u64,
190}
191
192impl fidl::Persistable for VolumeQuerySlicesResponse {}
193
194#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
195#[repr(C)]
196pub struct VolumeShrinkRequest {
197 pub start_slice: u64,
198 pub slice_count: u64,
199}
200
201impl fidl::Persistable for VolumeShrinkRequest {}
202
203#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
204#[repr(C)]
205pub struct VolumeShrinkResponse {
206 pub status: i32,
207}
208
209impl fidl::Persistable for VolumeShrinkResponse {}
210
211#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216pub struct VsliceRange {
217 pub allocated: bool,
219 pub count: u64,
221}
222
223impl fidl::Persistable for VsliceRange {}
224
225mod internal {
226 use super::*;
227
228 impl fidl::encoding::ValueTypeMarker for VolumeDestroyResponse {
229 type Borrowed<'a> = &'a Self;
230 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
231 value
232 }
233 }
234
235 unsafe impl fidl::encoding::TypeMarker for VolumeDestroyResponse {
236 type Owned = Self;
237
238 #[inline(always)]
239 fn inline_align(_context: fidl::encoding::Context) -> usize {
240 4
241 }
242
243 #[inline(always)]
244 fn inline_size(_context: fidl::encoding::Context) -> usize {
245 4
246 }
247 #[inline(always)]
248 fn encode_is_copy() -> bool {
249 true
250 }
251
252 #[inline(always)]
253 fn decode_is_copy() -> bool {
254 true
255 }
256 }
257
258 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeDestroyResponse, D>
259 for &VolumeDestroyResponse
260 {
261 #[inline]
262 unsafe fn encode(
263 self,
264 encoder: &mut fidl::encoding::Encoder<'_, D>,
265 offset: usize,
266 _depth: fidl::encoding::Depth,
267 ) -> fidl::Result<()> {
268 encoder.debug_check_bounds::<VolumeDestroyResponse>(offset);
269 unsafe {
270 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
272 (buf_ptr as *mut VolumeDestroyResponse)
273 .write_unaligned((self as *const VolumeDestroyResponse).read());
274 }
277 Ok(())
278 }
279 }
280 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
281 fidl::encoding::Encode<VolumeDestroyResponse, D> for (T0,)
282 {
283 #[inline]
284 unsafe fn encode(
285 self,
286 encoder: &mut fidl::encoding::Encoder<'_, D>,
287 offset: usize,
288 depth: fidl::encoding::Depth,
289 ) -> fidl::Result<()> {
290 encoder.debug_check_bounds::<VolumeDestroyResponse>(offset);
291 self.0.encode(encoder, offset + 0, depth)?;
295 Ok(())
296 }
297 }
298
299 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeDestroyResponse {
300 #[inline(always)]
301 fn new_empty() -> Self {
302 Self { status: fidl::new_empty!(i32, D) }
303 }
304
305 #[inline]
306 unsafe fn decode(
307 &mut self,
308 decoder: &mut fidl::encoding::Decoder<'_, D>,
309 offset: usize,
310 _depth: fidl::encoding::Depth,
311 ) -> fidl::Result<()> {
312 decoder.debug_check_bounds::<Self>(offset);
313 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
314 unsafe {
317 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
318 }
319 Ok(())
320 }
321 }
322
323 impl fidl::encoding::ValueTypeMarker for VolumeExtendRequest {
324 type Borrowed<'a> = &'a Self;
325 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
326 value
327 }
328 }
329
330 unsafe impl fidl::encoding::TypeMarker for VolumeExtendRequest {
331 type Owned = Self;
332
333 #[inline(always)]
334 fn inline_align(_context: fidl::encoding::Context) -> usize {
335 8
336 }
337
338 #[inline(always)]
339 fn inline_size(_context: fidl::encoding::Context) -> usize {
340 16
341 }
342 #[inline(always)]
343 fn encode_is_copy() -> bool {
344 true
345 }
346
347 #[inline(always)]
348 fn decode_is_copy() -> bool {
349 true
350 }
351 }
352
353 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeExtendRequest, D>
354 for &VolumeExtendRequest
355 {
356 #[inline]
357 unsafe fn encode(
358 self,
359 encoder: &mut fidl::encoding::Encoder<'_, D>,
360 offset: usize,
361 _depth: fidl::encoding::Depth,
362 ) -> fidl::Result<()> {
363 encoder.debug_check_bounds::<VolumeExtendRequest>(offset);
364 unsafe {
365 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
367 (buf_ptr as *mut VolumeExtendRequest)
368 .write_unaligned((self as *const VolumeExtendRequest).read());
369 }
372 Ok(())
373 }
374 }
375 unsafe impl<
376 D: fidl::encoding::ResourceDialect,
377 T0: fidl::encoding::Encode<u64, D>,
378 T1: fidl::encoding::Encode<u64, D>,
379 > fidl::encoding::Encode<VolumeExtendRequest, D> for (T0, T1)
380 {
381 #[inline]
382 unsafe fn encode(
383 self,
384 encoder: &mut fidl::encoding::Encoder<'_, D>,
385 offset: usize,
386 depth: fidl::encoding::Depth,
387 ) -> fidl::Result<()> {
388 encoder.debug_check_bounds::<VolumeExtendRequest>(offset);
389 self.0.encode(encoder, offset + 0, depth)?;
393 self.1.encode(encoder, offset + 8, depth)?;
394 Ok(())
395 }
396 }
397
398 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeExtendRequest {
399 #[inline(always)]
400 fn new_empty() -> Self {
401 Self { start_slice: fidl::new_empty!(u64, D), slice_count: fidl::new_empty!(u64, D) }
402 }
403
404 #[inline]
405 unsafe fn decode(
406 &mut self,
407 decoder: &mut fidl::encoding::Decoder<'_, D>,
408 offset: usize,
409 _depth: fidl::encoding::Depth,
410 ) -> fidl::Result<()> {
411 decoder.debug_check_bounds::<Self>(offset);
412 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
413 unsafe {
416 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
417 }
418 Ok(())
419 }
420 }
421
422 impl fidl::encoding::ValueTypeMarker for VolumeExtendResponse {
423 type Borrowed<'a> = &'a Self;
424 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
425 value
426 }
427 }
428
429 unsafe impl fidl::encoding::TypeMarker for VolumeExtendResponse {
430 type Owned = Self;
431
432 #[inline(always)]
433 fn inline_align(_context: fidl::encoding::Context) -> usize {
434 4
435 }
436
437 #[inline(always)]
438 fn inline_size(_context: fidl::encoding::Context) -> usize {
439 4
440 }
441 #[inline(always)]
442 fn encode_is_copy() -> bool {
443 true
444 }
445
446 #[inline(always)]
447 fn decode_is_copy() -> bool {
448 true
449 }
450 }
451
452 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeExtendResponse, D>
453 for &VolumeExtendResponse
454 {
455 #[inline]
456 unsafe fn encode(
457 self,
458 encoder: &mut fidl::encoding::Encoder<'_, D>,
459 offset: usize,
460 _depth: fidl::encoding::Depth,
461 ) -> fidl::Result<()> {
462 encoder.debug_check_bounds::<VolumeExtendResponse>(offset);
463 unsafe {
464 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
466 (buf_ptr as *mut VolumeExtendResponse)
467 .write_unaligned((self as *const VolumeExtendResponse).read());
468 }
471 Ok(())
472 }
473 }
474 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
475 fidl::encoding::Encode<VolumeExtendResponse, D> for (T0,)
476 {
477 #[inline]
478 unsafe fn encode(
479 self,
480 encoder: &mut fidl::encoding::Encoder<'_, D>,
481 offset: usize,
482 depth: fidl::encoding::Depth,
483 ) -> fidl::Result<()> {
484 encoder.debug_check_bounds::<VolumeExtendResponse>(offset);
485 self.0.encode(encoder, offset + 0, depth)?;
489 Ok(())
490 }
491 }
492
493 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeExtendResponse {
494 #[inline(always)]
495 fn new_empty() -> Self {
496 Self { status: fidl::new_empty!(i32, D) }
497 }
498
499 #[inline]
500 unsafe fn decode(
501 &mut self,
502 decoder: &mut fidl::encoding::Decoder<'_, D>,
503 offset: usize,
504 _depth: fidl::encoding::Depth,
505 ) -> fidl::Result<()> {
506 decoder.debug_check_bounds::<Self>(offset);
507 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
508 unsafe {
511 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
512 }
513 Ok(())
514 }
515 }
516
517 impl fidl::encoding::ValueTypeMarker for VolumeGetVolumeInfoResponse {
518 type Borrowed<'a> = &'a Self;
519 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
520 value
521 }
522 }
523
524 unsafe impl fidl::encoding::TypeMarker for VolumeGetVolumeInfoResponse {
525 type Owned = Self;
526
527 #[inline(always)]
528 fn inline_align(_context: fidl::encoding::Context) -> usize {
529 8
530 }
531
532 #[inline(always)]
533 fn inline_size(_context: fidl::encoding::Context) -> usize {
534 24
535 }
536 }
537
538 unsafe impl<D: fidl::encoding::ResourceDialect>
539 fidl::encoding::Encode<VolumeGetVolumeInfoResponse, D> for &VolumeGetVolumeInfoResponse
540 {
541 #[inline]
542 unsafe fn encode(
543 self,
544 encoder: &mut fidl::encoding::Encoder<'_, D>,
545 offset: usize,
546 _depth: fidl::encoding::Depth,
547 ) -> fidl::Result<()> {
548 encoder.debug_check_bounds::<VolumeGetVolumeInfoResponse>(offset);
549 fidl::encoding::Encode::<VolumeGetVolumeInfoResponse, D>::encode(
551 (
552 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
553 <fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.manager),
554 <fidl::encoding::Boxed<VolumeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
555 ),
556 encoder, offset, _depth
557 )
558 }
559 }
560 unsafe impl<
561 D: fidl::encoding::ResourceDialect,
562 T0: fidl::encoding::Encode<i32, D>,
563 T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
564 T2: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeInfo>, D>,
565 > fidl::encoding::Encode<VolumeGetVolumeInfoResponse, D> for (T0, T1, T2)
566 {
567 #[inline]
568 unsafe fn encode(
569 self,
570 encoder: &mut fidl::encoding::Encoder<'_, D>,
571 offset: usize,
572 depth: fidl::encoding::Depth,
573 ) -> fidl::Result<()> {
574 encoder.debug_check_bounds::<VolumeGetVolumeInfoResponse>(offset);
575 unsafe {
578 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
579 (ptr as *mut u64).write_unaligned(0);
580 }
581 self.0.encode(encoder, offset + 0, depth)?;
583 self.1.encode(encoder, offset + 8, depth)?;
584 self.2.encode(encoder, offset + 16, depth)?;
585 Ok(())
586 }
587 }
588
589 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
590 for VolumeGetVolumeInfoResponse
591 {
592 #[inline(always)]
593 fn new_empty() -> Self {
594 Self {
595 status: fidl::new_empty!(i32, D),
596 manager: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, D),
597 volume: fidl::new_empty!(fidl::encoding::Boxed<VolumeInfo>, D),
598 }
599 }
600
601 #[inline]
602 unsafe fn decode(
603 &mut self,
604 decoder: &mut fidl::encoding::Decoder<'_, D>,
605 offset: usize,
606 _depth: fidl::encoding::Depth,
607 ) -> fidl::Result<()> {
608 decoder.debug_check_bounds::<Self>(offset);
609 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
611 let padval = unsafe { (ptr as *const u64).read_unaligned() };
612 let mask = 0xffffffff00000000u64;
613 let maskedval = padval & mask;
614 if maskedval != 0 {
615 return Err(fidl::Error::NonZeroPadding {
616 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
617 });
618 }
619 fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
620 fidl::decode!(
621 fidl::encoding::Boxed<VolumeManagerInfo>,
622 D,
623 &mut self.manager,
624 decoder,
625 offset + 8,
626 _depth
627 )?;
628 fidl::decode!(
629 fidl::encoding::Boxed<VolumeInfo>,
630 D,
631 &mut self.volume,
632 decoder,
633 offset + 16,
634 _depth
635 )?;
636 Ok(())
637 }
638 }
639
640 impl fidl::encoding::ValueTypeMarker for VolumeInfo {
641 type Borrowed<'a> = &'a Self;
642 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
643 value
644 }
645 }
646
647 unsafe impl fidl::encoding::TypeMarker for VolumeInfo {
648 type Owned = Self;
649
650 #[inline(always)]
651 fn inline_align(_context: fidl::encoding::Context) -> usize {
652 8
653 }
654
655 #[inline(always)]
656 fn inline_size(_context: fidl::encoding::Context) -> usize {
657 16
658 }
659 #[inline(always)]
660 fn encode_is_copy() -> bool {
661 true
662 }
663
664 #[inline(always)]
665 fn decode_is_copy() -> bool {
666 true
667 }
668 }
669
670 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeInfo, D>
671 for &VolumeInfo
672 {
673 #[inline]
674 unsafe fn encode(
675 self,
676 encoder: &mut fidl::encoding::Encoder<'_, D>,
677 offset: usize,
678 _depth: fidl::encoding::Depth,
679 ) -> fidl::Result<()> {
680 encoder.debug_check_bounds::<VolumeInfo>(offset);
681 unsafe {
682 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
684 (buf_ptr as *mut VolumeInfo).write_unaligned((self as *const VolumeInfo).read());
685 }
688 Ok(())
689 }
690 }
691 unsafe impl<
692 D: fidl::encoding::ResourceDialect,
693 T0: fidl::encoding::Encode<u64, D>,
694 T1: fidl::encoding::Encode<u64, D>,
695 > fidl::encoding::Encode<VolumeInfo, D> for (T0, T1)
696 {
697 #[inline]
698 unsafe fn encode(
699 self,
700 encoder: &mut fidl::encoding::Encoder<'_, D>,
701 offset: usize,
702 depth: fidl::encoding::Depth,
703 ) -> fidl::Result<()> {
704 encoder.debug_check_bounds::<VolumeInfo>(offset);
705 self.0.encode(encoder, offset + 0, depth)?;
709 self.1.encode(encoder, offset + 8, depth)?;
710 Ok(())
711 }
712 }
713
714 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeInfo {
715 #[inline(always)]
716 fn new_empty() -> Self {
717 Self {
718 partition_slice_count: fidl::new_empty!(u64, D),
719 slice_limit: fidl::new_empty!(u64, D),
720 }
721 }
722
723 #[inline]
724 unsafe fn decode(
725 &mut self,
726 decoder: &mut fidl::encoding::Decoder<'_, D>,
727 offset: usize,
728 _depth: fidl::encoding::Depth,
729 ) -> fidl::Result<()> {
730 decoder.debug_check_bounds::<Self>(offset);
731 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
732 unsafe {
735 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
736 }
737 Ok(())
738 }
739 }
740
741 impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateRequest {
742 type Borrowed<'a> = &'a Self;
743 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
744 value
745 }
746 }
747
748 unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateRequest {
749 type Owned = Self;
750
751 #[inline(always)]
752 fn inline_align(_context: fidl::encoding::Context) -> usize {
753 1
754 }
755
756 #[inline(always)]
757 fn inline_size(_context: fidl::encoding::Context) -> usize {
758 32
759 }
760 }
761
762 unsafe impl<D: fidl::encoding::ResourceDialect>
763 fidl::encoding::Encode<VolumeManagerActivateRequest, D> for &VolumeManagerActivateRequest
764 {
765 #[inline]
766 unsafe fn encode(
767 self,
768 encoder: &mut fidl::encoding::Encoder<'_, D>,
769 offset: usize,
770 _depth: fidl::encoding::Depth,
771 ) -> fidl::Result<()> {
772 encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
773 fidl::encoding::Encode::<VolumeManagerActivateRequest, D>::encode(
775 (
776 <fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.old_guid),
777 <fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.new_guid),
778 ),
779 encoder, offset, _depth
780 )
781 }
782 }
783 unsafe impl<
784 D: fidl::encoding::ResourceDialect,
785 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
786 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
787 > fidl::encoding::Encode<VolumeManagerActivateRequest, D> for (T0, T1)
788 {
789 #[inline]
790 unsafe fn encode(
791 self,
792 encoder: &mut fidl::encoding::Encoder<'_, D>,
793 offset: usize,
794 depth: fidl::encoding::Depth,
795 ) -> fidl::Result<()> {
796 encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
797 self.0.encode(encoder, offset + 0, depth)?;
801 self.1.encode(encoder, offset + 16, depth)?;
802 Ok(())
803 }
804 }
805
806 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
807 for VolumeManagerActivateRequest
808 {
809 #[inline(always)]
810 fn new_empty() -> Self {
811 Self {
812 old_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
813 new_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
814 }
815 }
816
817 #[inline]
818 unsafe fn decode(
819 &mut self,
820 decoder: &mut fidl::encoding::Decoder<'_, D>,
821 offset: usize,
822 _depth: fidl::encoding::Depth,
823 ) -> fidl::Result<()> {
824 decoder.debug_check_bounds::<Self>(offset);
825 fidl::decode!(
827 fidl_fuchsia_hardware_block_partition::Guid,
828 D,
829 &mut self.old_guid,
830 decoder,
831 offset + 0,
832 _depth
833 )?;
834 fidl::decode!(
835 fidl_fuchsia_hardware_block_partition::Guid,
836 D,
837 &mut self.new_guid,
838 decoder,
839 offset + 16,
840 _depth
841 )?;
842 Ok(())
843 }
844 }
845
846 impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateResponse {
847 type Borrowed<'a> = &'a Self;
848 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
849 value
850 }
851 }
852
853 unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateResponse {
854 type Owned = Self;
855
856 #[inline(always)]
857 fn inline_align(_context: fidl::encoding::Context) -> usize {
858 4
859 }
860
861 #[inline(always)]
862 fn inline_size(_context: fidl::encoding::Context) -> usize {
863 4
864 }
865 #[inline(always)]
866 fn encode_is_copy() -> bool {
867 true
868 }
869
870 #[inline(always)]
871 fn decode_is_copy() -> bool {
872 true
873 }
874 }
875
876 unsafe impl<D: fidl::encoding::ResourceDialect>
877 fidl::encoding::Encode<VolumeManagerActivateResponse, D>
878 for &VolumeManagerActivateResponse
879 {
880 #[inline]
881 unsafe fn encode(
882 self,
883 encoder: &mut fidl::encoding::Encoder<'_, D>,
884 offset: usize,
885 _depth: fidl::encoding::Depth,
886 ) -> fidl::Result<()> {
887 encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
888 unsafe {
889 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
891 (buf_ptr as *mut VolumeManagerActivateResponse)
892 .write_unaligned((self as *const VolumeManagerActivateResponse).read());
893 }
896 Ok(())
897 }
898 }
899 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
900 fidl::encoding::Encode<VolumeManagerActivateResponse, D> for (T0,)
901 {
902 #[inline]
903 unsafe fn encode(
904 self,
905 encoder: &mut fidl::encoding::Encoder<'_, D>,
906 offset: usize,
907 depth: fidl::encoding::Depth,
908 ) -> fidl::Result<()> {
909 encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
910 self.0.encode(encoder, offset + 0, depth)?;
914 Ok(())
915 }
916 }
917
918 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
919 for VolumeManagerActivateResponse
920 {
921 #[inline(always)]
922 fn new_empty() -> Self {
923 Self { status: fidl::new_empty!(i32, D) }
924 }
925
926 #[inline]
927 unsafe fn decode(
928 &mut self,
929 decoder: &mut fidl::encoding::Decoder<'_, D>,
930 offset: usize,
931 _depth: fidl::encoding::Depth,
932 ) -> fidl::Result<()> {
933 decoder.debug_check_bounds::<Self>(offset);
934 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
935 unsafe {
938 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
939 }
940 Ok(())
941 }
942 }
943
944 impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionRequest {
945 type Borrowed<'a> = &'a Self;
946 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
947 value
948 }
949 }
950
951 unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionRequest {
952 type Owned = Self;
953
954 #[inline(always)]
955 fn inline_align(_context: fidl::encoding::Context) -> usize {
956 8
957 }
958
959 #[inline(always)]
960 fn inline_size(_context: fidl::encoding::Context) -> usize {
961 64
962 }
963 }
964
965 unsafe impl<D: fidl::encoding::ResourceDialect>
966 fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest, D>
967 for &VolumeManagerAllocatePartitionRequest
968 {
969 #[inline]
970 unsafe fn encode(
971 self,
972 encoder: &mut fidl::encoding::Encoder<'_, D>,
973 offset: usize,
974 _depth: fidl::encoding::Depth,
975 ) -> fidl::Result<()> {
976 encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
977 fidl::encoding::Encode::<VolumeManagerAllocatePartitionRequest, D>::encode(
979 (
980 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slice_count),
981 <fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
982 <fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.instance),
983 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
984 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
985 ),
986 encoder, offset, _depth
987 )
988 }
989 }
990 unsafe impl<
991 D: fidl::encoding::ResourceDialect,
992 T0: fidl::encoding::Encode<u64, D>,
993 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
994 T2: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
995 T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
996 T4: fidl::encoding::Encode<u32, D>,
997 > fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest, D>
998 for (T0, T1, T2, T3, T4)
999 {
1000 #[inline]
1001 unsafe fn encode(
1002 self,
1003 encoder: &mut fidl::encoding::Encoder<'_, D>,
1004 offset: usize,
1005 depth: fidl::encoding::Depth,
1006 ) -> fidl::Result<()> {
1007 encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
1008 unsafe {
1011 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
1012 (ptr as *mut u64).write_unaligned(0);
1013 }
1014 self.0.encode(encoder, offset + 0, depth)?;
1016 self.1.encode(encoder, offset + 8, depth)?;
1017 self.2.encode(encoder, offset + 24, depth)?;
1018 self.3.encode(encoder, offset + 40, depth)?;
1019 self.4.encode(encoder, offset + 56, depth)?;
1020 Ok(())
1021 }
1022 }
1023
1024 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1025 for VolumeManagerAllocatePartitionRequest
1026 {
1027 #[inline(always)]
1028 fn new_empty() -> Self {
1029 Self {
1030 slice_count: fidl::new_empty!(u64, D),
1031 type_: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
1032 instance: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
1033 name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
1034 flags: fidl::new_empty!(u32, D),
1035 }
1036 }
1037
1038 #[inline]
1039 unsafe fn decode(
1040 &mut self,
1041 decoder: &mut fidl::encoding::Decoder<'_, D>,
1042 offset: usize,
1043 _depth: fidl::encoding::Depth,
1044 ) -> fidl::Result<()> {
1045 decoder.debug_check_bounds::<Self>(offset);
1046 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
1048 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1049 let mask = 0xffffffff00000000u64;
1050 let maskedval = padval & mask;
1051 if maskedval != 0 {
1052 return Err(fidl::Error::NonZeroPadding {
1053 padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
1054 });
1055 }
1056 fidl::decode!(u64, D, &mut self.slice_count, decoder, offset + 0, _depth)?;
1057 fidl::decode!(
1058 fidl_fuchsia_hardware_block_partition::Guid,
1059 D,
1060 &mut self.type_,
1061 decoder,
1062 offset + 8,
1063 _depth
1064 )?;
1065 fidl::decode!(
1066 fidl_fuchsia_hardware_block_partition::Guid,
1067 D,
1068 &mut self.instance,
1069 decoder,
1070 offset + 24,
1071 _depth
1072 )?;
1073 fidl::decode!(
1074 fidl::encoding::BoundedString<128>,
1075 D,
1076 &mut self.name,
1077 decoder,
1078 offset + 40,
1079 _depth
1080 )?;
1081 fidl::decode!(u32, D, &mut self.flags, decoder, offset + 56, _depth)?;
1082 Ok(())
1083 }
1084 }
1085
1086 impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionResponse {
1087 type Borrowed<'a> = &'a Self;
1088 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1089 value
1090 }
1091 }
1092
1093 unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionResponse {
1094 type Owned = Self;
1095
1096 #[inline(always)]
1097 fn inline_align(_context: fidl::encoding::Context) -> usize {
1098 4
1099 }
1100
1101 #[inline(always)]
1102 fn inline_size(_context: fidl::encoding::Context) -> usize {
1103 4
1104 }
1105 #[inline(always)]
1106 fn encode_is_copy() -> bool {
1107 true
1108 }
1109
1110 #[inline(always)]
1111 fn decode_is_copy() -> bool {
1112 true
1113 }
1114 }
1115
1116 unsafe impl<D: fidl::encoding::ResourceDialect>
1117 fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse, D>
1118 for &VolumeManagerAllocatePartitionResponse
1119 {
1120 #[inline]
1121 unsafe fn encode(
1122 self,
1123 encoder: &mut fidl::encoding::Encoder<'_, D>,
1124 offset: usize,
1125 _depth: fidl::encoding::Depth,
1126 ) -> fidl::Result<()> {
1127 encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
1128 unsafe {
1129 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1131 (buf_ptr as *mut VolumeManagerAllocatePartitionResponse).write_unaligned(
1132 (self as *const VolumeManagerAllocatePartitionResponse).read(),
1133 );
1134 }
1137 Ok(())
1138 }
1139 }
1140 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1141 fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse, D> for (T0,)
1142 {
1143 #[inline]
1144 unsafe fn encode(
1145 self,
1146 encoder: &mut fidl::encoding::Encoder<'_, D>,
1147 offset: usize,
1148 depth: fidl::encoding::Depth,
1149 ) -> fidl::Result<()> {
1150 encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
1151 self.0.encode(encoder, offset + 0, depth)?;
1155 Ok(())
1156 }
1157 }
1158
1159 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1160 for VolumeManagerAllocatePartitionResponse
1161 {
1162 #[inline(always)]
1163 fn new_empty() -> Self {
1164 Self { status: fidl::new_empty!(i32, D) }
1165 }
1166
1167 #[inline]
1168 unsafe fn decode(
1169 &mut self,
1170 decoder: &mut fidl::encoding::Decoder<'_, D>,
1171 offset: usize,
1172 _depth: fidl::encoding::Depth,
1173 ) -> fidl::Result<()> {
1174 decoder.debug_check_bounds::<Self>(offset);
1175 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1176 unsafe {
1179 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1180 }
1181 Ok(())
1182 }
1183 }
1184
1185 impl fidl::encoding::ValueTypeMarker for VolumeManagerGetInfoResponse {
1186 type Borrowed<'a> = &'a Self;
1187 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1188 value
1189 }
1190 }
1191
1192 unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetInfoResponse {
1193 type Owned = Self;
1194
1195 #[inline(always)]
1196 fn inline_align(_context: fidl::encoding::Context) -> usize {
1197 8
1198 }
1199
1200 #[inline(always)]
1201 fn inline_size(_context: fidl::encoding::Context) -> usize {
1202 16
1203 }
1204 }
1205
1206 unsafe impl<D: fidl::encoding::ResourceDialect>
1207 fidl::encoding::Encode<VolumeManagerGetInfoResponse, D> for &VolumeManagerGetInfoResponse
1208 {
1209 #[inline]
1210 unsafe fn encode(
1211 self,
1212 encoder: &mut fidl::encoding::Encoder<'_, D>,
1213 offset: usize,
1214 _depth: fidl::encoding::Depth,
1215 ) -> fidl::Result<()> {
1216 encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
1217 fidl::encoding::Encode::<VolumeManagerGetInfoResponse, D>::encode(
1219 (
1220 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1221 <fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1222 ),
1223 encoder, offset, _depth
1224 )
1225 }
1226 }
1227 unsafe impl<
1228 D: fidl::encoding::ResourceDialect,
1229 T0: fidl::encoding::Encode<i32, D>,
1230 T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
1231 > fidl::encoding::Encode<VolumeManagerGetInfoResponse, D> for (T0, T1)
1232 {
1233 #[inline]
1234 unsafe fn encode(
1235 self,
1236 encoder: &mut fidl::encoding::Encoder<'_, D>,
1237 offset: usize,
1238 depth: fidl::encoding::Depth,
1239 ) -> fidl::Result<()> {
1240 encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
1241 unsafe {
1244 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1245 (ptr as *mut u64).write_unaligned(0);
1246 }
1247 self.0.encode(encoder, offset + 0, depth)?;
1249 self.1.encode(encoder, offset + 8, depth)?;
1250 Ok(())
1251 }
1252 }
1253
1254 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1255 for VolumeManagerGetInfoResponse
1256 {
1257 #[inline(always)]
1258 fn new_empty() -> Self {
1259 Self {
1260 status: fidl::new_empty!(i32, D),
1261 info: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, D),
1262 }
1263 }
1264
1265 #[inline]
1266 unsafe fn decode(
1267 &mut self,
1268 decoder: &mut fidl::encoding::Decoder<'_, D>,
1269 offset: usize,
1270 _depth: fidl::encoding::Depth,
1271 ) -> fidl::Result<()> {
1272 decoder.debug_check_bounds::<Self>(offset);
1273 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1275 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1276 let mask = 0xffffffff00000000u64;
1277 let maskedval = padval & mask;
1278 if maskedval != 0 {
1279 return Err(fidl::Error::NonZeroPadding {
1280 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1281 });
1282 }
1283 fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
1284 fidl::decode!(
1285 fidl::encoding::Boxed<VolumeManagerInfo>,
1286 D,
1287 &mut self.info,
1288 decoder,
1289 offset + 8,
1290 _depth
1291 )?;
1292 Ok(())
1293 }
1294 }
1295
1296 impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitRequest {
1297 type Borrowed<'a> = &'a Self;
1298 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1299 value
1300 }
1301 }
1302
1303 unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitRequest {
1304 type Owned = Self;
1305
1306 #[inline(always)]
1307 fn inline_align(_context: fidl::encoding::Context) -> usize {
1308 1
1309 }
1310
1311 #[inline(always)]
1312 fn inline_size(_context: fidl::encoding::Context) -> usize {
1313 16
1314 }
1315 }
1316
1317 unsafe impl<D: fidl::encoding::ResourceDialect>
1318 fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D>
1319 for &VolumeManagerGetPartitionLimitRequest
1320 {
1321 #[inline]
1322 unsafe fn encode(
1323 self,
1324 encoder: &mut fidl::encoding::Encoder<'_, D>,
1325 offset: usize,
1326 _depth: fidl::encoding::Depth,
1327 ) -> fidl::Result<()> {
1328 encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
1329 fidl::encoding::Encode::<VolumeManagerGetPartitionLimitRequest, D>::encode(
1331 (
1332 <fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
1333 ),
1334 encoder, offset, _depth
1335 )
1336 }
1337 }
1338 unsafe impl<
1339 D: fidl::encoding::ResourceDialect,
1340 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
1341 > fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D> for (T0,)
1342 {
1343 #[inline]
1344 unsafe fn encode(
1345 self,
1346 encoder: &mut fidl::encoding::Encoder<'_, D>,
1347 offset: usize,
1348 depth: fidl::encoding::Depth,
1349 ) -> fidl::Result<()> {
1350 encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
1351 self.0.encode(encoder, offset + 0, depth)?;
1355 Ok(())
1356 }
1357 }
1358
1359 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1360 for VolumeManagerGetPartitionLimitRequest
1361 {
1362 #[inline(always)]
1363 fn new_empty() -> Self {
1364 Self { guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D) }
1365 }
1366
1367 #[inline]
1368 unsafe fn decode(
1369 &mut self,
1370 decoder: &mut fidl::encoding::Decoder<'_, D>,
1371 offset: usize,
1372 _depth: fidl::encoding::Depth,
1373 ) -> fidl::Result<()> {
1374 decoder.debug_check_bounds::<Self>(offset);
1375 fidl::decode!(
1377 fidl_fuchsia_hardware_block_partition::Guid,
1378 D,
1379 &mut self.guid,
1380 decoder,
1381 offset + 0,
1382 _depth
1383 )?;
1384 Ok(())
1385 }
1386 }
1387
1388 impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitResponse {
1389 type Borrowed<'a> = &'a Self;
1390 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1391 value
1392 }
1393 }
1394
1395 unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitResponse {
1396 type Owned = Self;
1397
1398 #[inline(always)]
1399 fn inline_align(_context: fidl::encoding::Context) -> usize {
1400 8
1401 }
1402
1403 #[inline(always)]
1404 fn inline_size(_context: fidl::encoding::Context) -> usize {
1405 16
1406 }
1407 }
1408
1409 unsafe impl<D: fidl::encoding::ResourceDialect>
1410 fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse, D>
1411 for &VolumeManagerGetPartitionLimitResponse
1412 {
1413 #[inline]
1414 unsafe fn encode(
1415 self,
1416 encoder: &mut fidl::encoding::Encoder<'_, D>,
1417 offset: usize,
1418 _depth: fidl::encoding::Depth,
1419 ) -> fidl::Result<()> {
1420 encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitResponse>(offset);
1421 unsafe {
1422 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1424 (buf_ptr as *mut VolumeManagerGetPartitionLimitResponse).write_unaligned(
1425 (self as *const VolumeManagerGetPartitionLimitResponse).read(),
1426 );
1427 let padding_ptr = buf_ptr.offset(0) as *mut u64;
1430 let padding_mask = 0xffffffff00000000u64;
1431 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
1432 }
1433 Ok(())
1434 }
1435 }
1436 unsafe impl<
1437 D: fidl::encoding::ResourceDialect,
1438 T0: fidl::encoding::Encode<i32, D>,
1439 T1: fidl::encoding::Encode<u64, D>,
1440 > fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse, D> for (T0, T1)
1441 {
1442 #[inline]
1443 unsafe fn encode(
1444 self,
1445 encoder: &mut fidl::encoding::Encoder<'_, D>,
1446 offset: usize,
1447 depth: fidl::encoding::Depth,
1448 ) -> fidl::Result<()> {
1449 encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitResponse>(offset);
1450 unsafe {
1453 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1454 (ptr as *mut u64).write_unaligned(0);
1455 }
1456 self.0.encode(encoder, offset + 0, depth)?;
1458 self.1.encode(encoder, offset + 8, depth)?;
1459 Ok(())
1460 }
1461 }
1462
1463 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1464 for VolumeManagerGetPartitionLimitResponse
1465 {
1466 #[inline(always)]
1467 fn new_empty() -> Self {
1468 Self { status: fidl::new_empty!(i32, D), slice_count: fidl::new_empty!(u64, D) }
1469 }
1470
1471 #[inline]
1472 unsafe fn decode(
1473 &mut self,
1474 decoder: &mut fidl::encoding::Decoder<'_, D>,
1475 offset: usize,
1476 _depth: fidl::encoding::Depth,
1477 ) -> fidl::Result<()> {
1478 decoder.debug_check_bounds::<Self>(offset);
1479 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1480 let ptr = unsafe { buf_ptr.offset(0) };
1482 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1483 let mask = 0xffffffff00000000u64;
1484 let maskedval = padval & mask;
1485 if maskedval != 0 {
1486 return Err(fidl::Error::NonZeroPadding {
1487 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1488 });
1489 }
1490 unsafe {
1492 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1493 }
1494 Ok(())
1495 }
1496 }
1497
1498 impl fidl::encoding::ValueTypeMarker for VolumeManagerInfo {
1499 type Borrowed<'a> = &'a Self;
1500 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1501 value
1502 }
1503 }
1504
1505 unsafe impl fidl::encoding::TypeMarker for VolumeManagerInfo {
1506 type Owned = Self;
1507
1508 #[inline(always)]
1509 fn inline_align(_context: fidl::encoding::Context) -> usize {
1510 8
1511 }
1512
1513 #[inline(always)]
1514 fn inline_size(_context: fidl::encoding::Context) -> usize {
1515 40
1516 }
1517 #[inline(always)]
1518 fn encode_is_copy() -> bool {
1519 true
1520 }
1521
1522 #[inline(always)]
1523 fn decode_is_copy() -> bool {
1524 true
1525 }
1526 }
1527
1528 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeManagerInfo, D>
1529 for &VolumeManagerInfo
1530 {
1531 #[inline]
1532 unsafe fn encode(
1533 self,
1534 encoder: &mut fidl::encoding::Encoder<'_, D>,
1535 offset: usize,
1536 _depth: fidl::encoding::Depth,
1537 ) -> fidl::Result<()> {
1538 encoder.debug_check_bounds::<VolumeManagerInfo>(offset);
1539 unsafe {
1540 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1542 (buf_ptr as *mut VolumeManagerInfo)
1543 .write_unaligned((self as *const VolumeManagerInfo).read());
1544 }
1547 Ok(())
1548 }
1549 }
1550 unsafe impl<
1551 D: fidl::encoding::ResourceDialect,
1552 T0: fidl::encoding::Encode<u64, D>,
1553 T1: fidl::encoding::Encode<u64, D>,
1554 T2: fidl::encoding::Encode<u64, D>,
1555 T3: fidl::encoding::Encode<u64, D>,
1556 T4: fidl::encoding::Encode<u64, D>,
1557 > fidl::encoding::Encode<VolumeManagerInfo, D> for (T0, T1, T2, T3, T4)
1558 {
1559 #[inline]
1560 unsafe fn encode(
1561 self,
1562 encoder: &mut fidl::encoding::Encoder<'_, D>,
1563 offset: usize,
1564 depth: fidl::encoding::Depth,
1565 ) -> fidl::Result<()> {
1566 encoder.debug_check_bounds::<VolumeManagerInfo>(offset);
1567 self.0.encode(encoder, offset + 0, depth)?;
1571 self.1.encode(encoder, offset + 8, depth)?;
1572 self.2.encode(encoder, offset + 16, depth)?;
1573 self.3.encode(encoder, offset + 24, depth)?;
1574 self.4.encode(encoder, offset + 32, depth)?;
1575 Ok(())
1576 }
1577 }
1578
1579 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeManagerInfo {
1580 #[inline(always)]
1581 fn new_empty() -> Self {
1582 Self {
1583 slice_size: fidl::new_empty!(u64, D),
1584 slice_count: fidl::new_empty!(u64, D),
1585 assigned_slice_count: fidl::new_empty!(u64, D),
1586 maximum_slice_count: fidl::new_empty!(u64, D),
1587 max_virtual_slice: fidl::new_empty!(u64, D),
1588 }
1589 }
1590
1591 #[inline]
1592 unsafe fn decode(
1593 &mut self,
1594 decoder: &mut fidl::encoding::Decoder<'_, D>,
1595 offset: usize,
1596 _depth: fidl::encoding::Depth,
1597 ) -> fidl::Result<()> {
1598 decoder.debug_check_bounds::<Self>(offset);
1599 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1600 unsafe {
1603 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
1604 }
1605 Ok(())
1606 }
1607 }
1608
1609 impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitRequest {
1610 type Borrowed<'a> = &'a Self;
1611 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1612 value
1613 }
1614 }
1615
1616 unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitRequest {
1617 type Owned = Self;
1618
1619 #[inline(always)]
1620 fn inline_align(_context: fidl::encoding::Context) -> usize {
1621 8
1622 }
1623
1624 #[inline(always)]
1625 fn inline_size(_context: fidl::encoding::Context) -> usize {
1626 24
1627 }
1628 }
1629
1630 unsafe impl<D: fidl::encoding::ResourceDialect>
1631 fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, D>
1632 for &VolumeManagerSetPartitionLimitRequest
1633 {
1634 #[inline]
1635 unsafe fn encode(
1636 self,
1637 encoder: &mut fidl::encoding::Encoder<'_, D>,
1638 offset: usize,
1639 _depth: fidl::encoding::Depth,
1640 ) -> fidl::Result<()> {
1641 encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
1642 fidl::encoding::Encode::<VolumeManagerSetPartitionLimitRequest, D>::encode(
1644 (
1645 <fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
1646 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slice_count),
1647 ),
1648 encoder, offset, _depth
1649 )
1650 }
1651 }
1652 unsafe impl<
1653 D: fidl::encoding::ResourceDialect,
1654 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
1655 T1: fidl::encoding::Encode<u64, D>,
1656 > fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, D> for (T0, T1)
1657 {
1658 #[inline]
1659 unsafe fn encode(
1660 self,
1661 encoder: &mut fidl::encoding::Encoder<'_, D>,
1662 offset: usize,
1663 depth: fidl::encoding::Depth,
1664 ) -> fidl::Result<()> {
1665 encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
1666 self.0.encode(encoder, offset + 0, depth)?;
1670 self.1.encode(encoder, offset + 16, depth)?;
1671 Ok(())
1672 }
1673 }
1674
1675 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1676 for VolumeManagerSetPartitionLimitRequest
1677 {
1678 #[inline(always)]
1679 fn new_empty() -> Self {
1680 Self {
1681 guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
1682 slice_count: fidl::new_empty!(u64, D),
1683 }
1684 }
1685
1686 #[inline]
1687 unsafe fn decode(
1688 &mut self,
1689 decoder: &mut fidl::encoding::Decoder<'_, D>,
1690 offset: usize,
1691 _depth: fidl::encoding::Depth,
1692 ) -> fidl::Result<()> {
1693 decoder.debug_check_bounds::<Self>(offset);
1694 fidl::decode!(
1696 fidl_fuchsia_hardware_block_partition::Guid,
1697 D,
1698 &mut self.guid,
1699 decoder,
1700 offset + 0,
1701 _depth
1702 )?;
1703 fidl::decode!(u64, D, &mut self.slice_count, decoder, offset + 16, _depth)?;
1704 Ok(())
1705 }
1706 }
1707
1708 impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitResponse {
1709 type Borrowed<'a> = &'a Self;
1710 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1711 value
1712 }
1713 }
1714
1715 unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitResponse {
1716 type Owned = Self;
1717
1718 #[inline(always)]
1719 fn inline_align(_context: fidl::encoding::Context) -> usize {
1720 4
1721 }
1722
1723 #[inline(always)]
1724 fn inline_size(_context: fidl::encoding::Context) -> usize {
1725 4
1726 }
1727 #[inline(always)]
1728 fn encode_is_copy() -> bool {
1729 true
1730 }
1731
1732 #[inline(always)]
1733 fn decode_is_copy() -> bool {
1734 true
1735 }
1736 }
1737
1738 unsafe impl<D: fidl::encoding::ResourceDialect>
1739 fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse, D>
1740 for &VolumeManagerSetPartitionLimitResponse
1741 {
1742 #[inline]
1743 unsafe fn encode(
1744 self,
1745 encoder: &mut fidl::encoding::Encoder<'_, D>,
1746 offset: usize,
1747 _depth: fidl::encoding::Depth,
1748 ) -> fidl::Result<()> {
1749 encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
1750 unsafe {
1751 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1753 (buf_ptr as *mut VolumeManagerSetPartitionLimitResponse).write_unaligned(
1754 (self as *const VolumeManagerSetPartitionLimitResponse).read(),
1755 );
1756 }
1759 Ok(())
1760 }
1761 }
1762 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1763 fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse, D> for (T0,)
1764 {
1765 #[inline]
1766 unsafe fn encode(
1767 self,
1768 encoder: &mut fidl::encoding::Encoder<'_, D>,
1769 offset: usize,
1770 depth: fidl::encoding::Depth,
1771 ) -> fidl::Result<()> {
1772 encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
1773 self.0.encode(encoder, offset + 0, depth)?;
1777 Ok(())
1778 }
1779 }
1780
1781 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1782 for VolumeManagerSetPartitionLimitResponse
1783 {
1784 #[inline(always)]
1785 fn new_empty() -> Self {
1786 Self { status: fidl::new_empty!(i32, D) }
1787 }
1788
1789 #[inline]
1790 unsafe fn decode(
1791 &mut self,
1792 decoder: &mut fidl::encoding::Decoder<'_, D>,
1793 offset: usize,
1794 _depth: fidl::encoding::Depth,
1795 ) -> fidl::Result<()> {
1796 decoder.debug_check_bounds::<Self>(offset);
1797 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1798 unsafe {
1801 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1802 }
1803 Ok(())
1804 }
1805 }
1806
1807 impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionNameRequest {
1808 type Borrowed<'a> = &'a Self;
1809 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1810 value
1811 }
1812 }
1813
1814 unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionNameRequest {
1815 type Owned = Self;
1816
1817 #[inline(always)]
1818 fn inline_align(_context: fidl::encoding::Context) -> usize {
1819 8
1820 }
1821
1822 #[inline(always)]
1823 fn inline_size(_context: fidl::encoding::Context) -> usize {
1824 32
1825 }
1826 }
1827
1828 unsafe impl<D: fidl::encoding::ResourceDialect>
1829 fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, D>
1830 for &VolumeManagerSetPartitionNameRequest
1831 {
1832 #[inline]
1833 unsafe fn encode(
1834 self,
1835 encoder: &mut fidl::encoding::Encoder<'_, D>,
1836 offset: usize,
1837 _depth: fidl::encoding::Depth,
1838 ) -> fidl::Result<()> {
1839 encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
1840 fidl::encoding::Encode::<VolumeManagerSetPartitionNameRequest, D>::encode(
1842 (
1843 <fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
1844 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
1845 ),
1846 encoder, offset, _depth
1847 )
1848 }
1849 }
1850 unsafe impl<
1851 D: fidl::encoding::ResourceDialect,
1852 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
1853 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
1854 > fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, D> for (T0, T1)
1855 {
1856 #[inline]
1857 unsafe fn encode(
1858 self,
1859 encoder: &mut fidl::encoding::Encoder<'_, D>,
1860 offset: usize,
1861 depth: fidl::encoding::Depth,
1862 ) -> fidl::Result<()> {
1863 encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
1864 self.0.encode(encoder, offset + 0, depth)?;
1868 self.1.encode(encoder, offset + 16, depth)?;
1869 Ok(())
1870 }
1871 }
1872
1873 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1874 for VolumeManagerSetPartitionNameRequest
1875 {
1876 #[inline(always)]
1877 fn new_empty() -> Self {
1878 Self {
1879 guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
1880 name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
1881 }
1882 }
1883
1884 #[inline]
1885 unsafe fn decode(
1886 &mut self,
1887 decoder: &mut fidl::encoding::Decoder<'_, D>,
1888 offset: usize,
1889 _depth: fidl::encoding::Depth,
1890 ) -> fidl::Result<()> {
1891 decoder.debug_check_bounds::<Self>(offset);
1892 fidl::decode!(
1894 fidl_fuchsia_hardware_block_partition::Guid,
1895 D,
1896 &mut self.guid,
1897 decoder,
1898 offset + 0,
1899 _depth
1900 )?;
1901 fidl::decode!(
1902 fidl::encoding::BoundedString<128>,
1903 D,
1904 &mut self.name,
1905 decoder,
1906 offset + 16,
1907 _depth
1908 )?;
1909 Ok(())
1910 }
1911 }
1912
1913 impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesRequest {
1914 type Borrowed<'a> = &'a Self;
1915 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1916 value
1917 }
1918 }
1919
1920 unsafe impl fidl::encoding::TypeMarker for VolumeQuerySlicesRequest {
1921 type Owned = Self;
1922
1923 #[inline(always)]
1924 fn inline_align(_context: fidl::encoding::Context) -> usize {
1925 8
1926 }
1927
1928 #[inline(always)]
1929 fn inline_size(_context: fidl::encoding::Context) -> usize {
1930 16
1931 }
1932 }
1933
1934 unsafe impl<D: fidl::encoding::ResourceDialect>
1935 fidl::encoding::Encode<VolumeQuerySlicesRequest, D> for &VolumeQuerySlicesRequest
1936 {
1937 #[inline]
1938 unsafe fn encode(
1939 self,
1940 encoder: &mut fidl::encoding::Encoder<'_, D>,
1941 offset: usize,
1942 _depth: fidl::encoding::Depth,
1943 ) -> fidl::Result<()> {
1944 encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
1945 fidl::encoding::Encode::<VolumeQuerySlicesRequest, D>::encode(
1947 (<fidl::encoding::Vector<u64, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1948 &self.start_slices,
1949 ),),
1950 encoder,
1951 offset,
1952 _depth,
1953 )
1954 }
1955 }
1956 unsafe impl<
1957 D: fidl::encoding::ResourceDialect,
1958 T0: fidl::encoding::Encode<fidl::encoding::Vector<u64, 16>, D>,
1959 > fidl::encoding::Encode<VolumeQuerySlicesRequest, D> for (T0,)
1960 {
1961 #[inline]
1962 unsafe fn encode(
1963 self,
1964 encoder: &mut fidl::encoding::Encoder<'_, D>,
1965 offset: usize,
1966 depth: fidl::encoding::Depth,
1967 ) -> fidl::Result<()> {
1968 encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
1969 self.0.encode(encoder, offset + 0, depth)?;
1973 Ok(())
1974 }
1975 }
1976
1977 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1978 for VolumeQuerySlicesRequest
1979 {
1980 #[inline(always)]
1981 fn new_empty() -> Self {
1982 Self { start_slices: fidl::new_empty!(fidl::encoding::Vector<u64, 16>, D) }
1983 }
1984
1985 #[inline]
1986 unsafe fn decode(
1987 &mut self,
1988 decoder: &mut fidl::encoding::Decoder<'_, D>,
1989 offset: usize,
1990 _depth: fidl::encoding::Depth,
1991 ) -> fidl::Result<()> {
1992 decoder.debug_check_bounds::<Self>(offset);
1993 fidl::decode!(fidl::encoding::Vector<u64, 16>, D, &mut self.start_slices, decoder, offset + 0, _depth)?;
1995 Ok(())
1996 }
1997 }
1998
1999 impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesResponse {
2000 type Borrowed<'a> = &'a Self;
2001 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2002 value
2003 }
2004 }
2005
2006 unsafe impl fidl::encoding::TypeMarker for VolumeQuerySlicesResponse {
2007 type Owned = Self;
2008
2009 #[inline(always)]
2010 fn inline_align(_context: fidl::encoding::Context) -> usize {
2011 8
2012 }
2013
2014 #[inline(always)]
2015 fn inline_size(_context: fidl::encoding::Context) -> usize {
2016 272
2017 }
2018 }
2019
2020 unsafe impl<D: fidl::encoding::ResourceDialect>
2021 fidl::encoding::Encode<VolumeQuerySlicesResponse, D> for &VolumeQuerySlicesResponse
2022 {
2023 #[inline]
2024 unsafe fn encode(
2025 self,
2026 encoder: &mut fidl::encoding::Encoder<'_, D>,
2027 offset: usize,
2028 _depth: fidl::encoding::Depth,
2029 ) -> fidl::Result<()> {
2030 encoder.debug_check_bounds::<VolumeQuerySlicesResponse>(offset);
2031 fidl::encoding::Encode::<VolumeQuerySlicesResponse, D>::encode(
2033 (
2034 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
2035 <fidl::encoding::Array<VsliceRange, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.response),
2036 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.response_count),
2037 ),
2038 encoder, offset, _depth
2039 )
2040 }
2041 }
2042 unsafe impl<
2043 D: fidl::encoding::ResourceDialect,
2044 T0: fidl::encoding::Encode<i32, D>,
2045 T1: fidl::encoding::Encode<fidl::encoding::Array<VsliceRange, 16>, D>,
2046 T2: fidl::encoding::Encode<u64, D>,
2047 > fidl::encoding::Encode<VolumeQuerySlicesResponse, D> for (T0, T1, T2)
2048 {
2049 #[inline]
2050 unsafe fn encode(
2051 self,
2052 encoder: &mut fidl::encoding::Encoder<'_, D>,
2053 offset: usize,
2054 depth: fidl::encoding::Depth,
2055 ) -> fidl::Result<()> {
2056 encoder.debug_check_bounds::<VolumeQuerySlicesResponse>(offset);
2057 unsafe {
2060 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2061 (ptr as *mut u64).write_unaligned(0);
2062 }
2063 self.0.encode(encoder, offset + 0, depth)?;
2065 self.1.encode(encoder, offset + 8, depth)?;
2066 self.2.encode(encoder, offset + 264, depth)?;
2067 Ok(())
2068 }
2069 }
2070
2071 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2072 for VolumeQuerySlicesResponse
2073 {
2074 #[inline(always)]
2075 fn new_empty() -> Self {
2076 Self {
2077 status: fidl::new_empty!(i32, D),
2078 response: fidl::new_empty!(fidl::encoding::Array<VsliceRange, 16>, D),
2079 response_count: fidl::new_empty!(u64, D),
2080 }
2081 }
2082
2083 #[inline]
2084 unsafe fn decode(
2085 &mut self,
2086 decoder: &mut fidl::encoding::Decoder<'_, D>,
2087 offset: usize,
2088 _depth: fidl::encoding::Depth,
2089 ) -> fidl::Result<()> {
2090 decoder.debug_check_bounds::<Self>(offset);
2091 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2093 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2094 let mask = 0xffffffff00000000u64;
2095 let maskedval = padval & mask;
2096 if maskedval != 0 {
2097 return Err(fidl::Error::NonZeroPadding {
2098 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2099 });
2100 }
2101 fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
2102 fidl::decode!(fidl::encoding::Array<VsliceRange, 16>, D, &mut self.response, decoder, offset + 8, _depth)?;
2103 fidl::decode!(u64, D, &mut self.response_count, decoder, offset + 264, _depth)?;
2104 Ok(())
2105 }
2106 }
2107
2108 impl fidl::encoding::ValueTypeMarker for VolumeShrinkRequest {
2109 type Borrowed<'a> = &'a Self;
2110 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2111 value
2112 }
2113 }
2114
2115 unsafe impl fidl::encoding::TypeMarker for VolumeShrinkRequest {
2116 type Owned = Self;
2117
2118 #[inline(always)]
2119 fn inline_align(_context: fidl::encoding::Context) -> usize {
2120 8
2121 }
2122
2123 #[inline(always)]
2124 fn inline_size(_context: fidl::encoding::Context) -> usize {
2125 16
2126 }
2127 #[inline(always)]
2128 fn encode_is_copy() -> bool {
2129 true
2130 }
2131
2132 #[inline(always)]
2133 fn decode_is_copy() -> bool {
2134 true
2135 }
2136 }
2137
2138 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeShrinkRequest, D>
2139 for &VolumeShrinkRequest
2140 {
2141 #[inline]
2142 unsafe fn encode(
2143 self,
2144 encoder: &mut fidl::encoding::Encoder<'_, D>,
2145 offset: usize,
2146 _depth: fidl::encoding::Depth,
2147 ) -> fidl::Result<()> {
2148 encoder.debug_check_bounds::<VolumeShrinkRequest>(offset);
2149 unsafe {
2150 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2152 (buf_ptr as *mut VolumeShrinkRequest)
2153 .write_unaligned((self as *const VolumeShrinkRequest).read());
2154 }
2157 Ok(())
2158 }
2159 }
2160 unsafe impl<
2161 D: fidl::encoding::ResourceDialect,
2162 T0: fidl::encoding::Encode<u64, D>,
2163 T1: fidl::encoding::Encode<u64, D>,
2164 > fidl::encoding::Encode<VolumeShrinkRequest, D> for (T0, T1)
2165 {
2166 #[inline]
2167 unsafe fn encode(
2168 self,
2169 encoder: &mut fidl::encoding::Encoder<'_, D>,
2170 offset: usize,
2171 depth: fidl::encoding::Depth,
2172 ) -> fidl::Result<()> {
2173 encoder.debug_check_bounds::<VolumeShrinkRequest>(offset);
2174 self.0.encode(encoder, offset + 0, depth)?;
2178 self.1.encode(encoder, offset + 8, depth)?;
2179 Ok(())
2180 }
2181 }
2182
2183 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeShrinkRequest {
2184 #[inline(always)]
2185 fn new_empty() -> Self {
2186 Self { start_slice: fidl::new_empty!(u64, D), slice_count: fidl::new_empty!(u64, D) }
2187 }
2188
2189 #[inline]
2190 unsafe fn decode(
2191 &mut self,
2192 decoder: &mut fidl::encoding::Decoder<'_, D>,
2193 offset: usize,
2194 _depth: fidl::encoding::Depth,
2195 ) -> fidl::Result<()> {
2196 decoder.debug_check_bounds::<Self>(offset);
2197 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2198 unsafe {
2201 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2202 }
2203 Ok(())
2204 }
2205 }
2206
2207 impl fidl::encoding::ValueTypeMarker for VolumeShrinkResponse {
2208 type Borrowed<'a> = &'a Self;
2209 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2210 value
2211 }
2212 }
2213
2214 unsafe impl fidl::encoding::TypeMarker for VolumeShrinkResponse {
2215 type Owned = Self;
2216
2217 #[inline(always)]
2218 fn inline_align(_context: fidl::encoding::Context) -> usize {
2219 4
2220 }
2221
2222 #[inline(always)]
2223 fn inline_size(_context: fidl::encoding::Context) -> usize {
2224 4
2225 }
2226 #[inline(always)]
2227 fn encode_is_copy() -> bool {
2228 true
2229 }
2230
2231 #[inline(always)]
2232 fn decode_is_copy() -> bool {
2233 true
2234 }
2235 }
2236
2237 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VolumeShrinkResponse, D>
2238 for &VolumeShrinkResponse
2239 {
2240 #[inline]
2241 unsafe fn encode(
2242 self,
2243 encoder: &mut fidl::encoding::Encoder<'_, D>,
2244 offset: usize,
2245 _depth: fidl::encoding::Depth,
2246 ) -> fidl::Result<()> {
2247 encoder.debug_check_bounds::<VolumeShrinkResponse>(offset);
2248 unsafe {
2249 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2251 (buf_ptr as *mut VolumeShrinkResponse)
2252 .write_unaligned((self as *const VolumeShrinkResponse).read());
2253 }
2256 Ok(())
2257 }
2258 }
2259 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
2260 fidl::encoding::Encode<VolumeShrinkResponse, D> for (T0,)
2261 {
2262 #[inline]
2263 unsafe fn encode(
2264 self,
2265 encoder: &mut fidl::encoding::Encoder<'_, D>,
2266 offset: usize,
2267 depth: fidl::encoding::Depth,
2268 ) -> fidl::Result<()> {
2269 encoder.debug_check_bounds::<VolumeShrinkResponse>(offset);
2270 self.0.encode(encoder, offset + 0, depth)?;
2274 Ok(())
2275 }
2276 }
2277
2278 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeShrinkResponse {
2279 #[inline(always)]
2280 fn new_empty() -> Self {
2281 Self { status: fidl::new_empty!(i32, D) }
2282 }
2283
2284 #[inline]
2285 unsafe fn decode(
2286 &mut self,
2287 decoder: &mut fidl::encoding::Decoder<'_, D>,
2288 offset: usize,
2289 _depth: fidl::encoding::Depth,
2290 ) -> fidl::Result<()> {
2291 decoder.debug_check_bounds::<Self>(offset);
2292 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2293 unsafe {
2296 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2297 }
2298 Ok(())
2299 }
2300 }
2301
2302 impl fidl::encoding::ValueTypeMarker for VsliceRange {
2303 type Borrowed<'a> = &'a Self;
2304 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2305 value
2306 }
2307 }
2308
2309 unsafe impl fidl::encoding::TypeMarker for VsliceRange {
2310 type Owned = Self;
2311
2312 #[inline(always)]
2313 fn inline_align(_context: fidl::encoding::Context) -> usize {
2314 8
2315 }
2316
2317 #[inline(always)]
2318 fn inline_size(_context: fidl::encoding::Context) -> usize {
2319 16
2320 }
2321 }
2322
2323 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VsliceRange, D>
2324 for &VsliceRange
2325 {
2326 #[inline]
2327 unsafe fn encode(
2328 self,
2329 encoder: &mut fidl::encoding::Encoder<'_, D>,
2330 offset: usize,
2331 _depth: fidl::encoding::Depth,
2332 ) -> fidl::Result<()> {
2333 encoder.debug_check_bounds::<VsliceRange>(offset);
2334 fidl::encoding::Encode::<VsliceRange, D>::encode(
2336 (
2337 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allocated),
2338 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
2339 ),
2340 encoder,
2341 offset,
2342 _depth,
2343 )
2344 }
2345 }
2346 unsafe impl<
2347 D: fidl::encoding::ResourceDialect,
2348 T0: fidl::encoding::Encode<bool, D>,
2349 T1: fidl::encoding::Encode<u64, D>,
2350 > fidl::encoding::Encode<VsliceRange, D> for (T0, T1)
2351 {
2352 #[inline]
2353 unsafe fn encode(
2354 self,
2355 encoder: &mut fidl::encoding::Encoder<'_, D>,
2356 offset: usize,
2357 depth: fidl::encoding::Depth,
2358 ) -> fidl::Result<()> {
2359 encoder.debug_check_bounds::<VsliceRange>(offset);
2360 unsafe {
2363 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2364 (ptr as *mut u64).write_unaligned(0);
2365 }
2366 self.0.encode(encoder, offset + 0, depth)?;
2368 self.1.encode(encoder, offset + 8, depth)?;
2369 Ok(())
2370 }
2371 }
2372
2373 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VsliceRange {
2374 #[inline(always)]
2375 fn new_empty() -> Self {
2376 Self { allocated: fidl::new_empty!(bool, D), count: fidl::new_empty!(u64, D) }
2377 }
2378
2379 #[inline]
2380 unsafe fn decode(
2381 &mut self,
2382 decoder: &mut fidl::encoding::Decoder<'_, D>,
2383 offset: usize,
2384 _depth: fidl::encoding::Depth,
2385 ) -> fidl::Result<()> {
2386 decoder.debug_check_bounds::<Self>(offset);
2387 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2389 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2390 let mask = 0xffffffffffffff00u64;
2391 let maskedval = padval & mask;
2392 if maskedval != 0 {
2393 return Err(fidl::Error::NonZeroPadding {
2394 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2395 });
2396 }
2397 fidl::decode!(bool, D, &mut self.allocated, decoder, offset + 0, _depth)?;
2398 fidl::decode!(u64, D, &mut self.count, decoder, offset + 8, _depth)?;
2399 Ok(())
2400 }
2401 }
2402}