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 FORMAT_MODIFIER_ARM_AFBC_16_X16: u64 = 576460752303423489;
12
13pub const FORMAT_MODIFIER_ARM_AFBC_16_X16_SPLIT_BLOCK_SPARSE_YUV: u64 = 576460752303423601;
14
15pub const FORMAT_MODIFIER_ARM_AFBC_16_X16_SPLIT_BLOCK_SPARSE_YUV_TE: u64 = 576460752303427697;
16
17pub const FORMAT_MODIFIER_ARM_AFBC_16_X16_SPLIT_BLOCK_SPARSE_YUV_TE_TILED_HEADER: u64 =
18 576460752303435889;
19
20pub const FORMAT_MODIFIER_ARM_AFBC_16_X16_SPLIT_BLOCK_SPARSE_YUV_TILED_HEADER: u64 =
21 576460752303431793;
22
23pub const FORMAT_MODIFIER_ARM_AFBC_16_X16_TE: u64 = 576460752303427585;
24
25pub const FORMAT_MODIFIER_ARM_AFBC_16_X16_YUV_TILED_HEADER: u64 = 576460752303431697;
26
27pub const FORMAT_MODIFIER_ARM_AFBC_32_X8: u64 = 576460752303423490;
28
29pub const FORMAT_MODIFIER_ARM_AFBC_32_X8_TE: u64 = 576460752303427586;
30
31pub const FORMAT_MODIFIER_ARM_BCH_BIT: u64 = 2048;
32
33pub const FORMAT_MODIFIER_ARM_LINEAR_TE: u64 = 576460752303427584;
34
35pub const FORMAT_MODIFIER_ARM_SPARSE_BIT: u64 = 64;
36
37pub const FORMAT_MODIFIER_ARM_SPLIT_BLOCK_BIT: u64 = 32;
38
39pub const FORMAT_MODIFIER_ARM_TE_BIT: u64 = 4096;
40
41pub const FORMAT_MODIFIER_ARM_TILED_HEADER_BIT: u64 = 8192;
42
43pub const FORMAT_MODIFIER_ARM_YUV_BIT: u64 = 16;
44
45pub const FORMAT_MODIFIER_GOOGLE_GOLDFISH_OPTIMAL: u64 = 648518346341351425;
46
47pub const FORMAT_MODIFIER_INTEL_CCS_BIT: u64 = 16777216;
48
49pub const FORMAT_MODIFIER_INTEL_I915_X_TILED: u64 = 72057594037927937;
50
51pub const FORMAT_MODIFIER_INTEL_I915_YF_TILED: u64 = 72057594037927939;
52
53pub const FORMAT_MODIFIER_INTEL_I915_YF_TILED_CCS: u64 = 72057594054705155;
54
55pub const FORMAT_MODIFIER_INTEL_I915_Y_TILED: u64 = 72057594037927938;
56
57pub const FORMAT_MODIFIER_INTEL_I915_Y_TILED_CCS: u64 = 72057594054705154;
58
59pub const FORMAT_MODIFIER_INVALID: u64 = FORMAT_MODIFIER_VALUE_RESERVED as u64;
60
61pub const FORMAT_MODIFIER_LINEAR: u64 = 0;
62
63pub const FORMAT_MODIFIER_NONE: u64 = 0;
64
65pub const FORMAT_MODIFIER_VALUE_RESERVED: u64 = 72057594037927935;
66
67pub const FORMAT_MODIFIER_VENDOR_AMD: u64 = 144115188075855872;
68
69pub const FORMAT_MODIFIER_VENDOR_ARM: u64 = 576460752303423488;
70
71pub const FORMAT_MODIFIER_VENDOR_BROADCOM: u64 = 504403158265495552;
72
73pub const FORMAT_MODIFIER_VENDOR_GOOGLE: u64 = 648518346341351424;
76
77pub const FORMAT_MODIFIER_VENDOR_INTEL: u64 = 72057594037927936;
78
79pub const FORMAT_MODIFIER_VENDOR_NONE: u64 = 0;
80
81pub const FORMAT_MODIFIER_VENDOR_NVIDIA: u64 = 216172782113783808;
82
83pub const FORMAT_MODIFIER_VENDOR_QCOM: u64 = 360287970189639680;
84
85pub const FORMAT_MODIFIER_VENDOR_SAMSUNG: u64 = 288230376151711744;
86
87pub const FORMAT_MODIFIER_VENDOR_VIVANTE: u64 = 432345564227567616;
88
89pub const MAX_COUNT_BUFFER_COLLECTION_CONSTRAINTS_IMAGE_FORMAT_CONSTRAINTS: u32 = 32;
90
91pub const MAX_COUNT_BUFFER_COLLECTION_INFO_BUFFERS: u32 = 64;
92
93pub const MAX_COUNT_BUFFER_MEMORY_CONSTRAINTS_HEAP_PERMITTED: u32 = 32;
94
95pub const MAX_COUNT_CREATE_CHILDREN: i32 = 64;
104
105pub const MAX_COUNT_DUPLICATES: u32 = 64;
106
107pub const MAX_COUNT_IMAGE_FORMAT_CONSTRAINTS_COLOR_SPACES: u32 = 32;
108
109pub const MAX_HEAPS_COUNT: u32 = 32;
110
111pub const MAX_RANGES_COUNT: u32 = 128;
112
113pub const VULKAN_BUFFER_USAGE_INDEX_BUFFER: u32 = 4194304;
114
115pub const VULKAN_BUFFER_USAGE_INDIRECT_BUFFER: u32 = 16777216;
116
117pub const VULKAN_BUFFER_USAGE_STORAGE_BUFFER: u32 = 2097152;
118
119pub const VULKAN_BUFFER_USAGE_STORAGE_TEXEL_BUFFER: u32 = 524288;
120
121pub const VULKAN_BUFFER_USAGE_TRANSFER_DST: u32 = 131072;
122
123pub const VULKAN_BUFFER_USAGE_TRANSFER_SRC: u32 = 65536;
124
125pub const VULKAN_BUFFER_USAGE_UNIFORM_BUFFER: u32 = 1048576;
126
127pub const VULKAN_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER: u32 = 262144;
128
129pub const VULKAN_BUFFER_USAGE_VERTEX_BUFFER: u32 = 8388608;
130
131pub const VULKAN_IMAGE_USAGE_COLOR_ATTACHMENT: u32 = 16;
132
133pub const VULKAN_IMAGE_USAGE_INPUT_ATTACHMENT: u32 = 128;
134
135pub const VULKAN_IMAGE_USAGE_SAMPLED: u32 = 4;
136
137pub const VULKAN_IMAGE_USAGE_STENCIL_ATTACHMENT: u32 = 32;
138
139pub const VULKAN_IMAGE_USAGE_STORAGE: u32 = 8;
140
141pub const VULKAN_IMAGE_USAGE_TRANSFER_DST: u32 = 2;
142
143pub const VULKAN_IMAGE_USAGE_TRANSFER_SRC: u32 = 1;
144
145pub const VULKAN_IMAGE_USAGE_TRANSIENT_ATTACHMENT: u32 = 64;
146
147pub const CPU_USAGE_READ: u32 = 1;
148
149pub const CPU_USAGE_READ_OFTEN: u32 = 2;
150
151pub const CPU_USAGE_WRITE: u32 = 4;
152
153pub const CPU_USAGE_WRITE_OFTEN: u32 = 8;
154
155pub const DISPLAY_USAGE_CURSOR: u32 = 2;
156
157pub const DISPLAY_USAGE_LAYER: u32 = 1;
158
159pub const NONE_USAGE: u32 = 1;
160
161pub const VIDEO_USAGE_CAPTURE: u32 = 8;
162
163pub const VIDEO_USAGE_DECRYPTOR_OUTPUT: u32 = 16;
164
165pub const VIDEO_USAGE_HW_DECODER: u32 = 1;
166
167pub const VIDEO_USAGE_HW_DECODER_INTERNAL: u32 = 32;
168
169pub const VIDEO_USAGE_HW_ENCODER: u32 = 2;
170
171pub const VIDEO_USAGE_HW_PROTECTED: u32 = 4;
172
173pub const VULKAN_USAGE_COLOR_ATTACHMENT: u32 = 16;
174
175pub const VULKAN_USAGE_INPUT_ATTACHMENT: u32 = 128;
176
177pub const VULKAN_USAGE_SAMPLED: u32 = 4;
178
179pub const VULKAN_USAGE_STENCIL_ATTACHMENT: u32 = 32;
180
181pub const VULKAN_USAGE_STORAGE: u32 = 8;
182
183pub const VULKAN_USAGE_TRANSFER_DST: u32 = 2;
184
185pub const VULKAN_USAGE_TRANSFER_SRC: u32 = 1;
186
187pub const VULKAN_USAGE_TRANSIENT_ATTACHMENT: u32 = 64;
188
189#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
197#[repr(u32)]
198pub enum CoherencyDomain {
199 Cpu = 0,
200 Ram = 1,
201 Inaccessible = 2,
202}
203
204impl CoherencyDomain {
205 #[inline]
206 pub fn from_primitive(prim: u32) -> Option<Self> {
207 match prim {
208 0 => Some(Self::Cpu),
209 1 => Some(Self::Ram),
210 2 => Some(Self::Inaccessible),
211 _ => None,
212 }
213 }
214
215 #[inline]
216 pub const fn into_primitive(self) -> u32 {
217 self as u32
218 }
219
220 #[deprecated = "Strict enums should not use `is_unknown`"]
221 #[inline]
222 pub fn is_unknown(&self) -> bool {
223 false
224 }
225}
226
227#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
256#[repr(u32)]
257pub enum ColorSpaceType {
258 Invalid = 0,
260 Srgb = 1,
262 Rec601Ntsc = 2,
264 Rec601NtscFullRange = 3,
266 Rec601Pal = 4,
268 Rec601PalFullRange = 5,
270 Rec709 = 6,
272 Rec2020 = 7,
274 Rec2100 = 8,
276 PassThrough = 9,
280 DoNotCare = 4294967294,
283}
284
285impl ColorSpaceType {
286 #[inline]
287 pub fn from_primitive(prim: u32) -> Option<Self> {
288 match prim {
289 0 => Some(Self::Invalid),
290 1 => Some(Self::Srgb),
291 2 => Some(Self::Rec601Ntsc),
292 3 => Some(Self::Rec601NtscFullRange),
293 4 => Some(Self::Rec601Pal),
294 5 => Some(Self::Rec601PalFullRange),
295 6 => Some(Self::Rec709),
296 7 => Some(Self::Rec2020),
297 8 => Some(Self::Rec2100),
298 9 => Some(Self::PassThrough),
299 4294967294 => Some(Self::DoNotCare),
300 _ => None,
301 }
302 }
303
304 #[inline]
305 pub const fn into_primitive(self) -> u32 {
306 self as u32
307 }
308
309 #[deprecated = "Strict enums should not use `is_unknown`"]
310 #[inline]
311 pub fn is_unknown(&self) -> bool {
312 false
313 }
314}
315
316#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
322#[repr(u64)]
323pub enum HeapType {
324 SystemRam = 0,
325 AmlogicSecure = 1152921504606912512,
327 AmlogicSecureVdec = 1152921504606912513,
329 GoldfishDeviceLocal = 1152921504606978048,
331 GoldfishHostVisible = 1152921504606978049,
333 Framebuffer = 1152921504607043585,
338}
339
340impl HeapType {
341 #[inline]
342 pub fn from_primitive(prim: u64) -> Option<Self> {
343 match prim {
344 0 => Some(Self::SystemRam),
345 1152921504606912512 => Some(Self::AmlogicSecure),
346 1152921504606912513 => Some(Self::AmlogicSecureVdec),
347 1152921504606978048 => Some(Self::GoldfishDeviceLocal),
348 1152921504606978049 => Some(Self::GoldfishHostVisible),
349 1152921504607043585 => Some(Self::Framebuffer),
350 _ => None,
351 }
352 }
353
354 #[inline]
355 pub const fn into_primitive(self) -> u64 {
356 self as u64
357 }
358
359 #[deprecated = "Strict enums should not use `is_unknown`"]
360 #[inline]
361 pub fn is_unknown(&self) -> bool {
362 false
363 }
364}
365
366#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
376#[repr(u32)]
377pub enum PixelFormatType {
378 Invalid = 0,
379 R8G8B8A8 = 1,
382 Bgra32 = 101,
385 I420 = 102,
388 M420 = 103,
391 Nv12 = 104,
394 Yuy2 = 105,
397 Mjpeg = 106,
398 Yv12 = 107,
404 Bgr24 = 108,
407 Rgb565 = 109,
410 Rgb332 = 110,
413 Rgb2220 = 111,
416 L8 = 112,
419 R8 = 113,
422 R8G8 = 114,
425 A2R10G10B10 = 115,
428 A2B10G10R10 = 116,
431 DoNotCare = 4294967294,
435}
436
437impl PixelFormatType {
438 #[inline]
439 pub fn from_primitive(prim: u32) -> Option<Self> {
440 match prim {
441 0 => Some(Self::Invalid),
442 1 => Some(Self::R8G8B8A8),
443 101 => Some(Self::Bgra32),
444 102 => Some(Self::I420),
445 103 => Some(Self::M420),
446 104 => Some(Self::Nv12),
447 105 => Some(Self::Yuy2),
448 106 => Some(Self::Mjpeg),
449 107 => Some(Self::Yv12),
450 108 => Some(Self::Bgr24),
451 109 => Some(Self::Rgb565),
452 110 => Some(Self::Rgb332),
453 111 => Some(Self::Rgb2220),
454 112 => Some(Self::L8),
455 113 => Some(Self::R8),
456 114 => Some(Self::R8G8),
457 115 => Some(Self::A2R10G10B10),
458 116 => Some(Self::A2B10G10R10),
459 4294967294 => Some(Self::DoNotCare),
460 _ => None,
461 }
462 }
463
464 #[inline]
465 pub const fn into_primitive(self) -> u32 {
466 self as u32
467 }
468
469 #[deprecated = "Strict enums should not use `is_unknown`"]
470 #[inline]
471 pub fn is_unknown(&self) -> bool {
472 false
473 }
474}
475
476#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
477pub struct AllocatorSetDebugClientInfoRequest {
478 pub name: String,
479 pub id: u64,
480}
481
482impl fidl::Persistable for AllocatorSetDebugClientInfoRequest {}
483
484#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
485#[repr(C)]
486pub struct AllocatorValidateBufferCollectionTokenRequest {
487 pub token_server_koid: u64,
488}
489
490impl fidl::Persistable for AllocatorValidateBufferCollectionTokenRequest {}
491
492#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
493pub struct AllocatorValidateBufferCollectionTokenResponse {
494 pub is_known: bool,
495}
496
497impl fidl::Persistable for AllocatorValidateBufferCollectionTokenResponse {}
498
499#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
500#[repr(C)]
501pub struct BufferCollectionCheckBuffersAllocatedResponse {
502 pub status: i32,
503}
504
505impl fidl::Persistable for BufferCollectionCheckBuffersAllocatedResponse {}
506
507#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
513pub struct BufferCollectionConstraints {
514 pub usage: BufferUsage,
522 pub min_buffer_count_for_camping: u32,
538 pub min_buffer_count_for_dedicated_slack: u32,
555 pub min_buffer_count_for_shared_slack: u32,
571 pub min_buffer_count: u32,
578 pub max_buffer_count: u32,
580 pub has_buffer_memory_constraints: bool,
587 pub buffer_memory_constraints: BufferMemoryConstraints,
588 pub image_format_constraints_count: u32,
597 pub image_format_constraints: [ImageFormatConstraints; 32],
598}
599
600impl fidl::Persistable for BufferCollectionConstraints {}
601
602#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
603pub struct BufferCollectionConstraintsAuxBuffers {
604 pub need_clear_aux_buffers_for_secure: bool,
611 pub allow_clear_aux_buffers_for_secure: bool,
626}
627
628impl fidl::Persistable for BufferCollectionConstraintsAuxBuffers {}
629
630#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
631pub struct BufferCollectionSetConstraintsAuxBuffersRequest {
632 pub constraints: BufferCollectionConstraintsAuxBuffers,
633}
634
635impl fidl::Persistable for BufferCollectionSetConstraintsAuxBuffersRequest {}
636
637#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
638pub struct BufferCollectionSetConstraintsRequest {
639 pub has_constraints: bool,
640 pub constraints: BufferCollectionConstraints,
641}
642
643impl fidl::Persistable for BufferCollectionSetConstraintsRequest {}
644
645#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
646pub struct BufferCollectionTokenDuplicateSyncRequest {
647 pub rights_attenuation_masks: Vec<fidl::Rights>,
648}
649
650impl fidl::Persistable for BufferCollectionTokenDuplicateSyncRequest {}
651
652#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
653pub struct BufferCollectionTokenGroupCreateChildrenSyncRequest {
654 pub rights_attenuation_masks: Vec<fidl::Rights>,
655}
656
657impl fidl::Persistable for BufferCollectionTokenGroupCreateChildrenSyncRequest {}
658
659#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
664pub struct BufferFormat {
665 pub tag: u32,
669 pub image: ImageFormat,
670}
671
672impl fidl::Persistable for BufferFormat {}
673
674#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
676pub struct BufferMemoryConstraints {
677 pub min_size_bytes: u32,
678 pub max_size_bytes: u32,
680 pub physically_contiguous_required: bool,
681 pub secure_required: bool,
685 pub ram_domain_supported: bool,
693 pub cpu_domain_supported: bool,
694 pub inaccessible_domain_supported: bool,
695 pub heap_permitted_count: u32,
698 pub heap_permitted: [HeapType; 32],
699}
700
701impl fidl::Persistable for BufferMemoryConstraints {}
702
703#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
704pub struct BufferMemorySettings {
705 pub size_bytes: u32,
706 pub is_physically_contiguous: bool,
707 pub is_secure: bool,
708 pub coherency_domain: CoherencyDomain,
709 pub heap: HeapType,
712}
713
714impl fidl::Persistable for BufferMemorySettings {}
715
716#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
720#[repr(C)]
721pub struct BufferUsage {
722 pub none: u32,
723 pub cpu: u32,
724 pub vulkan: u32,
725 pub display: u32,
726 pub video: u32,
727}
728
729impl fidl::Persistable for BufferUsage {}
730
731#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
737pub struct ColorSpace {
738 pub type_: ColorSpaceType,
739}
740
741impl fidl::Persistable for ColorSpace {}
742
743#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
745#[repr(C)]
746pub struct FormatModifier {
747 pub value: u64,
753}
754
755impl fidl::Persistable for FormatModifier {}
756
757#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
761pub struct ImageFormat {
762 pub width: u32,
764 pub height: u32,
766 pub layers: u32,
769 pub pixel_format: PixelFormat,
771 pub color_space: ColorSpace,
773 pub planes: [ImagePlane; 4],
774}
775
776impl fidl::Persistable for ImageFormat {}
777
778#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
782pub struct ImageFormatConstraints {
783 pub pixel_format: PixelFormat,
790 pub color_spaces_count: u32,
793 pub color_space: [ColorSpace; 32],
794 pub min_coded_width: u32,
805 pub max_coded_width: u32,
810 pub min_coded_height: u32,
813 pub max_coded_height: u32,
818 pub min_bytes_per_row: u32,
820 pub max_bytes_per_row: u32,
823 pub max_coded_width_times_coded_height: u32,
828 pub layers: u32,
831 pub coded_width_divisor: u32,
834 pub coded_height_divisor: u32,
837 pub bytes_per_row_divisor: u32,
840 pub start_offset_divisor: u32,
843 pub display_width_divisor: u32,
846 pub display_height_divisor: u32,
849 pub required_min_coded_width: u32,
885 pub required_max_coded_width: u32,
886 pub required_min_coded_height: u32,
888 pub required_max_coded_height: u32,
889 pub required_min_bytes_per_row: u32,
891 pub required_max_bytes_per_row: u32,
892}
893
894impl fidl::Persistable for ImageFormatConstraints {}
895
896#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
900pub struct ImageFormat2 {
901 pub pixel_format: PixelFormat,
903 pub coded_width: u32,
906 pub coded_height: u32,
908 pub bytes_per_row: u32,
912 pub display_width: u32,
915 pub display_height: u32,
918 pub layers: u32,
920 pub color_space: ColorSpace,
922 pub has_pixel_aspect_ratio: bool,
934 pub pixel_aspect_ratio_width: u32,
935 pub pixel_aspect_ratio_height: u32,
936}
937
938impl fidl::Persistable for ImageFormat2 {}
939
940#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
943#[repr(C)]
944pub struct ImagePlane {
945 pub byte_offset: u32,
947 pub bytes_per_row: u32,
950}
951
952impl fidl::Persistable for ImagePlane {}
953
954#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
956pub struct ImageSpec {
957 pub min_width: u32,
959 pub min_height: u32,
961 pub layers: u32,
964 pub pixel_format: PixelFormat,
966 pub color_space: ColorSpace,
968}
969
970impl fidl::Persistable for ImageSpec {}
971
972#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
973pub struct NodeSetDebugClientInfoRequest {
974 pub name: String,
975 pub id: u64,
976}
977
978impl fidl::Persistable for NodeSetDebugClientInfoRequest {}
979
980#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
981#[repr(C)]
982pub struct NodeSetDebugTimeoutLogDeadlineRequest {
983 pub deadline: i64,
984}
985
986impl fidl::Persistable for NodeSetDebugTimeoutLogDeadlineRequest {}
987
988#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
989pub struct NodeSetNameRequest {
990 pub priority: u32,
991 pub name: String,
992}
993
994impl fidl::Persistable for NodeSetNameRequest {}
995
996#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
997pub struct NodeIsAlternateForResponse {
998 pub is_alternate: bool,
999}
1000
1001impl fidl::Persistable for NodeIsAlternateForResponse {}
1002
1003#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1009pub struct PixelFormat {
1010 pub type_: PixelFormatType,
1011 pub has_format_modifier: bool,
1014 pub format_modifier: FormatModifier,
1015}
1016
1017impl fidl::Persistable for PixelFormat {}
1018
1019#[derive(Clone, Debug, PartialEq)]
1020pub struct SecureMemAddSecureHeapPhysicalRangeRequest {
1021 pub heap_range: SecureHeapAndRange,
1022}
1023
1024impl fidl::Persistable for SecureMemAddSecureHeapPhysicalRangeRequest {}
1025
1026#[derive(Clone, Debug, PartialEq)]
1027pub struct SecureMemDeleteSecureHeapPhysicalRangeRequest {
1028 pub heap_range: SecureHeapAndRange,
1029}
1030
1031impl fidl::Persistable for SecureMemDeleteSecureHeapPhysicalRangeRequest {}
1032
1033#[derive(Clone, Debug, PartialEq)]
1034pub struct SecureMemGetPhysicalSecureHeapPropertiesRequest {
1035 pub entire_heap: SecureHeapAndRange,
1036}
1037
1038impl fidl::Persistable for SecureMemGetPhysicalSecureHeapPropertiesRequest {}
1039
1040#[derive(Clone, Debug, PartialEq)]
1041pub struct SecureMemModifySecureHeapPhysicalRangeRequest {
1042 pub range_modification: SecureHeapAndRangeModification,
1043}
1044
1045impl fidl::Persistable for SecureMemModifySecureHeapPhysicalRangeRequest {}
1046
1047#[derive(Clone, Debug, PartialEq)]
1048pub struct SecureMemZeroSubRangeRequest {
1049 pub is_covering_range_explicit: bool,
1050 pub heap_range: SecureHeapAndRange,
1051}
1052
1053impl fidl::Persistable for SecureMemZeroSubRangeRequest {}
1054
1055#[derive(Clone, Debug, PartialEq)]
1056pub struct SecureMemGetPhysicalSecureHeapPropertiesResponse {
1057 pub properties: SecureHeapProperties,
1058}
1059
1060impl fidl::Persistable for SecureMemGetPhysicalSecureHeapPropertiesResponse {}
1061
1062#[derive(Clone, Debug, PartialEq)]
1063pub struct SecureMemGetPhysicalSecureHeapsResponse {
1064 pub heaps: SecureHeapsAndRanges,
1065}
1066
1067impl fidl::Persistable for SecureMemGetPhysicalSecureHeapsResponse {}
1068
1069#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1075pub struct SingleBufferSettings {
1076 pub buffer_settings: BufferMemorySettings,
1077 pub has_image_format_constraints: bool,
1084 pub image_format_constraints: ImageFormatConstraints,
1085}
1086
1087impl fidl::Persistable for SingleBufferSettings {}
1088
1089#[derive(Clone, Debug, Default, PartialEq)]
1090pub struct SecureHeapAndRange {
1091 pub heap: Option<HeapType>,
1092 pub range: Option<SecureHeapRange>,
1093 #[doc(hidden)]
1094 pub __source_breaking: fidl::marker::SourceBreaking,
1095}
1096
1097impl fidl::Persistable for SecureHeapAndRange {}
1098
1099#[derive(Clone, Debug, Default, PartialEq)]
1100pub struct SecureHeapAndRangeModification {
1101 pub heap: Option<HeapType>,
1102 pub old_range: Option<SecureHeapRange>,
1103 pub new_range: Option<SecureHeapRange>,
1104 #[doc(hidden)]
1105 pub __source_breaking: fidl::marker::SourceBreaking,
1106}
1107
1108impl fidl::Persistable for SecureHeapAndRangeModification {}
1109
1110#[derive(Clone, Debug, Default, PartialEq)]
1111pub struct SecureHeapAndRanges {
1112 pub heap: Option<HeapType>,
1114 pub ranges: Option<Vec<SecureHeapRange>>,
1119 #[doc(hidden)]
1120 pub __source_breaking: fidl::marker::SourceBreaking,
1121}
1122
1123impl fidl::Persistable for SecureHeapAndRanges {}
1124
1125#[derive(Clone, Debug, Default, PartialEq)]
1126pub struct SecureHeapProperties {
1127 pub heap: Option<HeapType>,
1129 pub dynamic_protection_ranges: Option<bool>,
1137 pub protected_range_granularity: Option<u32>,
1147 pub max_protected_range_count: Option<u64>,
1160 pub is_mod_protected_range_available: Option<bool>,
1166 #[doc(hidden)]
1167 pub __source_breaking: fidl::marker::SourceBreaking,
1168}
1169
1170impl fidl::Persistable for SecureHeapProperties {}
1171
1172#[derive(Clone, Debug, Default, PartialEq)]
1173pub struct SecureHeapRange {
1174 pub physical_address: Option<u64>,
1176 pub size_bytes: Option<u64>,
1178 #[doc(hidden)]
1179 pub __source_breaking: fidl::marker::SourceBreaking,
1180}
1181
1182impl fidl::Persistable for SecureHeapRange {}
1183
1184#[derive(Clone, Debug, Default, PartialEq)]
1185pub struct SecureHeapsAndRanges {
1186 pub heaps: Option<Vec<SecureHeapAndRanges>>,
1187 #[doc(hidden)]
1188 pub __source_breaking: fidl::marker::SourceBreaking,
1189}
1190
1191impl fidl::Persistable for SecureHeapsAndRanges {}
1192
1193mod internal {
1194 use super::*;
1195 unsafe impl fidl::encoding::TypeMarker for CoherencyDomain {
1196 type Owned = Self;
1197
1198 #[inline(always)]
1199 fn inline_align(_context: fidl::encoding::Context) -> usize {
1200 std::mem::align_of::<u32>()
1201 }
1202
1203 #[inline(always)]
1204 fn inline_size(_context: fidl::encoding::Context) -> usize {
1205 std::mem::size_of::<u32>()
1206 }
1207
1208 #[inline(always)]
1209 fn encode_is_copy() -> bool {
1210 true
1211 }
1212
1213 #[inline(always)]
1214 fn decode_is_copy() -> bool {
1215 false
1216 }
1217 }
1218
1219 impl fidl::encoding::ValueTypeMarker for CoherencyDomain {
1220 type Borrowed<'a> = Self;
1221 #[inline(always)]
1222 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1223 *value
1224 }
1225 }
1226
1227 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1228 for CoherencyDomain
1229 {
1230 #[inline]
1231 unsafe fn encode(
1232 self,
1233 encoder: &mut fidl::encoding::Encoder<'_, D>,
1234 offset: usize,
1235 _depth: fidl::encoding::Depth,
1236 ) -> fidl::Result<()> {
1237 encoder.debug_check_bounds::<Self>(offset);
1238 encoder.write_num(self.into_primitive(), offset);
1239 Ok(())
1240 }
1241 }
1242
1243 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CoherencyDomain {
1244 #[inline(always)]
1245 fn new_empty() -> Self {
1246 Self::Cpu
1247 }
1248
1249 #[inline]
1250 unsafe fn decode(
1251 &mut self,
1252 decoder: &mut fidl::encoding::Decoder<'_, D>,
1253 offset: usize,
1254 _depth: fidl::encoding::Depth,
1255 ) -> fidl::Result<()> {
1256 decoder.debug_check_bounds::<Self>(offset);
1257 let prim = decoder.read_num::<u32>(offset);
1258
1259 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1260 Ok(())
1261 }
1262 }
1263 unsafe impl fidl::encoding::TypeMarker for ColorSpaceType {
1264 type Owned = Self;
1265
1266 #[inline(always)]
1267 fn inline_align(_context: fidl::encoding::Context) -> usize {
1268 std::mem::align_of::<u32>()
1269 }
1270
1271 #[inline(always)]
1272 fn inline_size(_context: fidl::encoding::Context) -> usize {
1273 std::mem::size_of::<u32>()
1274 }
1275
1276 #[inline(always)]
1277 fn encode_is_copy() -> bool {
1278 true
1279 }
1280
1281 #[inline(always)]
1282 fn decode_is_copy() -> bool {
1283 false
1284 }
1285 }
1286
1287 impl fidl::encoding::ValueTypeMarker for ColorSpaceType {
1288 type Borrowed<'a> = Self;
1289 #[inline(always)]
1290 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1291 *value
1292 }
1293 }
1294
1295 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ColorSpaceType {
1296 #[inline]
1297 unsafe fn encode(
1298 self,
1299 encoder: &mut fidl::encoding::Encoder<'_, D>,
1300 offset: usize,
1301 _depth: fidl::encoding::Depth,
1302 ) -> fidl::Result<()> {
1303 encoder.debug_check_bounds::<Self>(offset);
1304 encoder.write_num(self.into_primitive(), offset);
1305 Ok(())
1306 }
1307 }
1308
1309 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorSpaceType {
1310 #[inline(always)]
1311 fn new_empty() -> Self {
1312 Self::Invalid
1313 }
1314
1315 #[inline]
1316 unsafe fn decode(
1317 &mut self,
1318 decoder: &mut fidl::encoding::Decoder<'_, D>,
1319 offset: usize,
1320 _depth: fidl::encoding::Depth,
1321 ) -> fidl::Result<()> {
1322 decoder.debug_check_bounds::<Self>(offset);
1323 let prim = decoder.read_num::<u32>(offset);
1324
1325 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1326 Ok(())
1327 }
1328 }
1329 unsafe impl fidl::encoding::TypeMarker for HeapType {
1330 type Owned = Self;
1331
1332 #[inline(always)]
1333 fn inline_align(_context: fidl::encoding::Context) -> usize {
1334 std::mem::align_of::<u64>()
1335 }
1336
1337 #[inline(always)]
1338 fn inline_size(_context: fidl::encoding::Context) -> usize {
1339 std::mem::size_of::<u64>()
1340 }
1341
1342 #[inline(always)]
1343 fn encode_is_copy() -> bool {
1344 true
1345 }
1346
1347 #[inline(always)]
1348 fn decode_is_copy() -> bool {
1349 false
1350 }
1351 }
1352
1353 impl fidl::encoding::ValueTypeMarker for HeapType {
1354 type Borrowed<'a> = Self;
1355 #[inline(always)]
1356 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1357 *value
1358 }
1359 }
1360
1361 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for HeapType {
1362 #[inline]
1363 unsafe fn encode(
1364 self,
1365 encoder: &mut fidl::encoding::Encoder<'_, D>,
1366 offset: usize,
1367 _depth: fidl::encoding::Depth,
1368 ) -> fidl::Result<()> {
1369 encoder.debug_check_bounds::<Self>(offset);
1370 encoder.write_num(self.into_primitive(), offset);
1371 Ok(())
1372 }
1373 }
1374
1375 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HeapType {
1376 #[inline(always)]
1377 fn new_empty() -> Self {
1378 Self::SystemRam
1379 }
1380
1381 #[inline]
1382 unsafe fn decode(
1383 &mut self,
1384 decoder: &mut fidl::encoding::Decoder<'_, D>,
1385 offset: usize,
1386 _depth: fidl::encoding::Depth,
1387 ) -> fidl::Result<()> {
1388 decoder.debug_check_bounds::<Self>(offset);
1389 let prim = decoder.read_num::<u64>(offset);
1390
1391 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1392 Ok(())
1393 }
1394 }
1395 unsafe impl fidl::encoding::TypeMarker for PixelFormatType {
1396 type Owned = Self;
1397
1398 #[inline(always)]
1399 fn inline_align(_context: fidl::encoding::Context) -> usize {
1400 std::mem::align_of::<u32>()
1401 }
1402
1403 #[inline(always)]
1404 fn inline_size(_context: fidl::encoding::Context) -> usize {
1405 std::mem::size_of::<u32>()
1406 }
1407
1408 #[inline(always)]
1409 fn encode_is_copy() -> bool {
1410 true
1411 }
1412
1413 #[inline(always)]
1414 fn decode_is_copy() -> bool {
1415 false
1416 }
1417 }
1418
1419 impl fidl::encoding::ValueTypeMarker for PixelFormatType {
1420 type Borrowed<'a> = Self;
1421 #[inline(always)]
1422 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1423 *value
1424 }
1425 }
1426
1427 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1428 for PixelFormatType
1429 {
1430 #[inline]
1431 unsafe fn encode(
1432 self,
1433 encoder: &mut fidl::encoding::Encoder<'_, D>,
1434 offset: usize,
1435 _depth: fidl::encoding::Depth,
1436 ) -> fidl::Result<()> {
1437 encoder.debug_check_bounds::<Self>(offset);
1438 encoder.write_num(self.into_primitive(), offset);
1439 Ok(())
1440 }
1441 }
1442
1443 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PixelFormatType {
1444 #[inline(always)]
1445 fn new_empty() -> Self {
1446 Self::Invalid
1447 }
1448
1449 #[inline]
1450 unsafe fn decode(
1451 &mut self,
1452 decoder: &mut fidl::encoding::Decoder<'_, D>,
1453 offset: usize,
1454 _depth: fidl::encoding::Depth,
1455 ) -> fidl::Result<()> {
1456 decoder.debug_check_bounds::<Self>(offset);
1457 let prim = decoder.read_num::<u32>(offset);
1458
1459 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1460 Ok(())
1461 }
1462 }
1463
1464 impl fidl::encoding::ValueTypeMarker for AllocatorSetDebugClientInfoRequest {
1465 type Borrowed<'a> = &'a Self;
1466 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1467 value
1468 }
1469 }
1470
1471 unsafe impl fidl::encoding::TypeMarker for AllocatorSetDebugClientInfoRequest {
1472 type Owned = Self;
1473
1474 #[inline(always)]
1475 fn inline_align(_context: fidl::encoding::Context) -> usize {
1476 8
1477 }
1478
1479 #[inline(always)]
1480 fn inline_size(_context: fidl::encoding::Context) -> usize {
1481 24
1482 }
1483 }
1484
1485 unsafe impl<D: fidl::encoding::ResourceDialect>
1486 fidl::encoding::Encode<AllocatorSetDebugClientInfoRequest, D>
1487 for &AllocatorSetDebugClientInfoRequest
1488 {
1489 #[inline]
1490 unsafe fn encode(
1491 self,
1492 encoder: &mut fidl::encoding::Encoder<'_, D>,
1493 offset: usize,
1494 _depth: fidl::encoding::Depth,
1495 ) -> fidl::Result<()> {
1496 encoder.debug_check_bounds::<AllocatorSetDebugClientInfoRequest>(offset);
1497 fidl::encoding::Encode::<AllocatorSetDebugClientInfoRequest, D>::encode(
1499 (
1500 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1501 &self.name,
1502 ),
1503 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
1504 ),
1505 encoder,
1506 offset,
1507 _depth,
1508 )
1509 }
1510 }
1511 unsafe impl<
1512 D: fidl::encoding::ResourceDialect,
1513 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1514 T1: fidl::encoding::Encode<u64, D>,
1515 > fidl::encoding::Encode<AllocatorSetDebugClientInfoRequest, D> for (T0, T1)
1516 {
1517 #[inline]
1518 unsafe fn encode(
1519 self,
1520 encoder: &mut fidl::encoding::Encoder<'_, D>,
1521 offset: usize,
1522 depth: fidl::encoding::Depth,
1523 ) -> fidl::Result<()> {
1524 encoder.debug_check_bounds::<AllocatorSetDebugClientInfoRequest>(offset);
1525 self.0.encode(encoder, offset + 0, depth)?;
1529 self.1.encode(encoder, offset + 16, depth)?;
1530 Ok(())
1531 }
1532 }
1533
1534 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1535 for AllocatorSetDebugClientInfoRequest
1536 {
1537 #[inline(always)]
1538 fn new_empty() -> Self {
1539 Self {
1540 name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
1541 id: fidl::new_empty!(u64, D),
1542 }
1543 }
1544
1545 #[inline]
1546 unsafe fn decode(
1547 &mut self,
1548 decoder: &mut fidl::encoding::Decoder<'_, D>,
1549 offset: usize,
1550 _depth: fidl::encoding::Depth,
1551 ) -> fidl::Result<()> {
1552 decoder.debug_check_bounds::<Self>(offset);
1553 fidl::decode!(
1555 fidl::encoding::BoundedString<64>,
1556 D,
1557 &mut self.name,
1558 decoder,
1559 offset + 0,
1560 _depth
1561 )?;
1562 fidl::decode!(u64, D, &mut self.id, decoder, offset + 16, _depth)?;
1563 Ok(())
1564 }
1565 }
1566
1567 impl fidl::encoding::ValueTypeMarker for AllocatorValidateBufferCollectionTokenRequest {
1568 type Borrowed<'a> = &'a Self;
1569 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1570 value
1571 }
1572 }
1573
1574 unsafe impl fidl::encoding::TypeMarker for AllocatorValidateBufferCollectionTokenRequest {
1575 type Owned = Self;
1576
1577 #[inline(always)]
1578 fn inline_align(_context: fidl::encoding::Context) -> usize {
1579 8
1580 }
1581
1582 #[inline(always)]
1583 fn inline_size(_context: fidl::encoding::Context) -> usize {
1584 8
1585 }
1586 #[inline(always)]
1587 fn encode_is_copy() -> bool {
1588 true
1589 }
1590
1591 #[inline(always)]
1592 fn decode_is_copy() -> bool {
1593 true
1594 }
1595 }
1596
1597 unsafe impl<D: fidl::encoding::ResourceDialect>
1598 fidl::encoding::Encode<AllocatorValidateBufferCollectionTokenRequest, D>
1599 for &AllocatorValidateBufferCollectionTokenRequest
1600 {
1601 #[inline]
1602 unsafe fn encode(
1603 self,
1604 encoder: &mut fidl::encoding::Encoder<'_, D>,
1605 offset: usize,
1606 _depth: fidl::encoding::Depth,
1607 ) -> fidl::Result<()> {
1608 encoder.debug_check_bounds::<AllocatorValidateBufferCollectionTokenRequest>(offset);
1609 unsafe {
1610 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1612 (buf_ptr as *mut AllocatorValidateBufferCollectionTokenRequest).write_unaligned(
1613 (self as *const AllocatorValidateBufferCollectionTokenRequest).read(),
1614 );
1615 }
1618 Ok(())
1619 }
1620 }
1621 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
1622 fidl::encoding::Encode<AllocatorValidateBufferCollectionTokenRequest, D> for (T0,)
1623 {
1624 #[inline]
1625 unsafe fn encode(
1626 self,
1627 encoder: &mut fidl::encoding::Encoder<'_, D>,
1628 offset: usize,
1629 depth: fidl::encoding::Depth,
1630 ) -> fidl::Result<()> {
1631 encoder.debug_check_bounds::<AllocatorValidateBufferCollectionTokenRequest>(offset);
1632 self.0.encode(encoder, offset + 0, depth)?;
1636 Ok(())
1637 }
1638 }
1639
1640 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1641 for AllocatorValidateBufferCollectionTokenRequest
1642 {
1643 #[inline(always)]
1644 fn new_empty() -> Self {
1645 Self { token_server_koid: fidl::new_empty!(u64, D) }
1646 }
1647
1648 #[inline]
1649 unsafe fn decode(
1650 &mut self,
1651 decoder: &mut fidl::encoding::Decoder<'_, D>,
1652 offset: usize,
1653 _depth: fidl::encoding::Depth,
1654 ) -> fidl::Result<()> {
1655 decoder.debug_check_bounds::<Self>(offset);
1656 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1657 unsafe {
1660 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1661 }
1662 Ok(())
1663 }
1664 }
1665
1666 impl fidl::encoding::ValueTypeMarker for AllocatorValidateBufferCollectionTokenResponse {
1667 type Borrowed<'a> = &'a Self;
1668 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1669 value
1670 }
1671 }
1672
1673 unsafe impl fidl::encoding::TypeMarker for AllocatorValidateBufferCollectionTokenResponse {
1674 type Owned = Self;
1675
1676 #[inline(always)]
1677 fn inline_align(_context: fidl::encoding::Context) -> usize {
1678 1
1679 }
1680
1681 #[inline(always)]
1682 fn inline_size(_context: fidl::encoding::Context) -> usize {
1683 1
1684 }
1685 }
1686
1687 unsafe impl<D: fidl::encoding::ResourceDialect>
1688 fidl::encoding::Encode<AllocatorValidateBufferCollectionTokenResponse, D>
1689 for &AllocatorValidateBufferCollectionTokenResponse
1690 {
1691 #[inline]
1692 unsafe fn encode(
1693 self,
1694 encoder: &mut fidl::encoding::Encoder<'_, D>,
1695 offset: usize,
1696 _depth: fidl::encoding::Depth,
1697 ) -> fidl::Result<()> {
1698 encoder.debug_check_bounds::<AllocatorValidateBufferCollectionTokenResponse>(offset);
1699 fidl::encoding::Encode::<AllocatorValidateBufferCollectionTokenResponse, D>::encode(
1701 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_known),),
1702 encoder,
1703 offset,
1704 _depth,
1705 )
1706 }
1707 }
1708 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1709 fidl::encoding::Encode<AllocatorValidateBufferCollectionTokenResponse, D> for (T0,)
1710 {
1711 #[inline]
1712 unsafe fn encode(
1713 self,
1714 encoder: &mut fidl::encoding::Encoder<'_, D>,
1715 offset: usize,
1716 depth: fidl::encoding::Depth,
1717 ) -> fidl::Result<()> {
1718 encoder.debug_check_bounds::<AllocatorValidateBufferCollectionTokenResponse>(offset);
1719 self.0.encode(encoder, offset + 0, depth)?;
1723 Ok(())
1724 }
1725 }
1726
1727 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1728 for AllocatorValidateBufferCollectionTokenResponse
1729 {
1730 #[inline(always)]
1731 fn new_empty() -> Self {
1732 Self { is_known: fidl::new_empty!(bool, D) }
1733 }
1734
1735 #[inline]
1736 unsafe fn decode(
1737 &mut self,
1738 decoder: &mut fidl::encoding::Decoder<'_, D>,
1739 offset: usize,
1740 _depth: fidl::encoding::Depth,
1741 ) -> fidl::Result<()> {
1742 decoder.debug_check_bounds::<Self>(offset);
1743 fidl::decode!(bool, D, &mut self.is_known, decoder, offset + 0, _depth)?;
1745 Ok(())
1746 }
1747 }
1748
1749 impl fidl::encoding::ValueTypeMarker for BufferCollectionCheckBuffersAllocatedResponse {
1750 type Borrowed<'a> = &'a Self;
1751 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1752 value
1753 }
1754 }
1755
1756 unsafe impl fidl::encoding::TypeMarker for BufferCollectionCheckBuffersAllocatedResponse {
1757 type Owned = Self;
1758
1759 #[inline(always)]
1760 fn inline_align(_context: fidl::encoding::Context) -> usize {
1761 4
1762 }
1763
1764 #[inline(always)]
1765 fn inline_size(_context: fidl::encoding::Context) -> usize {
1766 4
1767 }
1768 #[inline(always)]
1769 fn encode_is_copy() -> bool {
1770 true
1771 }
1772
1773 #[inline(always)]
1774 fn decode_is_copy() -> bool {
1775 true
1776 }
1777 }
1778
1779 unsafe impl<D: fidl::encoding::ResourceDialect>
1780 fidl::encoding::Encode<BufferCollectionCheckBuffersAllocatedResponse, D>
1781 for &BufferCollectionCheckBuffersAllocatedResponse
1782 {
1783 #[inline]
1784 unsafe fn encode(
1785 self,
1786 encoder: &mut fidl::encoding::Encoder<'_, D>,
1787 offset: usize,
1788 _depth: fidl::encoding::Depth,
1789 ) -> fidl::Result<()> {
1790 encoder.debug_check_bounds::<BufferCollectionCheckBuffersAllocatedResponse>(offset);
1791 unsafe {
1792 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1794 (buf_ptr as *mut BufferCollectionCheckBuffersAllocatedResponse).write_unaligned(
1795 (self as *const BufferCollectionCheckBuffersAllocatedResponse).read(),
1796 );
1797 }
1800 Ok(())
1801 }
1802 }
1803 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1804 fidl::encoding::Encode<BufferCollectionCheckBuffersAllocatedResponse, D> for (T0,)
1805 {
1806 #[inline]
1807 unsafe fn encode(
1808 self,
1809 encoder: &mut fidl::encoding::Encoder<'_, D>,
1810 offset: usize,
1811 depth: fidl::encoding::Depth,
1812 ) -> fidl::Result<()> {
1813 encoder.debug_check_bounds::<BufferCollectionCheckBuffersAllocatedResponse>(offset);
1814 self.0.encode(encoder, offset + 0, depth)?;
1818 Ok(())
1819 }
1820 }
1821
1822 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1823 for BufferCollectionCheckBuffersAllocatedResponse
1824 {
1825 #[inline(always)]
1826 fn new_empty() -> Self {
1827 Self { status: fidl::new_empty!(i32, D) }
1828 }
1829
1830 #[inline]
1831 unsafe fn decode(
1832 &mut self,
1833 decoder: &mut fidl::encoding::Decoder<'_, D>,
1834 offset: usize,
1835 _depth: fidl::encoding::Depth,
1836 ) -> fidl::Result<()> {
1837 decoder.debug_check_bounds::<Self>(offset);
1838 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1839 unsafe {
1842 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1843 }
1844 Ok(())
1845 }
1846 }
1847
1848 impl fidl::encoding::ValueTypeMarker for BufferCollectionConstraints {
1849 type Borrowed<'a> = &'a Self;
1850 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1851 value
1852 }
1853 }
1854
1855 unsafe impl fidl::encoding::TypeMarker for BufferCollectionConstraints {
1856 type Owned = Self;
1857
1858 #[inline(always)]
1859 fn inline_align(_context: fidl::encoding::Context) -> usize {
1860 8
1861 }
1862
1863 #[inline(always)]
1864 fn inline_size(_context: fidl::encoding::Context) -> usize {
1865 7760
1866 }
1867 }
1868
1869 unsafe impl<D: fidl::encoding::ResourceDialect>
1870 fidl::encoding::Encode<BufferCollectionConstraints, D> for &BufferCollectionConstraints
1871 {
1872 #[inline]
1873 unsafe fn encode(
1874 self,
1875 encoder: &mut fidl::encoding::Encoder<'_, D>,
1876 offset: usize,
1877 _depth: fidl::encoding::Depth,
1878 ) -> fidl::Result<()> {
1879 encoder.debug_check_bounds::<BufferCollectionConstraints>(offset);
1880 fidl::encoding::Encode::<BufferCollectionConstraints, D>::encode(
1882 (
1883 <BufferUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
1884 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_buffer_count_for_camping),
1885 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_buffer_count_for_dedicated_slack),
1886 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_buffer_count_for_shared_slack),
1887 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_buffer_count),
1888 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_buffer_count),
1889 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_buffer_memory_constraints),
1890 <BufferMemoryConstraints as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_memory_constraints),
1891 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.image_format_constraints_count),
1892 <fidl::encoding::Array<ImageFormatConstraints, 32> as fidl::encoding::ValueTypeMarker>::borrow(&self.image_format_constraints),
1893 ),
1894 encoder, offset, _depth
1895 )
1896 }
1897 }
1898 unsafe impl<
1899 D: fidl::encoding::ResourceDialect,
1900 T0: fidl::encoding::Encode<BufferUsage, D>,
1901 T1: fidl::encoding::Encode<u32, D>,
1902 T2: fidl::encoding::Encode<u32, D>,
1903 T3: fidl::encoding::Encode<u32, D>,
1904 T4: fidl::encoding::Encode<u32, D>,
1905 T5: fidl::encoding::Encode<u32, D>,
1906 T6: fidl::encoding::Encode<bool, D>,
1907 T7: fidl::encoding::Encode<BufferMemoryConstraints, D>,
1908 T8: fidl::encoding::Encode<u32, D>,
1909 T9: fidl::encoding::Encode<fidl::encoding::Array<ImageFormatConstraints, 32>, D>,
1910 > fidl::encoding::Encode<BufferCollectionConstraints, D>
1911 for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
1912 {
1913 #[inline]
1914 unsafe fn encode(
1915 self,
1916 encoder: &mut fidl::encoding::Encoder<'_, D>,
1917 offset: usize,
1918 depth: fidl::encoding::Depth,
1919 ) -> fidl::Result<()> {
1920 encoder.debug_check_bounds::<BufferCollectionConstraints>(offset);
1921 unsafe {
1924 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
1925 (ptr as *mut u64).write_unaligned(0);
1926 }
1927 unsafe {
1928 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(328);
1929 (ptr as *mut u64).write_unaligned(0);
1930 }
1931 self.0.encode(encoder, offset + 0, depth)?;
1933 self.1.encode(encoder, offset + 20, depth)?;
1934 self.2.encode(encoder, offset + 24, depth)?;
1935 self.3.encode(encoder, offset + 28, depth)?;
1936 self.4.encode(encoder, offset + 32, depth)?;
1937 self.5.encode(encoder, offset + 36, depth)?;
1938 self.6.encode(encoder, offset + 40, depth)?;
1939 self.7.encode(encoder, offset + 48, depth)?;
1940 self.8.encode(encoder, offset + 328, depth)?;
1941 self.9.encode(encoder, offset + 336, depth)?;
1942 Ok(())
1943 }
1944 }
1945
1946 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1947 for BufferCollectionConstraints
1948 {
1949 #[inline(always)]
1950 fn new_empty() -> Self {
1951 Self {
1952 usage: fidl::new_empty!(BufferUsage, D),
1953 min_buffer_count_for_camping: fidl::new_empty!(u32, D),
1954 min_buffer_count_for_dedicated_slack: fidl::new_empty!(u32, D),
1955 min_buffer_count_for_shared_slack: fidl::new_empty!(u32, D),
1956 min_buffer_count: fidl::new_empty!(u32, D),
1957 max_buffer_count: fidl::new_empty!(u32, D),
1958 has_buffer_memory_constraints: fidl::new_empty!(bool, D),
1959 buffer_memory_constraints: fidl::new_empty!(BufferMemoryConstraints, D),
1960 image_format_constraints_count: fidl::new_empty!(u32, D),
1961 image_format_constraints: fidl::new_empty!(fidl::encoding::Array<ImageFormatConstraints, 32>, D),
1962 }
1963 }
1964
1965 #[inline]
1966 unsafe fn decode(
1967 &mut self,
1968 decoder: &mut fidl::encoding::Decoder<'_, D>,
1969 offset: usize,
1970 _depth: fidl::encoding::Depth,
1971 ) -> fidl::Result<()> {
1972 decoder.debug_check_bounds::<Self>(offset);
1973 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
1975 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1976 let mask = 0xffffffffffffff00u64;
1977 let maskedval = padval & mask;
1978 if maskedval != 0 {
1979 return Err(fidl::Error::NonZeroPadding {
1980 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
1981 });
1982 }
1983 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(328) };
1984 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1985 let mask = 0xffffffff00000000u64;
1986 let maskedval = padval & mask;
1987 if maskedval != 0 {
1988 return Err(fidl::Error::NonZeroPadding {
1989 padding_start: offset + 328 + ((mask as u64).trailing_zeros() / 8) as usize,
1990 });
1991 }
1992 fidl::decode!(BufferUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
1993 fidl::decode!(
1994 u32,
1995 D,
1996 &mut self.min_buffer_count_for_camping,
1997 decoder,
1998 offset + 20,
1999 _depth
2000 )?;
2001 fidl::decode!(
2002 u32,
2003 D,
2004 &mut self.min_buffer_count_for_dedicated_slack,
2005 decoder,
2006 offset + 24,
2007 _depth
2008 )?;
2009 fidl::decode!(
2010 u32,
2011 D,
2012 &mut self.min_buffer_count_for_shared_slack,
2013 decoder,
2014 offset + 28,
2015 _depth
2016 )?;
2017 fidl::decode!(u32, D, &mut self.min_buffer_count, decoder, offset + 32, _depth)?;
2018 fidl::decode!(u32, D, &mut self.max_buffer_count, decoder, offset + 36, _depth)?;
2019 fidl::decode!(
2020 bool,
2021 D,
2022 &mut self.has_buffer_memory_constraints,
2023 decoder,
2024 offset + 40,
2025 _depth
2026 )?;
2027 fidl::decode!(
2028 BufferMemoryConstraints,
2029 D,
2030 &mut self.buffer_memory_constraints,
2031 decoder,
2032 offset + 48,
2033 _depth
2034 )?;
2035 fidl::decode!(
2036 u32,
2037 D,
2038 &mut self.image_format_constraints_count,
2039 decoder,
2040 offset + 328,
2041 _depth
2042 )?;
2043 fidl::decode!(fidl::encoding::Array<ImageFormatConstraints, 32>, D, &mut self.image_format_constraints, decoder, offset + 336, _depth)?;
2044 Ok(())
2045 }
2046 }
2047
2048 impl fidl::encoding::ValueTypeMarker for BufferCollectionConstraintsAuxBuffers {
2049 type Borrowed<'a> = &'a Self;
2050 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2051 value
2052 }
2053 }
2054
2055 unsafe impl fidl::encoding::TypeMarker for BufferCollectionConstraintsAuxBuffers {
2056 type Owned = Self;
2057
2058 #[inline(always)]
2059 fn inline_align(_context: fidl::encoding::Context) -> usize {
2060 1
2061 }
2062
2063 #[inline(always)]
2064 fn inline_size(_context: fidl::encoding::Context) -> usize {
2065 2
2066 }
2067 }
2068
2069 unsafe impl<D: fidl::encoding::ResourceDialect>
2070 fidl::encoding::Encode<BufferCollectionConstraintsAuxBuffers, D>
2071 for &BufferCollectionConstraintsAuxBuffers
2072 {
2073 #[inline]
2074 unsafe fn encode(
2075 self,
2076 encoder: &mut fidl::encoding::Encoder<'_, D>,
2077 offset: usize,
2078 _depth: fidl::encoding::Depth,
2079 ) -> fidl::Result<()> {
2080 encoder.debug_check_bounds::<BufferCollectionConstraintsAuxBuffers>(offset);
2081 fidl::encoding::Encode::<BufferCollectionConstraintsAuxBuffers, D>::encode(
2083 (
2084 <bool as fidl::encoding::ValueTypeMarker>::borrow(
2085 &self.need_clear_aux_buffers_for_secure,
2086 ),
2087 <bool as fidl::encoding::ValueTypeMarker>::borrow(
2088 &self.allow_clear_aux_buffers_for_secure,
2089 ),
2090 ),
2091 encoder,
2092 offset,
2093 _depth,
2094 )
2095 }
2096 }
2097 unsafe impl<
2098 D: fidl::encoding::ResourceDialect,
2099 T0: fidl::encoding::Encode<bool, D>,
2100 T1: fidl::encoding::Encode<bool, D>,
2101 > fidl::encoding::Encode<BufferCollectionConstraintsAuxBuffers, D> for (T0, T1)
2102 {
2103 #[inline]
2104 unsafe fn encode(
2105 self,
2106 encoder: &mut fidl::encoding::Encoder<'_, D>,
2107 offset: usize,
2108 depth: fidl::encoding::Depth,
2109 ) -> fidl::Result<()> {
2110 encoder.debug_check_bounds::<BufferCollectionConstraintsAuxBuffers>(offset);
2111 self.0.encode(encoder, offset + 0, depth)?;
2115 self.1.encode(encoder, offset + 1, depth)?;
2116 Ok(())
2117 }
2118 }
2119
2120 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2121 for BufferCollectionConstraintsAuxBuffers
2122 {
2123 #[inline(always)]
2124 fn new_empty() -> Self {
2125 Self {
2126 need_clear_aux_buffers_for_secure: fidl::new_empty!(bool, D),
2127 allow_clear_aux_buffers_for_secure: fidl::new_empty!(bool, D),
2128 }
2129 }
2130
2131 #[inline]
2132 unsafe fn decode(
2133 &mut self,
2134 decoder: &mut fidl::encoding::Decoder<'_, D>,
2135 offset: usize,
2136 _depth: fidl::encoding::Depth,
2137 ) -> fidl::Result<()> {
2138 decoder.debug_check_bounds::<Self>(offset);
2139 fidl::decode!(
2141 bool,
2142 D,
2143 &mut self.need_clear_aux_buffers_for_secure,
2144 decoder,
2145 offset + 0,
2146 _depth
2147 )?;
2148 fidl::decode!(
2149 bool,
2150 D,
2151 &mut self.allow_clear_aux_buffers_for_secure,
2152 decoder,
2153 offset + 1,
2154 _depth
2155 )?;
2156 Ok(())
2157 }
2158 }
2159
2160 impl fidl::encoding::ValueTypeMarker for BufferCollectionSetConstraintsAuxBuffersRequest {
2161 type Borrowed<'a> = &'a Self;
2162 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2163 value
2164 }
2165 }
2166
2167 unsafe impl fidl::encoding::TypeMarker for BufferCollectionSetConstraintsAuxBuffersRequest {
2168 type Owned = Self;
2169
2170 #[inline(always)]
2171 fn inline_align(_context: fidl::encoding::Context) -> usize {
2172 1
2173 }
2174
2175 #[inline(always)]
2176 fn inline_size(_context: fidl::encoding::Context) -> usize {
2177 2
2178 }
2179 }
2180
2181 unsafe impl<D: fidl::encoding::ResourceDialect>
2182 fidl::encoding::Encode<BufferCollectionSetConstraintsAuxBuffersRequest, D>
2183 for &BufferCollectionSetConstraintsAuxBuffersRequest
2184 {
2185 #[inline]
2186 unsafe fn encode(
2187 self,
2188 encoder: &mut fidl::encoding::Encoder<'_, D>,
2189 offset: usize,
2190 _depth: fidl::encoding::Depth,
2191 ) -> fidl::Result<()> {
2192 encoder.debug_check_bounds::<BufferCollectionSetConstraintsAuxBuffersRequest>(offset);
2193 fidl::encoding::Encode::<BufferCollectionSetConstraintsAuxBuffersRequest, D>::encode(
2195 (
2196 <BufferCollectionConstraintsAuxBuffers as fidl::encoding::ValueTypeMarker>::borrow(&self.constraints),
2197 ),
2198 encoder, offset, _depth
2199 )
2200 }
2201 }
2202 unsafe impl<
2203 D: fidl::encoding::ResourceDialect,
2204 T0: fidl::encoding::Encode<BufferCollectionConstraintsAuxBuffers, D>,
2205 > fidl::encoding::Encode<BufferCollectionSetConstraintsAuxBuffersRequest, D> for (T0,)
2206 {
2207 #[inline]
2208 unsafe fn encode(
2209 self,
2210 encoder: &mut fidl::encoding::Encoder<'_, D>,
2211 offset: usize,
2212 depth: fidl::encoding::Depth,
2213 ) -> fidl::Result<()> {
2214 encoder.debug_check_bounds::<BufferCollectionSetConstraintsAuxBuffersRequest>(offset);
2215 self.0.encode(encoder, offset + 0, depth)?;
2219 Ok(())
2220 }
2221 }
2222
2223 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2224 for BufferCollectionSetConstraintsAuxBuffersRequest
2225 {
2226 #[inline(always)]
2227 fn new_empty() -> Self {
2228 Self { constraints: fidl::new_empty!(BufferCollectionConstraintsAuxBuffers, D) }
2229 }
2230
2231 #[inline]
2232 unsafe fn decode(
2233 &mut self,
2234 decoder: &mut fidl::encoding::Decoder<'_, D>,
2235 offset: usize,
2236 _depth: fidl::encoding::Depth,
2237 ) -> fidl::Result<()> {
2238 decoder.debug_check_bounds::<Self>(offset);
2239 fidl::decode!(
2241 BufferCollectionConstraintsAuxBuffers,
2242 D,
2243 &mut self.constraints,
2244 decoder,
2245 offset + 0,
2246 _depth
2247 )?;
2248 Ok(())
2249 }
2250 }
2251
2252 impl fidl::encoding::ValueTypeMarker for BufferCollectionSetConstraintsRequest {
2253 type Borrowed<'a> = &'a Self;
2254 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2255 value
2256 }
2257 }
2258
2259 unsafe impl fidl::encoding::TypeMarker for BufferCollectionSetConstraintsRequest {
2260 type Owned = Self;
2261
2262 #[inline(always)]
2263 fn inline_align(_context: fidl::encoding::Context) -> usize {
2264 8
2265 }
2266
2267 #[inline(always)]
2268 fn inline_size(_context: fidl::encoding::Context) -> usize {
2269 7768
2270 }
2271 }
2272
2273 unsafe impl<D: fidl::encoding::ResourceDialect>
2274 fidl::encoding::Encode<BufferCollectionSetConstraintsRequest, D>
2275 for &BufferCollectionSetConstraintsRequest
2276 {
2277 #[inline]
2278 unsafe fn encode(
2279 self,
2280 encoder: &mut fidl::encoding::Encoder<'_, D>,
2281 offset: usize,
2282 _depth: fidl::encoding::Depth,
2283 ) -> fidl::Result<()> {
2284 encoder.debug_check_bounds::<BufferCollectionSetConstraintsRequest>(offset);
2285 fidl::encoding::Encode::<BufferCollectionSetConstraintsRequest, D>::encode(
2287 (
2288 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_constraints),
2289 <BufferCollectionConstraints as fidl::encoding::ValueTypeMarker>::borrow(
2290 &self.constraints,
2291 ),
2292 ),
2293 encoder,
2294 offset,
2295 _depth,
2296 )
2297 }
2298 }
2299 unsafe impl<
2300 D: fidl::encoding::ResourceDialect,
2301 T0: fidl::encoding::Encode<bool, D>,
2302 T1: fidl::encoding::Encode<BufferCollectionConstraints, D>,
2303 > fidl::encoding::Encode<BufferCollectionSetConstraintsRequest, D> for (T0, T1)
2304 {
2305 #[inline]
2306 unsafe fn encode(
2307 self,
2308 encoder: &mut fidl::encoding::Encoder<'_, D>,
2309 offset: usize,
2310 depth: fidl::encoding::Depth,
2311 ) -> fidl::Result<()> {
2312 encoder.debug_check_bounds::<BufferCollectionSetConstraintsRequest>(offset);
2313 unsafe {
2316 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2317 (ptr as *mut u64).write_unaligned(0);
2318 }
2319 self.0.encode(encoder, offset + 0, depth)?;
2321 self.1.encode(encoder, offset + 8, depth)?;
2322 Ok(())
2323 }
2324 }
2325
2326 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2327 for BufferCollectionSetConstraintsRequest
2328 {
2329 #[inline(always)]
2330 fn new_empty() -> Self {
2331 Self {
2332 has_constraints: fidl::new_empty!(bool, D),
2333 constraints: fidl::new_empty!(BufferCollectionConstraints, D),
2334 }
2335 }
2336
2337 #[inline]
2338 unsafe fn decode(
2339 &mut self,
2340 decoder: &mut fidl::encoding::Decoder<'_, D>,
2341 offset: usize,
2342 _depth: fidl::encoding::Depth,
2343 ) -> fidl::Result<()> {
2344 decoder.debug_check_bounds::<Self>(offset);
2345 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2347 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2348 let mask = 0xffffffffffffff00u64;
2349 let maskedval = padval & mask;
2350 if maskedval != 0 {
2351 return Err(fidl::Error::NonZeroPadding {
2352 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2353 });
2354 }
2355 fidl::decode!(bool, D, &mut self.has_constraints, decoder, offset + 0, _depth)?;
2356 fidl::decode!(
2357 BufferCollectionConstraints,
2358 D,
2359 &mut self.constraints,
2360 decoder,
2361 offset + 8,
2362 _depth
2363 )?;
2364 Ok(())
2365 }
2366 }
2367
2368 impl fidl::encoding::ValueTypeMarker for BufferCollectionTokenDuplicateSyncRequest {
2369 type Borrowed<'a> = &'a Self;
2370 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2371 value
2372 }
2373 }
2374
2375 unsafe impl fidl::encoding::TypeMarker for BufferCollectionTokenDuplicateSyncRequest {
2376 type Owned = Self;
2377
2378 #[inline(always)]
2379 fn inline_align(_context: fidl::encoding::Context) -> usize {
2380 8
2381 }
2382
2383 #[inline(always)]
2384 fn inline_size(_context: fidl::encoding::Context) -> usize {
2385 16
2386 }
2387 }
2388
2389 unsafe impl<D: fidl::encoding::ResourceDialect>
2390 fidl::encoding::Encode<BufferCollectionTokenDuplicateSyncRequest, D>
2391 for &BufferCollectionTokenDuplicateSyncRequest
2392 {
2393 #[inline]
2394 unsafe fn encode(
2395 self,
2396 encoder: &mut fidl::encoding::Encoder<'_, D>,
2397 offset: usize,
2398 _depth: fidl::encoding::Depth,
2399 ) -> fidl::Result<()> {
2400 encoder.debug_check_bounds::<BufferCollectionTokenDuplicateSyncRequest>(offset);
2401 fidl::encoding::Encode::<BufferCollectionTokenDuplicateSyncRequest, D>::encode(
2403 (
2404 <fidl::encoding::Vector<fidl::Rights, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.rights_attenuation_masks),
2405 ),
2406 encoder, offset, _depth
2407 )
2408 }
2409 }
2410 unsafe impl<
2411 D: fidl::encoding::ResourceDialect,
2412 T0: fidl::encoding::Encode<fidl::encoding::Vector<fidl::Rights, 64>, D>,
2413 > fidl::encoding::Encode<BufferCollectionTokenDuplicateSyncRequest, D> for (T0,)
2414 {
2415 #[inline]
2416 unsafe fn encode(
2417 self,
2418 encoder: &mut fidl::encoding::Encoder<'_, D>,
2419 offset: usize,
2420 depth: fidl::encoding::Depth,
2421 ) -> fidl::Result<()> {
2422 encoder.debug_check_bounds::<BufferCollectionTokenDuplicateSyncRequest>(offset);
2423 self.0.encode(encoder, offset + 0, depth)?;
2427 Ok(())
2428 }
2429 }
2430
2431 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2432 for BufferCollectionTokenDuplicateSyncRequest
2433 {
2434 #[inline(always)]
2435 fn new_empty() -> Self {
2436 Self {
2437 rights_attenuation_masks: fidl::new_empty!(fidl::encoding::Vector<fidl::Rights, 64>, D),
2438 }
2439 }
2440
2441 #[inline]
2442 unsafe fn decode(
2443 &mut self,
2444 decoder: &mut fidl::encoding::Decoder<'_, D>,
2445 offset: usize,
2446 _depth: fidl::encoding::Depth,
2447 ) -> fidl::Result<()> {
2448 decoder.debug_check_bounds::<Self>(offset);
2449 fidl::decode!(fidl::encoding::Vector<fidl::Rights, 64>, D, &mut self.rights_attenuation_masks, decoder, offset + 0, _depth)?;
2451 Ok(())
2452 }
2453 }
2454
2455 impl fidl::encoding::ValueTypeMarker for BufferCollectionTokenGroupCreateChildrenSyncRequest {
2456 type Borrowed<'a> = &'a Self;
2457 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2458 value
2459 }
2460 }
2461
2462 unsafe impl fidl::encoding::TypeMarker for BufferCollectionTokenGroupCreateChildrenSyncRequest {
2463 type Owned = Self;
2464
2465 #[inline(always)]
2466 fn inline_align(_context: fidl::encoding::Context) -> usize {
2467 8
2468 }
2469
2470 #[inline(always)]
2471 fn inline_size(_context: fidl::encoding::Context) -> usize {
2472 16
2473 }
2474 }
2475
2476 unsafe impl<D: fidl::encoding::ResourceDialect>
2477 fidl::encoding::Encode<BufferCollectionTokenGroupCreateChildrenSyncRequest, D>
2478 for &BufferCollectionTokenGroupCreateChildrenSyncRequest
2479 {
2480 #[inline]
2481 unsafe fn encode(
2482 self,
2483 encoder: &mut fidl::encoding::Encoder<'_, D>,
2484 offset: usize,
2485 _depth: fidl::encoding::Depth,
2486 ) -> fidl::Result<()> {
2487 encoder
2488 .debug_check_bounds::<BufferCollectionTokenGroupCreateChildrenSyncRequest>(offset);
2489 fidl::encoding::Encode::<BufferCollectionTokenGroupCreateChildrenSyncRequest, D>::encode(
2491 (
2492 <fidl::encoding::Vector<fidl::Rights, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.rights_attenuation_masks),
2493 ),
2494 encoder, offset, _depth
2495 )
2496 }
2497 }
2498 unsafe impl<
2499 D: fidl::encoding::ResourceDialect,
2500 T0: fidl::encoding::Encode<fidl::encoding::Vector<fidl::Rights, 64>, D>,
2501 > fidl::encoding::Encode<BufferCollectionTokenGroupCreateChildrenSyncRequest, D> for (T0,)
2502 {
2503 #[inline]
2504 unsafe fn encode(
2505 self,
2506 encoder: &mut fidl::encoding::Encoder<'_, D>,
2507 offset: usize,
2508 depth: fidl::encoding::Depth,
2509 ) -> fidl::Result<()> {
2510 encoder
2511 .debug_check_bounds::<BufferCollectionTokenGroupCreateChildrenSyncRequest>(offset);
2512 self.0.encode(encoder, offset + 0, depth)?;
2516 Ok(())
2517 }
2518 }
2519
2520 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2521 for BufferCollectionTokenGroupCreateChildrenSyncRequest
2522 {
2523 #[inline(always)]
2524 fn new_empty() -> Self {
2525 Self {
2526 rights_attenuation_masks: fidl::new_empty!(fidl::encoding::Vector<fidl::Rights, 64>, D),
2527 }
2528 }
2529
2530 #[inline]
2531 unsafe fn decode(
2532 &mut self,
2533 decoder: &mut fidl::encoding::Decoder<'_, D>,
2534 offset: usize,
2535 _depth: fidl::encoding::Depth,
2536 ) -> fidl::Result<()> {
2537 decoder.debug_check_bounds::<Self>(offset);
2538 fidl::decode!(fidl::encoding::Vector<fidl::Rights, 64>, D, &mut self.rights_attenuation_masks, decoder, offset + 0, _depth)?;
2540 Ok(())
2541 }
2542 }
2543
2544 impl fidl::encoding::ValueTypeMarker for BufferFormat {
2545 type Borrowed<'a> = &'a Self;
2546 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2547 value
2548 }
2549 }
2550
2551 unsafe impl fidl::encoding::TypeMarker for BufferFormat {
2552 type Owned = Self;
2553
2554 #[inline(always)]
2555 fn inline_align(_context: fidl::encoding::Context) -> usize {
2556 8
2557 }
2558
2559 #[inline(always)]
2560 fn inline_size(_context: fidl::encoding::Context) -> usize {
2561 80
2562 }
2563 }
2564
2565 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferFormat, D>
2566 for &BufferFormat
2567 {
2568 #[inline]
2569 unsafe fn encode(
2570 self,
2571 encoder: &mut fidl::encoding::Encoder<'_, D>,
2572 offset: usize,
2573 _depth: fidl::encoding::Depth,
2574 ) -> fidl::Result<()> {
2575 encoder.debug_check_bounds::<BufferFormat>(offset);
2576 fidl::encoding::Encode::<BufferFormat, D>::encode(
2578 (
2579 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tag),
2580 <ImageFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.image),
2581 ),
2582 encoder,
2583 offset,
2584 _depth,
2585 )
2586 }
2587 }
2588 unsafe impl<
2589 D: fidl::encoding::ResourceDialect,
2590 T0: fidl::encoding::Encode<u32, D>,
2591 T1: fidl::encoding::Encode<ImageFormat, D>,
2592 > fidl::encoding::Encode<BufferFormat, D> for (T0, T1)
2593 {
2594 #[inline]
2595 unsafe fn encode(
2596 self,
2597 encoder: &mut fidl::encoding::Encoder<'_, D>,
2598 offset: usize,
2599 depth: fidl::encoding::Depth,
2600 ) -> fidl::Result<()> {
2601 encoder.debug_check_bounds::<BufferFormat>(offset);
2602 unsafe {
2605 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2606 (ptr as *mut u64).write_unaligned(0);
2607 }
2608 self.0.encode(encoder, offset + 0, depth)?;
2610 self.1.encode(encoder, offset + 8, depth)?;
2611 Ok(())
2612 }
2613 }
2614
2615 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferFormat {
2616 #[inline(always)]
2617 fn new_empty() -> Self {
2618 Self { tag: fidl::new_empty!(u32, D), image: fidl::new_empty!(ImageFormat, D) }
2619 }
2620
2621 #[inline]
2622 unsafe fn decode(
2623 &mut self,
2624 decoder: &mut fidl::encoding::Decoder<'_, D>,
2625 offset: usize,
2626 _depth: fidl::encoding::Depth,
2627 ) -> fidl::Result<()> {
2628 decoder.debug_check_bounds::<Self>(offset);
2629 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2631 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2632 let mask = 0xffffffff00000000u64;
2633 let maskedval = padval & mask;
2634 if maskedval != 0 {
2635 return Err(fidl::Error::NonZeroPadding {
2636 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2637 });
2638 }
2639 fidl::decode!(u32, D, &mut self.tag, decoder, offset + 0, _depth)?;
2640 fidl::decode!(ImageFormat, D, &mut self.image, decoder, offset + 8, _depth)?;
2641 Ok(())
2642 }
2643 }
2644
2645 impl fidl::encoding::ValueTypeMarker for BufferMemoryConstraints {
2646 type Borrowed<'a> = &'a Self;
2647 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2648 value
2649 }
2650 }
2651
2652 unsafe impl fidl::encoding::TypeMarker for BufferMemoryConstraints {
2653 type Owned = Self;
2654
2655 #[inline(always)]
2656 fn inline_align(_context: fidl::encoding::Context) -> usize {
2657 8
2658 }
2659
2660 #[inline(always)]
2661 fn inline_size(_context: fidl::encoding::Context) -> usize {
2662 280
2663 }
2664 }
2665
2666 unsafe impl<D: fidl::encoding::ResourceDialect>
2667 fidl::encoding::Encode<BufferMemoryConstraints, D> for &BufferMemoryConstraints
2668 {
2669 #[inline]
2670 unsafe fn encode(
2671 self,
2672 encoder: &mut fidl::encoding::Encoder<'_, D>,
2673 offset: usize,
2674 _depth: fidl::encoding::Depth,
2675 ) -> fidl::Result<()> {
2676 encoder.debug_check_bounds::<BufferMemoryConstraints>(offset);
2677 fidl::encoding::Encode::<BufferMemoryConstraints, D>::encode(
2679 (
2680 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_size_bytes),
2681 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_size_bytes),
2682 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.physically_contiguous_required),
2683 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.secure_required),
2684 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.ram_domain_supported),
2685 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.cpu_domain_supported),
2686 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.inaccessible_domain_supported),
2687 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.heap_permitted_count),
2688 <fidl::encoding::Array<HeapType, 32> as fidl::encoding::ValueTypeMarker>::borrow(&self.heap_permitted),
2689 ),
2690 encoder, offset, _depth
2691 )
2692 }
2693 }
2694 unsafe impl<
2695 D: fidl::encoding::ResourceDialect,
2696 T0: fidl::encoding::Encode<u32, D>,
2697 T1: fidl::encoding::Encode<u32, D>,
2698 T2: fidl::encoding::Encode<bool, D>,
2699 T3: fidl::encoding::Encode<bool, D>,
2700 T4: fidl::encoding::Encode<bool, D>,
2701 T5: fidl::encoding::Encode<bool, D>,
2702 T6: fidl::encoding::Encode<bool, D>,
2703 T7: fidl::encoding::Encode<u32, D>,
2704 T8: fidl::encoding::Encode<fidl::encoding::Array<HeapType, 32>, D>,
2705 > fidl::encoding::Encode<BufferMemoryConstraints, D>
2706 for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
2707 {
2708 #[inline]
2709 unsafe fn encode(
2710 self,
2711 encoder: &mut fidl::encoding::Encoder<'_, D>,
2712 offset: usize,
2713 depth: fidl::encoding::Depth,
2714 ) -> fidl::Result<()> {
2715 encoder.debug_check_bounds::<BufferMemoryConstraints>(offset);
2716 unsafe {
2719 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2720 (ptr as *mut u64).write_unaligned(0);
2721 }
2722 unsafe {
2723 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2724 (ptr as *mut u64).write_unaligned(0);
2725 }
2726 self.0.encode(encoder, offset + 0, depth)?;
2728 self.1.encode(encoder, offset + 4, depth)?;
2729 self.2.encode(encoder, offset + 8, depth)?;
2730 self.3.encode(encoder, offset + 9, depth)?;
2731 self.4.encode(encoder, offset + 10, depth)?;
2732 self.5.encode(encoder, offset + 11, depth)?;
2733 self.6.encode(encoder, offset + 12, depth)?;
2734 self.7.encode(encoder, offset + 16, depth)?;
2735 self.8.encode(encoder, offset + 24, depth)?;
2736 Ok(())
2737 }
2738 }
2739
2740 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2741 for BufferMemoryConstraints
2742 {
2743 #[inline(always)]
2744 fn new_empty() -> Self {
2745 Self {
2746 min_size_bytes: fidl::new_empty!(u32, D),
2747 max_size_bytes: fidl::new_empty!(u32, D),
2748 physically_contiguous_required: fidl::new_empty!(bool, D),
2749 secure_required: fidl::new_empty!(bool, D),
2750 ram_domain_supported: fidl::new_empty!(bool, D),
2751 cpu_domain_supported: fidl::new_empty!(bool, D),
2752 inaccessible_domain_supported: fidl::new_empty!(bool, D),
2753 heap_permitted_count: fidl::new_empty!(u32, D),
2754 heap_permitted: fidl::new_empty!(fidl::encoding::Array<HeapType, 32>, D),
2755 }
2756 }
2757
2758 #[inline]
2759 unsafe fn decode(
2760 &mut self,
2761 decoder: &mut fidl::encoding::Decoder<'_, D>,
2762 offset: usize,
2763 _depth: fidl::encoding::Depth,
2764 ) -> fidl::Result<()> {
2765 decoder.debug_check_bounds::<Self>(offset);
2766 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2768 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2769 let mask = 0xffffff0000000000u64;
2770 let maskedval = padval & mask;
2771 if maskedval != 0 {
2772 return Err(fidl::Error::NonZeroPadding {
2773 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2774 });
2775 }
2776 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2777 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2778 let mask = 0xffffffff00000000u64;
2779 let maskedval = padval & mask;
2780 if maskedval != 0 {
2781 return Err(fidl::Error::NonZeroPadding {
2782 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2783 });
2784 }
2785 fidl::decode!(u32, D, &mut self.min_size_bytes, decoder, offset + 0, _depth)?;
2786 fidl::decode!(u32, D, &mut self.max_size_bytes, decoder, offset + 4, _depth)?;
2787 fidl::decode!(
2788 bool,
2789 D,
2790 &mut self.physically_contiguous_required,
2791 decoder,
2792 offset + 8,
2793 _depth
2794 )?;
2795 fidl::decode!(bool, D, &mut self.secure_required, decoder, offset + 9, _depth)?;
2796 fidl::decode!(bool, D, &mut self.ram_domain_supported, decoder, offset + 10, _depth)?;
2797 fidl::decode!(bool, D, &mut self.cpu_domain_supported, decoder, offset + 11, _depth)?;
2798 fidl::decode!(
2799 bool,
2800 D,
2801 &mut self.inaccessible_domain_supported,
2802 decoder,
2803 offset + 12,
2804 _depth
2805 )?;
2806 fidl::decode!(u32, D, &mut self.heap_permitted_count, decoder, offset + 16, _depth)?;
2807 fidl::decode!(fidl::encoding::Array<HeapType, 32>, D, &mut self.heap_permitted, decoder, offset + 24, _depth)?;
2808 Ok(())
2809 }
2810 }
2811
2812 impl fidl::encoding::ValueTypeMarker for BufferMemorySettings {
2813 type Borrowed<'a> = &'a Self;
2814 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2815 value
2816 }
2817 }
2818
2819 unsafe impl fidl::encoding::TypeMarker for BufferMemorySettings {
2820 type Owned = Self;
2821
2822 #[inline(always)]
2823 fn inline_align(_context: fidl::encoding::Context) -> usize {
2824 8
2825 }
2826
2827 #[inline(always)]
2828 fn inline_size(_context: fidl::encoding::Context) -> usize {
2829 24
2830 }
2831 }
2832
2833 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferMemorySettings, D>
2834 for &BufferMemorySettings
2835 {
2836 #[inline]
2837 unsafe fn encode(
2838 self,
2839 encoder: &mut fidl::encoding::Encoder<'_, D>,
2840 offset: usize,
2841 _depth: fidl::encoding::Depth,
2842 ) -> fidl::Result<()> {
2843 encoder.debug_check_bounds::<BufferMemorySettings>(offset);
2844 fidl::encoding::Encode::<BufferMemorySettings, D>::encode(
2846 (
2847 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.size_bytes),
2848 <bool as fidl::encoding::ValueTypeMarker>::borrow(
2849 &self.is_physically_contiguous,
2850 ),
2851 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_secure),
2852 <CoherencyDomain as fidl::encoding::ValueTypeMarker>::borrow(
2853 &self.coherency_domain,
2854 ),
2855 <HeapType as fidl::encoding::ValueTypeMarker>::borrow(&self.heap),
2856 ),
2857 encoder,
2858 offset,
2859 _depth,
2860 )
2861 }
2862 }
2863 unsafe impl<
2864 D: fidl::encoding::ResourceDialect,
2865 T0: fidl::encoding::Encode<u32, D>,
2866 T1: fidl::encoding::Encode<bool, D>,
2867 T2: fidl::encoding::Encode<bool, D>,
2868 T3: fidl::encoding::Encode<CoherencyDomain, D>,
2869 T4: fidl::encoding::Encode<HeapType, D>,
2870 > fidl::encoding::Encode<BufferMemorySettings, D> for (T0, T1, T2, T3, T4)
2871 {
2872 #[inline]
2873 unsafe fn encode(
2874 self,
2875 encoder: &mut fidl::encoding::Encoder<'_, D>,
2876 offset: usize,
2877 depth: fidl::encoding::Depth,
2878 ) -> fidl::Result<()> {
2879 encoder.debug_check_bounds::<BufferMemorySettings>(offset);
2880 unsafe {
2883 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2884 (ptr as *mut u64).write_unaligned(0);
2885 }
2886 unsafe {
2887 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2888 (ptr as *mut u64).write_unaligned(0);
2889 }
2890 self.0.encode(encoder, offset + 0, depth)?;
2892 self.1.encode(encoder, offset + 4, depth)?;
2893 self.2.encode(encoder, offset + 5, depth)?;
2894 self.3.encode(encoder, offset + 8, depth)?;
2895 self.4.encode(encoder, offset + 16, depth)?;
2896 Ok(())
2897 }
2898 }
2899
2900 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferMemorySettings {
2901 #[inline(always)]
2902 fn new_empty() -> Self {
2903 Self {
2904 size_bytes: fidl::new_empty!(u32, D),
2905 is_physically_contiguous: fidl::new_empty!(bool, D),
2906 is_secure: fidl::new_empty!(bool, D),
2907 coherency_domain: fidl::new_empty!(CoherencyDomain, D),
2908 heap: fidl::new_empty!(HeapType, D),
2909 }
2910 }
2911
2912 #[inline]
2913 unsafe fn decode(
2914 &mut self,
2915 decoder: &mut fidl::encoding::Decoder<'_, D>,
2916 offset: usize,
2917 _depth: fidl::encoding::Depth,
2918 ) -> fidl::Result<()> {
2919 decoder.debug_check_bounds::<Self>(offset);
2920 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2922 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2923 let mask = 0xffff000000000000u64;
2924 let maskedval = padval & mask;
2925 if maskedval != 0 {
2926 return Err(fidl::Error::NonZeroPadding {
2927 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2928 });
2929 }
2930 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2931 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2932 let mask = 0xffffffff00000000u64;
2933 let maskedval = padval & mask;
2934 if maskedval != 0 {
2935 return Err(fidl::Error::NonZeroPadding {
2936 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2937 });
2938 }
2939 fidl::decode!(u32, D, &mut self.size_bytes, decoder, offset + 0, _depth)?;
2940 fidl::decode!(
2941 bool,
2942 D,
2943 &mut self.is_physically_contiguous,
2944 decoder,
2945 offset + 4,
2946 _depth
2947 )?;
2948 fidl::decode!(bool, D, &mut self.is_secure, decoder, offset + 5, _depth)?;
2949 fidl::decode!(
2950 CoherencyDomain,
2951 D,
2952 &mut self.coherency_domain,
2953 decoder,
2954 offset + 8,
2955 _depth
2956 )?;
2957 fidl::decode!(HeapType, D, &mut self.heap, decoder, offset + 16, _depth)?;
2958 Ok(())
2959 }
2960 }
2961
2962 impl fidl::encoding::ValueTypeMarker for BufferUsage {
2963 type Borrowed<'a> = &'a Self;
2964 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2965 value
2966 }
2967 }
2968
2969 unsafe impl fidl::encoding::TypeMarker for BufferUsage {
2970 type Owned = Self;
2971
2972 #[inline(always)]
2973 fn inline_align(_context: fidl::encoding::Context) -> usize {
2974 4
2975 }
2976
2977 #[inline(always)]
2978 fn inline_size(_context: fidl::encoding::Context) -> usize {
2979 20
2980 }
2981 #[inline(always)]
2982 fn encode_is_copy() -> bool {
2983 true
2984 }
2985
2986 #[inline(always)]
2987 fn decode_is_copy() -> bool {
2988 true
2989 }
2990 }
2991
2992 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferUsage, D>
2993 for &BufferUsage
2994 {
2995 #[inline]
2996 unsafe fn encode(
2997 self,
2998 encoder: &mut fidl::encoding::Encoder<'_, D>,
2999 offset: usize,
3000 _depth: fidl::encoding::Depth,
3001 ) -> fidl::Result<()> {
3002 encoder.debug_check_bounds::<BufferUsage>(offset);
3003 unsafe {
3004 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3006 (buf_ptr as *mut BufferUsage).write_unaligned((self as *const BufferUsage).read());
3007 }
3010 Ok(())
3011 }
3012 }
3013 unsafe impl<
3014 D: fidl::encoding::ResourceDialect,
3015 T0: fidl::encoding::Encode<u32, D>,
3016 T1: fidl::encoding::Encode<u32, D>,
3017 T2: fidl::encoding::Encode<u32, D>,
3018 T3: fidl::encoding::Encode<u32, D>,
3019 T4: fidl::encoding::Encode<u32, D>,
3020 > fidl::encoding::Encode<BufferUsage, D> for (T0, T1, T2, T3, T4)
3021 {
3022 #[inline]
3023 unsafe fn encode(
3024 self,
3025 encoder: &mut fidl::encoding::Encoder<'_, D>,
3026 offset: usize,
3027 depth: fidl::encoding::Depth,
3028 ) -> fidl::Result<()> {
3029 encoder.debug_check_bounds::<BufferUsage>(offset);
3030 self.0.encode(encoder, offset + 0, depth)?;
3034 self.1.encode(encoder, offset + 4, depth)?;
3035 self.2.encode(encoder, offset + 8, depth)?;
3036 self.3.encode(encoder, offset + 12, depth)?;
3037 self.4.encode(encoder, offset + 16, depth)?;
3038 Ok(())
3039 }
3040 }
3041
3042 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferUsage {
3043 #[inline(always)]
3044 fn new_empty() -> Self {
3045 Self {
3046 none: fidl::new_empty!(u32, D),
3047 cpu: fidl::new_empty!(u32, D),
3048 vulkan: fidl::new_empty!(u32, D),
3049 display: fidl::new_empty!(u32, D),
3050 video: fidl::new_empty!(u32, D),
3051 }
3052 }
3053
3054 #[inline]
3055 unsafe fn decode(
3056 &mut self,
3057 decoder: &mut fidl::encoding::Decoder<'_, D>,
3058 offset: usize,
3059 _depth: fidl::encoding::Depth,
3060 ) -> fidl::Result<()> {
3061 decoder.debug_check_bounds::<Self>(offset);
3062 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3063 unsafe {
3066 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 20);
3067 }
3068 Ok(())
3069 }
3070 }
3071
3072 impl fidl::encoding::ValueTypeMarker for ColorSpace {
3073 type Borrowed<'a> = &'a Self;
3074 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3075 value
3076 }
3077 }
3078
3079 unsafe impl fidl::encoding::TypeMarker for ColorSpace {
3080 type Owned = Self;
3081
3082 #[inline(always)]
3083 fn inline_align(_context: fidl::encoding::Context) -> usize {
3084 4
3085 }
3086
3087 #[inline(always)]
3088 fn inline_size(_context: fidl::encoding::Context) -> usize {
3089 4
3090 }
3091 }
3092
3093 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorSpace, D>
3094 for &ColorSpace
3095 {
3096 #[inline]
3097 unsafe fn encode(
3098 self,
3099 encoder: &mut fidl::encoding::Encoder<'_, D>,
3100 offset: usize,
3101 _depth: fidl::encoding::Depth,
3102 ) -> fidl::Result<()> {
3103 encoder.debug_check_bounds::<ColorSpace>(offset);
3104 fidl::encoding::Encode::<ColorSpace, D>::encode(
3106 (<ColorSpaceType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
3107 encoder,
3108 offset,
3109 _depth,
3110 )
3111 }
3112 }
3113 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ColorSpaceType, D>>
3114 fidl::encoding::Encode<ColorSpace, D> for (T0,)
3115 {
3116 #[inline]
3117 unsafe fn encode(
3118 self,
3119 encoder: &mut fidl::encoding::Encoder<'_, D>,
3120 offset: usize,
3121 depth: fidl::encoding::Depth,
3122 ) -> fidl::Result<()> {
3123 encoder.debug_check_bounds::<ColorSpace>(offset);
3124 self.0.encode(encoder, offset + 0, depth)?;
3128 Ok(())
3129 }
3130 }
3131
3132 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorSpace {
3133 #[inline(always)]
3134 fn new_empty() -> Self {
3135 Self { type_: fidl::new_empty!(ColorSpaceType, D) }
3136 }
3137
3138 #[inline]
3139 unsafe fn decode(
3140 &mut self,
3141 decoder: &mut fidl::encoding::Decoder<'_, D>,
3142 offset: usize,
3143 _depth: fidl::encoding::Depth,
3144 ) -> fidl::Result<()> {
3145 decoder.debug_check_bounds::<Self>(offset);
3146 fidl::decode!(ColorSpaceType, D, &mut self.type_, decoder, offset + 0, _depth)?;
3148 Ok(())
3149 }
3150 }
3151
3152 impl fidl::encoding::ValueTypeMarker for FormatModifier {
3153 type Borrowed<'a> = &'a Self;
3154 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3155 value
3156 }
3157 }
3158
3159 unsafe impl fidl::encoding::TypeMarker for FormatModifier {
3160 type Owned = Self;
3161
3162 #[inline(always)]
3163 fn inline_align(_context: fidl::encoding::Context) -> usize {
3164 8
3165 }
3166
3167 #[inline(always)]
3168 fn inline_size(_context: fidl::encoding::Context) -> usize {
3169 8
3170 }
3171 #[inline(always)]
3172 fn encode_is_copy() -> bool {
3173 true
3174 }
3175
3176 #[inline(always)]
3177 fn decode_is_copy() -> bool {
3178 true
3179 }
3180 }
3181
3182 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FormatModifier, D>
3183 for &FormatModifier
3184 {
3185 #[inline]
3186 unsafe fn encode(
3187 self,
3188 encoder: &mut fidl::encoding::Encoder<'_, D>,
3189 offset: usize,
3190 _depth: fidl::encoding::Depth,
3191 ) -> fidl::Result<()> {
3192 encoder.debug_check_bounds::<FormatModifier>(offset);
3193 unsafe {
3194 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3196 (buf_ptr as *mut FormatModifier)
3197 .write_unaligned((self as *const FormatModifier).read());
3198 }
3201 Ok(())
3202 }
3203 }
3204 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3205 fidl::encoding::Encode<FormatModifier, D> for (T0,)
3206 {
3207 #[inline]
3208 unsafe fn encode(
3209 self,
3210 encoder: &mut fidl::encoding::Encoder<'_, D>,
3211 offset: usize,
3212 depth: fidl::encoding::Depth,
3213 ) -> fidl::Result<()> {
3214 encoder.debug_check_bounds::<FormatModifier>(offset);
3215 self.0.encode(encoder, offset + 0, depth)?;
3219 Ok(())
3220 }
3221 }
3222
3223 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FormatModifier {
3224 #[inline(always)]
3225 fn new_empty() -> Self {
3226 Self { value: fidl::new_empty!(u64, D) }
3227 }
3228
3229 #[inline]
3230 unsafe fn decode(
3231 &mut self,
3232 decoder: &mut fidl::encoding::Decoder<'_, D>,
3233 offset: usize,
3234 _depth: fidl::encoding::Depth,
3235 ) -> fidl::Result<()> {
3236 decoder.debug_check_bounds::<Self>(offset);
3237 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3238 unsafe {
3241 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3242 }
3243 Ok(())
3244 }
3245 }
3246
3247 impl fidl::encoding::ValueTypeMarker for ImageFormat {
3248 type Borrowed<'a> = &'a Self;
3249 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3250 value
3251 }
3252 }
3253
3254 unsafe impl fidl::encoding::TypeMarker for ImageFormat {
3255 type Owned = Self;
3256
3257 #[inline(always)]
3258 fn inline_align(_context: fidl::encoding::Context) -> usize {
3259 8
3260 }
3261
3262 #[inline(always)]
3263 fn inline_size(_context: fidl::encoding::Context) -> usize {
3264 72
3265 }
3266 }
3267
3268 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageFormat, D>
3269 for &ImageFormat
3270 {
3271 #[inline]
3272 unsafe fn encode(
3273 self,
3274 encoder: &mut fidl::encoding::Encoder<'_, D>,
3275 offset: usize,
3276 _depth: fidl::encoding::Depth,
3277 ) -> fidl::Result<()> {
3278 encoder.debug_check_bounds::<ImageFormat>(offset);
3279 fidl::encoding::Encode::<ImageFormat, D>::encode(
3281 (
3282 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
3283 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
3284 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.layers),
3285 <PixelFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
3286 <ColorSpace as fidl::encoding::ValueTypeMarker>::borrow(&self.color_space),
3287 <fidl::encoding::Array<ImagePlane, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.planes),
3288 ),
3289 encoder, offset, _depth
3290 )
3291 }
3292 }
3293 unsafe impl<
3294 D: fidl::encoding::ResourceDialect,
3295 T0: fidl::encoding::Encode<u32, D>,
3296 T1: fidl::encoding::Encode<u32, D>,
3297 T2: fidl::encoding::Encode<u32, D>,
3298 T3: fidl::encoding::Encode<PixelFormat, D>,
3299 T4: fidl::encoding::Encode<ColorSpace, D>,
3300 T5: fidl::encoding::Encode<fidl::encoding::Array<ImagePlane, 4>, D>,
3301 > fidl::encoding::Encode<ImageFormat, D> for (T0, T1, T2, T3, T4, T5)
3302 {
3303 #[inline]
3304 unsafe fn encode(
3305 self,
3306 encoder: &mut fidl::encoding::Encoder<'_, D>,
3307 offset: usize,
3308 depth: fidl::encoding::Depth,
3309 ) -> fidl::Result<()> {
3310 encoder.debug_check_bounds::<ImageFormat>(offset);
3311 unsafe {
3314 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3315 (ptr as *mut u64).write_unaligned(0);
3316 }
3317 unsafe {
3318 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
3319 (ptr as *mut u64).write_unaligned(0);
3320 }
3321 self.0.encode(encoder, offset + 0, depth)?;
3323 self.1.encode(encoder, offset + 4, depth)?;
3324 self.2.encode(encoder, offset + 8, depth)?;
3325 self.3.encode(encoder, offset + 16, depth)?;
3326 self.4.encode(encoder, offset + 32, depth)?;
3327 self.5.encode(encoder, offset + 36, depth)?;
3328 Ok(())
3329 }
3330 }
3331
3332 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageFormat {
3333 #[inline(always)]
3334 fn new_empty() -> Self {
3335 Self {
3336 width: fidl::new_empty!(u32, D),
3337 height: fidl::new_empty!(u32, D),
3338 layers: fidl::new_empty!(u32, D),
3339 pixel_format: fidl::new_empty!(PixelFormat, D),
3340 color_space: fidl::new_empty!(ColorSpace, D),
3341 planes: fidl::new_empty!(fidl::encoding::Array<ImagePlane, 4>, D),
3342 }
3343 }
3344
3345 #[inline]
3346 unsafe fn decode(
3347 &mut self,
3348 decoder: &mut fidl::encoding::Decoder<'_, D>,
3349 offset: usize,
3350 _depth: fidl::encoding::Depth,
3351 ) -> fidl::Result<()> {
3352 decoder.debug_check_bounds::<Self>(offset);
3353 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3355 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3356 let mask = 0xffffffff00000000u64;
3357 let maskedval = padval & mask;
3358 if maskedval != 0 {
3359 return Err(fidl::Error::NonZeroPadding {
3360 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3361 });
3362 }
3363 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
3364 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3365 let mask = 0xffffffff00000000u64;
3366 let maskedval = padval & mask;
3367 if maskedval != 0 {
3368 return Err(fidl::Error::NonZeroPadding {
3369 padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
3370 });
3371 }
3372 fidl::decode!(u32, D, &mut self.width, decoder, offset + 0, _depth)?;
3373 fidl::decode!(u32, D, &mut self.height, decoder, offset + 4, _depth)?;
3374 fidl::decode!(u32, D, &mut self.layers, decoder, offset + 8, _depth)?;
3375 fidl::decode!(PixelFormat, D, &mut self.pixel_format, decoder, offset + 16, _depth)?;
3376 fidl::decode!(ColorSpace, D, &mut self.color_space, decoder, offset + 32, _depth)?;
3377 fidl::decode!(fidl::encoding::Array<ImagePlane, 4>, D, &mut self.planes, decoder, offset + 36, _depth)?;
3378 Ok(())
3379 }
3380 }
3381
3382 impl fidl::encoding::ValueTypeMarker for ImageFormatConstraints {
3383 type Borrowed<'a> = &'a Self;
3384 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3385 value
3386 }
3387 }
3388
3389 unsafe impl fidl::encoding::TypeMarker for ImageFormatConstraints {
3390 type Owned = Self;
3391
3392 #[inline(always)]
3393 fn inline_align(_context: fidl::encoding::Context) -> usize {
3394 8
3395 }
3396
3397 #[inline(always)]
3398 fn inline_size(_context: fidl::encoding::Context) -> usize {
3399 232
3400 }
3401 }
3402
3403 unsafe impl<D: fidl::encoding::ResourceDialect>
3404 fidl::encoding::Encode<ImageFormatConstraints, D> for &ImageFormatConstraints
3405 {
3406 #[inline]
3407 unsafe fn encode(
3408 self,
3409 encoder: &mut fidl::encoding::Encoder<'_, D>,
3410 offset: usize,
3411 _depth: fidl::encoding::Depth,
3412 ) -> fidl::Result<()> {
3413 encoder.debug_check_bounds::<ImageFormatConstraints>(offset);
3414 fidl::encoding::Encode::<ImageFormatConstraints, D>::encode(
3416 (
3417 <PixelFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
3418 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.color_spaces_count),
3419 <fidl::encoding::Array<ColorSpace, 32> as fidl::encoding::ValueTypeMarker>::borrow(&self.color_space),
3420 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_coded_width),
3421 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_coded_width),
3422 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_coded_height),
3423 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_coded_height),
3424 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_bytes_per_row),
3425 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_bytes_per_row),
3426 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_coded_width_times_coded_height),
3427 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.layers),
3428 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_width_divisor),
3429 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_height_divisor),
3430 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bytes_per_row_divisor),
3431 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.start_offset_divisor),
3432 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.display_width_divisor),
3433 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.display_height_divisor),
3434 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.required_min_coded_width),
3435 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.required_max_coded_width),
3436 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.required_min_coded_height),
3437 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.required_max_coded_height),
3438 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.required_min_bytes_per_row),
3439 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.required_max_bytes_per_row),
3440 ),
3441 encoder, offset, _depth
3442 )
3443 }
3444 }
3445 unsafe impl<
3446 D: fidl::encoding::ResourceDialect,
3447 T0: fidl::encoding::Encode<PixelFormat, D>,
3448 T1: fidl::encoding::Encode<u32, D>,
3449 T2: fidl::encoding::Encode<fidl::encoding::Array<ColorSpace, 32>, D>,
3450 T3: fidl::encoding::Encode<u32, D>,
3451 T4: fidl::encoding::Encode<u32, D>,
3452 T5: fidl::encoding::Encode<u32, D>,
3453 T6: fidl::encoding::Encode<u32, D>,
3454 T7: fidl::encoding::Encode<u32, D>,
3455 T8: fidl::encoding::Encode<u32, D>,
3456 T9: fidl::encoding::Encode<u32, D>,
3457 T10: fidl::encoding::Encode<u32, D>,
3458 T11: fidl::encoding::Encode<u32, D>,
3459 T12: fidl::encoding::Encode<u32, D>,
3460 T13: fidl::encoding::Encode<u32, D>,
3461 T14: fidl::encoding::Encode<u32, D>,
3462 T15: fidl::encoding::Encode<u32, D>,
3463 T16: fidl::encoding::Encode<u32, D>,
3464 T17: fidl::encoding::Encode<u32, D>,
3465 T18: fidl::encoding::Encode<u32, D>,
3466 T19: fidl::encoding::Encode<u32, D>,
3467 T20: fidl::encoding::Encode<u32, D>,
3468 T21: fidl::encoding::Encode<u32, D>,
3469 T22: fidl::encoding::Encode<u32, D>,
3470 > fidl::encoding::Encode<ImageFormatConstraints, D>
3471 for (
3472 T0,
3473 T1,
3474 T2,
3475 T3,
3476 T4,
3477 T5,
3478 T6,
3479 T7,
3480 T8,
3481 T9,
3482 T10,
3483 T11,
3484 T12,
3485 T13,
3486 T14,
3487 T15,
3488 T16,
3489 T17,
3490 T18,
3491 T19,
3492 T20,
3493 T21,
3494 T22,
3495 )
3496 {
3497 #[inline]
3498 unsafe fn encode(
3499 self,
3500 encoder: &mut fidl::encoding::Encoder<'_, D>,
3501 offset: usize,
3502 depth: fidl::encoding::Depth,
3503 ) -> fidl::Result<()> {
3504 encoder.debug_check_bounds::<ImageFormatConstraints>(offset);
3505 unsafe {
3508 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(224);
3509 (ptr as *mut u64).write_unaligned(0);
3510 }
3511 self.0.encode(encoder, offset + 0, depth)?;
3513 self.1.encode(encoder, offset + 16, depth)?;
3514 self.2.encode(encoder, offset + 20, depth)?;
3515 self.3.encode(encoder, offset + 148, depth)?;
3516 self.4.encode(encoder, offset + 152, depth)?;
3517 self.5.encode(encoder, offset + 156, depth)?;
3518 self.6.encode(encoder, offset + 160, depth)?;
3519 self.7.encode(encoder, offset + 164, depth)?;
3520 self.8.encode(encoder, offset + 168, depth)?;
3521 self.9.encode(encoder, offset + 172, depth)?;
3522 self.10.encode(encoder, offset + 176, depth)?;
3523 self.11.encode(encoder, offset + 180, depth)?;
3524 self.12.encode(encoder, offset + 184, depth)?;
3525 self.13.encode(encoder, offset + 188, depth)?;
3526 self.14.encode(encoder, offset + 192, depth)?;
3527 self.15.encode(encoder, offset + 196, depth)?;
3528 self.16.encode(encoder, offset + 200, depth)?;
3529 self.17.encode(encoder, offset + 204, depth)?;
3530 self.18.encode(encoder, offset + 208, depth)?;
3531 self.19.encode(encoder, offset + 212, depth)?;
3532 self.20.encode(encoder, offset + 216, depth)?;
3533 self.21.encode(encoder, offset + 220, depth)?;
3534 self.22.encode(encoder, offset + 224, depth)?;
3535 Ok(())
3536 }
3537 }
3538
3539 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3540 for ImageFormatConstraints
3541 {
3542 #[inline(always)]
3543 fn new_empty() -> Self {
3544 Self {
3545 pixel_format: fidl::new_empty!(PixelFormat, D),
3546 color_spaces_count: fidl::new_empty!(u32, D),
3547 color_space: fidl::new_empty!(fidl::encoding::Array<ColorSpace, 32>, D),
3548 min_coded_width: fidl::new_empty!(u32, D),
3549 max_coded_width: fidl::new_empty!(u32, D),
3550 min_coded_height: fidl::new_empty!(u32, D),
3551 max_coded_height: fidl::new_empty!(u32, D),
3552 min_bytes_per_row: fidl::new_empty!(u32, D),
3553 max_bytes_per_row: fidl::new_empty!(u32, D),
3554 max_coded_width_times_coded_height: fidl::new_empty!(u32, D),
3555 layers: fidl::new_empty!(u32, D),
3556 coded_width_divisor: fidl::new_empty!(u32, D),
3557 coded_height_divisor: fidl::new_empty!(u32, D),
3558 bytes_per_row_divisor: fidl::new_empty!(u32, D),
3559 start_offset_divisor: fidl::new_empty!(u32, D),
3560 display_width_divisor: fidl::new_empty!(u32, D),
3561 display_height_divisor: fidl::new_empty!(u32, D),
3562 required_min_coded_width: fidl::new_empty!(u32, D),
3563 required_max_coded_width: fidl::new_empty!(u32, D),
3564 required_min_coded_height: fidl::new_empty!(u32, D),
3565 required_max_coded_height: fidl::new_empty!(u32, D),
3566 required_min_bytes_per_row: fidl::new_empty!(u32, D),
3567 required_max_bytes_per_row: fidl::new_empty!(u32, D),
3568 }
3569 }
3570
3571 #[inline]
3572 unsafe fn decode(
3573 &mut self,
3574 decoder: &mut fidl::encoding::Decoder<'_, D>,
3575 offset: usize,
3576 _depth: fidl::encoding::Depth,
3577 ) -> fidl::Result<()> {
3578 decoder.debug_check_bounds::<Self>(offset);
3579 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(224) };
3581 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3582 let mask = 0xffffffff00000000u64;
3583 let maskedval = padval & mask;
3584 if maskedval != 0 {
3585 return Err(fidl::Error::NonZeroPadding {
3586 padding_start: offset + 224 + ((mask as u64).trailing_zeros() / 8) as usize,
3587 });
3588 }
3589 fidl::decode!(PixelFormat, D, &mut self.pixel_format, decoder, offset + 0, _depth)?;
3590 fidl::decode!(u32, D, &mut self.color_spaces_count, decoder, offset + 16, _depth)?;
3591 fidl::decode!(fidl::encoding::Array<ColorSpace, 32>, D, &mut self.color_space, decoder, offset + 20, _depth)?;
3592 fidl::decode!(u32, D, &mut self.min_coded_width, decoder, offset + 148, _depth)?;
3593 fidl::decode!(u32, D, &mut self.max_coded_width, decoder, offset + 152, _depth)?;
3594 fidl::decode!(u32, D, &mut self.min_coded_height, decoder, offset + 156, _depth)?;
3595 fidl::decode!(u32, D, &mut self.max_coded_height, decoder, offset + 160, _depth)?;
3596 fidl::decode!(u32, D, &mut self.min_bytes_per_row, decoder, offset + 164, _depth)?;
3597 fidl::decode!(u32, D, &mut self.max_bytes_per_row, decoder, offset + 168, _depth)?;
3598 fidl::decode!(
3599 u32,
3600 D,
3601 &mut self.max_coded_width_times_coded_height,
3602 decoder,
3603 offset + 172,
3604 _depth
3605 )?;
3606 fidl::decode!(u32, D, &mut self.layers, decoder, offset + 176, _depth)?;
3607 fidl::decode!(u32, D, &mut self.coded_width_divisor, decoder, offset + 180, _depth)?;
3608 fidl::decode!(u32, D, &mut self.coded_height_divisor, decoder, offset + 184, _depth)?;
3609 fidl::decode!(u32, D, &mut self.bytes_per_row_divisor, decoder, offset + 188, _depth)?;
3610 fidl::decode!(u32, D, &mut self.start_offset_divisor, decoder, offset + 192, _depth)?;
3611 fidl::decode!(u32, D, &mut self.display_width_divisor, decoder, offset + 196, _depth)?;
3612 fidl::decode!(u32, D, &mut self.display_height_divisor, decoder, offset + 200, _depth)?;
3613 fidl::decode!(
3614 u32,
3615 D,
3616 &mut self.required_min_coded_width,
3617 decoder,
3618 offset + 204,
3619 _depth
3620 )?;
3621 fidl::decode!(
3622 u32,
3623 D,
3624 &mut self.required_max_coded_width,
3625 decoder,
3626 offset + 208,
3627 _depth
3628 )?;
3629 fidl::decode!(
3630 u32,
3631 D,
3632 &mut self.required_min_coded_height,
3633 decoder,
3634 offset + 212,
3635 _depth
3636 )?;
3637 fidl::decode!(
3638 u32,
3639 D,
3640 &mut self.required_max_coded_height,
3641 decoder,
3642 offset + 216,
3643 _depth
3644 )?;
3645 fidl::decode!(
3646 u32,
3647 D,
3648 &mut self.required_min_bytes_per_row,
3649 decoder,
3650 offset + 220,
3651 _depth
3652 )?;
3653 fidl::decode!(
3654 u32,
3655 D,
3656 &mut self.required_max_bytes_per_row,
3657 decoder,
3658 offset + 224,
3659 _depth
3660 )?;
3661 Ok(())
3662 }
3663 }
3664
3665 impl fidl::encoding::ValueTypeMarker for ImageFormat2 {
3666 type Borrowed<'a> = &'a Self;
3667 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3668 value
3669 }
3670 }
3671
3672 unsafe impl fidl::encoding::TypeMarker for ImageFormat2 {
3673 type Owned = Self;
3674
3675 #[inline(always)]
3676 fn inline_align(_context: fidl::encoding::Context) -> usize {
3677 8
3678 }
3679
3680 #[inline(always)]
3681 fn inline_size(_context: fidl::encoding::Context) -> usize {
3682 56
3683 }
3684 }
3685
3686 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageFormat2, D>
3687 for &ImageFormat2
3688 {
3689 #[inline]
3690 unsafe fn encode(
3691 self,
3692 encoder: &mut fidl::encoding::Encoder<'_, D>,
3693 offset: usize,
3694 _depth: fidl::encoding::Depth,
3695 ) -> fidl::Result<()> {
3696 encoder.debug_check_bounds::<ImageFormat2>(offset);
3697 fidl::encoding::Encode::<ImageFormat2, D>::encode(
3699 (
3700 <PixelFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
3701 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_width),
3702 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_height),
3703 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bytes_per_row),
3704 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.display_width),
3705 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.display_height),
3706 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.layers),
3707 <ColorSpace as fidl::encoding::ValueTypeMarker>::borrow(&self.color_space),
3708 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_pixel_aspect_ratio),
3709 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
3710 &self.pixel_aspect_ratio_width,
3711 ),
3712 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
3713 &self.pixel_aspect_ratio_height,
3714 ),
3715 ),
3716 encoder,
3717 offset,
3718 _depth,
3719 )
3720 }
3721 }
3722 unsafe impl<
3723 D: fidl::encoding::ResourceDialect,
3724 T0: fidl::encoding::Encode<PixelFormat, D>,
3725 T1: fidl::encoding::Encode<u32, D>,
3726 T2: fidl::encoding::Encode<u32, D>,
3727 T3: fidl::encoding::Encode<u32, D>,
3728 T4: fidl::encoding::Encode<u32, D>,
3729 T5: fidl::encoding::Encode<u32, D>,
3730 T6: fidl::encoding::Encode<u32, D>,
3731 T7: fidl::encoding::Encode<ColorSpace, D>,
3732 T8: fidl::encoding::Encode<bool, D>,
3733 T9: fidl::encoding::Encode<u32, D>,
3734 T10: fidl::encoding::Encode<u32, D>,
3735 > fidl::encoding::Encode<ImageFormat2, D>
3736 for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
3737 {
3738 #[inline]
3739 unsafe fn encode(
3740 self,
3741 encoder: &mut fidl::encoding::Encoder<'_, D>,
3742 offset: usize,
3743 depth: fidl::encoding::Depth,
3744 ) -> fidl::Result<()> {
3745 encoder.debug_check_bounds::<ImageFormat2>(offset);
3746 unsafe {
3749 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
3750 (ptr as *mut u64).write_unaligned(0);
3751 }
3752 self.0.encode(encoder, offset + 0, depth)?;
3754 self.1.encode(encoder, offset + 16, depth)?;
3755 self.2.encode(encoder, offset + 20, depth)?;
3756 self.3.encode(encoder, offset + 24, depth)?;
3757 self.4.encode(encoder, offset + 28, depth)?;
3758 self.5.encode(encoder, offset + 32, depth)?;
3759 self.6.encode(encoder, offset + 36, depth)?;
3760 self.7.encode(encoder, offset + 40, depth)?;
3761 self.8.encode(encoder, offset + 44, depth)?;
3762 self.9.encode(encoder, offset + 48, depth)?;
3763 self.10.encode(encoder, offset + 52, depth)?;
3764 Ok(())
3765 }
3766 }
3767
3768 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageFormat2 {
3769 #[inline(always)]
3770 fn new_empty() -> Self {
3771 Self {
3772 pixel_format: fidl::new_empty!(PixelFormat, D),
3773 coded_width: fidl::new_empty!(u32, D),
3774 coded_height: fidl::new_empty!(u32, D),
3775 bytes_per_row: fidl::new_empty!(u32, D),
3776 display_width: fidl::new_empty!(u32, D),
3777 display_height: fidl::new_empty!(u32, D),
3778 layers: fidl::new_empty!(u32, D),
3779 color_space: fidl::new_empty!(ColorSpace, D),
3780 has_pixel_aspect_ratio: fidl::new_empty!(bool, D),
3781 pixel_aspect_ratio_width: fidl::new_empty!(u32, D),
3782 pixel_aspect_ratio_height: fidl::new_empty!(u32, D),
3783 }
3784 }
3785
3786 #[inline]
3787 unsafe fn decode(
3788 &mut self,
3789 decoder: &mut fidl::encoding::Decoder<'_, D>,
3790 offset: usize,
3791 _depth: fidl::encoding::Depth,
3792 ) -> fidl::Result<()> {
3793 decoder.debug_check_bounds::<Self>(offset);
3794 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3796 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3797 let mask = 0xffffff0000000000u64;
3798 let maskedval = padval & mask;
3799 if maskedval != 0 {
3800 return Err(fidl::Error::NonZeroPadding {
3801 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3802 });
3803 }
3804 fidl::decode!(PixelFormat, D, &mut self.pixel_format, decoder, offset + 0, _depth)?;
3805 fidl::decode!(u32, D, &mut self.coded_width, decoder, offset + 16, _depth)?;
3806 fidl::decode!(u32, D, &mut self.coded_height, decoder, offset + 20, _depth)?;
3807 fidl::decode!(u32, D, &mut self.bytes_per_row, decoder, offset + 24, _depth)?;
3808 fidl::decode!(u32, D, &mut self.display_width, decoder, offset + 28, _depth)?;
3809 fidl::decode!(u32, D, &mut self.display_height, decoder, offset + 32, _depth)?;
3810 fidl::decode!(u32, D, &mut self.layers, decoder, offset + 36, _depth)?;
3811 fidl::decode!(ColorSpace, D, &mut self.color_space, decoder, offset + 40, _depth)?;
3812 fidl::decode!(bool, D, &mut self.has_pixel_aspect_ratio, decoder, offset + 44, _depth)?;
3813 fidl::decode!(
3814 u32,
3815 D,
3816 &mut self.pixel_aspect_ratio_width,
3817 decoder,
3818 offset + 48,
3819 _depth
3820 )?;
3821 fidl::decode!(
3822 u32,
3823 D,
3824 &mut self.pixel_aspect_ratio_height,
3825 decoder,
3826 offset + 52,
3827 _depth
3828 )?;
3829 Ok(())
3830 }
3831 }
3832
3833 impl fidl::encoding::ValueTypeMarker for ImagePlane {
3834 type Borrowed<'a> = &'a Self;
3835 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3836 value
3837 }
3838 }
3839
3840 unsafe impl fidl::encoding::TypeMarker for ImagePlane {
3841 type Owned = Self;
3842
3843 #[inline(always)]
3844 fn inline_align(_context: fidl::encoding::Context) -> usize {
3845 4
3846 }
3847
3848 #[inline(always)]
3849 fn inline_size(_context: fidl::encoding::Context) -> usize {
3850 8
3851 }
3852 #[inline(always)]
3853 fn encode_is_copy() -> bool {
3854 true
3855 }
3856
3857 #[inline(always)]
3858 fn decode_is_copy() -> bool {
3859 true
3860 }
3861 }
3862
3863 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImagePlane, D>
3864 for &ImagePlane
3865 {
3866 #[inline]
3867 unsafe fn encode(
3868 self,
3869 encoder: &mut fidl::encoding::Encoder<'_, D>,
3870 offset: usize,
3871 _depth: fidl::encoding::Depth,
3872 ) -> fidl::Result<()> {
3873 encoder.debug_check_bounds::<ImagePlane>(offset);
3874 unsafe {
3875 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3877 (buf_ptr as *mut ImagePlane).write_unaligned((self as *const ImagePlane).read());
3878 }
3881 Ok(())
3882 }
3883 }
3884 unsafe impl<
3885 D: fidl::encoding::ResourceDialect,
3886 T0: fidl::encoding::Encode<u32, D>,
3887 T1: fidl::encoding::Encode<u32, D>,
3888 > fidl::encoding::Encode<ImagePlane, D> for (T0, T1)
3889 {
3890 #[inline]
3891 unsafe fn encode(
3892 self,
3893 encoder: &mut fidl::encoding::Encoder<'_, D>,
3894 offset: usize,
3895 depth: fidl::encoding::Depth,
3896 ) -> fidl::Result<()> {
3897 encoder.debug_check_bounds::<ImagePlane>(offset);
3898 self.0.encode(encoder, offset + 0, depth)?;
3902 self.1.encode(encoder, offset + 4, depth)?;
3903 Ok(())
3904 }
3905 }
3906
3907 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImagePlane {
3908 #[inline(always)]
3909 fn new_empty() -> Self {
3910 Self { byte_offset: fidl::new_empty!(u32, D), bytes_per_row: fidl::new_empty!(u32, D) }
3911 }
3912
3913 #[inline]
3914 unsafe fn decode(
3915 &mut self,
3916 decoder: &mut fidl::encoding::Decoder<'_, D>,
3917 offset: usize,
3918 _depth: fidl::encoding::Depth,
3919 ) -> fidl::Result<()> {
3920 decoder.debug_check_bounds::<Self>(offset);
3921 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3922 unsafe {
3925 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3926 }
3927 Ok(())
3928 }
3929 }
3930
3931 impl fidl::encoding::ValueTypeMarker for ImageSpec {
3932 type Borrowed<'a> = &'a Self;
3933 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3934 value
3935 }
3936 }
3937
3938 unsafe impl fidl::encoding::TypeMarker for ImageSpec {
3939 type Owned = Self;
3940
3941 #[inline(always)]
3942 fn inline_align(_context: fidl::encoding::Context) -> usize {
3943 8
3944 }
3945
3946 #[inline(always)]
3947 fn inline_size(_context: fidl::encoding::Context) -> usize {
3948 40
3949 }
3950 }
3951
3952 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageSpec, D>
3953 for &ImageSpec
3954 {
3955 #[inline]
3956 unsafe fn encode(
3957 self,
3958 encoder: &mut fidl::encoding::Encoder<'_, D>,
3959 offset: usize,
3960 _depth: fidl::encoding::Depth,
3961 ) -> fidl::Result<()> {
3962 encoder.debug_check_bounds::<ImageSpec>(offset);
3963 fidl::encoding::Encode::<ImageSpec, D>::encode(
3965 (
3966 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_width),
3967 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.min_height),
3968 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.layers),
3969 <PixelFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
3970 <ColorSpace as fidl::encoding::ValueTypeMarker>::borrow(&self.color_space),
3971 ),
3972 encoder,
3973 offset,
3974 _depth,
3975 )
3976 }
3977 }
3978 unsafe impl<
3979 D: fidl::encoding::ResourceDialect,
3980 T0: fidl::encoding::Encode<u32, D>,
3981 T1: fidl::encoding::Encode<u32, D>,
3982 T2: fidl::encoding::Encode<u32, D>,
3983 T3: fidl::encoding::Encode<PixelFormat, D>,
3984 T4: fidl::encoding::Encode<ColorSpace, D>,
3985 > fidl::encoding::Encode<ImageSpec, D> for (T0, T1, T2, T3, T4)
3986 {
3987 #[inline]
3988 unsafe fn encode(
3989 self,
3990 encoder: &mut fidl::encoding::Encoder<'_, D>,
3991 offset: usize,
3992 depth: fidl::encoding::Depth,
3993 ) -> fidl::Result<()> {
3994 encoder.debug_check_bounds::<ImageSpec>(offset);
3995 unsafe {
3998 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3999 (ptr as *mut u64).write_unaligned(0);
4000 }
4001 unsafe {
4002 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
4003 (ptr as *mut u64).write_unaligned(0);
4004 }
4005 self.0.encode(encoder, offset + 0, depth)?;
4007 self.1.encode(encoder, offset + 4, depth)?;
4008 self.2.encode(encoder, offset + 8, depth)?;
4009 self.3.encode(encoder, offset + 16, depth)?;
4010 self.4.encode(encoder, offset + 32, depth)?;
4011 Ok(())
4012 }
4013 }
4014
4015 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageSpec {
4016 #[inline(always)]
4017 fn new_empty() -> Self {
4018 Self {
4019 min_width: fidl::new_empty!(u32, D),
4020 min_height: fidl::new_empty!(u32, D),
4021 layers: fidl::new_empty!(u32, D),
4022 pixel_format: fidl::new_empty!(PixelFormat, D),
4023 color_space: fidl::new_empty!(ColorSpace, D),
4024 }
4025 }
4026
4027 #[inline]
4028 unsafe fn decode(
4029 &mut self,
4030 decoder: &mut fidl::encoding::Decoder<'_, D>,
4031 offset: usize,
4032 _depth: fidl::encoding::Depth,
4033 ) -> fidl::Result<()> {
4034 decoder.debug_check_bounds::<Self>(offset);
4035 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4037 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4038 let mask = 0xffffffff00000000u64;
4039 let maskedval = padval & mask;
4040 if maskedval != 0 {
4041 return Err(fidl::Error::NonZeroPadding {
4042 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4043 });
4044 }
4045 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
4046 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4047 let mask = 0xffffffff00000000u64;
4048 let maskedval = padval & mask;
4049 if maskedval != 0 {
4050 return Err(fidl::Error::NonZeroPadding {
4051 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
4052 });
4053 }
4054 fidl::decode!(u32, D, &mut self.min_width, decoder, offset + 0, _depth)?;
4055 fidl::decode!(u32, D, &mut self.min_height, decoder, offset + 4, _depth)?;
4056 fidl::decode!(u32, D, &mut self.layers, decoder, offset + 8, _depth)?;
4057 fidl::decode!(PixelFormat, D, &mut self.pixel_format, decoder, offset + 16, _depth)?;
4058 fidl::decode!(ColorSpace, D, &mut self.color_space, decoder, offset + 32, _depth)?;
4059 Ok(())
4060 }
4061 }
4062
4063 impl fidl::encoding::ValueTypeMarker for NodeSetDebugClientInfoRequest {
4064 type Borrowed<'a> = &'a Self;
4065 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4066 value
4067 }
4068 }
4069
4070 unsafe impl fidl::encoding::TypeMarker for NodeSetDebugClientInfoRequest {
4071 type Owned = Self;
4072
4073 #[inline(always)]
4074 fn inline_align(_context: fidl::encoding::Context) -> usize {
4075 8
4076 }
4077
4078 #[inline(always)]
4079 fn inline_size(_context: fidl::encoding::Context) -> usize {
4080 24
4081 }
4082 }
4083
4084 unsafe impl<D: fidl::encoding::ResourceDialect>
4085 fidl::encoding::Encode<NodeSetDebugClientInfoRequest, D>
4086 for &NodeSetDebugClientInfoRequest
4087 {
4088 #[inline]
4089 unsafe fn encode(
4090 self,
4091 encoder: &mut fidl::encoding::Encoder<'_, D>,
4092 offset: usize,
4093 _depth: fidl::encoding::Depth,
4094 ) -> fidl::Result<()> {
4095 encoder.debug_check_bounds::<NodeSetDebugClientInfoRequest>(offset);
4096 fidl::encoding::Encode::<NodeSetDebugClientInfoRequest, D>::encode(
4098 (
4099 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
4100 &self.name,
4101 ),
4102 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4103 ),
4104 encoder,
4105 offset,
4106 _depth,
4107 )
4108 }
4109 }
4110 unsafe impl<
4111 D: fidl::encoding::ResourceDialect,
4112 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
4113 T1: fidl::encoding::Encode<u64, D>,
4114 > fidl::encoding::Encode<NodeSetDebugClientInfoRequest, D> for (T0, T1)
4115 {
4116 #[inline]
4117 unsafe fn encode(
4118 self,
4119 encoder: &mut fidl::encoding::Encoder<'_, D>,
4120 offset: usize,
4121 depth: fidl::encoding::Depth,
4122 ) -> fidl::Result<()> {
4123 encoder.debug_check_bounds::<NodeSetDebugClientInfoRequest>(offset);
4124 self.0.encode(encoder, offset + 0, depth)?;
4128 self.1.encode(encoder, offset + 16, depth)?;
4129 Ok(())
4130 }
4131 }
4132
4133 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4134 for NodeSetDebugClientInfoRequest
4135 {
4136 #[inline(always)]
4137 fn new_empty() -> Self {
4138 Self {
4139 name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
4140 id: fidl::new_empty!(u64, D),
4141 }
4142 }
4143
4144 #[inline]
4145 unsafe fn decode(
4146 &mut self,
4147 decoder: &mut fidl::encoding::Decoder<'_, D>,
4148 offset: usize,
4149 _depth: fidl::encoding::Depth,
4150 ) -> fidl::Result<()> {
4151 decoder.debug_check_bounds::<Self>(offset);
4152 fidl::decode!(
4154 fidl::encoding::BoundedString<64>,
4155 D,
4156 &mut self.name,
4157 decoder,
4158 offset + 0,
4159 _depth
4160 )?;
4161 fidl::decode!(u64, D, &mut self.id, decoder, offset + 16, _depth)?;
4162 Ok(())
4163 }
4164 }
4165
4166 impl fidl::encoding::ValueTypeMarker for NodeSetDebugTimeoutLogDeadlineRequest {
4167 type Borrowed<'a> = &'a Self;
4168 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4169 value
4170 }
4171 }
4172
4173 unsafe impl fidl::encoding::TypeMarker for NodeSetDebugTimeoutLogDeadlineRequest {
4174 type Owned = Self;
4175
4176 #[inline(always)]
4177 fn inline_align(_context: fidl::encoding::Context) -> usize {
4178 8
4179 }
4180
4181 #[inline(always)]
4182 fn inline_size(_context: fidl::encoding::Context) -> usize {
4183 8
4184 }
4185 #[inline(always)]
4186 fn encode_is_copy() -> bool {
4187 true
4188 }
4189
4190 #[inline(always)]
4191 fn decode_is_copy() -> bool {
4192 true
4193 }
4194 }
4195
4196 unsafe impl<D: fidl::encoding::ResourceDialect>
4197 fidl::encoding::Encode<NodeSetDebugTimeoutLogDeadlineRequest, D>
4198 for &NodeSetDebugTimeoutLogDeadlineRequest
4199 {
4200 #[inline]
4201 unsafe fn encode(
4202 self,
4203 encoder: &mut fidl::encoding::Encoder<'_, D>,
4204 offset: usize,
4205 _depth: fidl::encoding::Depth,
4206 ) -> fidl::Result<()> {
4207 encoder.debug_check_bounds::<NodeSetDebugTimeoutLogDeadlineRequest>(offset);
4208 unsafe {
4209 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4211 (buf_ptr as *mut NodeSetDebugTimeoutLogDeadlineRequest)
4212 .write_unaligned((self as *const NodeSetDebugTimeoutLogDeadlineRequest).read());
4213 }
4216 Ok(())
4217 }
4218 }
4219 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
4220 fidl::encoding::Encode<NodeSetDebugTimeoutLogDeadlineRequest, D> for (T0,)
4221 {
4222 #[inline]
4223 unsafe fn encode(
4224 self,
4225 encoder: &mut fidl::encoding::Encoder<'_, D>,
4226 offset: usize,
4227 depth: fidl::encoding::Depth,
4228 ) -> fidl::Result<()> {
4229 encoder.debug_check_bounds::<NodeSetDebugTimeoutLogDeadlineRequest>(offset);
4230 self.0.encode(encoder, offset + 0, depth)?;
4234 Ok(())
4235 }
4236 }
4237
4238 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4239 for NodeSetDebugTimeoutLogDeadlineRequest
4240 {
4241 #[inline(always)]
4242 fn new_empty() -> Self {
4243 Self { deadline: fidl::new_empty!(i64, D) }
4244 }
4245
4246 #[inline]
4247 unsafe fn decode(
4248 &mut self,
4249 decoder: &mut fidl::encoding::Decoder<'_, D>,
4250 offset: usize,
4251 _depth: fidl::encoding::Depth,
4252 ) -> fidl::Result<()> {
4253 decoder.debug_check_bounds::<Self>(offset);
4254 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4255 unsafe {
4258 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4259 }
4260 Ok(())
4261 }
4262 }
4263
4264 impl fidl::encoding::ValueTypeMarker for NodeSetNameRequest {
4265 type Borrowed<'a> = &'a Self;
4266 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4267 value
4268 }
4269 }
4270
4271 unsafe impl fidl::encoding::TypeMarker for NodeSetNameRequest {
4272 type Owned = Self;
4273
4274 #[inline(always)]
4275 fn inline_align(_context: fidl::encoding::Context) -> usize {
4276 8
4277 }
4278
4279 #[inline(always)]
4280 fn inline_size(_context: fidl::encoding::Context) -> usize {
4281 24
4282 }
4283 }
4284
4285 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeSetNameRequest, D>
4286 for &NodeSetNameRequest
4287 {
4288 #[inline]
4289 unsafe fn encode(
4290 self,
4291 encoder: &mut fidl::encoding::Encoder<'_, D>,
4292 offset: usize,
4293 _depth: fidl::encoding::Depth,
4294 ) -> fidl::Result<()> {
4295 encoder.debug_check_bounds::<NodeSetNameRequest>(offset);
4296 fidl::encoding::Encode::<NodeSetNameRequest, D>::encode(
4298 (
4299 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.priority),
4300 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
4301 &self.name,
4302 ),
4303 ),
4304 encoder,
4305 offset,
4306 _depth,
4307 )
4308 }
4309 }
4310 unsafe impl<
4311 D: fidl::encoding::ResourceDialect,
4312 T0: fidl::encoding::Encode<u32, D>,
4313 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
4314 > fidl::encoding::Encode<NodeSetNameRequest, D> for (T0, T1)
4315 {
4316 #[inline]
4317 unsafe fn encode(
4318 self,
4319 encoder: &mut fidl::encoding::Encoder<'_, D>,
4320 offset: usize,
4321 depth: fidl::encoding::Depth,
4322 ) -> fidl::Result<()> {
4323 encoder.debug_check_bounds::<NodeSetNameRequest>(offset);
4324 unsafe {
4327 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4328 (ptr as *mut u64).write_unaligned(0);
4329 }
4330 self.0.encode(encoder, offset + 0, depth)?;
4332 self.1.encode(encoder, offset + 8, depth)?;
4333 Ok(())
4334 }
4335 }
4336
4337 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeSetNameRequest {
4338 #[inline(always)]
4339 fn new_empty() -> Self {
4340 Self {
4341 priority: fidl::new_empty!(u32, D),
4342 name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
4343 }
4344 }
4345
4346 #[inline]
4347 unsafe fn decode(
4348 &mut self,
4349 decoder: &mut fidl::encoding::Decoder<'_, D>,
4350 offset: usize,
4351 _depth: fidl::encoding::Depth,
4352 ) -> fidl::Result<()> {
4353 decoder.debug_check_bounds::<Self>(offset);
4354 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4356 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4357 let mask = 0xffffffff00000000u64;
4358 let maskedval = padval & mask;
4359 if maskedval != 0 {
4360 return Err(fidl::Error::NonZeroPadding {
4361 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4362 });
4363 }
4364 fidl::decode!(u32, D, &mut self.priority, decoder, offset + 0, _depth)?;
4365 fidl::decode!(
4366 fidl::encoding::BoundedString<64>,
4367 D,
4368 &mut self.name,
4369 decoder,
4370 offset + 8,
4371 _depth
4372 )?;
4373 Ok(())
4374 }
4375 }
4376
4377 impl fidl::encoding::ValueTypeMarker for NodeIsAlternateForResponse {
4378 type Borrowed<'a> = &'a Self;
4379 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4380 value
4381 }
4382 }
4383
4384 unsafe impl fidl::encoding::TypeMarker for NodeIsAlternateForResponse {
4385 type Owned = Self;
4386
4387 #[inline(always)]
4388 fn inline_align(_context: fidl::encoding::Context) -> usize {
4389 1
4390 }
4391
4392 #[inline(always)]
4393 fn inline_size(_context: fidl::encoding::Context) -> usize {
4394 1
4395 }
4396 }
4397
4398 unsafe impl<D: fidl::encoding::ResourceDialect>
4399 fidl::encoding::Encode<NodeIsAlternateForResponse, D> for &NodeIsAlternateForResponse
4400 {
4401 #[inline]
4402 unsafe fn encode(
4403 self,
4404 encoder: &mut fidl::encoding::Encoder<'_, D>,
4405 offset: usize,
4406 _depth: fidl::encoding::Depth,
4407 ) -> fidl::Result<()> {
4408 encoder.debug_check_bounds::<NodeIsAlternateForResponse>(offset);
4409 fidl::encoding::Encode::<NodeIsAlternateForResponse, D>::encode(
4411 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_alternate),),
4412 encoder,
4413 offset,
4414 _depth,
4415 )
4416 }
4417 }
4418 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4419 fidl::encoding::Encode<NodeIsAlternateForResponse, D> for (T0,)
4420 {
4421 #[inline]
4422 unsafe fn encode(
4423 self,
4424 encoder: &mut fidl::encoding::Encoder<'_, D>,
4425 offset: usize,
4426 depth: fidl::encoding::Depth,
4427 ) -> fidl::Result<()> {
4428 encoder.debug_check_bounds::<NodeIsAlternateForResponse>(offset);
4429 self.0.encode(encoder, offset + 0, depth)?;
4433 Ok(())
4434 }
4435 }
4436
4437 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4438 for NodeIsAlternateForResponse
4439 {
4440 #[inline(always)]
4441 fn new_empty() -> Self {
4442 Self { is_alternate: fidl::new_empty!(bool, D) }
4443 }
4444
4445 #[inline]
4446 unsafe fn decode(
4447 &mut self,
4448 decoder: &mut fidl::encoding::Decoder<'_, D>,
4449 offset: usize,
4450 _depth: fidl::encoding::Depth,
4451 ) -> fidl::Result<()> {
4452 decoder.debug_check_bounds::<Self>(offset);
4453 fidl::decode!(bool, D, &mut self.is_alternate, decoder, offset + 0, _depth)?;
4455 Ok(())
4456 }
4457 }
4458
4459 impl fidl::encoding::ValueTypeMarker for PixelFormat {
4460 type Borrowed<'a> = &'a Self;
4461 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4462 value
4463 }
4464 }
4465
4466 unsafe impl fidl::encoding::TypeMarker for PixelFormat {
4467 type Owned = Self;
4468
4469 #[inline(always)]
4470 fn inline_align(_context: fidl::encoding::Context) -> usize {
4471 8
4472 }
4473
4474 #[inline(always)]
4475 fn inline_size(_context: fidl::encoding::Context) -> usize {
4476 16
4477 }
4478 }
4479
4480 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PixelFormat, D>
4481 for &PixelFormat
4482 {
4483 #[inline]
4484 unsafe fn encode(
4485 self,
4486 encoder: &mut fidl::encoding::Encoder<'_, D>,
4487 offset: usize,
4488 _depth: fidl::encoding::Depth,
4489 ) -> fidl::Result<()> {
4490 encoder.debug_check_bounds::<PixelFormat>(offset);
4491 fidl::encoding::Encode::<PixelFormat, D>::encode(
4493 (
4494 <PixelFormatType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
4495 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_format_modifier),
4496 <FormatModifier as fidl::encoding::ValueTypeMarker>::borrow(
4497 &self.format_modifier,
4498 ),
4499 ),
4500 encoder,
4501 offset,
4502 _depth,
4503 )
4504 }
4505 }
4506 unsafe impl<
4507 D: fidl::encoding::ResourceDialect,
4508 T0: fidl::encoding::Encode<PixelFormatType, D>,
4509 T1: fidl::encoding::Encode<bool, D>,
4510 T2: fidl::encoding::Encode<FormatModifier, D>,
4511 > fidl::encoding::Encode<PixelFormat, D> for (T0, T1, T2)
4512 {
4513 #[inline]
4514 unsafe fn encode(
4515 self,
4516 encoder: &mut fidl::encoding::Encoder<'_, D>,
4517 offset: usize,
4518 depth: fidl::encoding::Depth,
4519 ) -> fidl::Result<()> {
4520 encoder.debug_check_bounds::<PixelFormat>(offset);
4521 unsafe {
4524 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4525 (ptr as *mut u64).write_unaligned(0);
4526 }
4527 self.0.encode(encoder, offset + 0, depth)?;
4529 self.1.encode(encoder, offset + 4, depth)?;
4530 self.2.encode(encoder, offset + 8, depth)?;
4531 Ok(())
4532 }
4533 }
4534
4535 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PixelFormat {
4536 #[inline(always)]
4537 fn new_empty() -> Self {
4538 Self {
4539 type_: fidl::new_empty!(PixelFormatType, D),
4540 has_format_modifier: fidl::new_empty!(bool, D),
4541 format_modifier: fidl::new_empty!(FormatModifier, D),
4542 }
4543 }
4544
4545 #[inline]
4546 unsafe fn decode(
4547 &mut self,
4548 decoder: &mut fidl::encoding::Decoder<'_, D>,
4549 offset: usize,
4550 _depth: fidl::encoding::Depth,
4551 ) -> fidl::Result<()> {
4552 decoder.debug_check_bounds::<Self>(offset);
4553 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4555 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4556 let mask = 0xffffff0000000000u64;
4557 let maskedval = padval & mask;
4558 if maskedval != 0 {
4559 return Err(fidl::Error::NonZeroPadding {
4560 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4561 });
4562 }
4563 fidl::decode!(PixelFormatType, D, &mut self.type_, decoder, offset + 0, _depth)?;
4564 fidl::decode!(bool, D, &mut self.has_format_modifier, decoder, offset + 4, _depth)?;
4565 fidl::decode!(
4566 FormatModifier,
4567 D,
4568 &mut self.format_modifier,
4569 decoder,
4570 offset + 8,
4571 _depth
4572 )?;
4573 Ok(())
4574 }
4575 }
4576
4577 impl fidl::encoding::ValueTypeMarker for SecureMemAddSecureHeapPhysicalRangeRequest {
4578 type Borrowed<'a> = &'a Self;
4579 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4580 value
4581 }
4582 }
4583
4584 unsafe impl fidl::encoding::TypeMarker for SecureMemAddSecureHeapPhysicalRangeRequest {
4585 type Owned = Self;
4586
4587 #[inline(always)]
4588 fn inline_align(_context: fidl::encoding::Context) -> usize {
4589 8
4590 }
4591
4592 #[inline(always)]
4593 fn inline_size(_context: fidl::encoding::Context) -> usize {
4594 16
4595 }
4596 }
4597
4598 unsafe impl<D: fidl::encoding::ResourceDialect>
4599 fidl::encoding::Encode<SecureMemAddSecureHeapPhysicalRangeRequest, D>
4600 for &SecureMemAddSecureHeapPhysicalRangeRequest
4601 {
4602 #[inline]
4603 unsafe fn encode(
4604 self,
4605 encoder: &mut fidl::encoding::Encoder<'_, D>,
4606 offset: usize,
4607 _depth: fidl::encoding::Depth,
4608 ) -> fidl::Result<()> {
4609 encoder.debug_check_bounds::<SecureMemAddSecureHeapPhysicalRangeRequest>(offset);
4610 fidl::encoding::Encode::<SecureMemAddSecureHeapPhysicalRangeRequest, D>::encode(
4612 (<SecureHeapAndRange as fidl::encoding::ValueTypeMarker>::borrow(&self.heap_range),),
4613 encoder,
4614 offset,
4615 _depth,
4616 )
4617 }
4618 }
4619 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SecureHeapAndRange, D>>
4620 fidl::encoding::Encode<SecureMemAddSecureHeapPhysicalRangeRequest, D> for (T0,)
4621 {
4622 #[inline]
4623 unsafe fn encode(
4624 self,
4625 encoder: &mut fidl::encoding::Encoder<'_, D>,
4626 offset: usize,
4627 depth: fidl::encoding::Depth,
4628 ) -> fidl::Result<()> {
4629 encoder.debug_check_bounds::<SecureMemAddSecureHeapPhysicalRangeRequest>(offset);
4630 self.0.encode(encoder, offset + 0, depth)?;
4634 Ok(())
4635 }
4636 }
4637
4638 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4639 for SecureMemAddSecureHeapPhysicalRangeRequest
4640 {
4641 #[inline(always)]
4642 fn new_empty() -> Self {
4643 Self { heap_range: fidl::new_empty!(SecureHeapAndRange, D) }
4644 }
4645
4646 #[inline]
4647 unsafe fn decode(
4648 &mut self,
4649 decoder: &mut fidl::encoding::Decoder<'_, D>,
4650 offset: usize,
4651 _depth: fidl::encoding::Depth,
4652 ) -> fidl::Result<()> {
4653 decoder.debug_check_bounds::<Self>(offset);
4654 fidl::decode!(
4656 SecureHeapAndRange,
4657 D,
4658 &mut self.heap_range,
4659 decoder,
4660 offset + 0,
4661 _depth
4662 )?;
4663 Ok(())
4664 }
4665 }
4666
4667 impl fidl::encoding::ValueTypeMarker for SecureMemDeleteSecureHeapPhysicalRangeRequest {
4668 type Borrowed<'a> = &'a Self;
4669 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4670 value
4671 }
4672 }
4673
4674 unsafe impl fidl::encoding::TypeMarker for SecureMemDeleteSecureHeapPhysicalRangeRequest {
4675 type Owned = Self;
4676
4677 #[inline(always)]
4678 fn inline_align(_context: fidl::encoding::Context) -> usize {
4679 8
4680 }
4681
4682 #[inline(always)]
4683 fn inline_size(_context: fidl::encoding::Context) -> usize {
4684 16
4685 }
4686 }
4687
4688 unsafe impl<D: fidl::encoding::ResourceDialect>
4689 fidl::encoding::Encode<SecureMemDeleteSecureHeapPhysicalRangeRequest, D>
4690 for &SecureMemDeleteSecureHeapPhysicalRangeRequest
4691 {
4692 #[inline]
4693 unsafe fn encode(
4694 self,
4695 encoder: &mut fidl::encoding::Encoder<'_, D>,
4696 offset: usize,
4697 _depth: fidl::encoding::Depth,
4698 ) -> fidl::Result<()> {
4699 encoder.debug_check_bounds::<SecureMemDeleteSecureHeapPhysicalRangeRequest>(offset);
4700 fidl::encoding::Encode::<SecureMemDeleteSecureHeapPhysicalRangeRequest, D>::encode(
4702 (<SecureHeapAndRange as fidl::encoding::ValueTypeMarker>::borrow(&self.heap_range),),
4703 encoder,
4704 offset,
4705 _depth,
4706 )
4707 }
4708 }
4709 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SecureHeapAndRange, D>>
4710 fidl::encoding::Encode<SecureMemDeleteSecureHeapPhysicalRangeRequest, D> for (T0,)
4711 {
4712 #[inline]
4713 unsafe fn encode(
4714 self,
4715 encoder: &mut fidl::encoding::Encoder<'_, D>,
4716 offset: usize,
4717 depth: fidl::encoding::Depth,
4718 ) -> fidl::Result<()> {
4719 encoder.debug_check_bounds::<SecureMemDeleteSecureHeapPhysicalRangeRequest>(offset);
4720 self.0.encode(encoder, offset + 0, depth)?;
4724 Ok(())
4725 }
4726 }
4727
4728 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4729 for SecureMemDeleteSecureHeapPhysicalRangeRequest
4730 {
4731 #[inline(always)]
4732 fn new_empty() -> Self {
4733 Self { heap_range: fidl::new_empty!(SecureHeapAndRange, D) }
4734 }
4735
4736 #[inline]
4737 unsafe fn decode(
4738 &mut self,
4739 decoder: &mut fidl::encoding::Decoder<'_, D>,
4740 offset: usize,
4741 _depth: fidl::encoding::Depth,
4742 ) -> fidl::Result<()> {
4743 decoder.debug_check_bounds::<Self>(offset);
4744 fidl::decode!(
4746 SecureHeapAndRange,
4747 D,
4748 &mut self.heap_range,
4749 decoder,
4750 offset + 0,
4751 _depth
4752 )?;
4753 Ok(())
4754 }
4755 }
4756
4757 impl fidl::encoding::ValueTypeMarker for SecureMemGetPhysicalSecureHeapPropertiesRequest {
4758 type Borrowed<'a> = &'a Self;
4759 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4760 value
4761 }
4762 }
4763
4764 unsafe impl fidl::encoding::TypeMarker for SecureMemGetPhysicalSecureHeapPropertiesRequest {
4765 type Owned = Self;
4766
4767 #[inline(always)]
4768 fn inline_align(_context: fidl::encoding::Context) -> usize {
4769 8
4770 }
4771
4772 #[inline(always)]
4773 fn inline_size(_context: fidl::encoding::Context) -> usize {
4774 16
4775 }
4776 }
4777
4778 unsafe impl<D: fidl::encoding::ResourceDialect>
4779 fidl::encoding::Encode<SecureMemGetPhysicalSecureHeapPropertiesRequest, D>
4780 for &SecureMemGetPhysicalSecureHeapPropertiesRequest
4781 {
4782 #[inline]
4783 unsafe fn encode(
4784 self,
4785 encoder: &mut fidl::encoding::Encoder<'_, D>,
4786 offset: usize,
4787 _depth: fidl::encoding::Depth,
4788 ) -> fidl::Result<()> {
4789 encoder.debug_check_bounds::<SecureMemGetPhysicalSecureHeapPropertiesRequest>(offset);
4790 fidl::encoding::Encode::<SecureMemGetPhysicalSecureHeapPropertiesRequest, D>::encode(
4792 (<SecureHeapAndRange as fidl::encoding::ValueTypeMarker>::borrow(
4793 &self.entire_heap,
4794 ),),
4795 encoder,
4796 offset,
4797 _depth,
4798 )
4799 }
4800 }
4801 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SecureHeapAndRange, D>>
4802 fidl::encoding::Encode<SecureMemGetPhysicalSecureHeapPropertiesRequest, D> for (T0,)
4803 {
4804 #[inline]
4805 unsafe fn encode(
4806 self,
4807 encoder: &mut fidl::encoding::Encoder<'_, D>,
4808 offset: usize,
4809 depth: fidl::encoding::Depth,
4810 ) -> fidl::Result<()> {
4811 encoder.debug_check_bounds::<SecureMemGetPhysicalSecureHeapPropertiesRequest>(offset);
4812 self.0.encode(encoder, offset + 0, depth)?;
4816 Ok(())
4817 }
4818 }
4819
4820 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4821 for SecureMemGetPhysicalSecureHeapPropertiesRequest
4822 {
4823 #[inline(always)]
4824 fn new_empty() -> Self {
4825 Self { entire_heap: fidl::new_empty!(SecureHeapAndRange, D) }
4826 }
4827
4828 #[inline]
4829 unsafe fn decode(
4830 &mut self,
4831 decoder: &mut fidl::encoding::Decoder<'_, D>,
4832 offset: usize,
4833 _depth: fidl::encoding::Depth,
4834 ) -> fidl::Result<()> {
4835 decoder.debug_check_bounds::<Self>(offset);
4836 fidl::decode!(
4838 SecureHeapAndRange,
4839 D,
4840 &mut self.entire_heap,
4841 decoder,
4842 offset + 0,
4843 _depth
4844 )?;
4845 Ok(())
4846 }
4847 }
4848
4849 impl fidl::encoding::ValueTypeMarker for SecureMemModifySecureHeapPhysicalRangeRequest {
4850 type Borrowed<'a> = &'a Self;
4851 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4852 value
4853 }
4854 }
4855
4856 unsafe impl fidl::encoding::TypeMarker for SecureMemModifySecureHeapPhysicalRangeRequest {
4857 type Owned = Self;
4858
4859 #[inline(always)]
4860 fn inline_align(_context: fidl::encoding::Context) -> usize {
4861 8
4862 }
4863
4864 #[inline(always)]
4865 fn inline_size(_context: fidl::encoding::Context) -> usize {
4866 16
4867 }
4868 }
4869
4870 unsafe impl<D: fidl::encoding::ResourceDialect>
4871 fidl::encoding::Encode<SecureMemModifySecureHeapPhysicalRangeRequest, D>
4872 for &SecureMemModifySecureHeapPhysicalRangeRequest
4873 {
4874 #[inline]
4875 unsafe fn encode(
4876 self,
4877 encoder: &mut fidl::encoding::Encoder<'_, D>,
4878 offset: usize,
4879 _depth: fidl::encoding::Depth,
4880 ) -> fidl::Result<()> {
4881 encoder.debug_check_bounds::<SecureMemModifySecureHeapPhysicalRangeRequest>(offset);
4882 fidl::encoding::Encode::<SecureMemModifySecureHeapPhysicalRangeRequest, D>::encode(
4884 (<SecureHeapAndRangeModification as fidl::encoding::ValueTypeMarker>::borrow(
4885 &self.range_modification,
4886 ),),
4887 encoder,
4888 offset,
4889 _depth,
4890 )
4891 }
4892 }
4893 unsafe impl<
4894 D: fidl::encoding::ResourceDialect,
4895 T0: fidl::encoding::Encode<SecureHeapAndRangeModification, D>,
4896 > fidl::encoding::Encode<SecureMemModifySecureHeapPhysicalRangeRequest, D> for (T0,)
4897 {
4898 #[inline]
4899 unsafe fn encode(
4900 self,
4901 encoder: &mut fidl::encoding::Encoder<'_, D>,
4902 offset: usize,
4903 depth: fidl::encoding::Depth,
4904 ) -> fidl::Result<()> {
4905 encoder.debug_check_bounds::<SecureMemModifySecureHeapPhysicalRangeRequest>(offset);
4906 self.0.encode(encoder, offset + 0, depth)?;
4910 Ok(())
4911 }
4912 }
4913
4914 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4915 for SecureMemModifySecureHeapPhysicalRangeRequest
4916 {
4917 #[inline(always)]
4918 fn new_empty() -> Self {
4919 Self { range_modification: fidl::new_empty!(SecureHeapAndRangeModification, D) }
4920 }
4921
4922 #[inline]
4923 unsafe fn decode(
4924 &mut self,
4925 decoder: &mut fidl::encoding::Decoder<'_, D>,
4926 offset: usize,
4927 _depth: fidl::encoding::Depth,
4928 ) -> fidl::Result<()> {
4929 decoder.debug_check_bounds::<Self>(offset);
4930 fidl::decode!(
4932 SecureHeapAndRangeModification,
4933 D,
4934 &mut self.range_modification,
4935 decoder,
4936 offset + 0,
4937 _depth
4938 )?;
4939 Ok(())
4940 }
4941 }
4942
4943 impl fidl::encoding::ValueTypeMarker for SecureMemZeroSubRangeRequest {
4944 type Borrowed<'a> = &'a Self;
4945 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4946 value
4947 }
4948 }
4949
4950 unsafe impl fidl::encoding::TypeMarker for SecureMemZeroSubRangeRequest {
4951 type Owned = Self;
4952
4953 #[inline(always)]
4954 fn inline_align(_context: fidl::encoding::Context) -> usize {
4955 8
4956 }
4957
4958 #[inline(always)]
4959 fn inline_size(_context: fidl::encoding::Context) -> usize {
4960 24
4961 }
4962 }
4963
4964 unsafe impl<D: fidl::encoding::ResourceDialect>
4965 fidl::encoding::Encode<SecureMemZeroSubRangeRequest, D> for &SecureMemZeroSubRangeRequest
4966 {
4967 #[inline]
4968 unsafe fn encode(
4969 self,
4970 encoder: &mut fidl::encoding::Encoder<'_, D>,
4971 offset: usize,
4972 _depth: fidl::encoding::Depth,
4973 ) -> fidl::Result<()> {
4974 encoder.debug_check_bounds::<SecureMemZeroSubRangeRequest>(offset);
4975 fidl::encoding::Encode::<SecureMemZeroSubRangeRequest, D>::encode(
4977 (
4978 <bool as fidl::encoding::ValueTypeMarker>::borrow(
4979 &self.is_covering_range_explicit,
4980 ),
4981 <SecureHeapAndRange as fidl::encoding::ValueTypeMarker>::borrow(
4982 &self.heap_range,
4983 ),
4984 ),
4985 encoder,
4986 offset,
4987 _depth,
4988 )
4989 }
4990 }
4991 unsafe impl<
4992 D: fidl::encoding::ResourceDialect,
4993 T0: fidl::encoding::Encode<bool, D>,
4994 T1: fidl::encoding::Encode<SecureHeapAndRange, D>,
4995 > fidl::encoding::Encode<SecureMemZeroSubRangeRequest, D> for (T0, T1)
4996 {
4997 #[inline]
4998 unsafe fn encode(
4999 self,
5000 encoder: &mut fidl::encoding::Encoder<'_, D>,
5001 offset: usize,
5002 depth: fidl::encoding::Depth,
5003 ) -> fidl::Result<()> {
5004 encoder.debug_check_bounds::<SecureMemZeroSubRangeRequest>(offset);
5005 unsafe {
5008 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5009 (ptr as *mut u64).write_unaligned(0);
5010 }
5011 self.0.encode(encoder, offset + 0, depth)?;
5013 self.1.encode(encoder, offset + 8, depth)?;
5014 Ok(())
5015 }
5016 }
5017
5018 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5019 for SecureMemZeroSubRangeRequest
5020 {
5021 #[inline(always)]
5022 fn new_empty() -> Self {
5023 Self {
5024 is_covering_range_explicit: fidl::new_empty!(bool, D),
5025 heap_range: fidl::new_empty!(SecureHeapAndRange, D),
5026 }
5027 }
5028
5029 #[inline]
5030 unsafe fn decode(
5031 &mut self,
5032 decoder: &mut fidl::encoding::Decoder<'_, D>,
5033 offset: usize,
5034 _depth: fidl::encoding::Depth,
5035 ) -> fidl::Result<()> {
5036 decoder.debug_check_bounds::<Self>(offset);
5037 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5039 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5040 let mask = 0xffffffffffffff00u64;
5041 let maskedval = padval & mask;
5042 if maskedval != 0 {
5043 return Err(fidl::Error::NonZeroPadding {
5044 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5045 });
5046 }
5047 fidl::decode!(
5048 bool,
5049 D,
5050 &mut self.is_covering_range_explicit,
5051 decoder,
5052 offset + 0,
5053 _depth
5054 )?;
5055 fidl::decode!(
5056 SecureHeapAndRange,
5057 D,
5058 &mut self.heap_range,
5059 decoder,
5060 offset + 8,
5061 _depth
5062 )?;
5063 Ok(())
5064 }
5065 }
5066
5067 impl fidl::encoding::ValueTypeMarker for SecureMemGetPhysicalSecureHeapPropertiesResponse {
5068 type Borrowed<'a> = &'a Self;
5069 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5070 value
5071 }
5072 }
5073
5074 unsafe impl fidl::encoding::TypeMarker for SecureMemGetPhysicalSecureHeapPropertiesResponse {
5075 type Owned = Self;
5076
5077 #[inline(always)]
5078 fn inline_align(_context: fidl::encoding::Context) -> usize {
5079 8
5080 }
5081
5082 #[inline(always)]
5083 fn inline_size(_context: fidl::encoding::Context) -> usize {
5084 16
5085 }
5086 }
5087
5088 unsafe impl<D: fidl::encoding::ResourceDialect>
5089 fidl::encoding::Encode<SecureMemGetPhysicalSecureHeapPropertiesResponse, D>
5090 for &SecureMemGetPhysicalSecureHeapPropertiesResponse
5091 {
5092 #[inline]
5093 unsafe fn encode(
5094 self,
5095 encoder: &mut fidl::encoding::Encoder<'_, D>,
5096 offset: usize,
5097 _depth: fidl::encoding::Depth,
5098 ) -> fidl::Result<()> {
5099 encoder.debug_check_bounds::<SecureMemGetPhysicalSecureHeapPropertiesResponse>(offset);
5100 fidl::encoding::Encode::<SecureMemGetPhysicalSecureHeapPropertiesResponse, D>::encode(
5102 (<SecureHeapProperties as fidl::encoding::ValueTypeMarker>::borrow(
5103 &self.properties,
5104 ),),
5105 encoder,
5106 offset,
5107 _depth,
5108 )
5109 }
5110 }
5111 unsafe impl<
5112 D: fidl::encoding::ResourceDialect,
5113 T0: fidl::encoding::Encode<SecureHeapProperties, D>,
5114 > fidl::encoding::Encode<SecureMemGetPhysicalSecureHeapPropertiesResponse, D> for (T0,)
5115 {
5116 #[inline]
5117 unsafe fn encode(
5118 self,
5119 encoder: &mut fidl::encoding::Encoder<'_, D>,
5120 offset: usize,
5121 depth: fidl::encoding::Depth,
5122 ) -> fidl::Result<()> {
5123 encoder.debug_check_bounds::<SecureMemGetPhysicalSecureHeapPropertiesResponse>(offset);
5124 self.0.encode(encoder, offset + 0, depth)?;
5128 Ok(())
5129 }
5130 }
5131
5132 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5133 for SecureMemGetPhysicalSecureHeapPropertiesResponse
5134 {
5135 #[inline(always)]
5136 fn new_empty() -> Self {
5137 Self { properties: fidl::new_empty!(SecureHeapProperties, D) }
5138 }
5139
5140 #[inline]
5141 unsafe fn decode(
5142 &mut self,
5143 decoder: &mut fidl::encoding::Decoder<'_, D>,
5144 offset: usize,
5145 _depth: fidl::encoding::Depth,
5146 ) -> fidl::Result<()> {
5147 decoder.debug_check_bounds::<Self>(offset);
5148 fidl::decode!(
5150 SecureHeapProperties,
5151 D,
5152 &mut self.properties,
5153 decoder,
5154 offset + 0,
5155 _depth
5156 )?;
5157 Ok(())
5158 }
5159 }
5160
5161 impl fidl::encoding::ValueTypeMarker for SecureMemGetPhysicalSecureHeapsResponse {
5162 type Borrowed<'a> = &'a Self;
5163 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5164 value
5165 }
5166 }
5167
5168 unsafe impl fidl::encoding::TypeMarker for SecureMemGetPhysicalSecureHeapsResponse {
5169 type Owned = Self;
5170
5171 #[inline(always)]
5172 fn inline_align(_context: fidl::encoding::Context) -> usize {
5173 8
5174 }
5175
5176 #[inline(always)]
5177 fn inline_size(_context: fidl::encoding::Context) -> usize {
5178 16
5179 }
5180 }
5181
5182 unsafe impl<D: fidl::encoding::ResourceDialect>
5183 fidl::encoding::Encode<SecureMemGetPhysicalSecureHeapsResponse, D>
5184 for &SecureMemGetPhysicalSecureHeapsResponse
5185 {
5186 #[inline]
5187 unsafe fn encode(
5188 self,
5189 encoder: &mut fidl::encoding::Encoder<'_, D>,
5190 offset: usize,
5191 _depth: fidl::encoding::Depth,
5192 ) -> fidl::Result<()> {
5193 encoder.debug_check_bounds::<SecureMemGetPhysicalSecureHeapsResponse>(offset);
5194 fidl::encoding::Encode::<SecureMemGetPhysicalSecureHeapsResponse, D>::encode(
5196 (<SecureHeapsAndRanges as fidl::encoding::ValueTypeMarker>::borrow(&self.heaps),),
5197 encoder,
5198 offset,
5199 _depth,
5200 )
5201 }
5202 }
5203 unsafe impl<
5204 D: fidl::encoding::ResourceDialect,
5205 T0: fidl::encoding::Encode<SecureHeapsAndRanges, D>,
5206 > fidl::encoding::Encode<SecureMemGetPhysicalSecureHeapsResponse, D> for (T0,)
5207 {
5208 #[inline]
5209 unsafe fn encode(
5210 self,
5211 encoder: &mut fidl::encoding::Encoder<'_, D>,
5212 offset: usize,
5213 depth: fidl::encoding::Depth,
5214 ) -> fidl::Result<()> {
5215 encoder.debug_check_bounds::<SecureMemGetPhysicalSecureHeapsResponse>(offset);
5216 self.0.encode(encoder, offset + 0, depth)?;
5220 Ok(())
5221 }
5222 }
5223
5224 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5225 for SecureMemGetPhysicalSecureHeapsResponse
5226 {
5227 #[inline(always)]
5228 fn new_empty() -> Self {
5229 Self { heaps: fidl::new_empty!(SecureHeapsAndRanges, D) }
5230 }
5231
5232 #[inline]
5233 unsafe fn decode(
5234 &mut self,
5235 decoder: &mut fidl::encoding::Decoder<'_, D>,
5236 offset: usize,
5237 _depth: fidl::encoding::Depth,
5238 ) -> fidl::Result<()> {
5239 decoder.debug_check_bounds::<Self>(offset);
5240 fidl::decode!(SecureHeapsAndRanges, D, &mut self.heaps, decoder, offset + 0, _depth)?;
5242 Ok(())
5243 }
5244 }
5245
5246 impl fidl::encoding::ValueTypeMarker for SingleBufferSettings {
5247 type Borrowed<'a> = &'a Self;
5248 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5249 value
5250 }
5251 }
5252
5253 unsafe impl fidl::encoding::TypeMarker for SingleBufferSettings {
5254 type Owned = Self;
5255
5256 #[inline(always)]
5257 fn inline_align(_context: fidl::encoding::Context) -> usize {
5258 8
5259 }
5260
5261 #[inline(always)]
5262 fn inline_size(_context: fidl::encoding::Context) -> usize {
5263 264
5264 }
5265 }
5266
5267 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SingleBufferSettings, D>
5268 for &SingleBufferSettings
5269 {
5270 #[inline]
5271 unsafe fn encode(
5272 self,
5273 encoder: &mut fidl::encoding::Encoder<'_, D>,
5274 offset: usize,
5275 _depth: fidl::encoding::Depth,
5276 ) -> fidl::Result<()> {
5277 encoder.debug_check_bounds::<SingleBufferSettings>(offset);
5278 fidl::encoding::Encode::<SingleBufferSettings, D>::encode(
5280 (
5281 <BufferMemorySettings as fidl::encoding::ValueTypeMarker>::borrow(
5282 &self.buffer_settings,
5283 ),
5284 <bool as fidl::encoding::ValueTypeMarker>::borrow(
5285 &self.has_image_format_constraints,
5286 ),
5287 <ImageFormatConstraints as fidl::encoding::ValueTypeMarker>::borrow(
5288 &self.image_format_constraints,
5289 ),
5290 ),
5291 encoder,
5292 offset,
5293 _depth,
5294 )
5295 }
5296 }
5297 unsafe impl<
5298 D: fidl::encoding::ResourceDialect,
5299 T0: fidl::encoding::Encode<BufferMemorySettings, D>,
5300 T1: fidl::encoding::Encode<bool, D>,
5301 T2: fidl::encoding::Encode<ImageFormatConstraints, D>,
5302 > fidl::encoding::Encode<SingleBufferSettings, D> for (T0, T1, T2)
5303 {
5304 #[inline]
5305 unsafe fn encode(
5306 self,
5307 encoder: &mut fidl::encoding::Encoder<'_, D>,
5308 offset: usize,
5309 depth: fidl::encoding::Depth,
5310 ) -> fidl::Result<()> {
5311 encoder.debug_check_bounds::<SingleBufferSettings>(offset);
5312 unsafe {
5315 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
5316 (ptr as *mut u64).write_unaligned(0);
5317 }
5318 self.0.encode(encoder, offset + 0, depth)?;
5320 self.1.encode(encoder, offset + 24, depth)?;
5321 self.2.encode(encoder, offset + 32, depth)?;
5322 Ok(())
5323 }
5324 }
5325
5326 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SingleBufferSettings {
5327 #[inline(always)]
5328 fn new_empty() -> Self {
5329 Self {
5330 buffer_settings: fidl::new_empty!(BufferMemorySettings, D),
5331 has_image_format_constraints: fidl::new_empty!(bool, D),
5332 image_format_constraints: fidl::new_empty!(ImageFormatConstraints, D),
5333 }
5334 }
5335
5336 #[inline]
5337 unsafe fn decode(
5338 &mut self,
5339 decoder: &mut fidl::encoding::Decoder<'_, D>,
5340 offset: usize,
5341 _depth: fidl::encoding::Depth,
5342 ) -> fidl::Result<()> {
5343 decoder.debug_check_bounds::<Self>(offset);
5344 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
5346 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5347 let mask = 0xffffffffffffff00u64;
5348 let maskedval = padval & mask;
5349 if maskedval != 0 {
5350 return Err(fidl::Error::NonZeroPadding {
5351 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
5352 });
5353 }
5354 fidl::decode!(
5355 BufferMemorySettings,
5356 D,
5357 &mut self.buffer_settings,
5358 decoder,
5359 offset + 0,
5360 _depth
5361 )?;
5362 fidl::decode!(
5363 bool,
5364 D,
5365 &mut self.has_image_format_constraints,
5366 decoder,
5367 offset + 24,
5368 _depth
5369 )?;
5370 fidl::decode!(
5371 ImageFormatConstraints,
5372 D,
5373 &mut self.image_format_constraints,
5374 decoder,
5375 offset + 32,
5376 _depth
5377 )?;
5378 Ok(())
5379 }
5380 }
5381
5382 impl SecureHeapAndRange {
5383 #[inline(always)]
5384 fn max_ordinal_present(&self) -> u64 {
5385 if let Some(_) = self.range {
5386 return 2;
5387 }
5388 if let Some(_) = self.heap {
5389 return 1;
5390 }
5391 0
5392 }
5393 }
5394
5395 impl fidl::encoding::ValueTypeMarker for SecureHeapAndRange {
5396 type Borrowed<'a> = &'a Self;
5397 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5398 value
5399 }
5400 }
5401
5402 unsafe impl fidl::encoding::TypeMarker for SecureHeapAndRange {
5403 type Owned = Self;
5404
5405 #[inline(always)]
5406 fn inline_align(_context: fidl::encoding::Context) -> usize {
5407 8
5408 }
5409
5410 #[inline(always)]
5411 fn inline_size(_context: fidl::encoding::Context) -> usize {
5412 16
5413 }
5414 }
5415
5416 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecureHeapAndRange, D>
5417 for &SecureHeapAndRange
5418 {
5419 unsafe fn encode(
5420 self,
5421 encoder: &mut fidl::encoding::Encoder<'_, D>,
5422 offset: usize,
5423 mut depth: fidl::encoding::Depth,
5424 ) -> fidl::Result<()> {
5425 encoder.debug_check_bounds::<SecureHeapAndRange>(offset);
5426 let max_ordinal: u64 = self.max_ordinal_present();
5428 encoder.write_num(max_ordinal, offset);
5429 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5430 if max_ordinal == 0 {
5432 return Ok(());
5433 }
5434 depth.increment()?;
5435 let envelope_size = 8;
5436 let bytes_len = max_ordinal as usize * envelope_size;
5437 #[allow(unused_variables)]
5438 let offset = encoder.out_of_line_offset(bytes_len);
5439 let mut _prev_end_offset: usize = 0;
5440 if 1 > max_ordinal {
5441 return Ok(());
5442 }
5443
5444 let cur_offset: usize = (1 - 1) * envelope_size;
5447
5448 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5450
5451 fidl::encoding::encode_in_envelope_optional::<HeapType, D>(
5456 self.heap.as_ref().map(<HeapType as fidl::encoding::ValueTypeMarker>::borrow),
5457 encoder,
5458 offset + cur_offset,
5459 depth,
5460 )?;
5461
5462 _prev_end_offset = cur_offset + envelope_size;
5463 if 2 > max_ordinal {
5464 return Ok(());
5465 }
5466
5467 let cur_offset: usize = (2 - 1) * envelope_size;
5470
5471 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5473
5474 fidl::encoding::encode_in_envelope_optional::<SecureHeapRange, D>(
5479 self.range
5480 .as_ref()
5481 .map(<SecureHeapRange as fidl::encoding::ValueTypeMarker>::borrow),
5482 encoder,
5483 offset + cur_offset,
5484 depth,
5485 )?;
5486
5487 _prev_end_offset = cur_offset + envelope_size;
5488
5489 Ok(())
5490 }
5491 }
5492
5493 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecureHeapAndRange {
5494 #[inline(always)]
5495 fn new_empty() -> Self {
5496 Self::default()
5497 }
5498
5499 unsafe fn decode(
5500 &mut self,
5501 decoder: &mut fidl::encoding::Decoder<'_, D>,
5502 offset: usize,
5503 mut depth: fidl::encoding::Depth,
5504 ) -> fidl::Result<()> {
5505 decoder.debug_check_bounds::<Self>(offset);
5506 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5507 None => return Err(fidl::Error::NotNullable),
5508 Some(len) => len,
5509 };
5510 if len == 0 {
5512 return Ok(());
5513 };
5514 depth.increment()?;
5515 let envelope_size = 8;
5516 let bytes_len = len * envelope_size;
5517 let offset = decoder.out_of_line_offset(bytes_len)?;
5518 let mut _next_ordinal_to_read = 0;
5520 let mut next_offset = offset;
5521 let end_offset = offset + bytes_len;
5522 _next_ordinal_to_read += 1;
5523 if next_offset >= end_offset {
5524 return Ok(());
5525 }
5526
5527 while _next_ordinal_to_read < 1 {
5529 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5530 _next_ordinal_to_read += 1;
5531 next_offset += envelope_size;
5532 }
5533
5534 let next_out_of_line = decoder.next_out_of_line();
5535 let handles_before = decoder.remaining_handles();
5536 if let Some((inlined, num_bytes, num_handles)) =
5537 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5538 {
5539 let member_inline_size =
5540 <HeapType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5541 if inlined != (member_inline_size <= 4) {
5542 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5543 }
5544 let inner_offset;
5545 let mut inner_depth = depth.clone();
5546 if inlined {
5547 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5548 inner_offset = next_offset;
5549 } else {
5550 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5551 inner_depth.increment()?;
5552 }
5553 let val_ref = self.heap.get_or_insert_with(|| fidl::new_empty!(HeapType, D));
5554 fidl::decode!(HeapType, D, val_ref, decoder, inner_offset, inner_depth)?;
5555 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5556 {
5557 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5558 }
5559 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5560 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5561 }
5562 }
5563
5564 next_offset += envelope_size;
5565 _next_ordinal_to_read += 1;
5566 if next_offset >= end_offset {
5567 return Ok(());
5568 }
5569
5570 while _next_ordinal_to_read < 2 {
5572 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5573 _next_ordinal_to_read += 1;
5574 next_offset += envelope_size;
5575 }
5576
5577 let next_out_of_line = decoder.next_out_of_line();
5578 let handles_before = decoder.remaining_handles();
5579 if let Some((inlined, num_bytes, num_handles)) =
5580 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5581 {
5582 let member_inline_size =
5583 <SecureHeapRange as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5584 if inlined != (member_inline_size <= 4) {
5585 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5586 }
5587 let inner_offset;
5588 let mut inner_depth = depth.clone();
5589 if inlined {
5590 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5591 inner_offset = next_offset;
5592 } else {
5593 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5594 inner_depth.increment()?;
5595 }
5596 let val_ref =
5597 self.range.get_or_insert_with(|| fidl::new_empty!(SecureHeapRange, D));
5598 fidl::decode!(SecureHeapRange, D, val_ref, decoder, inner_offset, inner_depth)?;
5599 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5600 {
5601 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5602 }
5603 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5604 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5605 }
5606 }
5607
5608 next_offset += envelope_size;
5609
5610 while next_offset < end_offset {
5612 _next_ordinal_to_read += 1;
5613 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5614 next_offset += envelope_size;
5615 }
5616
5617 Ok(())
5618 }
5619 }
5620
5621 impl SecureHeapAndRangeModification {
5622 #[inline(always)]
5623 fn max_ordinal_present(&self) -> u64 {
5624 if let Some(_) = self.new_range {
5625 return 3;
5626 }
5627 if let Some(_) = self.old_range {
5628 return 2;
5629 }
5630 if let Some(_) = self.heap {
5631 return 1;
5632 }
5633 0
5634 }
5635 }
5636
5637 impl fidl::encoding::ValueTypeMarker for SecureHeapAndRangeModification {
5638 type Borrowed<'a> = &'a Self;
5639 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5640 value
5641 }
5642 }
5643
5644 unsafe impl fidl::encoding::TypeMarker for SecureHeapAndRangeModification {
5645 type Owned = Self;
5646
5647 #[inline(always)]
5648 fn inline_align(_context: fidl::encoding::Context) -> usize {
5649 8
5650 }
5651
5652 #[inline(always)]
5653 fn inline_size(_context: fidl::encoding::Context) -> usize {
5654 16
5655 }
5656 }
5657
5658 unsafe impl<D: fidl::encoding::ResourceDialect>
5659 fidl::encoding::Encode<SecureHeapAndRangeModification, D>
5660 for &SecureHeapAndRangeModification
5661 {
5662 unsafe fn encode(
5663 self,
5664 encoder: &mut fidl::encoding::Encoder<'_, D>,
5665 offset: usize,
5666 mut depth: fidl::encoding::Depth,
5667 ) -> fidl::Result<()> {
5668 encoder.debug_check_bounds::<SecureHeapAndRangeModification>(offset);
5669 let max_ordinal: u64 = self.max_ordinal_present();
5671 encoder.write_num(max_ordinal, offset);
5672 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5673 if max_ordinal == 0 {
5675 return Ok(());
5676 }
5677 depth.increment()?;
5678 let envelope_size = 8;
5679 let bytes_len = max_ordinal as usize * envelope_size;
5680 #[allow(unused_variables)]
5681 let offset = encoder.out_of_line_offset(bytes_len);
5682 let mut _prev_end_offset: usize = 0;
5683 if 1 > max_ordinal {
5684 return Ok(());
5685 }
5686
5687 let cur_offset: usize = (1 - 1) * envelope_size;
5690
5691 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5693
5694 fidl::encoding::encode_in_envelope_optional::<HeapType, D>(
5699 self.heap.as_ref().map(<HeapType as fidl::encoding::ValueTypeMarker>::borrow),
5700 encoder,
5701 offset + cur_offset,
5702 depth,
5703 )?;
5704
5705 _prev_end_offset = cur_offset + envelope_size;
5706 if 2 > max_ordinal {
5707 return Ok(());
5708 }
5709
5710 let cur_offset: usize = (2 - 1) * envelope_size;
5713
5714 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5716
5717 fidl::encoding::encode_in_envelope_optional::<SecureHeapRange, D>(
5722 self.old_range
5723 .as_ref()
5724 .map(<SecureHeapRange as fidl::encoding::ValueTypeMarker>::borrow),
5725 encoder,
5726 offset + cur_offset,
5727 depth,
5728 )?;
5729
5730 _prev_end_offset = cur_offset + envelope_size;
5731 if 3 > max_ordinal {
5732 return Ok(());
5733 }
5734
5735 let cur_offset: usize = (3 - 1) * envelope_size;
5738
5739 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5741
5742 fidl::encoding::encode_in_envelope_optional::<SecureHeapRange, D>(
5747 self.new_range
5748 .as_ref()
5749 .map(<SecureHeapRange as fidl::encoding::ValueTypeMarker>::borrow),
5750 encoder,
5751 offset + cur_offset,
5752 depth,
5753 )?;
5754
5755 _prev_end_offset = cur_offset + envelope_size;
5756
5757 Ok(())
5758 }
5759 }
5760
5761 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5762 for SecureHeapAndRangeModification
5763 {
5764 #[inline(always)]
5765 fn new_empty() -> Self {
5766 Self::default()
5767 }
5768
5769 unsafe fn decode(
5770 &mut self,
5771 decoder: &mut fidl::encoding::Decoder<'_, D>,
5772 offset: usize,
5773 mut depth: fidl::encoding::Depth,
5774 ) -> fidl::Result<()> {
5775 decoder.debug_check_bounds::<Self>(offset);
5776 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5777 None => return Err(fidl::Error::NotNullable),
5778 Some(len) => len,
5779 };
5780 if len == 0 {
5782 return Ok(());
5783 };
5784 depth.increment()?;
5785 let envelope_size = 8;
5786 let bytes_len = len * envelope_size;
5787 let offset = decoder.out_of_line_offset(bytes_len)?;
5788 let mut _next_ordinal_to_read = 0;
5790 let mut next_offset = offset;
5791 let end_offset = offset + bytes_len;
5792 _next_ordinal_to_read += 1;
5793 if next_offset >= end_offset {
5794 return Ok(());
5795 }
5796
5797 while _next_ordinal_to_read < 1 {
5799 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5800 _next_ordinal_to_read += 1;
5801 next_offset += envelope_size;
5802 }
5803
5804 let next_out_of_line = decoder.next_out_of_line();
5805 let handles_before = decoder.remaining_handles();
5806 if let Some((inlined, num_bytes, num_handles)) =
5807 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5808 {
5809 let member_inline_size =
5810 <HeapType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5811 if inlined != (member_inline_size <= 4) {
5812 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5813 }
5814 let inner_offset;
5815 let mut inner_depth = depth.clone();
5816 if inlined {
5817 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5818 inner_offset = next_offset;
5819 } else {
5820 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5821 inner_depth.increment()?;
5822 }
5823 let val_ref = self.heap.get_or_insert_with(|| fidl::new_empty!(HeapType, D));
5824 fidl::decode!(HeapType, D, val_ref, decoder, inner_offset, inner_depth)?;
5825 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5826 {
5827 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5828 }
5829 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5830 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5831 }
5832 }
5833
5834 next_offset += envelope_size;
5835 _next_ordinal_to_read += 1;
5836 if next_offset >= end_offset {
5837 return Ok(());
5838 }
5839
5840 while _next_ordinal_to_read < 2 {
5842 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5843 _next_ordinal_to_read += 1;
5844 next_offset += envelope_size;
5845 }
5846
5847 let next_out_of_line = decoder.next_out_of_line();
5848 let handles_before = decoder.remaining_handles();
5849 if let Some((inlined, num_bytes, num_handles)) =
5850 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5851 {
5852 let member_inline_size =
5853 <SecureHeapRange as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5854 if inlined != (member_inline_size <= 4) {
5855 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5856 }
5857 let inner_offset;
5858 let mut inner_depth = depth.clone();
5859 if inlined {
5860 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5861 inner_offset = next_offset;
5862 } else {
5863 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5864 inner_depth.increment()?;
5865 }
5866 let val_ref =
5867 self.old_range.get_or_insert_with(|| fidl::new_empty!(SecureHeapRange, D));
5868 fidl::decode!(SecureHeapRange, D, val_ref, decoder, inner_offset, inner_depth)?;
5869 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5870 {
5871 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5872 }
5873 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5874 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5875 }
5876 }
5877
5878 next_offset += envelope_size;
5879 _next_ordinal_to_read += 1;
5880 if next_offset >= end_offset {
5881 return Ok(());
5882 }
5883
5884 while _next_ordinal_to_read < 3 {
5886 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5887 _next_ordinal_to_read += 1;
5888 next_offset += envelope_size;
5889 }
5890
5891 let next_out_of_line = decoder.next_out_of_line();
5892 let handles_before = decoder.remaining_handles();
5893 if let Some((inlined, num_bytes, num_handles)) =
5894 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5895 {
5896 let member_inline_size =
5897 <SecureHeapRange as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5898 if inlined != (member_inline_size <= 4) {
5899 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5900 }
5901 let inner_offset;
5902 let mut inner_depth = depth.clone();
5903 if inlined {
5904 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5905 inner_offset = next_offset;
5906 } else {
5907 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5908 inner_depth.increment()?;
5909 }
5910 let val_ref =
5911 self.new_range.get_or_insert_with(|| fidl::new_empty!(SecureHeapRange, D));
5912 fidl::decode!(SecureHeapRange, D, val_ref, decoder, inner_offset, inner_depth)?;
5913 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5914 {
5915 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5916 }
5917 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5918 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5919 }
5920 }
5921
5922 next_offset += envelope_size;
5923
5924 while next_offset < end_offset {
5926 _next_ordinal_to_read += 1;
5927 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5928 next_offset += envelope_size;
5929 }
5930
5931 Ok(())
5932 }
5933 }
5934
5935 impl SecureHeapAndRanges {
5936 #[inline(always)]
5937 fn max_ordinal_present(&self) -> u64 {
5938 if let Some(_) = self.ranges {
5939 return 2;
5940 }
5941 if let Some(_) = self.heap {
5942 return 1;
5943 }
5944 0
5945 }
5946 }
5947
5948 impl fidl::encoding::ValueTypeMarker for SecureHeapAndRanges {
5949 type Borrowed<'a> = &'a Self;
5950 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5951 value
5952 }
5953 }
5954
5955 unsafe impl fidl::encoding::TypeMarker for SecureHeapAndRanges {
5956 type Owned = Self;
5957
5958 #[inline(always)]
5959 fn inline_align(_context: fidl::encoding::Context) -> usize {
5960 8
5961 }
5962
5963 #[inline(always)]
5964 fn inline_size(_context: fidl::encoding::Context) -> usize {
5965 16
5966 }
5967 }
5968
5969 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecureHeapAndRanges, D>
5970 for &SecureHeapAndRanges
5971 {
5972 unsafe fn encode(
5973 self,
5974 encoder: &mut fidl::encoding::Encoder<'_, D>,
5975 offset: usize,
5976 mut depth: fidl::encoding::Depth,
5977 ) -> fidl::Result<()> {
5978 encoder.debug_check_bounds::<SecureHeapAndRanges>(offset);
5979 let max_ordinal: u64 = self.max_ordinal_present();
5981 encoder.write_num(max_ordinal, offset);
5982 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5983 if max_ordinal == 0 {
5985 return Ok(());
5986 }
5987 depth.increment()?;
5988 let envelope_size = 8;
5989 let bytes_len = max_ordinal as usize * envelope_size;
5990 #[allow(unused_variables)]
5991 let offset = encoder.out_of_line_offset(bytes_len);
5992 let mut _prev_end_offset: usize = 0;
5993 if 1 > max_ordinal {
5994 return Ok(());
5995 }
5996
5997 let cur_offset: usize = (1 - 1) * envelope_size;
6000
6001 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6003
6004 fidl::encoding::encode_in_envelope_optional::<HeapType, D>(
6009 self.heap.as_ref().map(<HeapType as fidl::encoding::ValueTypeMarker>::borrow),
6010 encoder,
6011 offset + cur_offset,
6012 depth,
6013 )?;
6014
6015 _prev_end_offset = cur_offset + envelope_size;
6016 if 2 > max_ordinal {
6017 return Ok(());
6018 }
6019
6020 let cur_offset: usize = (2 - 1) * envelope_size;
6023
6024 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6026
6027 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<SecureHeapRange, 128>, D>(
6032 self.ranges.as_ref().map(<fidl::encoding::Vector<SecureHeapRange, 128> as fidl::encoding::ValueTypeMarker>::borrow),
6033 encoder, offset + cur_offset, depth
6034 )?;
6035
6036 _prev_end_offset = cur_offset + envelope_size;
6037
6038 Ok(())
6039 }
6040 }
6041
6042 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecureHeapAndRanges {
6043 #[inline(always)]
6044 fn new_empty() -> Self {
6045 Self::default()
6046 }
6047
6048 unsafe fn decode(
6049 &mut self,
6050 decoder: &mut fidl::encoding::Decoder<'_, D>,
6051 offset: usize,
6052 mut depth: fidl::encoding::Depth,
6053 ) -> fidl::Result<()> {
6054 decoder.debug_check_bounds::<Self>(offset);
6055 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6056 None => return Err(fidl::Error::NotNullable),
6057 Some(len) => len,
6058 };
6059 if len == 0 {
6061 return Ok(());
6062 };
6063 depth.increment()?;
6064 let envelope_size = 8;
6065 let bytes_len = len * envelope_size;
6066 let offset = decoder.out_of_line_offset(bytes_len)?;
6067 let mut _next_ordinal_to_read = 0;
6069 let mut next_offset = offset;
6070 let end_offset = offset + bytes_len;
6071 _next_ordinal_to_read += 1;
6072 if next_offset >= end_offset {
6073 return Ok(());
6074 }
6075
6076 while _next_ordinal_to_read < 1 {
6078 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6079 _next_ordinal_to_read += 1;
6080 next_offset += envelope_size;
6081 }
6082
6083 let next_out_of_line = decoder.next_out_of_line();
6084 let handles_before = decoder.remaining_handles();
6085 if let Some((inlined, num_bytes, num_handles)) =
6086 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6087 {
6088 let member_inline_size =
6089 <HeapType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6090 if inlined != (member_inline_size <= 4) {
6091 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6092 }
6093 let inner_offset;
6094 let mut inner_depth = depth.clone();
6095 if inlined {
6096 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6097 inner_offset = next_offset;
6098 } else {
6099 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6100 inner_depth.increment()?;
6101 }
6102 let val_ref = self.heap.get_or_insert_with(|| fidl::new_empty!(HeapType, D));
6103 fidl::decode!(HeapType, D, val_ref, decoder, inner_offset, inner_depth)?;
6104 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6105 {
6106 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6107 }
6108 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6109 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6110 }
6111 }
6112
6113 next_offset += envelope_size;
6114 _next_ordinal_to_read += 1;
6115 if next_offset >= end_offset {
6116 return Ok(());
6117 }
6118
6119 while _next_ordinal_to_read < 2 {
6121 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6122 _next_ordinal_to_read += 1;
6123 next_offset += envelope_size;
6124 }
6125
6126 let next_out_of_line = decoder.next_out_of_line();
6127 let handles_before = decoder.remaining_handles();
6128 if let Some((inlined, num_bytes, num_handles)) =
6129 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6130 {
6131 let member_inline_size = <fidl::encoding::Vector<SecureHeapRange, 128> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6132 if inlined != (member_inline_size <= 4) {
6133 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6134 }
6135 let inner_offset;
6136 let mut inner_depth = depth.clone();
6137 if inlined {
6138 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6139 inner_offset = next_offset;
6140 } else {
6141 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6142 inner_depth.increment()?;
6143 }
6144 let val_ref = self.ranges.get_or_insert_with(
6145 || fidl::new_empty!(fidl::encoding::Vector<SecureHeapRange, 128>, D),
6146 );
6147 fidl::decode!(fidl::encoding::Vector<SecureHeapRange, 128>, D, val_ref, decoder, inner_offset, inner_depth)?;
6148 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6149 {
6150 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6151 }
6152 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6153 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6154 }
6155 }
6156
6157 next_offset += envelope_size;
6158
6159 while next_offset < end_offset {
6161 _next_ordinal_to_read += 1;
6162 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6163 next_offset += envelope_size;
6164 }
6165
6166 Ok(())
6167 }
6168 }
6169
6170 impl SecureHeapProperties {
6171 #[inline(always)]
6172 fn max_ordinal_present(&self) -> u64 {
6173 if let Some(_) = self.is_mod_protected_range_available {
6174 return 5;
6175 }
6176 if let Some(_) = self.max_protected_range_count {
6177 return 4;
6178 }
6179 if let Some(_) = self.protected_range_granularity {
6180 return 3;
6181 }
6182 if let Some(_) = self.dynamic_protection_ranges {
6183 return 2;
6184 }
6185 if let Some(_) = self.heap {
6186 return 1;
6187 }
6188 0
6189 }
6190 }
6191
6192 impl fidl::encoding::ValueTypeMarker for SecureHeapProperties {
6193 type Borrowed<'a> = &'a Self;
6194 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6195 value
6196 }
6197 }
6198
6199 unsafe impl fidl::encoding::TypeMarker for SecureHeapProperties {
6200 type Owned = Self;
6201
6202 #[inline(always)]
6203 fn inline_align(_context: fidl::encoding::Context) -> usize {
6204 8
6205 }
6206
6207 #[inline(always)]
6208 fn inline_size(_context: fidl::encoding::Context) -> usize {
6209 16
6210 }
6211 }
6212
6213 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecureHeapProperties, D>
6214 for &SecureHeapProperties
6215 {
6216 unsafe fn encode(
6217 self,
6218 encoder: &mut fidl::encoding::Encoder<'_, D>,
6219 offset: usize,
6220 mut depth: fidl::encoding::Depth,
6221 ) -> fidl::Result<()> {
6222 encoder.debug_check_bounds::<SecureHeapProperties>(offset);
6223 let max_ordinal: u64 = self.max_ordinal_present();
6225 encoder.write_num(max_ordinal, offset);
6226 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6227 if max_ordinal == 0 {
6229 return Ok(());
6230 }
6231 depth.increment()?;
6232 let envelope_size = 8;
6233 let bytes_len = max_ordinal as usize * envelope_size;
6234 #[allow(unused_variables)]
6235 let offset = encoder.out_of_line_offset(bytes_len);
6236 let mut _prev_end_offset: usize = 0;
6237 if 1 > max_ordinal {
6238 return Ok(());
6239 }
6240
6241 let cur_offset: usize = (1 - 1) * envelope_size;
6244
6245 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6247
6248 fidl::encoding::encode_in_envelope_optional::<HeapType, D>(
6253 self.heap.as_ref().map(<HeapType as fidl::encoding::ValueTypeMarker>::borrow),
6254 encoder,
6255 offset + cur_offset,
6256 depth,
6257 )?;
6258
6259 _prev_end_offset = cur_offset + envelope_size;
6260 if 2 > max_ordinal {
6261 return Ok(());
6262 }
6263
6264 let cur_offset: usize = (2 - 1) * envelope_size;
6267
6268 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6270
6271 fidl::encoding::encode_in_envelope_optional::<bool, D>(
6276 self.dynamic_protection_ranges
6277 .as_ref()
6278 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6279 encoder,
6280 offset + cur_offset,
6281 depth,
6282 )?;
6283
6284 _prev_end_offset = cur_offset + envelope_size;
6285 if 3 > max_ordinal {
6286 return Ok(());
6287 }
6288
6289 let cur_offset: usize = (3 - 1) * envelope_size;
6292
6293 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6295
6296 fidl::encoding::encode_in_envelope_optional::<u32, D>(
6301 self.protected_range_granularity
6302 .as_ref()
6303 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
6304 encoder,
6305 offset + cur_offset,
6306 depth,
6307 )?;
6308
6309 _prev_end_offset = cur_offset + envelope_size;
6310 if 4 > max_ordinal {
6311 return Ok(());
6312 }
6313
6314 let cur_offset: usize = (4 - 1) * envelope_size;
6317
6318 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6320
6321 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6326 self.max_protected_range_count
6327 .as_ref()
6328 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6329 encoder,
6330 offset + cur_offset,
6331 depth,
6332 )?;
6333
6334 _prev_end_offset = cur_offset + envelope_size;
6335 if 5 > max_ordinal {
6336 return Ok(());
6337 }
6338
6339 let cur_offset: usize = (5 - 1) * envelope_size;
6342
6343 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6345
6346 fidl::encoding::encode_in_envelope_optional::<bool, D>(
6351 self.is_mod_protected_range_available
6352 .as_ref()
6353 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6354 encoder,
6355 offset + cur_offset,
6356 depth,
6357 )?;
6358
6359 _prev_end_offset = cur_offset + envelope_size;
6360
6361 Ok(())
6362 }
6363 }
6364
6365 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecureHeapProperties {
6366 #[inline(always)]
6367 fn new_empty() -> Self {
6368 Self::default()
6369 }
6370
6371 unsafe fn decode(
6372 &mut self,
6373 decoder: &mut fidl::encoding::Decoder<'_, D>,
6374 offset: usize,
6375 mut depth: fidl::encoding::Depth,
6376 ) -> fidl::Result<()> {
6377 decoder.debug_check_bounds::<Self>(offset);
6378 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6379 None => return Err(fidl::Error::NotNullable),
6380 Some(len) => len,
6381 };
6382 if len == 0 {
6384 return Ok(());
6385 };
6386 depth.increment()?;
6387 let envelope_size = 8;
6388 let bytes_len = len * envelope_size;
6389 let offset = decoder.out_of_line_offset(bytes_len)?;
6390 let mut _next_ordinal_to_read = 0;
6392 let mut next_offset = offset;
6393 let end_offset = offset + bytes_len;
6394 _next_ordinal_to_read += 1;
6395 if next_offset >= end_offset {
6396 return Ok(());
6397 }
6398
6399 while _next_ordinal_to_read < 1 {
6401 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6402 _next_ordinal_to_read += 1;
6403 next_offset += envelope_size;
6404 }
6405
6406 let next_out_of_line = decoder.next_out_of_line();
6407 let handles_before = decoder.remaining_handles();
6408 if let Some((inlined, num_bytes, num_handles)) =
6409 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6410 {
6411 let member_inline_size =
6412 <HeapType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6413 if inlined != (member_inline_size <= 4) {
6414 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6415 }
6416 let inner_offset;
6417 let mut inner_depth = depth.clone();
6418 if inlined {
6419 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6420 inner_offset = next_offset;
6421 } else {
6422 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6423 inner_depth.increment()?;
6424 }
6425 let val_ref = self.heap.get_or_insert_with(|| fidl::new_empty!(HeapType, D));
6426 fidl::decode!(HeapType, D, val_ref, decoder, inner_offset, inner_depth)?;
6427 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6428 {
6429 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6430 }
6431 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6432 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6433 }
6434 }
6435
6436 next_offset += envelope_size;
6437 _next_ordinal_to_read += 1;
6438 if next_offset >= end_offset {
6439 return Ok(());
6440 }
6441
6442 while _next_ordinal_to_read < 2 {
6444 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6445 _next_ordinal_to_read += 1;
6446 next_offset += envelope_size;
6447 }
6448
6449 let next_out_of_line = decoder.next_out_of_line();
6450 let handles_before = decoder.remaining_handles();
6451 if let Some((inlined, num_bytes, num_handles)) =
6452 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6453 {
6454 let member_inline_size =
6455 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6456 if inlined != (member_inline_size <= 4) {
6457 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6458 }
6459 let inner_offset;
6460 let mut inner_depth = depth.clone();
6461 if inlined {
6462 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6463 inner_offset = next_offset;
6464 } else {
6465 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6466 inner_depth.increment()?;
6467 }
6468 let val_ref =
6469 self.dynamic_protection_ranges.get_or_insert_with(|| fidl::new_empty!(bool, D));
6470 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6471 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6472 {
6473 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6474 }
6475 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6476 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6477 }
6478 }
6479
6480 next_offset += envelope_size;
6481 _next_ordinal_to_read += 1;
6482 if next_offset >= end_offset {
6483 return Ok(());
6484 }
6485
6486 while _next_ordinal_to_read < 3 {
6488 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6489 _next_ordinal_to_read += 1;
6490 next_offset += envelope_size;
6491 }
6492
6493 let next_out_of_line = decoder.next_out_of_line();
6494 let handles_before = decoder.remaining_handles();
6495 if let Some((inlined, num_bytes, num_handles)) =
6496 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6497 {
6498 let member_inline_size =
6499 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6500 if inlined != (member_inline_size <= 4) {
6501 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6502 }
6503 let inner_offset;
6504 let mut inner_depth = depth.clone();
6505 if inlined {
6506 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6507 inner_offset = next_offset;
6508 } else {
6509 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6510 inner_depth.increment()?;
6511 }
6512 let val_ref = self
6513 .protected_range_granularity
6514 .get_or_insert_with(|| fidl::new_empty!(u32, D));
6515 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
6516 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6517 {
6518 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6519 }
6520 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6521 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6522 }
6523 }
6524
6525 next_offset += envelope_size;
6526 _next_ordinal_to_read += 1;
6527 if next_offset >= end_offset {
6528 return Ok(());
6529 }
6530
6531 while _next_ordinal_to_read < 4 {
6533 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6534 _next_ordinal_to_read += 1;
6535 next_offset += envelope_size;
6536 }
6537
6538 let next_out_of_line = decoder.next_out_of_line();
6539 let handles_before = decoder.remaining_handles();
6540 if let Some((inlined, num_bytes, num_handles)) =
6541 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6542 {
6543 let member_inline_size =
6544 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6545 if inlined != (member_inline_size <= 4) {
6546 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6547 }
6548 let inner_offset;
6549 let mut inner_depth = depth.clone();
6550 if inlined {
6551 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6552 inner_offset = next_offset;
6553 } else {
6554 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6555 inner_depth.increment()?;
6556 }
6557 let val_ref =
6558 self.max_protected_range_count.get_or_insert_with(|| fidl::new_empty!(u64, D));
6559 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6560 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6561 {
6562 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6563 }
6564 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6565 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6566 }
6567 }
6568
6569 next_offset += envelope_size;
6570 _next_ordinal_to_read += 1;
6571 if next_offset >= end_offset {
6572 return Ok(());
6573 }
6574
6575 while _next_ordinal_to_read < 5 {
6577 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6578 _next_ordinal_to_read += 1;
6579 next_offset += envelope_size;
6580 }
6581
6582 let next_out_of_line = decoder.next_out_of_line();
6583 let handles_before = decoder.remaining_handles();
6584 if let Some((inlined, num_bytes, num_handles)) =
6585 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6586 {
6587 let member_inline_size =
6588 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6589 if inlined != (member_inline_size <= 4) {
6590 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6591 }
6592 let inner_offset;
6593 let mut inner_depth = depth.clone();
6594 if inlined {
6595 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6596 inner_offset = next_offset;
6597 } else {
6598 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6599 inner_depth.increment()?;
6600 }
6601 let val_ref = self
6602 .is_mod_protected_range_available
6603 .get_or_insert_with(|| fidl::new_empty!(bool, D));
6604 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6605 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6606 {
6607 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6608 }
6609 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6610 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6611 }
6612 }
6613
6614 next_offset += envelope_size;
6615
6616 while next_offset < end_offset {
6618 _next_ordinal_to_read += 1;
6619 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6620 next_offset += envelope_size;
6621 }
6622
6623 Ok(())
6624 }
6625 }
6626
6627 impl SecureHeapRange {
6628 #[inline(always)]
6629 fn max_ordinal_present(&self) -> u64 {
6630 if let Some(_) = self.size_bytes {
6631 return 2;
6632 }
6633 if let Some(_) = self.physical_address {
6634 return 1;
6635 }
6636 0
6637 }
6638 }
6639
6640 impl fidl::encoding::ValueTypeMarker for SecureHeapRange {
6641 type Borrowed<'a> = &'a Self;
6642 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6643 value
6644 }
6645 }
6646
6647 unsafe impl fidl::encoding::TypeMarker for SecureHeapRange {
6648 type Owned = Self;
6649
6650 #[inline(always)]
6651 fn inline_align(_context: fidl::encoding::Context) -> usize {
6652 8
6653 }
6654
6655 #[inline(always)]
6656 fn inline_size(_context: fidl::encoding::Context) -> usize {
6657 16
6658 }
6659 }
6660
6661 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecureHeapRange, D>
6662 for &SecureHeapRange
6663 {
6664 unsafe fn encode(
6665 self,
6666 encoder: &mut fidl::encoding::Encoder<'_, D>,
6667 offset: usize,
6668 mut depth: fidl::encoding::Depth,
6669 ) -> fidl::Result<()> {
6670 encoder.debug_check_bounds::<SecureHeapRange>(offset);
6671 let max_ordinal: u64 = self.max_ordinal_present();
6673 encoder.write_num(max_ordinal, offset);
6674 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6675 if max_ordinal == 0 {
6677 return Ok(());
6678 }
6679 depth.increment()?;
6680 let envelope_size = 8;
6681 let bytes_len = max_ordinal as usize * envelope_size;
6682 #[allow(unused_variables)]
6683 let offset = encoder.out_of_line_offset(bytes_len);
6684 let mut _prev_end_offset: usize = 0;
6685 if 1 > max_ordinal {
6686 return Ok(());
6687 }
6688
6689 let cur_offset: usize = (1 - 1) * envelope_size;
6692
6693 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6695
6696 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6701 self.physical_address
6702 .as_ref()
6703 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6704 encoder,
6705 offset + cur_offset,
6706 depth,
6707 )?;
6708
6709 _prev_end_offset = cur_offset + envelope_size;
6710 if 2 > max_ordinal {
6711 return Ok(());
6712 }
6713
6714 let cur_offset: usize = (2 - 1) * envelope_size;
6717
6718 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6720
6721 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6726 self.size_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6727 encoder,
6728 offset + cur_offset,
6729 depth,
6730 )?;
6731
6732 _prev_end_offset = cur_offset + envelope_size;
6733
6734 Ok(())
6735 }
6736 }
6737
6738 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecureHeapRange {
6739 #[inline(always)]
6740 fn new_empty() -> Self {
6741 Self::default()
6742 }
6743
6744 unsafe fn decode(
6745 &mut self,
6746 decoder: &mut fidl::encoding::Decoder<'_, D>,
6747 offset: usize,
6748 mut depth: fidl::encoding::Depth,
6749 ) -> fidl::Result<()> {
6750 decoder.debug_check_bounds::<Self>(offset);
6751 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6752 None => return Err(fidl::Error::NotNullable),
6753 Some(len) => len,
6754 };
6755 if len == 0 {
6757 return Ok(());
6758 };
6759 depth.increment()?;
6760 let envelope_size = 8;
6761 let bytes_len = len * envelope_size;
6762 let offset = decoder.out_of_line_offset(bytes_len)?;
6763 let mut _next_ordinal_to_read = 0;
6765 let mut next_offset = offset;
6766 let end_offset = offset + bytes_len;
6767 _next_ordinal_to_read += 1;
6768 if next_offset >= end_offset {
6769 return Ok(());
6770 }
6771
6772 while _next_ordinal_to_read < 1 {
6774 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6775 _next_ordinal_to_read += 1;
6776 next_offset += envelope_size;
6777 }
6778
6779 let next_out_of_line = decoder.next_out_of_line();
6780 let handles_before = decoder.remaining_handles();
6781 if let Some((inlined, num_bytes, num_handles)) =
6782 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6783 {
6784 let member_inline_size =
6785 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6786 if inlined != (member_inline_size <= 4) {
6787 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6788 }
6789 let inner_offset;
6790 let mut inner_depth = depth.clone();
6791 if inlined {
6792 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6793 inner_offset = next_offset;
6794 } else {
6795 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6796 inner_depth.increment()?;
6797 }
6798 let val_ref = self.physical_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
6799 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6800 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6801 {
6802 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6803 }
6804 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6805 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6806 }
6807 }
6808
6809 next_offset += envelope_size;
6810 _next_ordinal_to_read += 1;
6811 if next_offset >= end_offset {
6812 return Ok(());
6813 }
6814
6815 while _next_ordinal_to_read < 2 {
6817 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6818 _next_ordinal_to_read += 1;
6819 next_offset += envelope_size;
6820 }
6821
6822 let next_out_of_line = decoder.next_out_of_line();
6823 let handles_before = decoder.remaining_handles();
6824 if let Some((inlined, num_bytes, num_handles)) =
6825 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6826 {
6827 let member_inline_size =
6828 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6829 if inlined != (member_inline_size <= 4) {
6830 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6831 }
6832 let inner_offset;
6833 let mut inner_depth = depth.clone();
6834 if inlined {
6835 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6836 inner_offset = next_offset;
6837 } else {
6838 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6839 inner_depth.increment()?;
6840 }
6841 let val_ref = self.size_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
6842 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6843 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6844 {
6845 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6846 }
6847 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6848 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6849 }
6850 }
6851
6852 next_offset += envelope_size;
6853
6854 while next_offset < end_offset {
6856 _next_ordinal_to_read += 1;
6857 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6858 next_offset += envelope_size;
6859 }
6860
6861 Ok(())
6862 }
6863 }
6864
6865 impl SecureHeapsAndRanges {
6866 #[inline(always)]
6867 fn max_ordinal_present(&self) -> u64 {
6868 if let Some(_) = self.heaps {
6869 return 1;
6870 }
6871 0
6872 }
6873 }
6874
6875 impl fidl::encoding::ValueTypeMarker for SecureHeapsAndRanges {
6876 type Borrowed<'a> = &'a Self;
6877 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6878 value
6879 }
6880 }
6881
6882 unsafe impl fidl::encoding::TypeMarker for SecureHeapsAndRanges {
6883 type Owned = Self;
6884
6885 #[inline(always)]
6886 fn inline_align(_context: fidl::encoding::Context) -> usize {
6887 8
6888 }
6889
6890 #[inline(always)]
6891 fn inline_size(_context: fidl::encoding::Context) -> usize {
6892 16
6893 }
6894 }
6895
6896 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecureHeapsAndRanges, D>
6897 for &SecureHeapsAndRanges
6898 {
6899 unsafe fn encode(
6900 self,
6901 encoder: &mut fidl::encoding::Encoder<'_, D>,
6902 offset: usize,
6903 mut depth: fidl::encoding::Depth,
6904 ) -> fidl::Result<()> {
6905 encoder.debug_check_bounds::<SecureHeapsAndRanges>(offset);
6906 let max_ordinal: u64 = self.max_ordinal_present();
6908 encoder.write_num(max_ordinal, offset);
6909 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6910 if max_ordinal == 0 {
6912 return Ok(());
6913 }
6914 depth.increment()?;
6915 let envelope_size = 8;
6916 let bytes_len = max_ordinal as usize * envelope_size;
6917 #[allow(unused_variables)]
6918 let offset = encoder.out_of_line_offset(bytes_len);
6919 let mut _prev_end_offset: usize = 0;
6920 if 1 > max_ordinal {
6921 return Ok(());
6922 }
6923
6924 let cur_offset: usize = (1 - 1) * envelope_size;
6927
6928 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6930
6931 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<SecureHeapAndRanges, 32>, D>(
6936 self.heaps.as_ref().map(<fidl::encoding::Vector<SecureHeapAndRanges, 32> as fidl::encoding::ValueTypeMarker>::borrow),
6937 encoder, offset + cur_offset, depth
6938 )?;
6939
6940 _prev_end_offset = cur_offset + envelope_size;
6941
6942 Ok(())
6943 }
6944 }
6945
6946 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecureHeapsAndRanges {
6947 #[inline(always)]
6948 fn new_empty() -> Self {
6949 Self::default()
6950 }
6951
6952 unsafe fn decode(
6953 &mut self,
6954 decoder: &mut fidl::encoding::Decoder<'_, D>,
6955 offset: usize,
6956 mut depth: fidl::encoding::Depth,
6957 ) -> fidl::Result<()> {
6958 decoder.debug_check_bounds::<Self>(offset);
6959 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6960 None => return Err(fidl::Error::NotNullable),
6961 Some(len) => len,
6962 };
6963 if len == 0 {
6965 return Ok(());
6966 };
6967 depth.increment()?;
6968 let envelope_size = 8;
6969 let bytes_len = len * envelope_size;
6970 let offset = decoder.out_of_line_offset(bytes_len)?;
6971 let mut _next_ordinal_to_read = 0;
6973 let mut next_offset = offset;
6974 let end_offset = offset + bytes_len;
6975 _next_ordinal_to_read += 1;
6976 if next_offset >= end_offset {
6977 return Ok(());
6978 }
6979
6980 while _next_ordinal_to_read < 1 {
6982 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6983 _next_ordinal_to_read += 1;
6984 next_offset += envelope_size;
6985 }
6986
6987 let next_out_of_line = decoder.next_out_of_line();
6988 let handles_before = decoder.remaining_handles();
6989 if let Some((inlined, num_bytes, num_handles)) =
6990 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6991 {
6992 let member_inline_size = <fidl::encoding::Vector<SecureHeapAndRanges, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6993 if inlined != (member_inline_size <= 4) {
6994 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6995 }
6996 let inner_offset;
6997 let mut inner_depth = depth.clone();
6998 if inlined {
6999 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7000 inner_offset = next_offset;
7001 } else {
7002 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7003 inner_depth.increment()?;
7004 }
7005 let val_ref = self.heaps.get_or_insert_with(
7006 || fidl::new_empty!(fidl::encoding::Vector<SecureHeapAndRanges, 32>, D),
7007 );
7008 fidl::decode!(fidl::encoding::Vector<SecureHeapAndRanges, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
7009 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7010 {
7011 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7012 }
7013 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7014 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7015 }
7016 }
7017
7018 next_offset += envelope_size;
7019
7020 while next_offset < end_offset {
7022 _next_ordinal_to_read += 1;
7023 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7024 next_offset += envelope_size;
7025 }
7026
7027 Ok(())
7028 }
7029 }
7030}