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 LABEL_MAX_LENGTH: u32 = 32;
13
14pub const METRICS_EVENT_MASK: u32 = 1;
17
18pub const SIZE_CHANGE_HINT_EVENT_MASK: u32 = 2;
19
20#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
22#[repr(u32)]
23pub enum HitTestBehavior {
24 KDefault = 0,
26 KSuppress = 1,
28}
29
30impl HitTestBehavior {
31 #[inline]
32 pub fn from_primitive(prim: u32) -> Option<Self> {
33 match prim {
34 0 => Some(Self::KDefault),
35 1 => Some(Self::KSuppress),
36 _ => None,
37 }
38 }
39
40 #[inline]
41 pub const fn into_primitive(self) -> u32 {
42 self as u32
43 }
44
45 #[deprecated = "Strict enums should not use `is_unknown`"]
46 #[inline]
47 pub fn is_unknown(&self) -> bool {
48 false
49 }
50}
51
52#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
58#[repr(u32)]
59pub enum ImportSpec {
60 Node = 0,
61}
62
63impl ImportSpec {
64 #[inline]
65 pub fn from_primitive(prim: u32) -> Option<Self> {
66 match prim {
67 0 => Some(Self::Node),
68 _ => None,
69 }
70 }
71
72 #[inline]
73 pub const fn into_primitive(self) -> u32 {
74 self as u32
75 }
76
77 #[deprecated = "Strict enums should not use `is_unknown`"]
78 #[inline]
79 pub fn is_unknown(&self) -> bool {
80 false
81 }
82}
83
84#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
106#[repr(u32)]
107pub enum MeshIndexFormat {
108 KUint16 = 1,
109 KUint32 = 2,
110}
111
112impl MeshIndexFormat {
113 #[inline]
114 pub fn from_primitive(prim: u32) -> Option<Self> {
115 match prim {
116 1 => Some(Self::KUint16),
117 2 => Some(Self::KUint32),
118 _ => None,
119 }
120 }
121
122 #[inline]
123 pub const fn into_primitive(self) -> u32 {
124 self as u32
125 }
126
127 #[deprecated = "Strict enums should not use `is_unknown`"]
128 #[inline]
129 pub fn is_unknown(&self) -> bool {
130 false
131 }
132}
133
134#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
135#[repr(u32)]
136pub enum RenderFrequency {
137 WhenRequested = 0,
138 Continuously = 1,
139}
140
141impl RenderFrequency {
142 #[inline]
143 pub fn from_primitive(prim: u32) -> Option<Self> {
144 match prim {
145 0 => Some(Self::WhenRequested),
146 1 => Some(Self::Continuously),
147 _ => None,
148 }
149 }
150
151 #[inline]
152 pub const fn into_primitive(self) -> u32 {
153 self as u32
154 }
155
156 #[deprecated = "Strict enums should not use `is_unknown`"]
157 #[inline]
158 pub fn is_unknown(&self) -> bool {
159 false
160 }
161}
162
163#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
166#[repr(u32)]
167pub enum ShadowTechnique {
168 Unshadowed = 0,
170 ScreenSpace = 1,
172 ShadowMap = 2,
174 MomentShadowMap = 3,
176 StencilShadowVolume = 4,
178}
179
180impl ShadowTechnique {
181 #[inline]
182 pub fn from_primitive(prim: u32) -> Option<Self> {
183 match prim {
184 0 => Some(Self::Unshadowed),
185 1 => Some(Self::ScreenSpace),
186 2 => Some(Self::ShadowMap),
187 3 => Some(Self::MomentShadowMap),
188 4 => Some(Self::StencilShadowVolume),
189 _ => None,
190 }
191 }
192
193 #[inline]
194 pub const fn into_primitive(self) -> u32 {
195 self as u32
196 }
197
198 #[deprecated = "Strict enums should not use `is_unknown`"]
199 #[inline]
200 pub fn is_unknown(&self) -> bool {
201 false
202 }
203}
204
205#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
206#[repr(u32)]
207pub enum ValueType {
208 KNone = 0,
209 KVector1 = 1,
210 KVector2 = 2,
211 KVector3 = 3,
212 KVector4 = 4,
213 KMatrix4 = 5,
214 KColorRgb = 6,
215 KColorRgba = 7,
216 KQuaternion = 8,
217 KFactoredTransform = 9,
218}
219
220impl ValueType {
221 #[inline]
222 pub fn from_primitive(prim: u32) -> Option<Self> {
223 match prim {
224 0 => Some(Self::KNone),
225 1 => Some(Self::KVector1),
226 2 => Some(Self::KVector2),
227 3 => Some(Self::KVector3),
228 4 => Some(Self::KVector4),
229 5 => Some(Self::KMatrix4),
230 6 => Some(Self::KColorRgb),
231 7 => Some(Self::KColorRgba),
232 8 => Some(Self::KQuaternion),
233 9 => Some(Self::KFactoredTransform),
234 _ => None,
235 }
236 }
237
238 #[inline]
239 pub const fn into_primitive(self) -> u32 {
240 self as u32
241 }
242
243 #[deprecated = "Strict enums should not use `is_unknown`"]
244 #[inline]
245 pub fn is_unknown(&self) -> bool {
246 false
247 }
248}
249
250#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
260#[repr(C)]
261pub struct AddChildCmd {
262 pub node_id: u32,
263 pub child_id: u32,
264}
265
266impl fidl::Persistable for AddChildCmd {}
267
268#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
275#[repr(C)]
276pub struct AddLayerCmd {
277 pub layer_stack_id: u32,
278 pub layer_id: u32,
279}
280
281impl fidl::Persistable for AddLayerCmd {}
282
283#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
286#[repr(C)]
287pub struct AddLightCmd {
288 pub scene_id: u32,
289 pub light_id: u32,
290}
291
292impl fidl::Persistable for AddLightCmd {}
293
294#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
310#[repr(C)]
311pub struct AddPartCmd {
312 pub node_id: u32,
313 pub part_id: u32,
314}
315
316impl fidl::Persistable for AddPartCmd {}
317
318#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
324#[repr(C)]
325pub struct AmbientLightArgs {
326 pub dummy: u32,
327}
328
329impl fidl::Persistable for AmbientLightArgs {}
330
331#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
332pub struct BindMeshBuffersCmd {
333 pub mesh_id: u32,
334 pub index_buffer_id: u32,
335 pub index_format: MeshIndexFormat,
336 pub index_offset: u64,
337 pub index_count: u32,
338 pub vertex_buffer_id: u32,
339 pub vertex_format: MeshVertexFormat,
340 pub vertex_offset: u64,
341 pub vertex_count: u32,
342 pub bounding_box: BoundingBox,
343}
344
345impl fidl::Persistable for BindMeshBuffersCmd {}
346
347#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
357pub struct BoundingBox {
358 pub min: Vec3,
359 pub max: Vec3,
360}
361
362impl fidl::Persistable for BoundingBox {}
363
364#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
366#[repr(C)]
367pub struct BufferArgs {
368 pub memory_id: u32,
369 pub memory_offset: u32,
370 pub num_bytes: u32,
371}
372
373impl fidl::Persistable for BufferArgs {}
374
375#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
383#[repr(C)]
384pub struct CameraArgs {
385 pub scene_id: u32,
387}
388
389impl fidl::Persistable for CameraArgs {}
390
391#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
392pub struct CircleArgs {
393 pub radius: Value,
394}
395
396impl fidl::Persistable for CircleArgs {}
397
398#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
403#[repr(C)]
404pub struct ClipNodeArgs {
405 pub unused: u32,
406}
407
408impl fidl::Persistable for ClipNodeArgs {}
409
410#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
411pub struct ColorRgb {
412 pub red: f32,
413 pub green: f32,
414 pub blue: f32,
415}
416
417impl fidl::Persistable for ColorRgb {}
418
419#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
424pub struct ColorRgbValue {
425 pub value: ColorRgb,
426 pub variable_id: u32,
427}
428
429impl fidl::Persistable for ColorRgbValue {}
430
431#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
433#[repr(C)]
434pub struct ColorRgba {
435 pub red: u8,
436 pub green: u8,
437 pub blue: u8,
438 pub alpha: u8,
439}
440
441impl fidl::Persistable for ColorRgba {}
442
443#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
448#[repr(C)]
449pub struct ColorRgbaValue {
450 pub value: ColorRgba,
451 pub variable_id: u32,
452}
453
454impl fidl::Persistable for ColorRgbaValue {}
455
456#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
459#[repr(C)]
460pub struct CompositorArgs {
461 pub dummy: u32,
462}
463
464impl fidl::Persistable for CompositorArgs {}
465
466#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
468#[repr(C)]
469pub struct DetachChildrenCmd {
470 pub node_id: u32,
471}
472
473impl fidl::Persistable for DetachChildrenCmd {}
474
475#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
486#[repr(C)]
487pub struct DetachCmd {
488 pub id: u32,
489}
490
491impl fidl::Persistable for DetachCmd {}
492
493#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
496#[repr(C)]
497pub struct DetachLightCmd {
498 pub light_id: u32,
499}
500
501impl fidl::Persistable for DetachLightCmd {}
502
503#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
505#[repr(C)]
506pub struct DetachLightsCmd {
507 pub scene_id: u32,
508}
509
510impl fidl::Persistable for DetachLightsCmd {}
511
512#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
523#[repr(C)]
524pub struct DirectionalLightArgs {
525 pub dummy: u32,
526}
527
528impl fidl::Persistable for DirectionalLightArgs {}
529
530#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
533#[repr(C)]
534pub struct DisplayCompositorArgs {
535 pub dummy: u32,
536}
537
538impl fidl::Persistable for DisplayCompositorArgs {}
539
540#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
542#[repr(C)]
543pub struct DisplayInfo {
544 pub width_in_px: u32,
546 pub height_in_px: u32,
547}
548
549impl fidl::Persistable for DisplayInfo {}
550
551#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
558#[repr(C)]
559pub struct EntityNodeArgs {
560 pub unused: u32,
561}
562
563impl fidl::Persistable for EntityNodeArgs {}
564
565#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
566pub struct FactoredTransform {
567 pub translation: Vec3,
568 pub scale: Vec3,
569 pub anchor: Vec3,
571 pub rotation: Quaternion,
572}
573
574impl fidl::Persistable for FactoredTransform {}
575
576#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
581pub struct FloatValue {
582 pub value: f32,
583 pub variable_id: u32,
584}
585
586impl fidl::Persistable for FloatValue {}
587
588#[derive(Clone, Debug, PartialEq)]
590pub struct ImageArgs {
591 pub info: fidl_fuchsia_images::ImageInfo,
592 pub memory_id: u32,
593 pub memory_offset: u32,
594}
595
596impl fidl::Persistable for ImageArgs {}
597
598#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
600#[repr(C)]
601pub struct ImageArgs2 {
602 pub width: u32,
603 pub height: u32,
604 pub buffer_collection_id: u32,
611 pub buffer_collection_index: u32,
613}
614
615impl fidl::Persistable for ImageArgs2 {}
616
617#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
621#[repr(C)]
622pub struct ImportUnboundEvent {
623 pub resource_id: u32,
624}
625
626impl fidl::Persistable for ImportUnboundEvent {}
627
628#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
643#[repr(C)]
644pub struct LayerArgs {
645 pub dummy: u32,
646}
647
648impl fidl::Persistable for LayerArgs {}
649
650#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
658#[repr(C)]
659pub struct LayerStackArgs {
660 pub dummy: u32,
661}
662
663impl fidl::Persistable for LayerStackArgs {}
664
665#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
672#[repr(C)]
673pub struct MaterialArgs {
674 pub dummy: u32,
675}
676
677impl fidl::Persistable for MaterialArgs {}
678
679#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
684pub struct Matrix4Value {
685 pub value: Mat4,
686 pub variable_id: u32,
687}
688
689impl fidl::Persistable for Matrix4Value {}
690
691#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
694pub struct MeshArgs;
695
696impl fidl::Persistable for MeshArgs {}
697
698#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
699pub struct MeshVertexFormat {
700 pub position_type: ValueType,
702 pub normal_type: ValueType,
704 pub tex_coord_type: ValueType,
706}
707
708impl fidl::Persistable for MeshVertexFormat {}
709
710#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
713pub struct Metrics {
714 pub scale_x: f32,
734 pub scale_y: f32,
735 pub scale_z: f32,
736}
737
738impl fidl::Persistable for Metrics {}
739
740#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
751pub struct MetricsEvent {
752 pub node_id: u32,
753 pub metrics: Metrics,
754}
755
756impl fidl::Persistable for MetricsEvent {}
757
758#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
765#[repr(C)]
766pub struct OpacityNodeArgsHack {
767 pub unused: u32,
768}
769
770impl fidl::Persistable for OpacityNodeArgsHack {}
771
772#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
775pub struct Plane3 {
776 pub dir: Vec3,
777 pub dist: f32,
778}
779
780impl fidl::Persistable for Plane3 {}
781
782#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
792#[repr(C)]
793pub struct PointLightArgs {
794 pub dummy: u32,
795}
796
797impl fidl::Persistable for PointLightArgs {}
798
799#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
800pub struct Quaternion {
801 pub x: f32,
802 pub y: f32,
803 pub z: f32,
804 pub w: f32,
805}
806
807impl fidl::Persistable for Quaternion {}
808
809#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
814pub struct QuaternionValue {
815 pub value: Quaternion,
816 pub variable_id: u32,
817}
818
819impl fidl::Persistable for QuaternionValue {}
820
821#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
823pub struct RectangleArgs {
824 pub width: Value,
825 pub height: Value,
826}
827
828impl fidl::Persistable for RectangleArgs {}
829
830#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
838#[repr(C)]
839pub struct ReleaseResourceCmd {
840 pub id: u32,
842}
843
844impl fidl::Persistable for ReleaseResourceCmd {}
845
846#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
850#[repr(C)]
851pub struct RemoveAllLayersCmd {
852 pub layer_stack_id: u32,
853}
854
855impl fidl::Persistable for RemoveAllLayersCmd {}
856
857#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
863#[repr(C)]
864pub struct RemoveLayerCmd {
865 pub layer_stack_id: u32,
866 pub layer_id: u32,
867}
868
869impl fidl::Persistable for RemoveLayerCmd {}
870
871#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
877#[repr(C)]
878pub struct RendererArgs {
879 pub dummy: u32,
880}
881
882impl fidl::Persistable for RendererArgs {}
883
884#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
892pub struct RoundedRectangleArgs {
893 pub width: Value,
894 pub height: Value,
895 pub top_left_radius: Value,
896 pub top_right_radius: Value,
897 pub bottom_right_radius: Value,
898 pub bottom_left_radius: Value,
899}
900
901impl fidl::Persistable for RoundedRectangleArgs {}
902
903#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
906#[repr(C)]
907pub struct SceneAddAmbientLightCmd {
908 pub scene_id: u32,
909 pub light_id: u32,
910}
911
912impl fidl::Persistable for SceneAddAmbientLightCmd {}
913
914#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
917#[repr(C)]
918pub struct SceneAddDirectionalLightCmd {
919 pub scene_id: u32,
920 pub light_id: u32,
921}
922
923impl fidl::Persistable for SceneAddDirectionalLightCmd {}
924
925#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
928#[repr(C)]
929pub struct SceneAddPointLightCmd {
930 pub scene_id: u32,
931 pub light_id: u32,
932}
933
934impl fidl::Persistable for SceneAddPointLightCmd {}
935
936#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
943#[repr(C)]
944pub struct SceneArgs {
945 pub dummy: u32,
946}
947
948impl fidl::Persistable for SceneArgs {}
949
950#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
957pub struct SendSizeChangeHintCmdHack {
958 pub node_id: u32,
959 pub width_change_factor: f32,
960 pub height_change_factor: f32,
961}
962
963impl fidl::Persistable for SendSizeChangeHintCmdHack {}
964
965#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
970pub struct SetAnchorCmd {
971 pub id: u32,
972 pub value: Vector3Value,
973}
974
975impl fidl::Persistable for SetAnchorCmd {}
976
977#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
984pub struct SetCameraClipSpaceTransformCmd {
985 pub camera_id: u32,
986 pub translation: Vec2,
987 pub scale: f32,
988}
989
990impl fidl::Persistable for SetCameraClipSpaceTransformCmd {}
991
992#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
999#[repr(C)]
1000pub struct SetCameraCmd {
1001 pub renderer_id: u32,
1002 pub camera_id: u32,
1003}
1004
1005impl fidl::Persistable for SetCameraCmd {}
1006
1007#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1080#[repr(C)]
1081pub struct SetCameraPoseBufferCmd {
1082 pub camera_id: u32,
1083 pub buffer_id: u32,
1084 pub num_entries: u32,
1085 pub base_time: i64,
1086 pub time_interval: u64,
1087}
1088
1089impl fidl::Persistable for SetCameraPoseBufferCmd {}
1090
1091#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1101pub struct SetCameraProjectionCmd {
1102 pub camera_id: u32,
1103 pub fovy: FloatValue,
1104}
1105
1106impl fidl::Persistable for SetCameraProjectionCmd {}
1107
1108#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1117pub struct SetCameraTransformCmd {
1118 pub camera_id: u32,
1119 pub eye_position: Vector3Value,
1120 pub eye_look_at: Vector3Value,
1121 pub eye_up: Vector3Value,
1122}
1123
1124impl fidl::Persistable for SetCameraTransformCmd {}
1125
1126#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1143pub struct SetClipCmd {
1144 pub node_id: u32,
1145 pub clip_id: u32,
1146 pub clip_to_self: bool,
1147}
1148
1149impl fidl::Persistable for SetClipCmd {}
1150
1151#[derive(Clone, Debug, PartialEq, PartialOrd)]
1157pub struct SetClipPlanesCmd {
1158 pub node_id: u32,
1159 pub clip_planes: Vec<Plane3>,
1160}
1161
1162impl fidl::Persistable for SetClipPlanesCmd {}
1163
1164#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1172#[repr(C)]
1173pub struct SetColorCmd {
1174 pub material_id: u32,
1175 pub color: ColorRgbaValue,
1176}
1177
1178impl fidl::Persistable for SetColorCmd {}
1179
1180#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1190pub struct SetDisableClippingCmd {
1191 pub renderer_id: u32,
1192 pub disable_clipping: bool,
1193}
1194
1195impl fidl::Persistable for SetDisableClippingCmd {}
1196
1197#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1212pub struct SetDisplayColorConversionCmdHack {
1213 pub compositor_id: u32,
1214 pub preoffsets: [f32; 3],
1215 pub matrix: [f32; 9],
1216 pub postoffsets: [f32; 3],
1217}
1218
1219impl fidl::Persistable for SetDisplayColorConversionCmdHack {}
1220
1221#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1222#[repr(C)]
1223pub struct SetDisplayMinimumRgbCmdHack {
1224 pub min_value: u8,
1225}
1226
1227impl fidl::Persistable for SetDisplayMinimumRgbCmdHack {}
1228
1229#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1241#[repr(C)]
1242pub struct SetDisplayRotationCmdHack {
1243 pub compositor_id: u32,
1244 pub rotation_degrees: u32,
1245}
1246
1247impl fidl::Persistable for SetDisplayRotationCmdHack {}
1248
1249#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1250pub struct SetEnableDebugViewBoundsCmd {
1251 pub view_id: u32,
1252 pub enable: bool,
1253}
1254
1255impl fidl::Persistable for SetEnableDebugViewBoundsCmd {}
1256
1257#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1267#[repr(C)]
1268pub struct SetEventMaskCmd {
1269 pub id: u32,
1270 pub event_mask: u32,
1271}
1272
1273impl fidl::Persistable for SetEventMaskCmd {}
1274
1275#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1281pub struct SetHitTestBehaviorCmd {
1282 pub node_id: u32,
1283 pub hit_test_behavior: HitTestBehavior,
1284}
1285
1286impl fidl::Persistable for SetHitTestBehaviorCmd {}
1287
1288#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1289pub struct SetImportFocusCmdDeprecated;
1290
1291impl fidl::Persistable for SetImportFocusCmdDeprecated {}
1292
1293#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1304pub struct SetLabelCmd {
1305 pub id: u32,
1306 pub label: String,
1307}
1308
1309impl fidl::Persistable for SetLabelCmd {}
1310
1311#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1316#[repr(C)]
1317pub struct SetLayerStackCmd {
1318 pub compositor_id: u32,
1319 pub layer_stack_id: u32,
1320}
1321
1322impl fidl::Persistable for SetLayerStackCmd {}
1323
1324#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1326pub struct SetLightColorCmd {
1327 pub light_id: u32,
1328 pub color: ColorRgbValue,
1329}
1330
1331impl fidl::Persistable for SetLightColorCmd {}
1332
1333#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1335pub struct SetLightDirectionCmd {
1336 pub light_id: u32,
1337 pub direction: Vector3Value,
1338}
1339
1340impl fidl::Persistable for SetLightDirectionCmd {}
1341
1342#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1356#[repr(C)]
1357pub struct SetMaterialCmd {
1358 pub node_id: u32,
1359 pub material_id: u32,
1360}
1361
1362impl fidl::Persistable for SetMaterialCmd {}
1363
1364#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1370pub struct SetOpacityCmd {
1371 pub node_id: u32,
1372 pub opacity: f32,
1373}
1374
1375impl fidl::Persistable for SetOpacityCmd {}
1376
1377#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1383pub struct SetPointLightFalloffCmd {
1384 pub light_id: u32,
1385 pub falloff: FloatValue,
1386}
1387
1388impl fidl::Persistable for SetPointLightFalloffCmd {}
1389
1390#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1392pub struct SetPointLightPositionCmd {
1393 pub light_id: u32,
1394 pub position: Vector3Value,
1395}
1396
1397impl fidl::Persistable for SetPointLightPositionCmd {}
1398
1399#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1404#[repr(C)]
1405pub struct SetRendererCmd {
1406 pub layer_id: u32,
1407 pub renderer_id: u32,
1408}
1409
1410impl fidl::Persistable for SetRendererCmd {}
1411
1412#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1417pub struct SetRendererParamCmd {
1418 pub renderer_id: u32,
1419 pub param: RendererParam,
1420}
1421
1422impl fidl::Persistable for SetRendererParamCmd {}
1423
1424#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1435pub struct SetRotationCmd {
1436 pub id: u32,
1437 pub value: QuaternionValue,
1438}
1439
1440impl fidl::Persistable for SetRotationCmd {}
1441
1442#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1447pub struct SetScaleCmd {
1448 pub id: u32,
1449 pub value: Vector3Value,
1450}
1451
1452impl fidl::Persistable for SetScaleCmd {}
1453
1454#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1460pub struct SetSemanticVisibilityCmd {
1461 pub node_id: u32,
1462 pub visible: bool,
1463}
1464
1465impl fidl::Persistable for SetSemanticVisibilityCmd {}
1466
1467#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1481#[repr(C)]
1482pub struct SetShapeCmd {
1483 pub node_id: u32,
1484 pub shape_id: u32,
1485}
1486
1487impl fidl::Persistable for SetShapeCmd {}
1488
1489#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1496pub struct SetSizeCmd {
1497 pub id: u32,
1498 pub value: Vector2Value,
1499}
1500
1501impl fidl::Persistable for SetSizeCmd {}
1502
1503#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1514pub struct SetStereoCameraProjectionCmd {
1515 pub camera_id: u32,
1516 pub left_projection: Matrix4Value,
1517 pub right_projection: Matrix4Value,
1518}
1519
1520impl fidl::Persistable for SetStereoCameraProjectionCmd {}
1521
1522#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1537#[repr(C)]
1538pub struct SetTagCmd {
1539 pub node_id: u32,
1540 pub tag_value: u32,
1541}
1542
1543impl fidl::Persistable for SetTagCmd {}
1544
1545#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1555#[repr(C)]
1556pub struct SetTextureCmd {
1557 pub material_id: u32,
1558 pub texture_id: u32,
1559}
1560
1561impl fidl::Persistable for SetTextureCmd {}
1562
1563#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1568pub struct SetTranslationCmd {
1569 pub id: u32,
1570 pub value: Vector3Value,
1571}
1572
1573impl fidl::Persistable for SetTranslationCmd {}
1574
1575#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1576pub struct SetViewHolderBoundsColorCmd {
1577 pub view_holder_id: u32,
1578 pub color: ColorRgbValue,
1579}
1580
1581impl fidl::Persistable for SetViewHolderBoundsColorCmd {}
1582
1583#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1588pub struct SetViewPropertiesCmd {
1589 pub view_holder_id: u32,
1590 pub properties: ViewProperties,
1591}
1592
1593impl fidl::Persistable for SetViewPropertiesCmd {}
1594
1595#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1600#[repr(C)]
1601pub struct ShapeNodeArgs {
1602 pub unused: u32,
1603}
1604
1605impl fidl::Persistable for ShapeNodeArgs {}
1606
1607#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1618pub struct SizeChangeHintEvent {
1619 pub node_id: u32,
1620 pub width_change_factor: f32,
1621 pub height_change_factor: f32,
1622}
1623
1624impl fidl::Persistable for SizeChangeHintEvent {}
1625
1626#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1633#[repr(C)]
1634pub struct StereoCameraArgs {
1635 pub scene_id: u32,
1637}
1638
1639impl fidl::Persistable for StereoCameraArgs {}
1640
1641#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1643pub struct VariableArgs {
1644 pub type_: ValueType,
1645 pub initial_value: Value,
1646}
1647
1648impl fidl::Persistable for VariableArgs {}
1649
1650#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1655pub struct Vector2Value {
1656 pub value: Vec2,
1657 pub variable_id: u32,
1658}
1659
1660impl fidl::Persistable for Vector2Value {}
1661
1662#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1667pub struct Vector3Value {
1668 pub value: Vec3,
1669 pub variable_id: u32,
1670}
1671
1672impl fidl::Persistable for Vector3Value {}
1673
1674#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1679pub struct Vector4Value {
1680 pub value: Vec4,
1681 pub variable_id: u32,
1682}
1683
1684impl fidl::Persistable for Vector4Value {}
1685
1686#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1693pub struct ViewAttachedToSceneEvent {
1694 pub view_id: u32,
1695 pub properties: ViewProperties,
1696}
1697
1698impl fidl::Persistable for ViewAttachedToSceneEvent {}
1699
1700#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1702#[repr(C)]
1703pub struct ViewConnectedEvent {
1704 pub view_holder_id: u32,
1705}
1706
1707impl fidl::Persistable for ViewConnectedEvent {}
1708
1709#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1719#[repr(C)]
1720pub struct ViewDetachedFromSceneEvent {
1721 pub view_id: u32,
1722}
1723
1724impl fidl::Persistable for ViewDetachedFromSceneEvent {}
1725
1726#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1732#[repr(C)]
1733pub struct ViewDisconnectedEvent {
1734 pub view_holder_id: u32,
1735}
1736
1737impl fidl::Persistable for ViewDisconnectedEvent {}
1738
1739#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1744#[repr(C)]
1745pub struct ViewHolderConnectedEvent {
1746 pub view_id: u32,
1747}
1748
1749impl fidl::Persistable for ViewHolderConnectedEvent {}
1750
1751#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1757#[repr(C)]
1758pub struct ViewHolderDisconnectedEvent {
1759 pub view_id: u32,
1760}
1761
1762impl fidl::Persistable for ViewHolderDisconnectedEvent {}
1763
1764#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1766pub struct ViewProperties {
1767 pub bounding_box: BoundingBox,
1771 pub inset_from_min: Vec3,
1782 pub inset_from_max: Vec3,
1783 pub focus_change: bool,
1787 pub downward_input: bool,
1791}
1792
1793impl fidl::Persistable for ViewProperties {}
1794
1795#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1798pub struct ViewPropertiesChangedEvent {
1799 pub view_id: u32,
1800 pub properties: ViewProperties,
1801}
1802
1803impl fidl::Persistable for ViewPropertiesChangedEvent {}
1804
1805#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1807pub struct ViewState {
1808 pub is_rendering: bool,
1811}
1812
1813impl fidl::Persistable for ViewState {}
1814
1815#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1817pub struct ViewStateChangedEvent {
1818 pub view_holder_id: u32,
1819 pub state: ViewState,
1820}
1821
1822impl fidl::Persistable for ViewStateChangedEvent {}
1823
1824#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1825pub struct Mat4 {
1826 pub matrix: [f32; 16],
1828}
1829
1830impl fidl::Persistable for Mat4 {}
1831
1832#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1833pub struct Vec2 {
1834 pub x: f32,
1835 pub y: f32,
1836}
1837
1838impl fidl::Persistable for Vec2 {}
1839
1840#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1841pub struct Vec3 {
1842 pub x: f32,
1843 pub y: f32,
1844 pub z: f32,
1845}
1846
1847impl fidl::Persistable for Vec3 {}
1848
1849#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1850pub struct Vec4 {
1851 pub x: f32,
1852 pub y: f32,
1853 pub z: f32,
1854 pub w: f32,
1855}
1856
1857impl fidl::Persistable for Vec4 {}
1858
1859#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1862pub enum Event {
1863 Metrics(MetricsEvent),
1865 SizeChangeHint(SizeChangeHintEvent),
1866 ImportUnbound(ImportUnboundEvent),
1868 ViewConnected(ViewConnectedEvent),
1869 ViewDisconnected(ViewDisconnectedEvent),
1870 ViewHolderDisconnected(ViewHolderDisconnectedEvent),
1871 ViewAttachedToScene(ViewAttachedToSceneEvent),
1872 ViewDetachedFromScene(ViewDetachedFromSceneEvent),
1873 ViewPropertiesChanged(ViewPropertiesChangedEvent),
1874 ViewStateChanged(ViewStateChangedEvent),
1875 ViewHolderConnected(ViewHolderConnectedEvent),
1876}
1877
1878impl Event {
1879 #[inline]
1880 pub fn ordinal(&self) -> u64 {
1881 match *self {
1882 Self::Metrics(_) => 1,
1883 Self::SizeChangeHint(_) => 2,
1884 Self::ImportUnbound(_) => 3,
1885 Self::ViewConnected(_) => 4,
1886 Self::ViewDisconnected(_) => 5,
1887 Self::ViewHolderDisconnected(_) => 6,
1888 Self::ViewAttachedToScene(_) => 7,
1889 Self::ViewDetachedFromScene(_) => 8,
1890 Self::ViewPropertiesChanged(_) => 9,
1891 Self::ViewStateChanged(_) => 10,
1892 Self::ViewHolderConnected(_) => 11,
1893 }
1894 }
1895
1896 #[deprecated = "Strict unions should not use `is_unknown`"]
1897 #[inline]
1898 pub fn is_unknown(&self) -> bool {
1899 false
1900 }
1901}
1902
1903impl fidl::Persistable for Event {}
1904
1905#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1908pub enum RendererParam {
1909 ShadowTechnique(ShadowTechnique),
1910 Reserved(RenderFrequency),
1911 EnableDebugging(bool),
1912}
1913
1914impl RendererParam {
1915 #[inline]
1916 pub fn ordinal(&self) -> u64 {
1917 match *self {
1918 Self::ShadowTechnique(_) => 1,
1919 Self::Reserved(_) => 2,
1920 Self::EnableDebugging(_) => 3,
1921 }
1922 }
1923
1924 #[deprecated = "Strict unions should not use `is_unknown`"]
1925 #[inline]
1926 pub fn is_unknown(&self) -> bool {
1927 false
1928 }
1929}
1930
1931impl fidl::Persistable for RendererParam {}
1932
1933#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1934pub enum Value {
1935 Vector1(f32),
1936 Vector2(Vec2),
1937 Vector3(Vec3),
1938 Vector4(Vec4),
1939 Matrix4x4(Mat4),
1940 ColorRgba(ColorRgba),
1941 ColorRgb(ColorRgb),
1942 Degrees(f32),
1944 Quaternion(Quaternion),
1945 Transform(FactoredTransform),
1946 VariableId(u32),
1949}
1950
1951impl Value {
1952 #[inline]
1953 pub fn ordinal(&self) -> u64 {
1954 match *self {
1955 Self::Vector1(_) => 1,
1956 Self::Vector2(_) => 2,
1957 Self::Vector3(_) => 3,
1958 Self::Vector4(_) => 4,
1959 Self::Matrix4x4(_) => 5,
1960 Self::ColorRgba(_) => 6,
1961 Self::ColorRgb(_) => 7,
1962 Self::Degrees(_) => 8,
1963 Self::Quaternion(_) => 9,
1964 Self::Transform(_) => 10,
1965 Self::VariableId(_) => 11,
1966 }
1967 }
1968
1969 #[deprecated = "Strict unions should not use `is_unknown`"]
1970 #[inline]
1971 pub fn is_unknown(&self) -> bool {
1972 false
1973 }
1974}
1975
1976impl fidl::Persistable for Value {}
1977
1978mod internal {
1979 use super::*;
1980 unsafe impl fidl::encoding::TypeMarker for HitTestBehavior {
1981 type Owned = Self;
1982
1983 #[inline(always)]
1984 fn inline_align(_context: fidl::encoding::Context) -> usize {
1985 std::mem::align_of::<u32>()
1986 }
1987
1988 #[inline(always)]
1989 fn inline_size(_context: fidl::encoding::Context) -> usize {
1990 std::mem::size_of::<u32>()
1991 }
1992
1993 #[inline(always)]
1994 fn encode_is_copy() -> bool {
1995 true
1996 }
1997
1998 #[inline(always)]
1999 fn decode_is_copy() -> bool {
2000 false
2001 }
2002 }
2003
2004 impl fidl::encoding::ValueTypeMarker for HitTestBehavior {
2005 type Borrowed<'a> = Self;
2006 #[inline(always)]
2007 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2008 *value
2009 }
2010 }
2011
2012 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2013 for HitTestBehavior
2014 {
2015 #[inline]
2016 unsafe fn encode(
2017 self,
2018 encoder: &mut fidl::encoding::Encoder<'_, D>,
2019 offset: usize,
2020 _depth: fidl::encoding::Depth,
2021 ) -> fidl::Result<()> {
2022 encoder.debug_check_bounds::<Self>(offset);
2023 encoder.write_num(self.into_primitive(), offset);
2024 Ok(())
2025 }
2026 }
2027
2028 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitTestBehavior {
2029 #[inline(always)]
2030 fn new_empty() -> Self {
2031 Self::KDefault
2032 }
2033
2034 #[inline]
2035 unsafe fn decode(
2036 &mut self,
2037 decoder: &mut fidl::encoding::Decoder<'_, D>,
2038 offset: usize,
2039 _depth: fidl::encoding::Depth,
2040 ) -> fidl::Result<()> {
2041 decoder.debug_check_bounds::<Self>(offset);
2042 let prim = decoder.read_num::<u32>(offset);
2043
2044 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2045 Ok(())
2046 }
2047 }
2048 unsafe impl fidl::encoding::TypeMarker for ImportSpec {
2049 type Owned = Self;
2050
2051 #[inline(always)]
2052 fn inline_align(_context: fidl::encoding::Context) -> usize {
2053 std::mem::align_of::<u32>()
2054 }
2055
2056 #[inline(always)]
2057 fn inline_size(_context: fidl::encoding::Context) -> usize {
2058 std::mem::size_of::<u32>()
2059 }
2060
2061 #[inline(always)]
2062 fn encode_is_copy() -> bool {
2063 true
2064 }
2065
2066 #[inline(always)]
2067 fn decode_is_copy() -> bool {
2068 false
2069 }
2070 }
2071
2072 impl fidl::encoding::ValueTypeMarker for ImportSpec {
2073 type Borrowed<'a> = Self;
2074 #[inline(always)]
2075 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2076 *value
2077 }
2078 }
2079
2080 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImportSpec {
2081 #[inline]
2082 unsafe fn encode(
2083 self,
2084 encoder: &mut fidl::encoding::Encoder<'_, D>,
2085 offset: usize,
2086 _depth: fidl::encoding::Depth,
2087 ) -> fidl::Result<()> {
2088 encoder.debug_check_bounds::<Self>(offset);
2089 encoder.write_num(self.into_primitive(), offset);
2090 Ok(())
2091 }
2092 }
2093
2094 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportSpec {
2095 #[inline(always)]
2096 fn new_empty() -> Self {
2097 Self::Node
2098 }
2099
2100 #[inline]
2101 unsafe fn decode(
2102 &mut self,
2103 decoder: &mut fidl::encoding::Decoder<'_, D>,
2104 offset: usize,
2105 _depth: fidl::encoding::Depth,
2106 ) -> fidl::Result<()> {
2107 decoder.debug_check_bounds::<Self>(offset);
2108 let prim = decoder.read_num::<u32>(offset);
2109
2110 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2111 Ok(())
2112 }
2113 }
2114 unsafe impl fidl::encoding::TypeMarker for MeshIndexFormat {
2115 type Owned = Self;
2116
2117 #[inline(always)]
2118 fn inline_align(_context: fidl::encoding::Context) -> usize {
2119 std::mem::align_of::<u32>()
2120 }
2121
2122 #[inline(always)]
2123 fn inline_size(_context: fidl::encoding::Context) -> usize {
2124 std::mem::size_of::<u32>()
2125 }
2126
2127 #[inline(always)]
2128 fn encode_is_copy() -> bool {
2129 true
2130 }
2131
2132 #[inline(always)]
2133 fn decode_is_copy() -> bool {
2134 false
2135 }
2136 }
2137
2138 impl fidl::encoding::ValueTypeMarker for MeshIndexFormat {
2139 type Borrowed<'a> = Self;
2140 #[inline(always)]
2141 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2142 *value
2143 }
2144 }
2145
2146 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2147 for MeshIndexFormat
2148 {
2149 #[inline]
2150 unsafe fn encode(
2151 self,
2152 encoder: &mut fidl::encoding::Encoder<'_, D>,
2153 offset: usize,
2154 _depth: fidl::encoding::Depth,
2155 ) -> fidl::Result<()> {
2156 encoder.debug_check_bounds::<Self>(offset);
2157 encoder.write_num(self.into_primitive(), offset);
2158 Ok(())
2159 }
2160 }
2161
2162 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshIndexFormat {
2163 #[inline(always)]
2164 fn new_empty() -> Self {
2165 Self::KUint16
2166 }
2167
2168 #[inline]
2169 unsafe fn decode(
2170 &mut self,
2171 decoder: &mut fidl::encoding::Decoder<'_, D>,
2172 offset: usize,
2173 _depth: fidl::encoding::Depth,
2174 ) -> fidl::Result<()> {
2175 decoder.debug_check_bounds::<Self>(offset);
2176 let prim = decoder.read_num::<u32>(offset);
2177
2178 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2179 Ok(())
2180 }
2181 }
2182 unsafe impl fidl::encoding::TypeMarker for RenderFrequency {
2183 type Owned = Self;
2184
2185 #[inline(always)]
2186 fn inline_align(_context: fidl::encoding::Context) -> usize {
2187 std::mem::align_of::<u32>()
2188 }
2189
2190 #[inline(always)]
2191 fn inline_size(_context: fidl::encoding::Context) -> usize {
2192 std::mem::size_of::<u32>()
2193 }
2194
2195 #[inline(always)]
2196 fn encode_is_copy() -> bool {
2197 true
2198 }
2199
2200 #[inline(always)]
2201 fn decode_is_copy() -> bool {
2202 false
2203 }
2204 }
2205
2206 impl fidl::encoding::ValueTypeMarker for RenderFrequency {
2207 type Borrowed<'a> = Self;
2208 #[inline(always)]
2209 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2210 *value
2211 }
2212 }
2213
2214 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2215 for RenderFrequency
2216 {
2217 #[inline]
2218 unsafe fn encode(
2219 self,
2220 encoder: &mut fidl::encoding::Encoder<'_, D>,
2221 offset: usize,
2222 _depth: fidl::encoding::Depth,
2223 ) -> fidl::Result<()> {
2224 encoder.debug_check_bounds::<Self>(offset);
2225 encoder.write_num(self.into_primitive(), offset);
2226 Ok(())
2227 }
2228 }
2229
2230 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RenderFrequency {
2231 #[inline(always)]
2232 fn new_empty() -> Self {
2233 Self::WhenRequested
2234 }
2235
2236 #[inline]
2237 unsafe fn decode(
2238 &mut self,
2239 decoder: &mut fidl::encoding::Decoder<'_, D>,
2240 offset: usize,
2241 _depth: fidl::encoding::Depth,
2242 ) -> fidl::Result<()> {
2243 decoder.debug_check_bounds::<Self>(offset);
2244 let prim = decoder.read_num::<u32>(offset);
2245
2246 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2247 Ok(())
2248 }
2249 }
2250 unsafe impl fidl::encoding::TypeMarker for ShadowTechnique {
2251 type Owned = Self;
2252
2253 #[inline(always)]
2254 fn inline_align(_context: fidl::encoding::Context) -> usize {
2255 std::mem::align_of::<u32>()
2256 }
2257
2258 #[inline(always)]
2259 fn inline_size(_context: fidl::encoding::Context) -> usize {
2260 std::mem::size_of::<u32>()
2261 }
2262
2263 #[inline(always)]
2264 fn encode_is_copy() -> bool {
2265 true
2266 }
2267
2268 #[inline(always)]
2269 fn decode_is_copy() -> bool {
2270 false
2271 }
2272 }
2273
2274 impl fidl::encoding::ValueTypeMarker for ShadowTechnique {
2275 type Borrowed<'a> = Self;
2276 #[inline(always)]
2277 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2278 *value
2279 }
2280 }
2281
2282 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2283 for ShadowTechnique
2284 {
2285 #[inline]
2286 unsafe fn encode(
2287 self,
2288 encoder: &mut fidl::encoding::Encoder<'_, D>,
2289 offset: usize,
2290 _depth: fidl::encoding::Depth,
2291 ) -> fidl::Result<()> {
2292 encoder.debug_check_bounds::<Self>(offset);
2293 encoder.write_num(self.into_primitive(), offset);
2294 Ok(())
2295 }
2296 }
2297
2298 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShadowTechnique {
2299 #[inline(always)]
2300 fn new_empty() -> Self {
2301 Self::Unshadowed
2302 }
2303
2304 #[inline]
2305 unsafe fn decode(
2306 &mut self,
2307 decoder: &mut fidl::encoding::Decoder<'_, D>,
2308 offset: usize,
2309 _depth: fidl::encoding::Depth,
2310 ) -> fidl::Result<()> {
2311 decoder.debug_check_bounds::<Self>(offset);
2312 let prim = decoder.read_num::<u32>(offset);
2313
2314 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2315 Ok(())
2316 }
2317 }
2318 unsafe impl fidl::encoding::TypeMarker for ValueType {
2319 type Owned = Self;
2320
2321 #[inline(always)]
2322 fn inline_align(_context: fidl::encoding::Context) -> usize {
2323 std::mem::align_of::<u32>()
2324 }
2325
2326 #[inline(always)]
2327 fn inline_size(_context: fidl::encoding::Context) -> usize {
2328 std::mem::size_of::<u32>()
2329 }
2330
2331 #[inline(always)]
2332 fn encode_is_copy() -> bool {
2333 true
2334 }
2335
2336 #[inline(always)]
2337 fn decode_is_copy() -> bool {
2338 false
2339 }
2340 }
2341
2342 impl fidl::encoding::ValueTypeMarker for ValueType {
2343 type Borrowed<'a> = Self;
2344 #[inline(always)]
2345 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2346 *value
2347 }
2348 }
2349
2350 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ValueType {
2351 #[inline]
2352 unsafe fn encode(
2353 self,
2354 encoder: &mut fidl::encoding::Encoder<'_, D>,
2355 offset: usize,
2356 _depth: fidl::encoding::Depth,
2357 ) -> fidl::Result<()> {
2358 encoder.debug_check_bounds::<Self>(offset);
2359 encoder.write_num(self.into_primitive(), offset);
2360 Ok(())
2361 }
2362 }
2363
2364 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValueType {
2365 #[inline(always)]
2366 fn new_empty() -> Self {
2367 Self::KNone
2368 }
2369
2370 #[inline]
2371 unsafe fn decode(
2372 &mut self,
2373 decoder: &mut fidl::encoding::Decoder<'_, D>,
2374 offset: usize,
2375 _depth: fidl::encoding::Depth,
2376 ) -> fidl::Result<()> {
2377 decoder.debug_check_bounds::<Self>(offset);
2378 let prim = decoder.read_num::<u32>(offset);
2379
2380 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2381 Ok(())
2382 }
2383 }
2384
2385 impl fidl::encoding::ValueTypeMarker for AddChildCmd {
2386 type Borrowed<'a> = &'a Self;
2387 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2388 value
2389 }
2390 }
2391
2392 unsafe impl fidl::encoding::TypeMarker for AddChildCmd {
2393 type Owned = Self;
2394
2395 #[inline(always)]
2396 fn inline_align(_context: fidl::encoding::Context) -> usize {
2397 4
2398 }
2399
2400 #[inline(always)]
2401 fn inline_size(_context: fidl::encoding::Context) -> usize {
2402 8
2403 }
2404 #[inline(always)]
2405 fn encode_is_copy() -> bool {
2406 true
2407 }
2408
2409 #[inline(always)]
2410 fn decode_is_copy() -> bool {
2411 true
2412 }
2413 }
2414
2415 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddChildCmd, D>
2416 for &AddChildCmd
2417 {
2418 #[inline]
2419 unsafe fn encode(
2420 self,
2421 encoder: &mut fidl::encoding::Encoder<'_, D>,
2422 offset: usize,
2423 _depth: fidl::encoding::Depth,
2424 ) -> fidl::Result<()> {
2425 encoder.debug_check_bounds::<AddChildCmd>(offset);
2426 unsafe {
2427 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2429 (buf_ptr as *mut AddChildCmd).write_unaligned((self as *const AddChildCmd).read());
2430 }
2433 Ok(())
2434 }
2435 }
2436 unsafe impl<
2437 D: fidl::encoding::ResourceDialect,
2438 T0: fidl::encoding::Encode<u32, D>,
2439 T1: fidl::encoding::Encode<u32, D>,
2440 > fidl::encoding::Encode<AddChildCmd, D> for (T0, T1)
2441 {
2442 #[inline]
2443 unsafe fn encode(
2444 self,
2445 encoder: &mut fidl::encoding::Encoder<'_, D>,
2446 offset: usize,
2447 depth: fidl::encoding::Depth,
2448 ) -> fidl::Result<()> {
2449 encoder.debug_check_bounds::<AddChildCmd>(offset);
2450 self.0.encode(encoder, offset + 0, depth)?;
2454 self.1.encode(encoder, offset + 4, depth)?;
2455 Ok(())
2456 }
2457 }
2458
2459 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddChildCmd {
2460 #[inline(always)]
2461 fn new_empty() -> Self {
2462 Self { node_id: fidl::new_empty!(u32, D), child_id: fidl::new_empty!(u32, D) }
2463 }
2464
2465 #[inline]
2466 unsafe fn decode(
2467 &mut self,
2468 decoder: &mut fidl::encoding::Decoder<'_, D>,
2469 offset: usize,
2470 _depth: fidl::encoding::Depth,
2471 ) -> fidl::Result<()> {
2472 decoder.debug_check_bounds::<Self>(offset);
2473 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2474 unsafe {
2477 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2478 }
2479 Ok(())
2480 }
2481 }
2482
2483 impl fidl::encoding::ValueTypeMarker for AddLayerCmd {
2484 type Borrowed<'a> = &'a Self;
2485 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2486 value
2487 }
2488 }
2489
2490 unsafe impl fidl::encoding::TypeMarker for AddLayerCmd {
2491 type Owned = Self;
2492
2493 #[inline(always)]
2494 fn inline_align(_context: fidl::encoding::Context) -> usize {
2495 4
2496 }
2497
2498 #[inline(always)]
2499 fn inline_size(_context: fidl::encoding::Context) -> usize {
2500 8
2501 }
2502 #[inline(always)]
2503 fn encode_is_copy() -> bool {
2504 true
2505 }
2506
2507 #[inline(always)]
2508 fn decode_is_copy() -> bool {
2509 true
2510 }
2511 }
2512
2513 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLayerCmd, D>
2514 for &AddLayerCmd
2515 {
2516 #[inline]
2517 unsafe fn encode(
2518 self,
2519 encoder: &mut fidl::encoding::Encoder<'_, D>,
2520 offset: usize,
2521 _depth: fidl::encoding::Depth,
2522 ) -> fidl::Result<()> {
2523 encoder.debug_check_bounds::<AddLayerCmd>(offset);
2524 unsafe {
2525 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2527 (buf_ptr as *mut AddLayerCmd).write_unaligned((self as *const AddLayerCmd).read());
2528 }
2531 Ok(())
2532 }
2533 }
2534 unsafe impl<
2535 D: fidl::encoding::ResourceDialect,
2536 T0: fidl::encoding::Encode<u32, D>,
2537 T1: fidl::encoding::Encode<u32, D>,
2538 > fidl::encoding::Encode<AddLayerCmd, D> for (T0, T1)
2539 {
2540 #[inline]
2541 unsafe fn encode(
2542 self,
2543 encoder: &mut fidl::encoding::Encoder<'_, D>,
2544 offset: usize,
2545 depth: fidl::encoding::Depth,
2546 ) -> fidl::Result<()> {
2547 encoder.debug_check_bounds::<AddLayerCmd>(offset);
2548 self.0.encode(encoder, offset + 0, depth)?;
2552 self.1.encode(encoder, offset + 4, depth)?;
2553 Ok(())
2554 }
2555 }
2556
2557 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLayerCmd {
2558 #[inline(always)]
2559 fn new_empty() -> Self {
2560 Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
2561 }
2562
2563 #[inline]
2564 unsafe fn decode(
2565 &mut self,
2566 decoder: &mut fidl::encoding::Decoder<'_, D>,
2567 offset: usize,
2568 _depth: fidl::encoding::Depth,
2569 ) -> fidl::Result<()> {
2570 decoder.debug_check_bounds::<Self>(offset);
2571 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2572 unsafe {
2575 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2576 }
2577 Ok(())
2578 }
2579 }
2580
2581 impl fidl::encoding::ValueTypeMarker for AddLightCmd {
2582 type Borrowed<'a> = &'a Self;
2583 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2584 value
2585 }
2586 }
2587
2588 unsafe impl fidl::encoding::TypeMarker for AddLightCmd {
2589 type Owned = Self;
2590
2591 #[inline(always)]
2592 fn inline_align(_context: fidl::encoding::Context) -> usize {
2593 4
2594 }
2595
2596 #[inline(always)]
2597 fn inline_size(_context: fidl::encoding::Context) -> usize {
2598 8
2599 }
2600 #[inline(always)]
2601 fn encode_is_copy() -> bool {
2602 true
2603 }
2604
2605 #[inline(always)]
2606 fn decode_is_copy() -> bool {
2607 true
2608 }
2609 }
2610
2611 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLightCmd, D>
2612 for &AddLightCmd
2613 {
2614 #[inline]
2615 unsafe fn encode(
2616 self,
2617 encoder: &mut fidl::encoding::Encoder<'_, D>,
2618 offset: usize,
2619 _depth: fidl::encoding::Depth,
2620 ) -> fidl::Result<()> {
2621 encoder.debug_check_bounds::<AddLightCmd>(offset);
2622 unsafe {
2623 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2625 (buf_ptr as *mut AddLightCmd).write_unaligned((self as *const AddLightCmd).read());
2626 }
2629 Ok(())
2630 }
2631 }
2632 unsafe impl<
2633 D: fidl::encoding::ResourceDialect,
2634 T0: fidl::encoding::Encode<u32, D>,
2635 T1: fidl::encoding::Encode<u32, D>,
2636 > fidl::encoding::Encode<AddLightCmd, D> for (T0, T1)
2637 {
2638 #[inline]
2639 unsafe fn encode(
2640 self,
2641 encoder: &mut fidl::encoding::Encoder<'_, D>,
2642 offset: usize,
2643 depth: fidl::encoding::Depth,
2644 ) -> fidl::Result<()> {
2645 encoder.debug_check_bounds::<AddLightCmd>(offset);
2646 self.0.encode(encoder, offset + 0, depth)?;
2650 self.1.encode(encoder, offset + 4, depth)?;
2651 Ok(())
2652 }
2653 }
2654
2655 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLightCmd {
2656 #[inline(always)]
2657 fn new_empty() -> Self {
2658 Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
2659 }
2660
2661 #[inline]
2662 unsafe fn decode(
2663 &mut self,
2664 decoder: &mut fidl::encoding::Decoder<'_, D>,
2665 offset: usize,
2666 _depth: fidl::encoding::Depth,
2667 ) -> fidl::Result<()> {
2668 decoder.debug_check_bounds::<Self>(offset);
2669 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2670 unsafe {
2673 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2674 }
2675 Ok(())
2676 }
2677 }
2678
2679 impl fidl::encoding::ValueTypeMarker for AddPartCmd {
2680 type Borrowed<'a> = &'a Self;
2681 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2682 value
2683 }
2684 }
2685
2686 unsafe impl fidl::encoding::TypeMarker for AddPartCmd {
2687 type Owned = Self;
2688
2689 #[inline(always)]
2690 fn inline_align(_context: fidl::encoding::Context) -> usize {
2691 4
2692 }
2693
2694 #[inline(always)]
2695 fn inline_size(_context: fidl::encoding::Context) -> usize {
2696 8
2697 }
2698 #[inline(always)]
2699 fn encode_is_copy() -> bool {
2700 true
2701 }
2702
2703 #[inline(always)]
2704 fn decode_is_copy() -> bool {
2705 true
2706 }
2707 }
2708
2709 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddPartCmd, D>
2710 for &AddPartCmd
2711 {
2712 #[inline]
2713 unsafe fn encode(
2714 self,
2715 encoder: &mut fidl::encoding::Encoder<'_, D>,
2716 offset: usize,
2717 _depth: fidl::encoding::Depth,
2718 ) -> fidl::Result<()> {
2719 encoder.debug_check_bounds::<AddPartCmd>(offset);
2720 unsafe {
2721 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2723 (buf_ptr as *mut AddPartCmd).write_unaligned((self as *const AddPartCmd).read());
2724 }
2727 Ok(())
2728 }
2729 }
2730 unsafe impl<
2731 D: fidl::encoding::ResourceDialect,
2732 T0: fidl::encoding::Encode<u32, D>,
2733 T1: fidl::encoding::Encode<u32, D>,
2734 > fidl::encoding::Encode<AddPartCmd, D> for (T0, T1)
2735 {
2736 #[inline]
2737 unsafe fn encode(
2738 self,
2739 encoder: &mut fidl::encoding::Encoder<'_, D>,
2740 offset: usize,
2741 depth: fidl::encoding::Depth,
2742 ) -> fidl::Result<()> {
2743 encoder.debug_check_bounds::<AddPartCmd>(offset);
2744 self.0.encode(encoder, offset + 0, depth)?;
2748 self.1.encode(encoder, offset + 4, depth)?;
2749 Ok(())
2750 }
2751 }
2752
2753 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddPartCmd {
2754 #[inline(always)]
2755 fn new_empty() -> Self {
2756 Self { node_id: fidl::new_empty!(u32, D), part_id: fidl::new_empty!(u32, D) }
2757 }
2758
2759 #[inline]
2760 unsafe fn decode(
2761 &mut self,
2762 decoder: &mut fidl::encoding::Decoder<'_, D>,
2763 offset: usize,
2764 _depth: fidl::encoding::Depth,
2765 ) -> fidl::Result<()> {
2766 decoder.debug_check_bounds::<Self>(offset);
2767 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2768 unsafe {
2771 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2772 }
2773 Ok(())
2774 }
2775 }
2776
2777 impl fidl::encoding::ValueTypeMarker for AmbientLightArgs {
2778 type Borrowed<'a> = &'a Self;
2779 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2780 value
2781 }
2782 }
2783
2784 unsafe impl fidl::encoding::TypeMarker for AmbientLightArgs {
2785 type Owned = Self;
2786
2787 #[inline(always)]
2788 fn inline_align(_context: fidl::encoding::Context) -> usize {
2789 4
2790 }
2791
2792 #[inline(always)]
2793 fn inline_size(_context: fidl::encoding::Context) -> usize {
2794 4
2795 }
2796 #[inline(always)]
2797 fn encode_is_copy() -> bool {
2798 true
2799 }
2800
2801 #[inline(always)]
2802 fn decode_is_copy() -> bool {
2803 true
2804 }
2805 }
2806
2807 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AmbientLightArgs, D>
2808 for &AmbientLightArgs
2809 {
2810 #[inline]
2811 unsafe fn encode(
2812 self,
2813 encoder: &mut fidl::encoding::Encoder<'_, D>,
2814 offset: usize,
2815 _depth: fidl::encoding::Depth,
2816 ) -> fidl::Result<()> {
2817 encoder.debug_check_bounds::<AmbientLightArgs>(offset);
2818 unsafe {
2819 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2821 (buf_ptr as *mut AmbientLightArgs)
2822 .write_unaligned((self as *const AmbientLightArgs).read());
2823 }
2826 Ok(())
2827 }
2828 }
2829 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2830 fidl::encoding::Encode<AmbientLightArgs, D> for (T0,)
2831 {
2832 #[inline]
2833 unsafe fn encode(
2834 self,
2835 encoder: &mut fidl::encoding::Encoder<'_, D>,
2836 offset: usize,
2837 depth: fidl::encoding::Depth,
2838 ) -> fidl::Result<()> {
2839 encoder.debug_check_bounds::<AmbientLightArgs>(offset);
2840 self.0.encode(encoder, offset + 0, depth)?;
2844 Ok(())
2845 }
2846 }
2847
2848 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AmbientLightArgs {
2849 #[inline(always)]
2850 fn new_empty() -> Self {
2851 Self { dummy: fidl::new_empty!(u32, D) }
2852 }
2853
2854 #[inline]
2855 unsafe fn decode(
2856 &mut self,
2857 decoder: &mut fidl::encoding::Decoder<'_, D>,
2858 offset: usize,
2859 _depth: fidl::encoding::Depth,
2860 ) -> fidl::Result<()> {
2861 decoder.debug_check_bounds::<Self>(offset);
2862 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2863 unsafe {
2866 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2867 }
2868 Ok(())
2869 }
2870 }
2871
2872 impl fidl::encoding::ValueTypeMarker for BindMeshBuffersCmd {
2873 type Borrowed<'a> = &'a Self;
2874 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2875 value
2876 }
2877 }
2878
2879 unsafe impl fidl::encoding::TypeMarker for BindMeshBuffersCmd {
2880 type Owned = Self;
2881
2882 #[inline(always)]
2883 fn inline_align(_context: fidl::encoding::Context) -> usize {
2884 8
2885 }
2886
2887 #[inline(always)]
2888 fn inline_size(_context: fidl::encoding::Context) -> usize {
2889 88
2890 }
2891 }
2892
2893 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BindMeshBuffersCmd, D>
2894 for &BindMeshBuffersCmd
2895 {
2896 #[inline]
2897 unsafe fn encode(
2898 self,
2899 encoder: &mut fidl::encoding::Encoder<'_, D>,
2900 offset: usize,
2901 _depth: fidl::encoding::Depth,
2902 ) -> fidl::Result<()> {
2903 encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
2904 fidl::encoding::Encode::<BindMeshBuffersCmd, D>::encode(
2906 (
2907 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mesh_id),
2908 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_buffer_id),
2909 <MeshIndexFormat as fidl::encoding::ValueTypeMarker>::borrow(
2910 &self.index_format,
2911 ),
2912 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_offset),
2913 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_count),
2914 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_buffer_id),
2915 <MeshVertexFormat as fidl::encoding::ValueTypeMarker>::borrow(
2916 &self.vertex_format,
2917 ),
2918 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_offset),
2919 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_count),
2920 <BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
2921 ),
2922 encoder,
2923 offset,
2924 _depth,
2925 )
2926 }
2927 }
2928 unsafe impl<
2929 D: fidl::encoding::ResourceDialect,
2930 T0: fidl::encoding::Encode<u32, D>,
2931 T1: fidl::encoding::Encode<u32, D>,
2932 T2: fidl::encoding::Encode<MeshIndexFormat, D>,
2933 T3: fidl::encoding::Encode<u64, D>,
2934 T4: fidl::encoding::Encode<u32, D>,
2935 T5: fidl::encoding::Encode<u32, D>,
2936 T6: fidl::encoding::Encode<MeshVertexFormat, D>,
2937 T7: fidl::encoding::Encode<u64, D>,
2938 T8: fidl::encoding::Encode<u32, D>,
2939 T9: fidl::encoding::Encode<BoundingBox, D>,
2940 > fidl::encoding::Encode<BindMeshBuffersCmd, D>
2941 for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
2942 {
2943 #[inline]
2944 unsafe fn encode(
2945 self,
2946 encoder: &mut fidl::encoding::Encoder<'_, D>,
2947 offset: usize,
2948 depth: fidl::encoding::Depth,
2949 ) -> fidl::Result<()> {
2950 encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
2951 unsafe {
2954 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2955 (ptr as *mut u64).write_unaligned(0);
2956 }
2957 unsafe {
2958 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
2959 (ptr as *mut u64).write_unaligned(0);
2960 }
2961 unsafe {
2962 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(80);
2963 (ptr as *mut u64).write_unaligned(0);
2964 }
2965 self.0.encode(encoder, offset + 0, depth)?;
2967 self.1.encode(encoder, offset + 4, depth)?;
2968 self.2.encode(encoder, offset + 8, depth)?;
2969 self.3.encode(encoder, offset + 16, depth)?;
2970 self.4.encode(encoder, offset + 24, depth)?;
2971 self.5.encode(encoder, offset + 28, depth)?;
2972 self.6.encode(encoder, offset + 32, depth)?;
2973 self.7.encode(encoder, offset + 48, depth)?;
2974 self.8.encode(encoder, offset + 56, depth)?;
2975 self.9.encode(encoder, offset + 60, depth)?;
2976 Ok(())
2977 }
2978 }
2979
2980 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BindMeshBuffersCmd {
2981 #[inline(always)]
2982 fn new_empty() -> Self {
2983 Self {
2984 mesh_id: fidl::new_empty!(u32, D),
2985 index_buffer_id: fidl::new_empty!(u32, D),
2986 index_format: fidl::new_empty!(MeshIndexFormat, D),
2987 index_offset: fidl::new_empty!(u64, D),
2988 index_count: fidl::new_empty!(u32, D),
2989 vertex_buffer_id: fidl::new_empty!(u32, D),
2990 vertex_format: fidl::new_empty!(MeshVertexFormat, D),
2991 vertex_offset: fidl::new_empty!(u64, D),
2992 vertex_count: fidl::new_empty!(u32, D),
2993 bounding_box: fidl::new_empty!(BoundingBox, D),
2994 }
2995 }
2996
2997 #[inline]
2998 unsafe fn decode(
2999 &mut self,
3000 decoder: &mut fidl::encoding::Decoder<'_, D>,
3001 offset: usize,
3002 _depth: fidl::encoding::Depth,
3003 ) -> fidl::Result<()> {
3004 decoder.debug_check_bounds::<Self>(offset);
3005 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3007 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3008 let mask = 0xffffffff00000000u64;
3009 let maskedval = padval & mask;
3010 if maskedval != 0 {
3011 return Err(fidl::Error::NonZeroPadding {
3012 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3013 });
3014 }
3015 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3016 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3017 let mask = 0xffffffff00000000u64;
3018 let maskedval = padval & mask;
3019 if maskedval != 0 {
3020 return Err(fidl::Error::NonZeroPadding {
3021 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3022 });
3023 }
3024 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
3025 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3026 let mask = 0xffffffff00000000u64;
3027 let maskedval = padval & mask;
3028 if maskedval != 0 {
3029 return Err(fidl::Error::NonZeroPadding {
3030 padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
3031 });
3032 }
3033 fidl::decode!(u32, D, &mut self.mesh_id, decoder, offset + 0, _depth)?;
3034 fidl::decode!(u32, D, &mut self.index_buffer_id, decoder, offset + 4, _depth)?;
3035 fidl::decode!(MeshIndexFormat, D, &mut self.index_format, decoder, offset + 8, _depth)?;
3036 fidl::decode!(u64, D, &mut self.index_offset, decoder, offset + 16, _depth)?;
3037 fidl::decode!(u32, D, &mut self.index_count, decoder, offset + 24, _depth)?;
3038 fidl::decode!(u32, D, &mut self.vertex_buffer_id, decoder, offset + 28, _depth)?;
3039 fidl::decode!(
3040 MeshVertexFormat,
3041 D,
3042 &mut self.vertex_format,
3043 decoder,
3044 offset + 32,
3045 _depth
3046 )?;
3047 fidl::decode!(u64, D, &mut self.vertex_offset, decoder, offset + 48, _depth)?;
3048 fidl::decode!(u32, D, &mut self.vertex_count, decoder, offset + 56, _depth)?;
3049 fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 60, _depth)?;
3050 Ok(())
3051 }
3052 }
3053
3054 impl fidl::encoding::ValueTypeMarker for BoundingBox {
3055 type Borrowed<'a> = &'a Self;
3056 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3057 value
3058 }
3059 }
3060
3061 unsafe impl fidl::encoding::TypeMarker for BoundingBox {
3062 type Owned = Self;
3063
3064 #[inline(always)]
3065 fn inline_align(_context: fidl::encoding::Context) -> usize {
3066 4
3067 }
3068
3069 #[inline(always)]
3070 fn inline_size(_context: fidl::encoding::Context) -> usize {
3071 24
3072 }
3073 }
3074
3075 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BoundingBox, D>
3076 for &BoundingBox
3077 {
3078 #[inline]
3079 unsafe fn encode(
3080 self,
3081 encoder: &mut fidl::encoding::Encoder<'_, D>,
3082 offset: usize,
3083 _depth: fidl::encoding::Depth,
3084 ) -> fidl::Result<()> {
3085 encoder.debug_check_bounds::<BoundingBox>(offset);
3086 fidl::encoding::Encode::<BoundingBox, D>::encode(
3088 (
3089 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.min),
3090 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.max),
3091 ),
3092 encoder,
3093 offset,
3094 _depth,
3095 )
3096 }
3097 }
3098 unsafe impl<
3099 D: fidl::encoding::ResourceDialect,
3100 T0: fidl::encoding::Encode<Vec3, D>,
3101 T1: fidl::encoding::Encode<Vec3, D>,
3102 > fidl::encoding::Encode<BoundingBox, D> for (T0, T1)
3103 {
3104 #[inline]
3105 unsafe fn encode(
3106 self,
3107 encoder: &mut fidl::encoding::Encoder<'_, D>,
3108 offset: usize,
3109 depth: fidl::encoding::Depth,
3110 ) -> fidl::Result<()> {
3111 encoder.debug_check_bounds::<BoundingBox>(offset);
3112 self.0.encode(encoder, offset + 0, depth)?;
3116 self.1.encode(encoder, offset + 12, depth)?;
3117 Ok(())
3118 }
3119 }
3120
3121 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoundingBox {
3122 #[inline(always)]
3123 fn new_empty() -> Self {
3124 Self { min: fidl::new_empty!(Vec3, D), max: fidl::new_empty!(Vec3, D) }
3125 }
3126
3127 #[inline]
3128 unsafe fn decode(
3129 &mut self,
3130 decoder: &mut fidl::encoding::Decoder<'_, D>,
3131 offset: usize,
3132 _depth: fidl::encoding::Depth,
3133 ) -> fidl::Result<()> {
3134 decoder.debug_check_bounds::<Self>(offset);
3135 fidl::decode!(Vec3, D, &mut self.min, decoder, offset + 0, _depth)?;
3137 fidl::decode!(Vec3, D, &mut self.max, decoder, offset + 12, _depth)?;
3138 Ok(())
3139 }
3140 }
3141
3142 impl fidl::encoding::ValueTypeMarker for BufferArgs {
3143 type Borrowed<'a> = &'a Self;
3144 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3145 value
3146 }
3147 }
3148
3149 unsafe impl fidl::encoding::TypeMarker for BufferArgs {
3150 type Owned = Self;
3151
3152 #[inline(always)]
3153 fn inline_align(_context: fidl::encoding::Context) -> usize {
3154 4
3155 }
3156
3157 #[inline(always)]
3158 fn inline_size(_context: fidl::encoding::Context) -> usize {
3159 12
3160 }
3161 #[inline(always)]
3162 fn encode_is_copy() -> bool {
3163 true
3164 }
3165
3166 #[inline(always)]
3167 fn decode_is_copy() -> bool {
3168 true
3169 }
3170 }
3171
3172 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferArgs, D>
3173 for &BufferArgs
3174 {
3175 #[inline]
3176 unsafe fn encode(
3177 self,
3178 encoder: &mut fidl::encoding::Encoder<'_, D>,
3179 offset: usize,
3180 _depth: fidl::encoding::Depth,
3181 ) -> fidl::Result<()> {
3182 encoder.debug_check_bounds::<BufferArgs>(offset);
3183 unsafe {
3184 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3186 (buf_ptr as *mut BufferArgs).write_unaligned((self as *const BufferArgs).read());
3187 }
3190 Ok(())
3191 }
3192 }
3193 unsafe impl<
3194 D: fidl::encoding::ResourceDialect,
3195 T0: fidl::encoding::Encode<u32, D>,
3196 T1: fidl::encoding::Encode<u32, D>,
3197 T2: fidl::encoding::Encode<u32, D>,
3198 > fidl::encoding::Encode<BufferArgs, D> for (T0, T1, T2)
3199 {
3200 #[inline]
3201 unsafe fn encode(
3202 self,
3203 encoder: &mut fidl::encoding::Encoder<'_, D>,
3204 offset: usize,
3205 depth: fidl::encoding::Depth,
3206 ) -> fidl::Result<()> {
3207 encoder.debug_check_bounds::<BufferArgs>(offset);
3208 self.0.encode(encoder, offset + 0, depth)?;
3212 self.1.encode(encoder, offset + 4, depth)?;
3213 self.2.encode(encoder, offset + 8, depth)?;
3214 Ok(())
3215 }
3216 }
3217
3218 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferArgs {
3219 #[inline(always)]
3220 fn new_empty() -> Self {
3221 Self {
3222 memory_id: fidl::new_empty!(u32, D),
3223 memory_offset: fidl::new_empty!(u32, D),
3224 num_bytes: fidl::new_empty!(u32, D),
3225 }
3226 }
3227
3228 #[inline]
3229 unsafe fn decode(
3230 &mut self,
3231 decoder: &mut fidl::encoding::Decoder<'_, D>,
3232 offset: usize,
3233 _depth: fidl::encoding::Depth,
3234 ) -> fidl::Result<()> {
3235 decoder.debug_check_bounds::<Self>(offset);
3236 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3237 unsafe {
3240 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
3241 }
3242 Ok(())
3243 }
3244 }
3245
3246 impl fidl::encoding::ValueTypeMarker for CameraArgs {
3247 type Borrowed<'a> = &'a Self;
3248 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3249 value
3250 }
3251 }
3252
3253 unsafe impl fidl::encoding::TypeMarker for CameraArgs {
3254 type Owned = Self;
3255
3256 #[inline(always)]
3257 fn inline_align(_context: fidl::encoding::Context) -> usize {
3258 4
3259 }
3260
3261 #[inline(always)]
3262 fn inline_size(_context: fidl::encoding::Context) -> usize {
3263 4
3264 }
3265 #[inline(always)]
3266 fn encode_is_copy() -> bool {
3267 true
3268 }
3269
3270 #[inline(always)]
3271 fn decode_is_copy() -> bool {
3272 true
3273 }
3274 }
3275
3276 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CameraArgs, D>
3277 for &CameraArgs
3278 {
3279 #[inline]
3280 unsafe fn encode(
3281 self,
3282 encoder: &mut fidl::encoding::Encoder<'_, D>,
3283 offset: usize,
3284 _depth: fidl::encoding::Depth,
3285 ) -> fidl::Result<()> {
3286 encoder.debug_check_bounds::<CameraArgs>(offset);
3287 unsafe {
3288 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3290 (buf_ptr as *mut CameraArgs).write_unaligned((self as *const CameraArgs).read());
3291 }
3294 Ok(())
3295 }
3296 }
3297 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3298 fidl::encoding::Encode<CameraArgs, D> for (T0,)
3299 {
3300 #[inline]
3301 unsafe fn encode(
3302 self,
3303 encoder: &mut fidl::encoding::Encoder<'_, D>,
3304 offset: usize,
3305 depth: fidl::encoding::Depth,
3306 ) -> fidl::Result<()> {
3307 encoder.debug_check_bounds::<CameraArgs>(offset);
3308 self.0.encode(encoder, offset + 0, depth)?;
3312 Ok(())
3313 }
3314 }
3315
3316 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CameraArgs {
3317 #[inline(always)]
3318 fn new_empty() -> Self {
3319 Self { scene_id: fidl::new_empty!(u32, D) }
3320 }
3321
3322 #[inline]
3323 unsafe fn decode(
3324 &mut self,
3325 decoder: &mut fidl::encoding::Decoder<'_, D>,
3326 offset: usize,
3327 _depth: fidl::encoding::Depth,
3328 ) -> fidl::Result<()> {
3329 decoder.debug_check_bounds::<Self>(offset);
3330 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3331 unsafe {
3334 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3335 }
3336 Ok(())
3337 }
3338 }
3339
3340 impl fidl::encoding::ValueTypeMarker for CircleArgs {
3341 type Borrowed<'a> = &'a Self;
3342 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3343 value
3344 }
3345 }
3346
3347 unsafe impl fidl::encoding::TypeMarker for CircleArgs {
3348 type Owned = Self;
3349
3350 #[inline(always)]
3351 fn inline_align(_context: fidl::encoding::Context) -> usize {
3352 8
3353 }
3354
3355 #[inline(always)]
3356 fn inline_size(_context: fidl::encoding::Context) -> usize {
3357 16
3358 }
3359 }
3360
3361 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CircleArgs, D>
3362 for &CircleArgs
3363 {
3364 #[inline]
3365 unsafe fn encode(
3366 self,
3367 encoder: &mut fidl::encoding::Encoder<'_, D>,
3368 offset: usize,
3369 _depth: fidl::encoding::Depth,
3370 ) -> fidl::Result<()> {
3371 encoder.debug_check_bounds::<CircleArgs>(offset);
3372 fidl::encoding::Encode::<CircleArgs, D>::encode(
3374 (<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.radius),),
3375 encoder,
3376 offset,
3377 _depth,
3378 )
3379 }
3380 }
3381 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Value, D>>
3382 fidl::encoding::Encode<CircleArgs, D> for (T0,)
3383 {
3384 #[inline]
3385 unsafe fn encode(
3386 self,
3387 encoder: &mut fidl::encoding::Encoder<'_, D>,
3388 offset: usize,
3389 depth: fidl::encoding::Depth,
3390 ) -> fidl::Result<()> {
3391 encoder.debug_check_bounds::<CircleArgs>(offset);
3392 self.0.encode(encoder, offset + 0, depth)?;
3396 Ok(())
3397 }
3398 }
3399
3400 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CircleArgs {
3401 #[inline(always)]
3402 fn new_empty() -> Self {
3403 Self { radius: fidl::new_empty!(Value, D) }
3404 }
3405
3406 #[inline]
3407 unsafe fn decode(
3408 &mut self,
3409 decoder: &mut fidl::encoding::Decoder<'_, D>,
3410 offset: usize,
3411 _depth: fidl::encoding::Depth,
3412 ) -> fidl::Result<()> {
3413 decoder.debug_check_bounds::<Self>(offset);
3414 fidl::decode!(Value, D, &mut self.radius, decoder, offset + 0, _depth)?;
3416 Ok(())
3417 }
3418 }
3419
3420 impl fidl::encoding::ValueTypeMarker for ClipNodeArgs {
3421 type Borrowed<'a> = &'a Self;
3422 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3423 value
3424 }
3425 }
3426
3427 unsafe impl fidl::encoding::TypeMarker for ClipNodeArgs {
3428 type Owned = Self;
3429
3430 #[inline(always)]
3431 fn inline_align(_context: fidl::encoding::Context) -> usize {
3432 4
3433 }
3434
3435 #[inline(always)]
3436 fn inline_size(_context: fidl::encoding::Context) -> usize {
3437 4
3438 }
3439 #[inline(always)]
3440 fn encode_is_copy() -> bool {
3441 true
3442 }
3443
3444 #[inline(always)]
3445 fn decode_is_copy() -> bool {
3446 true
3447 }
3448 }
3449
3450 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClipNodeArgs, D>
3451 for &ClipNodeArgs
3452 {
3453 #[inline]
3454 unsafe fn encode(
3455 self,
3456 encoder: &mut fidl::encoding::Encoder<'_, D>,
3457 offset: usize,
3458 _depth: fidl::encoding::Depth,
3459 ) -> fidl::Result<()> {
3460 encoder.debug_check_bounds::<ClipNodeArgs>(offset);
3461 unsafe {
3462 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3464 (buf_ptr as *mut ClipNodeArgs)
3465 .write_unaligned((self as *const ClipNodeArgs).read());
3466 }
3469 Ok(())
3470 }
3471 }
3472 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3473 fidl::encoding::Encode<ClipNodeArgs, D> for (T0,)
3474 {
3475 #[inline]
3476 unsafe fn encode(
3477 self,
3478 encoder: &mut fidl::encoding::Encoder<'_, D>,
3479 offset: usize,
3480 depth: fidl::encoding::Depth,
3481 ) -> fidl::Result<()> {
3482 encoder.debug_check_bounds::<ClipNodeArgs>(offset);
3483 self.0.encode(encoder, offset + 0, depth)?;
3487 Ok(())
3488 }
3489 }
3490
3491 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClipNodeArgs {
3492 #[inline(always)]
3493 fn new_empty() -> Self {
3494 Self { unused: fidl::new_empty!(u32, D) }
3495 }
3496
3497 #[inline]
3498 unsafe fn decode(
3499 &mut self,
3500 decoder: &mut fidl::encoding::Decoder<'_, D>,
3501 offset: usize,
3502 _depth: fidl::encoding::Depth,
3503 ) -> fidl::Result<()> {
3504 decoder.debug_check_bounds::<Self>(offset);
3505 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3506 unsafe {
3509 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3510 }
3511 Ok(())
3512 }
3513 }
3514
3515 impl fidl::encoding::ValueTypeMarker for ColorRgb {
3516 type Borrowed<'a> = &'a Self;
3517 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3518 value
3519 }
3520 }
3521
3522 unsafe impl fidl::encoding::TypeMarker for ColorRgb {
3523 type Owned = Self;
3524
3525 #[inline(always)]
3526 fn inline_align(_context: fidl::encoding::Context) -> usize {
3527 4
3528 }
3529
3530 #[inline(always)]
3531 fn inline_size(_context: fidl::encoding::Context) -> usize {
3532 12
3533 }
3534 }
3535
3536 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgb, D> for &ColorRgb {
3537 #[inline]
3538 unsafe fn encode(
3539 self,
3540 encoder: &mut fidl::encoding::Encoder<'_, D>,
3541 offset: usize,
3542 _depth: fidl::encoding::Depth,
3543 ) -> fidl::Result<()> {
3544 encoder.debug_check_bounds::<ColorRgb>(offset);
3545 fidl::encoding::Encode::<ColorRgb, D>::encode(
3547 (
3548 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
3549 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
3550 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
3551 ),
3552 encoder,
3553 offset,
3554 _depth,
3555 )
3556 }
3557 }
3558 unsafe impl<
3559 D: fidl::encoding::ResourceDialect,
3560 T0: fidl::encoding::Encode<f32, D>,
3561 T1: fidl::encoding::Encode<f32, D>,
3562 T2: fidl::encoding::Encode<f32, D>,
3563 > fidl::encoding::Encode<ColorRgb, D> for (T0, T1, T2)
3564 {
3565 #[inline]
3566 unsafe fn encode(
3567 self,
3568 encoder: &mut fidl::encoding::Encoder<'_, D>,
3569 offset: usize,
3570 depth: fidl::encoding::Depth,
3571 ) -> fidl::Result<()> {
3572 encoder.debug_check_bounds::<ColorRgb>(offset);
3573 self.0.encode(encoder, offset + 0, depth)?;
3577 self.1.encode(encoder, offset + 4, depth)?;
3578 self.2.encode(encoder, offset + 8, depth)?;
3579 Ok(())
3580 }
3581 }
3582
3583 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgb {
3584 #[inline(always)]
3585 fn new_empty() -> Self {
3586 Self {
3587 red: fidl::new_empty!(f32, D),
3588 green: fidl::new_empty!(f32, D),
3589 blue: fidl::new_empty!(f32, D),
3590 }
3591 }
3592
3593 #[inline]
3594 unsafe fn decode(
3595 &mut self,
3596 decoder: &mut fidl::encoding::Decoder<'_, D>,
3597 offset: usize,
3598 _depth: fidl::encoding::Depth,
3599 ) -> fidl::Result<()> {
3600 decoder.debug_check_bounds::<Self>(offset);
3601 fidl::decode!(f32, D, &mut self.red, decoder, offset + 0, _depth)?;
3603 fidl::decode!(f32, D, &mut self.green, decoder, offset + 4, _depth)?;
3604 fidl::decode!(f32, D, &mut self.blue, decoder, offset + 8, _depth)?;
3605 Ok(())
3606 }
3607 }
3608
3609 impl fidl::encoding::ValueTypeMarker for ColorRgbValue {
3610 type Borrowed<'a> = &'a Self;
3611 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3612 value
3613 }
3614 }
3615
3616 unsafe impl fidl::encoding::TypeMarker for ColorRgbValue {
3617 type Owned = Self;
3618
3619 #[inline(always)]
3620 fn inline_align(_context: fidl::encoding::Context) -> usize {
3621 4
3622 }
3623
3624 #[inline(always)]
3625 fn inline_size(_context: fidl::encoding::Context) -> usize {
3626 16
3627 }
3628 }
3629
3630 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbValue, D>
3631 for &ColorRgbValue
3632 {
3633 #[inline]
3634 unsafe fn encode(
3635 self,
3636 encoder: &mut fidl::encoding::Encoder<'_, D>,
3637 offset: usize,
3638 _depth: fidl::encoding::Depth,
3639 ) -> fidl::Result<()> {
3640 encoder.debug_check_bounds::<ColorRgbValue>(offset);
3641 fidl::encoding::Encode::<ColorRgbValue, D>::encode(
3643 (
3644 <ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3645 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
3646 ),
3647 encoder,
3648 offset,
3649 _depth,
3650 )
3651 }
3652 }
3653 unsafe impl<
3654 D: fidl::encoding::ResourceDialect,
3655 T0: fidl::encoding::Encode<ColorRgb, D>,
3656 T1: fidl::encoding::Encode<u32, D>,
3657 > fidl::encoding::Encode<ColorRgbValue, D> for (T0, T1)
3658 {
3659 #[inline]
3660 unsafe fn encode(
3661 self,
3662 encoder: &mut fidl::encoding::Encoder<'_, D>,
3663 offset: usize,
3664 depth: fidl::encoding::Depth,
3665 ) -> fidl::Result<()> {
3666 encoder.debug_check_bounds::<ColorRgbValue>(offset);
3667 self.0.encode(encoder, offset + 0, depth)?;
3671 self.1.encode(encoder, offset + 12, depth)?;
3672 Ok(())
3673 }
3674 }
3675
3676 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbValue {
3677 #[inline(always)]
3678 fn new_empty() -> Self {
3679 Self { value: fidl::new_empty!(ColorRgb, D), variable_id: fidl::new_empty!(u32, D) }
3680 }
3681
3682 #[inline]
3683 unsafe fn decode(
3684 &mut self,
3685 decoder: &mut fidl::encoding::Decoder<'_, D>,
3686 offset: usize,
3687 _depth: fidl::encoding::Depth,
3688 ) -> fidl::Result<()> {
3689 decoder.debug_check_bounds::<Self>(offset);
3690 fidl::decode!(ColorRgb, D, &mut self.value, decoder, offset + 0, _depth)?;
3692 fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
3693 Ok(())
3694 }
3695 }
3696
3697 impl fidl::encoding::ValueTypeMarker for ColorRgba {
3698 type Borrowed<'a> = &'a Self;
3699 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3700 value
3701 }
3702 }
3703
3704 unsafe impl fidl::encoding::TypeMarker for ColorRgba {
3705 type Owned = Self;
3706
3707 #[inline(always)]
3708 fn inline_align(_context: fidl::encoding::Context) -> usize {
3709 1
3710 }
3711
3712 #[inline(always)]
3713 fn inline_size(_context: fidl::encoding::Context) -> usize {
3714 4
3715 }
3716 #[inline(always)]
3717 fn encode_is_copy() -> bool {
3718 true
3719 }
3720
3721 #[inline(always)]
3722 fn decode_is_copy() -> bool {
3723 true
3724 }
3725 }
3726
3727 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgba, D>
3728 for &ColorRgba
3729 {
3730 #[inline]
3731 unsafe fn encode(
3732 self,
3733 encoder: &mut fidl::encoding::Encoder<'_, D>,
3734 offset: usize,
3735 _depth: fidl::encoding::Depth,
3736 ) -> fidl::Result<()> {
3737 encoder.debug_check_bounds::<ColorRgba>(offset);
3738 unsafe {
3739 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3741 (buf_ptr as *mut ColorRgba).write_unaligned((self as *const ColorRgba).read());
3742 }
3745 Ok(())
3746 }
3747 }
3748 unsafe impl<
3749 D: fidl::encoding::ResourceDialect,
3750 T0: fidl::encoding::Encode<u8, D>,
3751 T1: fidl::encoding::Encode<u8, D>,
3752 T2: fidl::encoding::Encode<u8, D>,
3753 T3: fidl::encoding::Encode<u8, D>,
3754 > fidl::encoding::Encode<ColorRgba, D> for (T0, T1, T2, T3)
3755 {
3756 #[inline]
3757 unsafe fn encode(
3758 self,
3759 encoder: &mut fidl::encoding::Encoder<'_, D>,
3760 offset: usize,
3761 depth: fidl::encoding::Depth,
3762 ) -> fidl::Result<()> {
3763 encoder.debug_check_bounds::<ColorRgba>(offset);
3764 self.0.encode(encoder, offset + 0, depth)?;
3768 self.1.encode(encoder, offset + 1, depth)?;
3769 self.2.encode(encoder, offset + 2, depth)?;
3770 self.3.encode(encoder, offset + 3, depth)?;
3771 Ok(())
3772 }
3773 }
3774
3775 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgba {
3776 #[inline(always)]
3777 fn new_empty() -> Self {
3778 Self {
3779 red: fidl::new_empty!(u8, D),
3780 green: fidl::new_empty!(u8, D),
3781 blue: fidl::new_empty!(u8, D),
3782 alpha: fidl::new_empty!(u8, 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 buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3795 unsafe {
3798 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3799 }
3800 Ok(())
3801 }
3802 }
3803
3804 impl fidl::encoding::ValueTypeMarker for ColorRgbaValue {
3805 type Borrowed<'a> = &'a Self;
3806 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3807 value
3808 }
3809 }
3810
3811 unsafe impl fidl::encoding::TypeMarker for ColorRgbaValue {
3812 type Owned = Self;
3813
3814 #[inline(always)]
3815 fn inline_align(_context: fidl::encoding::Context) -> usize {
3816 4
3817 }
3818
3819 #[inline(always)]
3820 fn inline_size(_context: fidl::encoding::Context) -> usize {
3821 8
3822 }
3823 #[inline(always)]
3824 fn encode_is_copy() -> bool {
3825 true
3826 }
3827
3828 #[inline(always)]
3829 fn decode_is_copy() -> bool {
3830 true
3831 }
3832 }
3833
3834 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbaValue, D>
3835 for &ColorRgbaValue
3836 {
3837 #[inline]
3838 unsafe fn encode(
3839 self,
3840 encoder: &mut fidl::encoding::Encoder<'_, D>,
3841 offset: usize,
3842 _depth: fidl::encoding::Depth,
3843 ) -> fidl::Result<()> {
3844 encoder.debug_check_bounds::<ColorRgbaValue>(offset);
3845 unsafe {
3846 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3848 (buf_ptr as *mut ColorRgbaValue)
3849 .write_unaligned((self as *const ColorRgbaValue).read());
3850 }
3853 Ok(())
3854 }
3855 }
3856 unsafe impl<
3857 D: fidl::encoding::ResourceDialect,
3858 T0: fidl::encoding::Encode<ColorRgba, D>,
3859 T1: fidl::encoding::Encode<u32, D>,
3860 > fidl::encoding::Encode<ColorRgbaValue, D> for (T0, T1)
3861 {
3862 #[inline]
3863 unsafe fn encode(
3864 self,
3865 encoder: &mut fidl::encoding::Encoder<'_, D>,
3866 offset: usize,
3867 depth: fidl::encoding::Depth,
3868 ) -> fidl::Result<()> {
3869 encoder.debug_check_bounds::<ColorRgbaValue>(offset);
3870 self.0.encode(encoder, offset + 0, depth)?;
3874 self.1.encode(encoder, offset + 4, depth)?;
3875 Ok(())
3876 }
3877 }
3878
3879 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbaValue {
3880 #[inline(always)]
3881 fn new_empty() -> Self {
3882 Self { value: fidl::new_empty!(ColorRgba, D), variable_id: fidl::new_empty!(u32, D) }
3883 }
3884
3885 #[inline]
3886 unsafe fn decode(
3887 &mut self,
3888 decoder: &mut fidl::encoding::Decoder<'_, D>,
3889 offset: usize,
3890 _depth: fidl::encoding::Depth,
3891 ) -> fidl::Result<()> {
3892 decoder.debug_check_bounds::<Self>(offset);
3893 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3894 unsafe {
3897 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3898 }
3899 Ok(())
3900 }
3901 }
3902
3903 impl fidl::encoding::ValueTypeMarker for CompositorArgs {
3904 type Borrowed<'a> = &'a Self;
3905 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3906 value
3907 }
3908 }
3909
3910 unsafe impl fidl::encoding::TypeMarker for CompositorArgs {
3911 type Owned = Self;
3912
3913 #[inline(always)]
3914 fn inline_align(_context: fidl::encoding::Context) -> usize {
3915 4
3916 }
3917
3918 #[inline(always)]
3919 fn inline_size(_context: fidl::encoding::Context) -> usize {
3920 4
3921 }
3922 #[inline(always)]
3923 fn encode_is_copy() -> bool {
3924 true
3925 }
3926
3927 #[inline(always)]
3928 fn decode_is_copy() -> bool {
3929 true
3930 }
3931 }
3932
3933 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompositorArgs, D>
3934 for &CompositorArgs
3935 {
3936 #[inline]
3937 unsafe fn encode(
3938 self,
3939 encoder: &mut fidl::encoding::Encoder<'_, D>,
3940 offset: usize,
3941 _depth: fidl::encoding::Depth,
3942 ) -> fidl::Result<()> {
3943 encoder.debug_check_bounds::<CompositorArgs>(offset);
3944 unsafe {
3945 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3947 (buf_ptr as *mut CompositorArgs)
3948 .write_unaligned((self as *const CompositorArgs).read());
3949 }
3952 Ok(())
3953 }
3954 }
3955 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3956 fidl::encoding::Encode<CompositorArgs, D> for (T0,)
3957 {
3958 #[inline]
3959 unsafe fn encode(
3960 self,
3961 encoder: &mut fidl::encoding::Encoder<'_, D>,
3962 offset: usize,
3963 depth: fidl::encoding::Depth,
3964 ) -> fidl::Result<()> {
3965 encoder.debug_check_bounds::<CompositorArgs>(offset);
3966 self.0.encode(encoder, offset + 0, depth)?;
3970 Ok(())
3971 }
3972 }
3973
3974 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositorArgs {
3975 #[inline(always)]
3976 fn new_empty() -> Self {
3977 Self { dummy: fidl::new_empty!(u32, D) }
3978 }
3979
3980 #[inline]
3981 unsafe fn decode(
3982 &mut self,
3983 decoder: &mut fidl::encoding::Decoder<'_, D>,
3984 offset: usize,
3985 _depth: fidl::encoding::Depth,
3986 ) -> fidl::Result<()> {
3987 decoder.debug_check_bounds::<Self>(offset);
3988 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3989 unsafe {
3992 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3993 }
3994 Ok(())
3995 }
3996 }
3997
3998 impl fidl::encoding::ValueTypeMarker for DetachChildrenCmd {
3999 type Borrowed<'a> = &'a Self;
4000 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4001 value
4002 }
4003 }
4004
4005 unsafe impl fidl::encoding::TypeMarker for DetachChildrenCmd {
4006 type Owned = Self;
4007
4008 #[inline(always)]
4009 fn inline_align(_context: fidl::encoding::Context) -> usize {
4010 4
4011 }
4012
4013 #[inline(always)]
4014 fn inline_size(_context: fidl::encoding::Context) -> usize {
4015 4
4016 }
4017 #[inline(always)]
4018 fn encode_is_copy() -> bool {
4019 true
4020 }
4021
4022 #[inline(always)]
4023 fn decode_is_copy() -> bool {
4024 true
4025 }
4026 }
4027
4028 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachChildrenCmd, D>
4029 for &DetachChildrenCmd
4030 {
4031 #[inline]
4032 unsafe fn encode(
4033 self,
4034 encoder: &mut fidl::encoding::Encoder<'_, D>,
4035 offset: usize,
4036 _depth: fidl::encoding::Depth,
4037 ) -> fidl::Result<()> {
4038 encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
4039 unsafe {
4040 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4042 (buf_ptr as *mut DetachChildrenCmd)
4043 .write_unaligned((self as *const DetachChildrenCmd).read());
4044 }
4047 Ok(())
4048 }
4049 }
4050 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4051 fidl::encoding::Encode<DetachChildrenCmd, D> for (T0,)
4052 {
4053 #[inline]
4054 unsafe fn encode(
4055 self,
4056 encoder: &mut fidl::encoding::Encoder<'_, D>,
4057 offset: usize,
4058 depth: fidl::encoding::Depth,
4059 ) -> fidl::Result<()> {
4060 encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
4061 self.0.encode(encoder, offset + 0, depth)?;
4065 Ok(())
4066 }
4067 }
4068
4069 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachChildrenCmd {
4070 #[inline(always)]
4071 fn new_empty() -> Self {
4072 Self { node_id: fidl::new_empty!(u32, D) }
4073 }
4074
4075 #[inline]
4076 unsafe fn decode(
4077 &mut self,
4078 decoder: &mut fidl::encoding::Decoder<'_, D>,
4079 offset: usize,
4080 _depth: fidl::encoding::Depth,
4081 ) -> fidl::Result<()> {
4082 decoder.debug_check_bounds::<Self>(offset);
4083 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4084 unsafe {
4087 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4088 }
4089 Ok(())
4090 }
4091 }
4092
4093 impl fidl::encoding::ValueTypeMarker for DetachCmd {
4094 type Borrowed<'a> = &'a Self;
4095 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4096 value
4097 }
4098 }
4099
4100 unsafe impl fidl::encoding::TypeMarker for DetachCmd {
4101 type Owned = Self;
4102
4103 #[inline(always)]
4104 fn inline_align(_context: fidl::encoding::Context) -> usize {
4105 4
4106 }
4107
4108 #[inline(always)]
4109 fn inline_size(_context: fidl::encoding::Context) -> usize {
4110 4
4111 }
4112 #[inline(always)]
4113 fn encode_is_copy() -> bool {
4114 true
4115 }
4116
4117 #[inline(always)]
4118 fn decode_is_copy() -> bool {
4119 true
4120 }
4121 }
4122
4123 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachCmd, D>
4124 for &DetachCmd
4125 {
4126 #[inline]
4127 unsafe fn encode(
4128 self,
4129 encoder: &mut fidl::encoding::Encoder<'_, D>,
4130 offset: usize,
4131 _depth: fidl::encoding::Depth,
4132 ) -> fidl::Result<()> {
4133 encoder.debug_check_bounds::<DetachCmd>(offset);
4134 unsafe {
4135 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4137 (buf_ptr as *mut DetachCmd).write_unaligned((self as *const DetachCmd).read());
4138 }
4141 Ok(())
4142 }
4143 }
4144 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4145 fidl::encoding::Encode<DetachCmd, D> for (T0,)
4146 {
4147 #[inline]
4148 unsafe fn encode(
4149 self,
4150 encoder: &mut fidl::encoding::Encoder<'_, D>,
4151 offset: usize,
4152 depth: fidl::encoding::Depth,
4153 ) -> fidl::Result<()> {
4154 encoder.debug_check_bounds::<DetachCmd>(offset);
4155 self.0.encode(encoder, offset + 0, depth)?;
4159 Ok(())
4160 }
4161 }
4162
4163 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachCmd {
4164 #[inline(always)]
4165 fn new_empty() -> Self {
4166 Self { id: fidl::new_empty!(u32, D) }
4167 }
4168
4169 #[inline]
4170 unsafe fn decode(
4171 &mut self,
4172 decoder: &mut fidl::encoding::Decoder<'_, D>,
4173 offset: usize,
4174 _depth: fidl::encoding::Depth,
4175 ) -> fidl::Result<()> {
4176 decoder.debug_check_bounds::<Self>(offset);
4177 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4178 unsafe {
4181 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4182 }
4183 Ok(())
4184 }
4185 }
4186
4187 impl fidl::encoding::ValueTypeMarker for DetachLightCmd {
4188 type Borrowed<'a> = &'a Self;
4189 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4190 value
4191 }
4192 }
4193
4194 unsafe impl fidl::encoding::TypeMarker for DetachLightCmd {
4195 type Owned = Self;
4196
4197 #[inline(always)]
4198 fn inline_align(_context: fidl::encoding::Context) -> usize {
4199 4
4200 }
4201
4202 #[inline(always)]
4203 fn inline_size(_context: fidl::encoding::Context) -> usize {
4204 4
4205 }
4206 #[inline(always)]
4207 fn encode_is_copy() -> bool {
4208 true
4209 }
4210
4211 #[inline(always)]
4212 fn decode_is_copy() -> bool {
4213 true
4214 }
4215 }
4216
4217 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightCmd, D>
4218 for &DetachLightCmd
4219 {
4220 #[inline]
4221 unsafe fn encode(
4222 self,
4223 encoder: &mut fidl::encoding::Encoder<'_, D>,
4224 offset: usize,
4225 _depth: fidl::encoding::Depth,
4226 ) -> fidl::Result<()> {
4227 encoder.debug_check_bounds::<DetachLightCmd>(offset);
4228 unsafe {
4229 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4231 (buf_ptr as *mut DetachLightCmd)
4232 .write_unaligned((self as *const DetachLightCmd).read());
4233 }
4236 Ok(())
4237 }
4238 }
4239 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4240 fidl::encoding::Encode<DetachLightCmd, D> for (T0,)
4241 {
4242 #[inline]
4243 unsafe fn encode(
4244 self,
4245 encoder: &mut fidl::encoding::Encoder<'_, D>,
4246 offset: usize,
4247 depth: fidl::encoding::Depth,
4248 ) -> fidl::Result<()> {
4249 encoder.debug_check_bounds::<DetachLightCmd>(offset);
4250 self.0.encode(encoder, offset + 0, depth)?;
4254 Ok(())
4255 }
4256 }
4257
4258 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightCmd {
4259 #[inline(always)]
4260 fn new_empty() -> Self {
4261 Self { light_id: fidl::new_empty!(u32, D) }
4262 }
4263
4264 #[inline]
4265 unsafe fn decode(
4266 &mut self,
4267 decoder: &mut fidl::encoding::Decoder<'_, D>,
4268 offset: usize,
4269 _depth: fidl::encoding::Depth,
4270 ) -> fidl::Result<()> {
4271 decoder.debug_check_bounds::<Self>(offset);
4272 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4273 unsafe {
4276 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4277 }
4278 Ok(())
4279 }
4280 }
4281
4282 impl fidl::encoding::ValueTypeMarker for DetachLightsCmd {
4283 type Borrowed<'a> = &'a Self;
4284 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4285 value
4286 }
4287 }
4288
4289 unsafe impl fidl::encoding::TypeMarker for DetachLightsCmd {
4290 type Owned = Self;
4291
4292 #[inline(always)]
4293 fn inline_align(_context: fidl::encoding::Context) -> usize {
4294 4
4295 }
4296
4297 #[inline(always)]
4298 fn inline_size(_context: fidl::encoding::Context) -> usize {
4299 4
4300 }
4301 #[inline(always)]
4302 fn encode_is_copy() -> bool {
4303 true
4304 }
4305
4306 #[inline(always)]
4307 fn decode_is_copy() -> bool {
4308 true
4309 }
4310 }
4311
4312 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightsCmd, D>
4313 for &DetachLightsCmd
4314 {
4315 #[inline]
4316 unsafe fn encode(
4317 self,
4318 encoder: &mut fidl::encoding::Encoder<'_, D>,
4319 offset: usize,
4320 _depth: fidl::encoding::Depth,
4321 ) -> fidl::Result<()> {
4322 encoder.debug_check_bounds::<DetachLightsCmd>(offset);
4323 unsafe {
4324 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4326 (buf_ptr as *mut DetachLightsCmd)
4327 .write_unaligned((self as *const DetachLightsCmd).read());
4328 }
4331 Ok(())
4332 }
4333 }
4334 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4335 fidl::encoding::Encode<DetachLightsCmd, D> for (T0,)
4336 {
4337 #[inline]
4338 unsafe fn encode(
4339 self,
4340 encoder: &mut fidl::encoding::Encoder<'_, D>,
4341 offset: usize,
4342 depth: fidl::encoding::Depth,
4343 ) -> fidl::Result<()> {
4344 encoder.debug_check_bounds::<DetachLightsCmd>(offset);
4345 self.0.encode(encoder, offset + 0, depth)?;
4349 Ok(())
4350 }
4351 }
4352
4353 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightsCmd {
4354 #[inline(always)]
4355 fn new_empty() -> Self {
4356 Self { scene_id: fidl::new_empty!(u32, D) }
4357 }
4358
4359 #[inline]
4360 unsafe fn decode(
4361 &mut self,
4362 decoder: &mut fidl::encoding::Decoder<'_, D>,
4363 offset: usize,
4364 _depth: fidl::encoding::Depth,
4365 ) -> fidl::Result<()> {
4366 decoder.debug_check_bounds::<Self>(offset);
4367 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4368 unsafe {
4371 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4372 }
4373 Ok(())
4374 }
4375 }
4376
4377 impl fidl::encoding::ValueTypeMarker for DirectionalLightArgs {
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 DirectionalLightArgs {
4385 type Owned = Self;
4386
4387 #[inline(always)]
4388 fn inline_align(_context: fidl::encoding::Context) -> usize {
4389 4
4390 }
4391
4392 #[inline(always)]
4393 fn inline_size(_context: fidl::encoding::Context) -> usize {
4394 4
4395 }
4396 #[inline(always)]
4397 fn encode_is_copy() -> bool {
4398 true
4399 }
4400
4401 #[inline(always)]
4402 fn decode_is_copy() -> bool {
4403 true
4404 }
4405 }
4406
4407 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectionalLightArgs, D>
4408 for &DirectionalLightArgs
4409 {
4410 #[inline]
4411 unsafe fn encode(
4412 self,
4413 encoder: &mut fidl::encoding::Encoder<'_, D>,
4414 offset: usize,
4415 _depth: fidl::encoding::Depth,
4416 ) -> fidl::Result<()> {
4417 encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
4418 unsafe {
4419 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4421 (buf_ptr as *mut DirectionalLightArgs)
4422 .write_unaligned((self as *const DirectionalLightArgs).read());
4423 }
4426 Ok(())
4427 }
4428 }
4429 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4430 fidl::encoding::Encode<DirectionalLightArgs, D> for (T0,)
4431 {
4432 #[inline]
4433 unsafe fn encode(
4434 self,
4435 encoder: &mut fidl::encoding::Encoder<'_, D>,
4436 offset: usize,
4437 depth: fidl::encoding::Depth,
4438 ) -> fidl::Result<()> {
4439 encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
4440 self.0.encode(encoder, offset + 0, depth)?;
4444 Ok(())
4445 }
4446 }
4447
4448 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectionalLightArgs {
4449 #[inline(always)]
4450 fn new_empty() -> Self {
4451 Self { dummy: fidl::new_empty!(u32, D) }
4452 }
4453
4454 #[inline]
4455 unsafe fn decode(
4456 &mut self,
4457 decoder: &mut fidl::encoding::Decoder<'_, D>,
4458 offset: usize,
4459 _depth: fidl::encoding::Depth,
4460 ) -> fidl::Result<()> {
4461 decoder.debug_check_bounds::<Self>(offset);
4462 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4463 unsafe {
4466 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4467 }
4468 Ok(())
4469 }
4470 }
4471
4472 impl fidl::encoding::ValueTypeMarker for DisplayCompositorArgs {
4473 type Borrowed<'a> = &'a Self;
4474 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4475 value
4476 }
4477 }
4478
4479 unsafe impl fidl::encoding::TypeMarker for DisplayCompositorArgs {
4480 type Owned = Self;
4481
4482 #[inline(always)]
4483 fn inline_align(_context: fidl::encoding::Context) -> usize {
4484 4
4485 }
4486
4487 #[inline(always)]
4488 fn inline_size(_context: fidl::encoding::Context) -> usize {
4489 4
4490 }
4491 #[inline(always)]
4492 fn encode_is_copy() -> bool {
4493 true
4494 }
4495
4496 #[inline(always)]
4497 fn decode_is_copy() -> bool {
4498 true
4499 }
4500 }
4501
4502 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayCompositorArgs, D>
4503 for &DisplayCompositorArgs
4504 {
4505 #[inline]
4506 unsafe fn encode(
4507 self,
4508 encoder: &mut fidl::encoding::Encoder<'_, D>,
4509 offset: usize,
4510 _depth: fidl::encoding::Depth,
4511 ) -> fidl::Result<()> {
4512 encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
4513 unsafe {
4514 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4516 (buf_ptr as *mut DisplayCompositorArgs)
4517 .write_unaligned((self as *const DisplayCompositorArgs).read());
4518 }
4521 Ok(())
4522 }
4523 }
4524 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4525 fidl::encoding::Encode<DisplayCompositorArgs, D> for (T0,)
4526 {
4527 #[inline]
4528 unsafe fn encode(
4529 self,
4530 encoder: &mut fidl::encoding::Encoder<'_, D>,
4531 offset: usize,
4532 depth: fidl::encoding::Depth,
4533 ) -> fidl::Result<()> {
4534 encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
4535 self.0.encode(encoder, offset + 0, depth)?;
4539 Ok(())
4540 }
4541 }
4542
4543 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayCompositorArgs {
4544 #[inline(always)]
4545 fn new_empty() -> Self {
4546 Self { dummy: fidl::new_empty!(u32, D) }
4547 }
4548
4549 #[inline]
4550 unsafe fn decode(
4551 &mut self,
4552 decoder: &mut fidl::encoding::Decoder<'_, D>,
4553 offset: usize,
4554 _depth: fidl::encoding::Depth,
4555 ) -> fidl::Result<()> {
4556 decoder.debug_check_bounds::<Self>(offset);
4557 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4558 unsafe {
4561 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4562 }
4563 Ok(())
4564 }
4565 }
4566
4567 impl fidl::encoding::ValueTypeMarker for DisplayInfo {
4568 type Borrowed<'a> = &'a Self;
4569 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4570 value
4571 }
4572 }
4573
4574 unsafe impl fidl::encoding::TypeMarker for DisplayInfo {
4575 type Owned = Self;
4576
4577 #[inline(always)]
4578 fn inline_align(_context: fidl::encoding::Context) -> usize {
4579 4
4580 }
4581
4582 #[inline(always)]
4583 fn inline_size(_context: fidl::encoding::Context) -> usize {
4584 8
4585 }
4586 #[inline(always)]
4587 fn encode_is_copy() -> bool {
4588 true
4589 }
4590
4591 #[inline(always)]
4592 fn decode_is_copy() -> bool {
4593 true
4594 }
4595 }
4596
4597 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayInfo, D>
4598 for &DisplayInfo
4599 {
4600 #[inline]
4601 unsafe fn encode(
4602 self,
4603 encoder: &mut fidl::encoding::Encoder<'_, D>,
4604 offset: usize,
4605 _depth: fidl::encoding::Depth,
4606 ) -> fidl::Result<()> {
4607 encoder.debug_check_bounds::<DisplayInfo>(offset);
4608 unsafe {
4609 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4611 (buf_ptr as *mut DisplayInfo).write_unaligned((self as *const DisplayInfo).read());
4612 }
4615 Ok(())
4616 }
4617 }
4618 unsafe impl<
4619 D: fidl::encoding::ResourceDialect,
4620 T0: fidl::encoding::Encode<u32, D>,
4621 T1: fidl::encoding::Encode<u32, D>,
4622 > fidl::encoding::Encode<DisplayInfo, D> for (T0, T1)
4623 {
4624 #[inline]
4625 unsafe fn encode(
4626 self,
4627 encoder: &mut fidl::encoding::Encoder<'_, D>,
4628 offset: usize,
4629 depth: fidl::encoding::Depth,
4630 ) -> fidl::Result<()> {
4631 encoder.debug_check_bounds::<DisplayInfo>(offset);
4632 self.0.encode(encoder, offset + 0, depth)?;
4636 self.1.encode(encoder, offset + 4, depth)?;
4637 Ok(())
4638 }
4639 }
4640
4641 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayInfo {
4642 #[inline(always)]
4643 fn new_empty() -> Self {
4644 Self { width_in_px: fidl::new_empty!(u32, D), height_in_px: fidl::new_empty!(u32, D) }
4645 }
4646
4647 #[inline]
4648 unsafe fn decode(
4649 &mut self,
4650 decoder: &mut fidl::encoding::Decoder<'_, D>,
4651 offset: usize,
4652 _depth: fidl::encoding::Depth,
4653 ) -> fidl::Result<()> {
4654 decoder.debug_check_bounds::<Self>(offset);
4655 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4656 unsafe {
4659 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4660 }
4661 Ok(())
4662 }
4663 }
4664
4665 impl fidl::encoding::ValueTypeMarker for EntityNodeArgs {
4666 type Borrowed<'a> = &'a Self;
4667 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4668 value
4669 }
4670 }
4671
4672 unsafe impl fidl::encoding::TypeMarker for EntityNodeArgs {
4673 type Owned = Self;
4674
4675 #[inline(always)]
4676 fn inline_align(_context: fidl::encoding::Context) -> usize {
4677 4
4678 }
4679
4680 #[inline(always)]
4681 fn inline_size(_context: fidl::encoding::Context) -> usize {
4682 4
4683 }
4684 #[inline(always)]
4685 fn encode_is_copy() -> bool {
4686 true
4687 }
4688
4689 #[inline(always)]
4690 fn decode_is_copy() -> bool {
4691 true
4692 }
4693 }
4694
4695 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EntityNodeArgs, D>
4696 for &EntityNodeArgs
4697 {
4698 #[inline]
4699 unsafe fn encode(
4700 self,
4701 encoder: &mut fidl::encoding::Encoder<'_, D>,
4702 offset: usize,
4703 _depth: fidl::encoding::Depth,
4704 ) -> fidl::Result<()> {
4705 encoder.debug_check_bounds::<EntityNodeArgs>(offset);
4706 unsafe {
4707 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4709 (buf_ptr as *mut EntityNodeArgs)
4710 .write_unaligned((self as *const EntityNodeArgs).read());
4711 }
4714 Ok(())
4715 }
4716 }
4717 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4718 fidl::encoding::Encode<EntityNodeArgs, D> for (T0,)
4719 {
4720 #[inline]
4721 unsafe fn encode(
4722 self,
4723 encoder: &mut fidl::encoding::Encoder<'_, D>,
4724 offset: usize,
4725 depth: fidl::encoding::Depth,
4726 ) -> fidl::Result<()> {
4727 encoder.debug_check_bounds::<EntityNodeArgs>(offset);
4728 self.0.encode(encoder, offset + 0, depth)?;
4732 Ok(())
4733 }
4734 }
4735
4736 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EntityNodeArgs {
4737 #[inline(always)]
4738 fn new_empty() -> Self {
4739 Self { unused: fidl::new_empty!(u32, D) }
4740 }
4741
4742 #[inline]
4743 unsafe fn decode(
4744 &mut self,
4745 decoder: &mut fidl::encoding::Decoder<'_, D>,
4746 offset: usize,
4747 _depth: fidl::encoding::Depth,
4748 ) -> fidl::Result<()> {
4749 decoder.debug_check_bounds::<Self>(offset);
4750 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4751 unsafe {
4754 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4755 }
4756 Ok(())
4757 }
4758 }
4759
4760 impl fidl::encoding::ValueTypeMarker for FactoredTransform {
4761 type Borrowed<'a> = &'a Self;
4762 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4763 value
4764 }
4765 }
4766
4767 unsafe impl fidl::encoding::TypeMarker for FactoredTransform {
4768 type Owned = Self;
4769
4770 #[inline(always)]
4771 fn inline_align(_context: fidl::encoding::Context) -> usize {
4772 4
4773 }
4774
4775 #[inline(always)]
4776 fn inline_size(_context: fidl::encoding::Context) -> usize {
4777 52
4778 }
4779 }
4780
4781 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FactoredTransform, D>
4782 for &FactoredTransform
4783 {
4784 #[inline]
4785 unsafe fn encode(
4786 self,
4787 encoder: &mut fidl::encoding::Encoder<'_, D>,
4788 offset: usize,
4789 _depth: fidl::encoding::Depth,
4790 ) -> fidl::Result<()> {
4791 encoder.debug_check_bounds::<FactoredTransform>(offset);
4792 fidl::encoding::Encode::<FactoredTransform, D>::encode(
4794 (
4795 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
4796 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
4797 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.anchor),
4798 <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.rotation),
4799 ),
4800 encoder,
4801 offset,
4802 _depth,
4803 )
4804 }
4805 }
4806 unsafe impl<
4807 D: fidl::encoding::ResourceDialect,
4808 T0: fidl::encoding::Encode<Vec3, D>,
4809 T1: fidl::encoding::Encode<Vec3, D>,
4810 T2: fidl::encoding::Encode<Vec3, D>,
4811 T3: fidl::encoding::Encode<Quaternion, D>,
4812 > fidl::encoding::Encode<FactoredTransform, D> for (T0, T1, T2, T3)
4813 {
4814 #[inline]
4815 unsafe fn encode(
4816 self,
4817 encoder: &mut fidl::encoding::Encoder<'_, D>,
4818 offset: usize,
4819 depth: fidl::encoding::Depth,
4820 ) -> fidl::Result<()> {
4821 encoder.debug_check_bounds::<FactoredTransform>(offset);
4822 self.0.encode(encoder, offset + 0, depth)?;
4826 self.1.encode(encoder, offset + 12, depth)?;
4827 self.2.encode(encoder, offset + 24, depth)?;
4828 self.3.encode(encoder, offset + 36, depth)?;
4829 Ok(())
4830 }
4831 }
4832
4833 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FactoredTransform {
4834 #[inline(always)]
4835 fn new_empty() -> Self {
4836 Self {
4837 translation: fidl::new_empty!(Vec3, D),
4838 scale: fidl::new_empty!(Vec3, D),
4839 anchor: fidl::new_empty!(Vec3, D),
4840 rotation: fidl::new_empty!(Quaternion, D),
4841 }
4842 }
4843
4844 #[inline]
4845 unsafe fn decode(
4846 &mut self,
4847 decoder: &mut fidl::encoding::Decoder<'_, D>,
4848 offset: usize,
4849 _depth: fidl::encoding::Depth,
4850 ) -> fidl::Result<()> {
4851 decoder.debug_check_bounds::<Self>(offset);
4852 fidl::decode!(Vec3, D, &mut self.translation, decoder, offset + 0, _depth)?;
4854 fidl::decode!(Vec3, D, &mut self.scale, decoder, offset + 12, _depth)?;
4855 fidl::decode!(Vec3, D, &mut self.anchor, decoder, offset + 24, _depth)?;
4856 fidl::decode!(Quaternion, D, &mut self.rotation, decoder, offset + 36, _depth)?;
4857 Ok(())
4858 }
4859 }
4860
4861 impl fidl::encoding::ValueTypeMarker for FloatValue {
4862 type Borrowed<'a> = &'a Self;
4863 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4864 value
4865 }
4866 }
4867
4868 unsafe impl fidl::encoding::TypeMarker for FloatValue {
4869 type Owned = Self;
4870
4871 #[inline(always)]
4872 fn inline_align(_context: fidl::encoding::Context) -> usize {
4873 4
4874 }
4875
4876 #[inline(always)]
4877 fn inline_size(_context: fidl::encoding::Context) -> usize {
4878 8
4879 }
4880 }
4881
4882 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FloatValue, D>
4883 for &FloatValue
4884 {
4885 #[inline]
4886 unsafe fn encode(
4887 self,
4888 encoder: &mut fidl::encoding::Encoder<'_, D>,
4889 offset: usize,
4890 _depth: fidl::encoding::Depth,
4891 ) -> fidl::Result<()> {
4892 encoder.debug_check_bounds::<FloatValue>(offset);
4893 fidl::encoding::Encode::<FloatValue, D>::encode(
4895 (
4896 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4897 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
4898 ),
4899 encoder,
4900 offset,
4901 _depth,
4902 )
4903 }
4904 }
4905 unsafe impl<
4906 D: fidl::encoding::ResourceDialect,
4907 T0: fidl::encoding::Encode<f32, D>,
4908 T1: fidl::encoding::Encode<u32, D>,
4909 > fidl::encoding::Encode<FloatValue, D> for (T0, T1)
4910 {
4911 #[inline]
4912 unsafe fn encode(
4913 self,
4914 encoder: &mut fidl::encoding::Encoder<'_, D>,
4915 offset: usize,
4916 depth: fidl::encoding::Depth,
4917 ) -> fidl::Result<()> {
4918 encoder.debug_check_bounds::<FloatValue>(offset);
4919 self.0.encode(encoder, offset + 0, depth)?;
4923 self.1.encode(encoder, offset + 4, depth)?;
4924 Ok(())
4925 }
4926 }
4927
4928 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FloatValue {
4929 #[inline(always)]
4930 fn new_empty() -> Self {
4931 Self { value: fidl::new_empty!(f32, D), variable_id: fidl::new_empty!(u32, D) }
4932 }
4933
4934 #[inline]
4935 unsafe fn decode(
4936 &mut self,
4937 decoder: &mut fidl::encoding::Decoder<'_, D>,
4938 offset: usize,
4939 _depth: fidl::encoding::Depth,
4940 ) -> fidl::Result<()> {
4941 decoder.debug_check_bounds::<Self>(offset);
4942 fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
4944 fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 4, _depth)?;
4945 Ok(())
4946 }
4947 }
4948
4949 impl fidl::encoding::ValueTypeMarker for ImageArgs {
4950 type Borrowed<'a> = &'a Self;
4951 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4952 value
4953 }
4954 }
4955
4956 unsafe impl fidl::encoding::TypeMarker for ImageArgs {
4957 type Owned = Self;
4958
4959 #[inline(always)]
4960 fn inline_align(_context: fidl::encoding::Context) -> usize {
4961 4
4962 }
4963
4964 #[inline(always)]
4965 fn inline_size(_context: fidl::encoding::Context) -> usize {
4966 40
4967 }
4968 }
4969
4970 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs, D>
4971 for &ImageArgs
4972 {
4973 #[inline]
4974 unsafe fn encode(
4975 self,
4976 encoder: &mut fidl::encoding::Encoder<'_, D>,
4977 offset: usize,
4978 _depth: fidl::encoding::Depth,
4979 ) -> fidl::Result<()> {
4980 encoder.debug_check_bounds::<ImageArgs>(offset);
4981 fidl::encoding::Encode::<ImageArgs, D>::encode(
4983 (
4984 <fidl_fuchsia_images::ImageInfo as fidl::encoding::ValueTypeMarker>::borrow(
4985 &self.info,
4986 ),
4987 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_id),
4988 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_offset),
4989 ),
4990 encoder,
4991 offset,
4992 _depth,
4993 )
4994 }
4995 }
4996 unsafe impl<
4997 D: fidl::encoding::ResourceDialect,
4998 T0: fidl::encoding::Encode<fidl_fuchsia_images::ImageInfo, D>,
4999 T1: fidl::encoding::Encode<u32, D>,
5000 T2: fidl::encoding::Encode<u32, D>,
5001 > fidl::encoding::Encode<ImageArgs, D> for (T0, T1, T2)
5002 {
5003 #[inline]
5004 unsafe fn encode(
5005 self,
5006 encoder: &mut fidl::encoding::Encoder<'_, D>,
5007 offset: usize,
5008 depth: fidl::encoding::Depth,
5009 ) -> fidl::Result<()> {
5010 encoder.debug_check_bounds::<ImageArgs>(offset);
5011 self.0.encode(encoder, offset + 0, depth)?;
5015 self.1.encode(encoder, offset + 32, depth)?;
5016 self.2.encode(encoder, offset + 36, depth)?;
5017 Ok(())
5018 }
5019 }
5020
5021 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs {
5022 #[inline(always)]
5023 fn new_empty() -> Self {
5024 Self {
5025 info: fidl::new_empty!(fidl_fuchsia_images::ImageInfo, D),
5026 memory_id: fidl::new_empty!(u32, D),
5027 memory_offset: fidl::new_empty!(u32, D),
5028 }
5029 }
5030
5031 #[inline]
5032 unsafe fn decode(
5033 &mut self,
5034 decoder: &mut fidl::encoding::Decoder<'_, D>,
5035 offset: usize,
5036 _depth: fidl::encoding::Depth,
5037 ) -> fidl::Result<()> {
5038 decoder.debug_check_bounds::<Self>(offset);
5039 fidl::decode!(
5041 fidl_fuchsia_images::ImageInfo,
5042 D,
5043 &mut self.info,
5044 decoder,
5045 offset + 0,
5046 _depth
5047 )?;
5048 fidl::decode!(u32, D, &mut self.memory_id, decoder, offset + 32, _depth)?;
5049 fidl::decode!(u32, D, &mut self.memory_offset, decoder, offset + 36, _depth)?;
5050 Ok(())
5051 }
5052 }
5053
5054 impl fidl::encoding::ValueTypeMarker for ImageArgs2 {
5055 type Borrowed<'a> = &'a Self;
5056 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5057 value
5058 }
5059 }
5060
5061 unsafe impl fidl::encoding::TypeMarker for ImageArgs2 {
5062 type Owned = Self;
5063
5064 #[inline(always)]
5065 fn inline_align(_context: fidl::encoding::Context) -> usize {
5066 4
5067 }
5068
5069 #[inline(always)]
5070 fn inline_size(_context: fidl::encoding::Context) -> usize {
5071 16
5072 }
5073 #[inline(always)]
5074 fn encode_is_copy() -> bool {
5075 true
5076 }
5077
5078 #[inline(always)]
5079 fn decode_is_copy() -> bool {
5080 true
5081 }
5082 }
5083
5084 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs2, D>
5085 for &ImageArgs2
5086 {
5087 #[inline]
5088 unsafe fn encode(
5089 self,
5090 encoder: &mut fidl::encoding::Encoder<'_, D>,
5091 offset: usize,
5092 _depth: fidl::encoding::Depth,
5093 ) -> fidl::Result<()> {
5094 encoder.debug_check_bounds::<ImageArgs2>(offset);
5095 unsafe {
5096 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5098 (buf_ptr as *mut ImageArgs2).write_unaligned((self as *const ImageArgs2).read());
5099 }
5102 Ok(())
5103 }
5104 }
5105 unsafe impl<
5106 D: fidl::encoding::ResourceDialect,
5107 T0: fidl::encoding::Encode<u32, D>,
5108 T1: fidl::encoding::Encode<u32, D>,
5109 T2: fidl::encoding::Encode<u32, D>,
5110 T3: fidl::encoding::Encode<u32, D>,
5111 > fidl::encoding::Encode<ImageArgs2, D> for (T0, T1, T2, T3)
5112 {
5113 #[inline]
5114 unsafe fn encode(
5115 self,
5116 encoder: &mut fidl::encoding::Encoder<'_, D>,
5117 offset: usize,
5118 depth: fidl::encoding::Depth,
5119 ) -> fidl::Result<()> {
5120 encoder.debug_check_bounds::<ImageArgs2>(offset);
5121 self.0.encode(encoder, offset + 0, depth)?;
5125 self.1.encode(encoder, offset + 4, depth)?;
5126 self.2.encode(encoder, offset + 8, depth)?;
5127 self.3.encode(encoder, offset + 12, depth)?;
5128 Ok(())
5129 }
5130 }
5131
5132 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs2 {
5133 #[inline(always)]
5134 fn new_empty() -> Self {
5135 Self {
5136 width: fidl::new_empty!(u32, D),
5137 height: fidl::new_empty!(u32, D),
5138 buffer_collection_id: fidl::new_empty!(u32, D),
5139 buffer_collection_index: fidl::new_empty!(u32, D),
5140 }
5141 }
5142
5143 #[inline]
5144 unsafe fn decode(
5145 &mut self,
5146 decoder: &mut fidl::encoding::Decoder<'_, D>,
5147 offset: usize,
5148 _depth: fidl::encoding::Depth,
5149 ) -> fidl::Result<()> {
5150 decoder.debug_check_bounds::<Self>(offset);
5151 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5152 unsafe {
5155 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5156 }
5157 Ok(())
5158 }
5159 }
5160
5161 impl fidl::encoding::ValueTypeMarker for ImportUnboundEvent {
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 ImportUnboundEvent {
5169 type Owned = Self;
5170
5171 #[inline(always)]
5172 fn inline_align(_context: fidl::encoding::Context) -> usize {
5173 4
5174 }
5175
5176 #[inline(always)]
5177 fn inline_size(_context: fidl::encoding::Context) -> usize {
5178 4
5179 }
5180 #[inline(always)]
5181 fn encode_is_copy() -> bool {
5182 true
5183 }
5184
5185 #[inline(always)]
5186 fn decode_is_copy() -> bool {
5187 true
5188 }
5189 }
5190
5191 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImportUnboundEvent, D>
5192 for &ImportUnboundEvent
5193 {
5194 #[inline]
5195 unsafe fn encode(
5196 self,
5197 encoder: &mut fidl::encoding::Encoder<'_, D>,
5198 offset: usize,
5199 _depth: fidl::encoding::Depth,
5200 ) -> fidl::Result<()> {
5201 encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5202 unsafe {
5203 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5205 (buf_ptr as *mut ImportUnboundEvent)
5206 .write_unaligned((self as *const ImportUnboundEvent).read());
5207 }
5210 Ok(())
5211 }
5212 }
5213 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5214 fidl::encoding::Encode<ImportUnboundEvent, D> for (T0,)
5215 {
5216 #[inline]
5217 unsafe fn encode(
5218 self,
5219 encoder: &mut fidl::encoding::Encoder<'_, D>,
5220 offset: usize,
5221 depth: fidl::encoding::Depth,
5222 ) -> fidl::Result<()> {
5223 encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5224 self.0.encode(encoder, offset + 0, depth)?;
5228 Ok(())
5229 }
5230 }
5231
5232 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportUnboundEvent {
5233 #[inline(always)]
5234 fn new_empty() -> Self {
5235 Self { resource_id: fidl::new_empty!(u32, D) }
5236 }
5237
5238 #[inline]
5239 unsafe fn decode(
5240 &mut self,
5241 decoder: &mut fidl::encoding::Decoder<'_, D>,
5242 offset: usize,
5243 _depth: fidl::encoding::Depth,
5244 ) -> fidl::Result<()> {
5245 decoder.debug_check_bounds::<Self>(offset);
5246 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5247 unsafe {
5250 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5251 }
5252 Ok(())
5253 }
5254 }
5255
5256 impl fidl::encoding::ValueTypeMarker for LayerArgs {
5257 type Borrowed<'a> = &'a Self;
5258 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5259 value
5260 }
5261 }
5262
5263 unsafe impl fidl::encoding::TypeMarker for LayerArgs {
5264 type Owned = Self;
5265
5266 #[inline(always)]
5267 fn inline_align(_context: fidl::encoding::Context) -> usize {
5268 4
5269 }
5270
5271 #[inline(always)]
5272 fn inline_size(_context: fidl::encoding::Context) -> usize {
5273 4
5274 }
5275 #[inline(always)]
5276 fn encode_is_copy() -> bool {
5277 true
5278 }
5279
5280 #[inline(always)]
5281 fn decode_is_copy() -> bool {
5282 true
5283 }
5284 }
5285
5286 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerArgs, D>
5287 for &LayerArgs
5288 {
5289 #[inline]
5290 unsafe fn encode(
5291 self,
5292 encoder: &mut fidl::encoding::Encoder<'_, D>,
5293 offset: usize,
5294 _depth: fidl::encoding::Depth,
5295 ) -> fidl::Result<()> {
5296 encoder.debug_check_bounds::<LayerArgs>(offset);
5297 unsafe {
5298 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5300 (buf_ptr as *mut LayerArgs).write_unaligned((self as *const LayerArgs).read());
5301 }
5304 Ok(())
5305 }
5306 }
5307 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5308 fidl::encoding::Encode<LayerArgs, D> for (T0,)
5309 {
5310 #[inline]
5311 unsafe fn encode(
5312 self,
5313 encoder: &mut fidl::encoding::Encoder<'_, D>,
5314 offset: usize,
5315 depth: fidl::encoding::Depth,
5316 ) -> fidl::Result<()> {
5317 encoder.debug_check_bounds::<LayerArgs>(offset);
5318 self.0.encode(encoder, offset + 0, depth)?;
5322 Ok(())
5323 }
5324 }
5325
5326 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerArgs {
5327 #[inline(always)]
5328 fn new_empty() -> Self {
5329 Self { dummy: fidl::new_empty!(u32, D) }
5330 }
5331
5332 #[inline]
5333 unsafe fn decode(
5334 &mut self,
5335 decoder: &mut fidl::encoding::Decoder<'_, D>,
5336 offset: usize,
5337 _depth: fidl::encoding::Depth,
5338 ) -> fidl::Result<()> {
5339 decoder.debug_check_bounds::<Self>(offset);
5340 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5341 unsafe {
5344 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5345 }
5346 Ok(())
5347 }
5348 }
5349
5350 impl fidl::encoding::ValueTypeMarker for LayerStackArgs {
5351 type Borrowed<'a> = &'a Self;
5352 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5353 value
5354 }
5355 }
5356
5357 unsafe impl fidl::encoding::TypeMarker for LayerStackArgs {
5358 type Owned = Self;
5359
5360 #[inline(always)]
5361 fn inline_align(_context: fidl::encoding::Context) -> usize {
5362 4
5363 }
5364
5365 #[inline(always)]
5366 fn inline_size(_context: fidl::encoding::Context) -> usize {
5367 4
5368 }
5369 #[inline(always)]
5370 fn encode_is_copy() -> bool {
5371 true
5372 }
5373
5374 #[inline(always)]
5375 fn decode_is_copy() -> bool {
5376 true
5377 }
5378 }
5379
5380 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerStackArgs, D>
5381 for &LayerStackArgs
5382 {
5383 #[inline]
5384 unsafe fn encode(
5385 self,
5386 encoder: &mut fidl::encoding::Encoder<'_, D>,
5387 offset: usize,
5388 _depth: fidl::encoding::Depth,
5389 ) -> fidl::Result<()> {
5390 encoder.debug_check_bounds::<LayerStackArgs>(offset);
5391 unsafe {
5392 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5394 (buf_ptr as *mut LayerStackArgs)
5395 .write_unaligned((self as *const LayerStackArgs).read());
5396 }
5399 Ok(())
5400 }
5401 }
5402 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5403 fidl::encoding::Encode<LayerStackArgs, D> for (T0,)
5404 {
5405 #[inline]
5406 unsafe fn encode(
5407 self,
5408 encoder: &mut fidl::encoding::Encoder<'_, D>,
5409 offset: usize,
5410 depth: fidl::encoding::Depth,
5411 ) -> fidl::Result<()> {
5412 encoder.debug_check_bounds::<LayerStackArgs>(offset);
5413 self.0.encode(encoder, offset + 0, depth)?;
5417 Ok(())
5418 }
5419 }
5420
5421 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerStackArgs {
5422 #[inline(always)]
5423 fn new_empty() -> Self {
5424 Self { dummy: fidl::new_empty!(u32, D) }
5425 }
5426
5427 #[inline]
5428 unsafe fn decode(
5429 &mut self,
5430 decoder: &mut fidl::encoding::Decoder<'_, D>,
5431 offset: usize,
5432 _depth: fidl::encoding::Depth,
5433 ) -> fidl::Result<()> {
5434 decoder.debug_check_bounds::<Self>(offset);
5435 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5436 unsafe {
5439 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5440 }
5441 Ok(())
5442 }
5443 }
5444
5445 impl fidl::encoding::ValueTypeMarker for MaterialArgs {
5446 type Borrowed<'a> = &'a Self;
5447 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5448 value
5449 }
5450 }
5451
5452 unsafe impl fidl::encoding::TypeMarker for MaterialArgs {
5453 type Owned = Self;
5454
5455 #[inline(always)]
5456 fn inline_align(_context: fidl::encoding::Context) -> usize {
5457 4
5458 }
5459
5460 #[inline(always)]
5461 fn inline_size(_context: fidl::encoding::Context) -> usize {
5462 4
5463 }
5464 #[inline(always)]
5465 fn encode_is_copy() -> bool {
5466 true
5467 }
5468
5469 #[inline(always)]
5470 fn decode_is_copy() -> bool {
5471 true
5472 }
5473 }
5474
5475 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MaterialArgs, D>
5476 for &MaterialArgs
5477 {
5478 #[inline]
5479 unsafe fn encode(
5480 self,
5481 encoder: &mut fidl::encoding::Encoder<'_, D>,
5482 offset: usize,
5483 _depth: fidl::encoding::Depth,
5484 ) -> fidl::Result<()> {
5485 encoder.debug_check_bounds::<MaterialArgs>(offset);
5486 unsafe {
5487 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5489 (buf_ptr as *mut MaterialArgs)
5490 .write_unaligned((self as *const MaterialArgs).read());
5491 }
5494 Ok(())
5495 }
5496 }
5497 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5498 fidl::encoding::Encode<MaterialArgs, D> for (T0,)
5499 {
5500 #[inline]
5501 unsafe fn encode(
5502 self,
5503 encoder: &mut fidl::encoding::Encoder<'_, D>,
5504 offset: usize,
5505 depth: fidl::encoding::Depth,
5506 ) -> fidl::Result<()> {
5507 encoder.debug_check_bounds::<MaterialArgs>(offset);
5508 self.0.encode(encoder, offset + 0, depth)?;
5512 Ok(())
5513 }
5514 }
5515
5516 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MaterialArgs {
5517 #[inline(always)]
5518 fn new_empty() -> Self {
5519 Self { dummy: fidl::new_empty!(u32, D) }
5520 }
5521
5522 #[inline]
5523 unsafe fn decode(
5524 &mut self,
5525 decoder: &mut fidl::encoding::Decoder<'_, D>,
5526 offset: usize,
5527 _depth: fidl::encoding::Depth,
5528 ) -> fidl::Result<()> {
5529 decoder.debug_check_bounds::<Self>(offset);
5530 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5531 unsafe {
5534 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5535 }
5536 Ok(())
5537 }
5538 }
5539
5540 impl fidl::encoding::ValueTypeMarker for Matrix4Value {
5541 type Borrowed<'a> = &'a Self;
5542 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5543 value
5544 }
5545 }
5546
5547 unsafe impl fidl::encoding::TypeMarker for Matrix4Value {
5548 type Owned = Self;
5549
5550 #[inline(always)]
5551 fn inline_align(_context: fidl::encoding::Context) -> usize {
5552 4
5553 }
5554
5555 #[inline(always)]
5556 fn inline_size(_context: fidl::encoding::Context) -> usize {
5557 68
5558 }
5559 }
5560
5561 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Matrix4Value, D>
5562 for &Matrix4Value
5563 {
5564 #[inline]
5565 unsafe fn encode(
5566 self,
5567 encoder: &mut fidl::encoding::Encoder<'_, D>,
5568 offset: usize,
5569 _depth: fidl::encoding::Depth,
5570 ) -> fidl::Result<()> {
5571 encoder.debug_check_bounds::<Matrix4Value>(offset);
5572 fidl::encoding::Encode::<Matrix4Value, D>::encode(
5574 (
5575 <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5576 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
5577 ),
5578 encoder,
5579 offset,
5580 _depth,
5581 )
5582 }
5583 }
5584 unsafe impl<
5585 D: fidl::encoding::ResourceDialect,
5586 T0: fidl::encoding::Encode<Mat4, D>,
5587 T1: fidl::encoding::Encode<u32, D>,
5588 > fidl::encoding::Encode<Matrix4Value, D> for (T0, T1)
5589 {
5590 #[inline]
5591 unsafe fn encode(
5592 self,
5593 encoder: &mut fidl::encoding::Encoder<'_, D>,
5594 offset: usize,
5595 depth: fidl::encoding::Depth,
5596 ) -> fidl::Result<()> {
5597 encoder.debug_check_bounds::<Matrix4Value>(offset);
5598 self.0.encode(encoder, offset + 0, depth)?;
5602 self.1.encode(encoder, offset + 64, depth)?;
5603 Ok(())
5604 }
5605 }
5606
5607 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Matrix4Value {
5608 #[inline(always)]
5609 fn new_empty() -> Self {
5610 Self { value: fidl::new_empty!(Mat4, D), variable_id: fidl::new_empty!(u32, D) }
5611 }
5612
5613 #[inline]
5614 unsafe fn decode(
5615 &mut self,
5616 decoder: &mut fidl::encoding::Decoder<'_, D>,
5617 offset: usize,
5618 _depth: fidl::encoding::Depth,
5619 ) -> fidl::Result<()> {
5620 decoder.debug_check_bounds::<Self>(offset);
5621 fidl::decode!(Mat4, D, &mut self.value, decoder, offset + 0, _depth)?;
5623 fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 64, _depth)?;
5624 Ok(())
5625 }
5626 }
5627
5628 impl fidl::encoding::ValueTypeMarker for MeshArgs {
5629 type Borrowed<'a> = &'a Self;
5630 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5631 value
5632 }
5633 }
5634
5635 unsafe impl fidl::encoding::TypeMarker for MeshArgs {
5636 type Owned = Self;
5637
5638 #[inline(always)]
5639 fn inline_align(_context: fidl::encoding::Context) -> usize {
5640 1
5641 }
5642
5643 #[inline(always)]
5644 fn inline_size(_context: fidl::encoding::Context) -> usize {
5645 1
5646 }
5647 }
5648
5649 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshArgs, D> for &MeshArgs {
5650 #[inline]
5651 unsafe fn encode(
5652 self,
5653 encoder: &mut fidl::encoding::Encoder<'_, D>,
5654 offset: usize,
5655 _depth: fidl::encoding::Depth,
5656 ) -> fidl::Result<()> {
5657 encoder.debug_check_bounds::<MeshArgs>(offset);
5658 encoder.write_num(0u8, offset);
5659 Ok(())
5660 }
5661 }
5662
5663 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshArgs {
5664 #[inline(always)]
5665 fn new_empty() -> Self {
5666 Self
5667 }
5668
5669 #[inline]
5670 unsafe fn decode(
5671 &mut self,
5672 decoder: &mut fidl::encoding::Decoder<'_, D>,
5673 offset: usize,
5674 _depth: fidl::encoding::Depth,
5675 ) -> fidl::Result<()> {
5676 decoder.debug_check_bounds::<Self>(offset);
5677 match decoder.read_num::<u8>(offset) {
5678 0 => Ok(()),
5679 _ => Err(fidl::Error::Invalid),
5680 }
5681 }
5682 }
5683
5684 impl fidl::encoding::ValueTypeMarker for MeshVertexFormat {
5685 type Borrowed<'a> = &'a Self;
5686 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5687 value
5688 }
5689 }
5690
5691 unsafe impl fidl::encoding::TypeMarker for MeshVertexFormat {
5692 type Owned = Self;
5693
5694 #[inline(always)]
5695 fn inline_align(_context: fidl::encoding::Context) -> usize {
5696 4
5697 }
5698
5699 #[inline(always)]
5700 fn inline_size(_context: fidl::encoding::Context) -> usize {
5701 12
5702 }
5703 }
5704
5705 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshVertexFormat, D>
5706 for &MeshVertexFormat
5707 {
5708 #[inline]
5709 unsafe fn encode(
5710 self,
5711 encoder: &mut fidl::encoding::Encoder<'_, D>,
5712 offset: usize,
5713 _depth: fidl::encoding::Depth,
5714 ) -> fidl::Result<()> {
5715 encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5716 fidl::encoding::Encode::<MeshVertexFormat, D>::encode(
5718 (
5719 <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.position_type),
5720 <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.normal_type),
5721 <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.tex_coord_type),
5722 ),
5723 encoder,
5724 offset,
5725 _depth,
5726 )
5727 }
5728 }
5729 unsafe impl<
5730 D: fidl::encoding::ResourceDialect,
5731 T0: fidl::encoding::Encode<ValueType, D>,
5732 T1: fidl::encoding::Encode<ValueType, D>,
5733 T2: fidl::encoding::Encode<ValueType, D>,
5734 > fidl::encoding::Encode<MeshVertexFormat, D> for (T0, T1, T2)
5735 {
5736 #[inline]
5737 unsafe fn encode(
5738 self,
5739 encoder: &mut fidl::encoding::Encoder<'_, D>,
5740 offset: usize,
5741 depth: fidl::encoding::Depth,
5742 ) -> fidl::Result<()> {
5743 encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5744 self.0.encode(encoder, offset + 0, depth)?;
5748 self.1.encode(encoder, offset + 4, depth)?;
5749 self.2.encode(encoder, offset + 8, depth)?;
5750 Ok(())
5751 }
5752 }
5753
5754 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshVertexFormat {
5755 #[inline(always)]
5756 fn new_empty() -> Self {
5757 Self {
5758 position_type: fidl::new_empty!(ValueType, D),
5759 normal_type: fidl::new_empty!(ValueType, D),
5760 tex_coord_type: fidl::new_empty!(ValueType, D),
5761 }
5762 }
5763
5764 #[inline]
5765 unsafe fn decode(
5766 &mut self,
5767 decoder: &mut fidl::encoding::Decoder<'_, D>,
5768 offset: usize,
5769 _depth: fidl::encoding::Depth,
5770 ) -> fidl::Result<()> {
5771 decoder.debug_check_bounds::<Self>(offset);
5772 fidl::decode!(ValueType, D, &mut self.position_type, decoder, offset + 0, _depth)?;
5774 fidl::decode!(ValueType, D, &mut self.normal_type, decoder, offset + 4, _depth)?;
5775 fidl::decode!(ValueType, D, &mut self.tex_coord_type, decoder, offset + 8, _depth)?;
5776 Ok(())
5777 }
5778 }
5779
5780 impl fidl::encoding::ValueTypeMarker for Metrics {
5781 type Borrowed<'a> = &'a Self;
5782 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5783 value
5784 }
5785 }
5786
5787 unsafe impl fidl::encoding::TypeMarker for Metrics {
5788 type Owned = Self;
5789
5790 #[inline(always)]
5791 fn inline_align(_context: fidl::encoding::Context) -> usize {
5792 4
5793 }
5794
5795 #[inline(always)]
5796 fn inline_size(_context: fidl::encoding::Context) -> usize {
5797 12
5798 }
5799 }
5800
5801 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metrics, D> for &Metrics {
5802 #[inline]
5803 unsafe fn encode(
5804 self,
5805 encoder: &mut fidl::encoding::Encoder<'_, D>,
5806 offset: usize,
5807 _depth: fidl::encoding::Depth,
5808 ) -> fidl::Result<()> {
5809 encoder.debug_check_bounds::<Metrics>(offset);
5810 fidl::encoding::Encode::<Metrics, D>::encode(
5812 (
5813 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_x),
5814 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_y),
5815 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_z),
5816 ),
5817 encoder,
5818 offset,
5819 _depth,
5820 )
5821 }
5822 }
5823 unsafe impl<
5824 D: fidl::encoding::ResourceDialect,
5825 T0: fidl::encoding::Encode<f32, D>,
5826 T1: fidl::encoding::Encode<f32, D>,
5827 T2: fidl::encoding::Encode<f32, D>,
5828 > fidl::encoding::Encode<Metrics, D> for (T0, T1, T2)
5829 {
5830 #[inline]
5831 unsafe fn encode(
5832 self,
5833 encoder: &mut fidl::encoding::Encoder<'_, D>,
5834 offset: usize,
5835 depth: fidl::encoding::Depth,
5836 ) -> fidl::Result<()> {
5837 encoder.debug_check_bounds::<Metrics>(offset);
5838 self.0.encode(encoder, offset + 0, depth)?;
5842 self.1.encode(encoder, offset + 4, depth)?;
5843 self.2.encode(encoder, offset + 8, depth)?;
5844 Ok(())
5845 }
5846 }
5847
5848 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metrics {
5849 #[inline(always)]
5850 fn new_empty() -> Self {
5851 Self {
5852 scale_x: fidl::new_empty!(f32, D),
5853 scale_y: fidl::new_empty!(f32, D),
5854 scale_z: fidl::new_empty!(f32, D),
5855 }
5856 }
5857
5858 #[inline]
5859 unsafe fn decode(
5860 &mut self,
5861 decoder: &mut fidl::encoding::Decoder<'_, D>,
5862 offset: usize,
5863 _depth: fidl::encoding::Depth,
5864 ) -> fidl::Result<()> {
5865 decoder.debug_check_bounds::<Self>(offset);
5866 fidl::decode!(f32, D, &mut self.scale_x, decoder, offset + 0, _depth)?;
5868 fidl::decode!(f32, D, &mut self.scale_y, decoder, offset + 4, _depth)?;
5869 fidl::decode!(f32, D, &mut self.scale_z, decoder, offset + 8, _depth)?;
5870 Ok(())
5871 }
5872 }
5873
5874 impl fidl::encoding::ValueTypeMarker for MetricsEvent {
5875 type Borrowed<'a> = &'a Self;
5876 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5877 value
5878 }
5879 }
5880
5881 unsafe impl fidl::encoding::TypeMarker for MetricsEvent {
5882 type Owned = Self;
5883
5884 #[inline(always)]
5885 fn inline_align(_context: fidl::encoding::Context) -> usize {
5886 4
5887 }
5888
5889 #[inline(always)]
5890 fn inline_size(_context: fidl::encoding::Context) -> usize {
5891 16
5892 }
5893 }
5894
5895 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MetricsEvent, D>
5896 for &MetricsEvent
5897 {
5898 #[inline]
5899 unsafe fn encode(
5900 self,
5901 encoder: &mut fidl::encoding::Encoder<'_, D>,
5902 offset: usize,
5903 _depth: fidl::encoding::Depth,
5904 ) -> fidl::Result<()> {
5905 encoder.debug_check_bounds::<MetricsEvent>(offset);
5906 fidl::encoding::Encode::<MetricsEvent, D>::encode(
5908 (
5909 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
5910 <Metrics as fidl::encoding::ValueTypeMarker>::borrow(&self.metrics),
5911 ),
5912 encoder,
5913 offset,
5914 _depth,
5915 )
5916 }
5917 }
5918 unsafe impl<
5919 D: fidl::encoding::ResourceDialect,
5920 T0: fidl::encoding::Encode<u32, D>,
5921 T1: fidl::encoding::Encode<Metrics, D>,
5922 > fidl::encoding::Encode<MetricsEvent, D> for (T0, T1)
5923 {
5924 #[inline]
5925 unsafe fn encode(
5926 self,
5927 encoder: &mut fidl::encoding::Encoder<'_, D>,
5928 offset: usize,
5929 depth: fidl::encoding::Depth,
5930 ) -> fidl::Result<()> {
5931 encoder.debug_check_bounds::<MetricsEvent>(offset);
5932 self.0.encode(encoder, offset + 0, depth)?;
5936 self.1.encode(encoder, offset + 4, depth)?;
5937 Ok(())
5938 }
5939 }
5940
5941 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MetricsEvent {
5942 #[inline(always)]
5943 fn new_empty() -> Self {
5944 Self { node_id: fidl::new_empty!(u32, D), metrics: fidl::new_empty!(Metrics, D) }
5945 }
5946
5947 #[inline]
5948 unsafe fn decode(
5949 &mut self,
5950 decoder: &mut fidl::encoding::Decoder<'_, D>,
5951 offset: usize,
5952 _depth: fidl::encoding::Depth,
5953 ) -> fidl::Result<()> {
5954 decoder.debug_check_bounds::<Self>(offset);
5955 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
5957 fidl::decode!(Metrics, D, &mut self.metrics, decoder, offset + 4, _depth)?;
5958 Ok(())
5959 }
5960 }
5961
5962 impl fidl::encoding::ValueTypeMarker for OpacityNodeArgsHack {
5963 type Borrowed<'a> = &'a Self;
5964 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5965 value
5966 }
5967 }
5968
5969 unsafe impl fidl::encoding::TypeMarker for OpacityNodeArgsHack {
5970 type Owned = Self;
5971
5972 #[inline(always)]
5973 fn inline_align(_context: fidl::encoding::Context) -> usize {
5974 4
5975 }
5976
5977 #[inline(always)]
5978 fn inline_size(_context: fidl::encoding::Context) -> usize {
5979 4
5980 }
5981 #[inline(always)]
5982 fn encode_is_copy() -> bool {
5983 true
5984 }
5985
5986 #[inline(always)]
5987 fn decode_is_copy() -> bool {
5988 true
5989 }
5990 }
5991
5992 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OpacityNodeArgsHack, D>
5993 for &OpacityNodeArgsHack
5994 {
5995 #[inline]
5996 unsafe fn encode(
5997 self,
5998 encoder: &mut fidl::encoding::Encoder<'_, D>,
5999 offset: usize,
6000 _depth: fidl::encoding::Depth,
6001 ) -> fidl::Result<()> {
6002 encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
6003 unsafe {
6004 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6006 (buf_ptr as *mut OpacityNodeArgsHack)
6007 .write_unaligned((self as *const OpacityNodeArgsHack).read());
6008 }
6011 Ok(())
6012 }
6013 }
6014 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6015 fidl::encoding::Encode<OpacityNodeArgsHack, D> for (T0,)
6016 {
6017 #[inline]
6018 unsafe fn encode(
6019 self,
6020 encoder: &mut fidl::encoding::Encoder<'_, D>,
6021 offset: usize,
6022 depth: fidl::encoding::Depth,
6023 ) -> fidl::Result<()> {
6024 encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
6025 self.0.encode(encoder, offset + 0, depth)?;
6029 Ok(())
6030 }
6031 }
6032
6033 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpacityNodeArgsHack {
6034 #[inline(always)]
6035 fn new_empty() -> Self {
6036 Self { unused: fidl::new_empty!(u32, D) }
6037 }
6038
6039 #[inline]
6040 unsafe fn decode(
6041 &mut self,
6042 decoder: &mut fidl::encoding::Decoder<'_, D>,
6043 offset: usize,
6044 _depth: fidl::encoding::Depth,
6045 ) -> fidl::Result<()> {
6046 decoder.debug_check_bounds::<Self>(offset);
6047 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6048 unsafe {
6051 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6052 }
6053 Ok(())
6054 }
6055 }
6056
6057 impl fidl::encoding::ValueTypeMarker for Plane3 {
6058 type Borrowed<'a> = &'a Self;
6059 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6060 value
6061 }
6062 }
6063
6064 unsafe impl fidl::encoding::TypeMarker for Plane3 {
6065 type Owned = Self;
6066
6067 #[inline(always)]
6068 fn inline_align(_context: fidl::encoding::Context) -> usize {
6069 4
6070 }
6071
6072 #[inline(always)]
6073 fn inline_size(_context: fidl::encoding::Context) -> usize {
6074 16
6075 }
6076 }
6077
6078 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Plane3, D> for &Plane3 {
6079 #[inline]
6080 unsafe fn encode(
6081 self,
6082 encoder: &mut fidl::encoding::Encoder<'_, D>,
6083 offset: usize,
6084 _depth: fidl::encoding::Depth,
6085 ) -> fidl::Result<()> {
6086 encoder.debug_check_bounds::<Plane3>(offset);
6087 fidl::encoding::Encode::<Plane3, D>::encode(
6089 (
6090 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.dir),
6091 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dist),
6092 ),
6093 encoder,
6094 offset,
6095 _depth,
6096 )
6097 }
6098 }
6099 unsafe impl<
6100 D: fidl::encoding::ResourceDialect,
6101 T0: fidl::encoding::Encode<Vec3, D>,
6102 T1: fidl::encoding::Encode<f32, D>,
6103 > fidl::encoding::Encode<Plane3, D> for (T0, T1)
6104 {
6105 #[inline]
6106 unsafe fn encode(
6107 self,
6108 encoder: &mut fidl::encoding::Encoder<'_, D>,
6109 offset: usize,
6110 depth: fidl::encoding::Depth,
6111 ) -> fidl::Result<()> {
6112 encoder.debug_check_bounds::<Plane3>(offset);
6113 self.0.encode(encoder, offset + 0, depth)?;
6117 self.1.encode(encoder, offset + 12, depth)?;
6118 Ok(())
6119 }
6120 }
6121
6122 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Plane3 {
6123 #[inline(always)]
6124 fn new_empty() -> Self {
6125 Self { dir: fidl::new_empty!(Vec3, D), dist: fidl::new_empty!(f32, D) }
6126 }
6127
6128 #[inline]
6129 unsafe fn decode(
6130 &mut self,
6131 decoder: &mut fidl::encoding::Decoder<'_, D>,
6132 offset: usize,
6133 _depth: fidl::encoding::Depth,
6134 ) -> fidl::Result<()> {
6135 decoder.debug_check_bounds::<Self>(offset);
6136 fidl::decode!(Vec3, D, &mut self.dir, decoder, offset + 0, _depth)?;
6138 fidl::decode!(f32, D, &mut self.dist, decoder, offset + 12, _depth)?;
6139 Ok(())
6140 }
6141 }
6142
6143 impl fidl::encoding::ValueTypeMarker for PointLightArgs {
6144 type Borrowed<'a> = &'a Self;
6145 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6146 value
6147 }
6148 }
6149
6150 unsafe impl fidl::encoding::TypeMarker for PointLightArgs {
6151 type Owned = Self;
6152
6153 #[inline(always)]
6154 fn inline_align(_context: fidl::encoding::Context) -> usize {
6155 4
6156 }
6157
6158 #[inline(always)]
6159 fn inline_size(_context: fidl::encoding::Context) -> usize {
6160 4
6161 }
6162 #[inline(always)]
6163 fn encode_is_copy() -> bool {
6164 true
6165 }
6166
6167 #[inline(always)]
6168 fn decode_is_copy() -> bool {
6169 true
6170 }
6171 }
6172
6173 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PointLightArgs, D>
6174 for &PointLightArgs
6175 {
6176 #[inline]
6177 unsafe fn encode(
6178 self,
6179 encoder: &mut fidl::encoding::Encoder<'_, D>,
6180 offset: usize,
6181 _depth: fidl::encoding::Depth,
6182 ) -> fidl::Result<()> {
6183 encoder.debug_check_bounds::<PointLightArgs>(offset);
6184 unsafe {
6185 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6187 (buf_ptr as *mut PointLightArgs)
6188 .write_unaligned((self as *const PointLightArgs).read());
6189 }
6192 Ok(())
6193 }
6194 }
6195 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6196 fidl::encoding::Encode<PointLightArgs, D> for (T0,)
6197 {
6198 #[inline]
6199 unsafe fn encode(
6200 self,
6201 encoder: &mut fidl::encoding::Encoder<'_, D>,
6202 offset: usize,
6203 depth: fidl::encoding::Depth,
6204 ) -> fidl::Result<()> {
6205 encoder.debug_check_bounds::<PointLightArgs>(offset);
6206 self.0.encode(encoder, offset + 0, depth)?;
6210 Ok(())
6211 }
6212 }
6213
6214 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PointLightArgs {
6215 #[inline(always)]
6216 fn new_empty() -> Self {
6217 Self { dummy: fidl::new_empty!(u32, D) }
6218 }
6219
6220 #[inline]
6221 unsafe fn decode(
6222 &mut self,
6223 decoder: &mut fidl::encoding::Decoder<'_, D>,
6224 offset: usize,
6225 _depth: fidl::encoding::Depth,
6226 ) -> fidl::Result<()> {
6227 decoder.debug_check_bounds::<Self>(offset);
6228 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6229 unsafe {
6232 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6233 }
6234 Ok(())
6235 }
6236 }
6237
6238 impl fidl::encoding::ValueTypeMarker for Quaternion {
6239 type Borrowed<'a> = &'a Self;
6240 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6241 value
6242 }
6243 }
6244
6245 unsafe impl fidl::encoding::TypeMarker for Quaternion {
6246 type Owned = Self;
6247
6248 #[inline(always)]
6249 fn inline_align(_context: fidl::encoding::Context) -> usize {
6250 4
6251 }
6252
6253 #[inline(always)]
6254 fn inline_size(_context: fidl::encoding::Context) -> usize {
6255 16
6256 }
6257 }
6258
6259 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Quaternion, D>
6260 for &Quaternion
6261 {
6262 #[inline]
6263 unsafe fn encode(
6264 self,
6265 encoder: &mut fidl::encoding::Encoder<'_, D>,
6266 offset: usize,
6267 _depth: fidl::encoding::Depth,
6268 ) -> fidl::Result<()> {
6269 encoder.debug_check_bounds::<Quaternion>(offset);
6270 fidl::encoding::Encode::<Quaternion, D>::encode(
6272 (
6273 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
6274 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
6275 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
6276 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
6277 ),
6278 encoder,
6279 offset,
6280 _depth,
6281 )
6282 }
6283 }
6284 unsafe impl<
6285 D: fidl::encoding::ResourceDialect,
6286 T0: fidl::encoding::Encode<f32, D>,
6287 T1: fidl::encoding::Encode<f32, D>,
6288 T2: fidl::encoding::Encode<f32, D>,
6289 T3: fidl::encoding::Encode<f32, D>,
6290 > fidl::encoding::Encode<Quaternion, D> for (T0, T1, T2, T3)
6291 {
6292 #[inline]
6293 unsafe fn encode(
6294 self,
6295 encoder: &mut fidl::encoding::Encoder<'_, D>,
6296 offset: usize,
6297 depth: fidl::encoding::Depth,
6298 ) -> fidl::Result<()> {
6299 encoder.debug_check_bounds::<Quaternion>(offset);
6300 self.0.encode(encoder, offset + 0, depth)?;
6304 self.1.encode(encoder, offset + 4, depth)?;
6305 self.2.encode(encoder, offset + 8, depth)?;
6306 self.3.encode(encoder, offset + 12, depth)?;
6307 Ok(())
6308 }
6309 }
6310
6311 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Quaternion {
6312 #[inline(always)]
6313 fn new_empty() -> Self {
6314 Self {
6315 x: fidl::new_empty!(f32, D),
6316 y: fidl::new_empty!(f32, D),
6317 z: fidl::new_empty!(f32, D),
6318 w: fidl::new_empty!(f32, D),
6319 }
6320 }
6321
6322 #[inline]
6323 unsafe fn decode(
6324 &mut self,
6325 decoder: &mut fidl::encoding::Decoder<'_, D>,
6326 offset: usize,
6327 _depth: fidl::encoding::Depth,
6328 ) -> fidl::Result<()> {
6329 decoder.debug_check_bounds::<Self>(offset);
6330 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
6332 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
6333 fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
6334 fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
6335 Ok(())
6336 }
6337 }
6338
6339 impl fidl::encoding::ValueTypeMarker for QuaternionValue {
6340 type Borrowed<'a> = &'a Self;
6341 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6342 value
6343 }
6344 }
6345
6346 unsafe impl fidl::encoding::TypeMarker for QuaternionValue {
6347 type Owned = Self;
6348
6349 #[inline(always)]
6350 fn inline_align(_context: fidl::encoding::Context) -> usize {
6351 4
6352 }
6353
6354 #[inline(always)]
6355 fn inline_size(_context: fidl::encoding::Context) -> usize {
6356 20
6357 }
6358 }
6359
6360 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QuaternionValue, D>
6361 for &QuaternionValue
6362 {
6363 #[inline]
6364 unsafe fn encode(
6365 self,
6366 encoder: &mut fidl::encoding::Encoder<'_, D>,
6367 offset: usize,
6368 _depth: fidl::encoding::Depth,
6369 ) -> fidl::Result<()> {
6370 encoder.debug_check_bounds::<QuaternionValue>(offset);
6371 fidl::encoding::Encode::<QuaternionValue, D>::encode(
6373 (
6374 <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6375 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
6376 ),
6377 encoder,
6378 offset,
6379 _depth,
6380 )
6381 }
6382 }
6383 unsafe impl<
6384 D: fidl::encoding::ResourceDialect,
6385 T0: fidl::encoding::Encode<Quaternion, D>,
6386 T1: fidl::encoding::Encode<u32, D>,
6387 > fidl::encoding::Encode<QuaternionValue, D> for (T0, T1)
6388 {
6389 #[inline]
6390 unsafe fn encode(
6391 self,
6392 encoder: &mut fidl::encoding::Encoder<'_, D>,
6393 offset: usize,
6394 depth: fidl::encoding::Depth,
6395 ) -> fidl::Result<()> {
6396 encoder.debug_check_bounds::<QuaternionValue>(offset);
6397 self.0.encode(encoder, offset + 0, depth)?;
6401 self.1.encode(encoder, offset + 16, depth)?;
6402 Ok(())
6403 }
6404 }
6405
6406 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QuaternionValue {
6407 #[inline(always)]
6408 fn new_empty() -> Self {
6409 Self { value: fidl::new_empty!(Quaternion, D), variable_id: fidl::new_empty!(u32, D) }
6410 }
6411
6412 #[inline]
6413 unsafe fn decode(
6414 &mut self,
6415 decoder: &mut fidl::encoding::Decoder<'_, D>,
6416 offset: usize,
6417 _depth: fidl::encoding::Depth,
6418 ) -> fidl::Result<()> {
6419 decoder.debug_check_bounds::<Self>(offset);
6420 fidl::decode!(Quaternion, D, &mut self.value, decoder, offset + 0, _depth)?;
6422 fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
6423 Ok(())
6424 }
6425 }
6426
6427 impl fidl::encoding::ValueTypeMarker for RectangleArgs {
6428 type Borrowed<'a> = &'a Self;
6429 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6430 value
6431 }
6432 }
6433
6434 unsafe impl fidl::encoding::TypeMarker for RectangleArgs {
6435 type Owned = Self;
6436
6437 #[inline(always)]
6438 fn inline_align(_context: fidl::encoding::Context) -> usize {
6439 8
6440 }
6441
6442 #[inline(always)]
6443 fn inline_size(_context: fidl::encoding::Context) -> usize {
6444 32
6445 }
6446 }
6447
6448 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RectangleArgs, D>
6449 for &RectangleArgs
6450 {
6451 #[inline]
6452 unsafe fn encode(
6453 self,
6454 encoder: &mut fidl::encoding::Encoder<'_, D>,
6455 offset: usize,
6456 _depth: fidl::encoding::Depth,
6457 ) -> fidl::Result<()> {
6458 encoder.debug_check_bounds::<RectangleArgs>(offset);
6459 fidl::encoding::Encode::<RectangleArgs, D>::encode(
6461 (
6462 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6463 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6464 ),
6465 encoder,
6466 offset,
6467 _depth,
6468 )
6469 }
6470 }
6471 unsafe impl<
6472 D: fidl::encoding::ResourceDialect,
6473 T0: fidl::encoding::Encode<Value, D>,
6474 T1: fidl::encoding::Encode<Value, D>,
6475 > fidl::encoding::Encode<RectangleArgs, D> for (T0, T1)
6476 {
6477 #[inline]
6478 unsafe fn encode(
6479 self,
6480 encoder: &mut fidl::encoding::Encoder<'_, D>,
6481 offset: usize,
6482 depth: fidl::encoding::Depth,
6483 ) -> fidl::Result<()> {
6484 encoder.debug_check_bounds::<RectangleArgs>(offset);
6485 self.0.encode(encoder, offset + 0, depth)?;
6489 self.1.encode(encoder, offset + 16, depth)?;
6490 Ok(())
6491 }
6492 }
6493
6494 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RectangleArgs {
6495 #[inline(always)]
6496 fn new_empty() -> Self {
6497 Self { width: fidl::new_empty!(Value, D), height: fidl::new_empty!(Value, D) }
6498 }
6499
6500 #[inline]
6501 unsafe fn decode(
6502 &mut self,
6503 decoder: &mut fidl::encoding::Decoder<'_, D>,
6504 offset: usize,
6505 _depth: fidl::encoding::Depth,
6506 ) -> fidl::Result<()> {
6507 decoder.debug_check_bounds::<Self>(offset);
6508 fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
6510 fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
6511 Ok(())
6512 }
6513 }
6514
6515 impl fidl::encoding::ValueTypeMarker for ReleaseResourceCmd {
6516 type Borrowed<'a> = &'a Self;
6517 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6518 value
6519 }
6520 }
6521
6522 unsafe impl fidl::encoding::TypeMarker for ReleaseResourceCmd {
6523 type Owned = Self;
6524
6525 #[inline(always)]
6526 fn inline_align(_context: fidl::encoding::Context) -> usize {
6527 4
6528 }
6529
6530 #[inline(always)]
6531 fn inline_size(_context: fidl::encoding::Context) -> usize {
6532 4
6533 }
6534 #[inline(always)]
6535 fn encode_is_copy() -> bool {
6536 true
6537 }
6538
6539 #[inline(always)]
6540 fn decode_is_copy() -> bool {
6541 true
6542 }
6543 }
6544
6545 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReleaseResourceCmd, D>
6546 for &ReleaseResourceCmd
6547 {
6548 #[inline]
6549 unsafe fn encode(
6550 self,
6551 encoder: &mut fidl::encoding::Encoder<'_, D>,
6552 offset: usize,
6553 _depth: fidl::encoding::Depth,
6554 ) -> fidl::Result<()> {
6555 encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6556 unsafe {
6557 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6559 (buf_ptr as *mut ReleaseResourceCmd)
6560 .write_unaligned((self as *const ReleaseResourceCmd).read());
6561 }
6564 Ok(())
6565 }
6566 }
6567 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6568 fidl::encoding::Encode<ReleaseResourceCmd, D> for (T0,)
6569 {
6570 #[inline]
6571 unsafe fn encode(
6572 self,
6573 encoder: &mut fidl::encoding::Encoder<'_, D>,
6574 offset: usize,
6575 depth: fidl::encoding::Depth,
6576 ) -> fidl::Result<()> {
6577 encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6578 self.0.encode(encoder, offset + 0, depth)?;
6582 Ok(())
6583 }
6584 }
6585
6586 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReleaseResourceCmd {
6587 #[inline(always)]
6588 fn new_empty() -> Self {
6589 Self { id: fidl::new_empty!(u32, D) }
6590 }
6591
6592 #[inline]
6593 unsafe fn decode(
6594 &mut self,
6595 decoder: &mut fidl::encoding::Decoder<'_, D>,
6596 offset: usize,
6597 _depth: fidl::encoding::Depth,
6598 ) -> fidl::Result<()> {
6599 decoder.debug_check_bounds::<Self>(offset);
6600 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6601 unsafe {
6604 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6605 }
6606 Ok(())
6607 }
6608 }
6609
6610 impl fidl::encoding::ValueTypeMarker for RemoveAllLayersCmd {
6611 type Borrowed<'a> = &'a Self;
6612 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6613 value
6614 }
6615 }
6616
6617 unsafe impl fidl::encoding::TypeMarker for RemoveAllLayersCmd {
6618 type Owned = Self;
6619
6620 #[inline(always)]
6621 fn inline_align(_context: fidl::encoding::Context) -> usize {
6622 4
6623 }
6624
6625 #[inline(always)]
6626 fn inline_size(_context: fidl::encoding::Context) -> usize {
6627 4
6628 }
6629 #[inline(always)]
6630 fn encode_is_copy() -> bool {
6631 true
6632 }
6633
6634 #[inline(always)]
6635 fn decode_is_copy() -> bool {
6636 true
6637 }
6638 }
6639
6640 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveAllLayersCmd, D>
6641 for &RemoveAllLayersCmd
6642 {
6643 #[inline]
6644 unsafe fn encode(
6645 self,
6646 encoder: &mut fidl::encoding::Encoder<'_, D>,
6647 offset: usize,
6648 _depth: fidl::encoding::Depth,
6649 ) -> fidl::Result<()> {
6650 encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6651 unsafe {
6652 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6654 (buf_ptr as *mut RemoveAllLayersCmd)
6655 .write_unaligned((self as *const RemoveAllLayersCmd).read());
6656 }
6659 Ok(())
6660 }
6661 }
6662 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6663 fidl::encoding::Encode<RemoveAllLayersCmd, D> for (T0,)
6664 {
6665 #[inline]
6666 unsafe fn encode(
6667 self,
6668 encoder: &mut fidl::encoding::Encoder<'_, D>,
6669 offset: usize,
6670 depth: fidl::encoding::Depth,
6671 ) -> fidl::Result<()> {
6672 encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6673 self.0.encode(encoder, offset + 0, depth)?;
6677 Ok(())
6678 }
6679 }
6680
6681 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveAllLayersCmd {
6682 #[inline(always)]
6683 fn new_empty() -> Self {
6684 Self { layer_stack_id: fidl::new_empty!(u32, D) }
6685 }
6686
6687 #[inline]
6688 unsafe fn decode(
6689 &mut self,
6690 decoder: &mut fidl::encoding::Decoder<'_, D>,
6691 offset: usize,
6692 _depth: fidl::encoding::Depth,
6693 ) -> fidl::Result<()> {
6694 decoder.debug_check_bounds::<Self>(offset);
6695 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6696 unsafe {
6699 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6700 }
6701 Ok(())
6702 }
6703 }
6704
6705 impl fidl::encoding::ValueTypeMarker for RemoveLayerCmd {
6706 type Borrowed<'a> = &'a Self;
6707 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6708 value
6709 }
6710 }
6711
6712 unsafe impl fidl::encoding::TypeMarker for RemoveLayerCmd {
6713 type Owned = Self;
6714
6715 #[inline(always)]
6716 fn inline_align(_context: fidl::encoding::Context) -> usize {
6717 4
6718 }
6719
6720 #[inline(always)]
6721 fn inline_size(_context: fidl::encoding::Context) -> usize {
6722 8
6723 }
6724 #[inline(always)]
6725 fn encode_is_copy() -> bool {
6726 true
6727 }
6728
6729 #[inline(always)]
6730 fn decode_is_copy() -> bool {
6731 true
6732 }
6733 }
6734
6735 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveLayerCmd, D>
6736 for &RemoveLayerCmd
6737 {
6738 #[inline]
6739 unsafe fn encode(
6740 self,
6741 encoder: &mut fidl::encoding::Encoder<'_, D>,
6742 offset: usize,
6743 _depth: fidl::encoding::Depth,
6744 ) -> fidl::Result<()> {
6745 encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6746 unsafe {
6747 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6749 (buf_ptr as *mut RemoveLayerCmd)
6750 .write_unaligned((self as *const RemoveLayerCmd).read());
6751 }
6754 Ok(())
6755 }
6756 }
6757 unsafe impl<
6758 D: fidl::encoding::ResourceDialect,
6759 T0: fidl::encoding::Encode<u32, D>,
6760 T1: fidl::encoding::Encode<u32, D>,
6761 > fidl::encoding::Encode<RemoveLayerCmd, D> for (T0, T1)
6762 {
6763 #[inline]
6764 unsafe fn encode(
6765 self,
6766 encoder: &mut fidl::encoding::Encoder<'_, D>,
6767 offset: usize,
6768 depth: fidl::encoding::Depth,
6769 ) -> fidl::Result<()> {
6770 encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6771 self.0.encode(encoder, offset + 0, depth)?;
6775 self.1.encode(encoder, offset + 4, depth)?;
6776 Ok(())
6777 }
6778 }
6779
6780 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveLayerCmd {
6781 #[inline(always)]
6782 fn new_empty() -> Self {
6783 Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
6784 }
6785
6786 #[inline]
6787 unsafe fn decode(
6788 &mut self,
6789 decoder: &mut fidl::encoding::Decoder<'_, D>,
6790 offset: usize,
6791 _depth: fidl::encoding::Depth,
6792 ) -> fidl::Result<()> {
6793 decoder.debug_check_bounds::<Self>(offset);
6794 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6795 unsafe {
6798 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6799 }
6800 Ok(())
6801 }
6802 }
6803
6804 impl fidl::encoding::ValueTypeMarker for RendererArgs {
6805 type Borrowed<'a> = &'a Self;
6806 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6807 value
6808 }
6809 }
6810
6811 unsafe impl fidl::encoding::TypeMarker for RendererArgs {
6812 type Owned = Self;
6813
6814 #[inline(always)]
6815 fn inline_align(_context: fidl::encoding::Context) -> usize {
6816 4
6817 }
6818
6819 #[inline(always)]
6820 fn inline_size(_context: fidl::encoding::Context) -> usize {
6821 4
6822 }
6823 #[inline(always)]
6824 fn encode_is_copy() -> bool {
6825 true
6826 }
6827
6828 #[inline(always)]
6829 fn decode_is_copy() -> bool {
6830 true
6831 }
6832 }
6833
6834 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererArgs, D>
6835 for &RendererArgs
6836 {
6837 #[inline]
6838 unsafe fn encode(
6839 self,
6840 encoder: &mut fidl::encoding::Encoder<'_, D>,
6841 offset: usize,
6842 _depth: fidl::encoding::Depth,
6843 ) -> fidl::Result<()> {
6844 encoder.debug_check_bounds::<RendererArgs>(offset);
6845 unsafe {
6846 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6848 (buf_ptr as *mut RendererArgs)
6849 .write_unaligned((self as *const RendererArgs).read());
6850 }
6853 Ok(())
6854 }
6855 }
6856 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6857 fidl::encoding::Encode<RendererArgs, D> for (T0,)
6858 {
6859 #[inline]
6860 unsafe fn encode(
6861 self,
6862 encoder: &mut fidl::encoding::Encoder<'_, D>,
6863 offset: usize,
6864 depth: fidl::encoding::Depth,
6865 ) -> fidl::Result<()> {
6866 encoder.debug_check_bounds::<RendererArgs>(offset);
6867 self.0.encode(encoder, offset + 0, depth)?;
6871 Ok(())
6872 }
6873 }
6874
6875 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererArgs {
6876 #[inline(always)]
6877 fn new_empty() -> Self {
6878 Self { dummy: fidl::new_empty!(u32, D) }
6879 }
6880
6881 #[inline]
6882 unsafe fn decode(
6883 &mut self,
6884 decoder: &mut fidl::encoding::Decoder<'_, D>,
6885 offset: usize,
6886 _depth: fidl::encoding::Depth,
6887 ) -> fidl::Result<()> {
6888 decoder.debug_check_bounds::<Self>(offset);
6889 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6890 unsafe {
6893 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6894 }
6895 Ok(())
6896 }
6897 }
6898
6899 impl fidl::encoding::ValueTypeMarker for RoundedRectangleArgs {
6900 type Borrowed<'a> = &'a Self;
6901 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6902 value
6903 }
6904 }
6905
6906 unsafe impl fidl::encoding::TypeMarker for RoundedRectangleArgs {
6907 type Owned = Self;
6908
6909 #[inline(always)]
6910 fn inline_align(_context: fidl::encoding::Context) -> usize {
6911 8
6912 }
6913
6914 #[inline(always)]
6915 fn inline_size(_context: fidl::encoding::Context) -> usize {
6916 96
6917 }
6918 }
6919
6920 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RoundedRectangleArgs, D>
6921 for &RoundedRectangleArgs
6922 {
6923 #[inline]
6924 unsafe fn encode(
6925 self,
6926 encoder: &mut fidl::encoding::Encoder<'_, D>,
6927 offset: usize,
6928 _depth: fidl::encoding::Depth,
6929 ) -> fidl::Result<()> {
6930 encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6931 fidl::encoding::Encode::<RoundedRectangleArgs, D>::encode(
6933 (
6934 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6935 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6936 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_left_radius),
6937 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_right_radius),
6938 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_right_radius),
6939 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_left_radius),
6940 ),
6941 encoder,
6942 offset,
6943 _depth,
6944 )
6945 }
6946 }
6947 unsafe impl<
6948 D: fidl::encoding::ResourceDialect,
6949 T0: fidl::encoding::Encode<Value, D>,
6950 T1: fidl::encoding::Encode<Value, D>,
6951 T2: fidl::encoding::Encode<Value, D>,
6952 T3: fidl::encoding::Encode<Value, D>,
6953 T4: fidl::encoding::Encode<Value, D>,
6954 T5: fidl::encoding::Encode<Value, D>,
6955 > fidl::encoding::Encode<RoundedRectangleArgs, D> for (T0, T1, T2, T3, T4, T5)
6956 {
6957 #[inline]
6958 unsafe fn encode(
6959 self,
6960 encoder: &mut fidl::encoding::Encoder<'_, D>,
6961 offset: usize,
6962 depth: fidl::encoding::Depth,
6963 ) -> fidl::Result<()> {
6964 encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6965 self.0.encode(encoder, offset + 0, depth)?;
6969 self.1.encode(encoder, offset + 16, depth)?;
6970 self.2.encode(encoder, offset + 32, depth)?;
6971 self.3.encode(encoder, offset + 48, depth)?;
6972 self.4.encode(encoder, offset + 64, depth)?;
6973 self.5.encode(encoder, offset + 80, depth)?;
6974 Ok(())
6975 }
6976 }
6977
6978 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RoundedRectangleArgs {
6979 #[inline(always)]
6980 fn new_empty() -> Self {
6981 Self {
6982 width: fidl::new_empty!(Value, D),
6983 height: fidl::new_empty!(Value, D),
6984 top_left_radius: fidl::new_empty!(Value, D),
6985 top_right_radius: fidl::new_empty!(Value, D),
6986 bottom_right_radius: fidl::new_empty!(Value, D),
6987 bottom_left_radius: fidl::new_empty!(Value, D),
6988 }
6989 }
6990
6991 #[inline]
6992 unsafe fn decode(
6993 &mut self,
6994 decoder: &mut fidl::encoding::Decoder<'_, D>,
6995 offset: usize,
6996 _depth: fidl::encoding::Depth,
6997 ) -> fidl::Result<()> {
6998 decoder.debug_check_bounds::<Self>(offset);
6999 fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
7001 fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
7002 fidl::decode!(Value, D, &mut self.top_left_radius, decoder, offset + 32, _depth)?;
7003 fidl::decode!(Value, D, &mut self.top_right_radius, decoder, offset + 48, _depth)?;
7004 fidl::decode!(Value, D, &mut self.bottom_right_radius, decoder, offset + 64, _depth)?;
7005 fidl::decode!(Value, D, &mut self.bottom_left_radius, decoder, offset + 80, _depth)?;
7006 Ok(())
7007 }
7008 }
7009
7010 impl fidl::encoding::ValueTypeMarker for SceneAddAmbientLightCmd {
7011 type Borrowed<'a> = &'a Self;
7012 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7013 value
7014 }
7015 }
7016
7017 unsafe impl fidl::encoding::TypeMarker for SceneAddAmbientLightCmd {
7018 type Owned = Self;
7019
7020 #[inline(always)]
7021 fn inline_align(_context: fidl::encoding::Context) -> usize {
7022 4
7023 }
7024
7025 #[inline(always)]
7026 fn inline_size(_context: fidl::encoding::Context) -> usize {
7027 8
7028 }
7029 #[inline(always)]
7030 fn encode_is_copy() -> bool {
7031 true
7032 }
7033
7034 #[inline(always)]
7035 fn decode_is_copy() -> bool {
7036 true
7037 }
7038 }
7039
7040 unsafe impl<D: fidl::encoding::ResourceDialect>
7041 fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for &SceneAddAmbientLightCmd
7042 {
7043 #[inline]
7044 unsafe fn encode(
7045 self,
7046 encoder: &mut fidl::encoding::Encoder<'_, D>,
7047 offset: usize,
7048 _depth: fidl::encoding::Depth,
7049 ) -> fidl::Result<()> {
7050 encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
7051 unsafe {
7052 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7054 (buf_ptr as *mut SceneAddAmbientLightCmd)
7055 .write_unaligned((self as *const SceneAddAmbientLightCmd).read());
7056 }
7059 Ok(())
7060 }
7061 }
7062 unsafe impl<
7063 D: fidl::encoding::ResourceDialect,
7064 T0: fidl::encoding::Encode<u32, D>,
7065 T1: fidl::encoding::Encode<u32, D>,
7066 > fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for (T0, T1)
7067 {
7068 #[inline]
7069 unsafe fn encode(
7070 self,
7071 encoder: &mut fidl::encoding::Encoder<'_, D>,
7072 offset: usize,
7073 depth: fidl::encoding::Depth,
7074 ) -> fidl::Result<()> {
7075 encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
7076 self.0.encode(encoder, offset + 0, depth)?;
7080 self.1.encode(encoder, offset + 4, depth)?;
7081 Ok(())
7082 }
7083 }
7084
7085 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7086 for SceneAddAmbientLightCmd
7087 {
7088 #[inline(always)]
7089 fn new_empty() -> Self {
7090 Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7091 }
7092
7093 #[inline]
7094 unsafe fn decode(
7095 &mut self,
7096 decoder: &mut fidl::encoding::Decoder<'_, D>,
7097 offset: usize,
7098 _depth: fidl::encoding::Depth,
7099 ) -> fidl::Result<()> {
7100 decoder.debug_check_bounds::<Self>(offset);
7101 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7102 unsafe {
7105 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7106 }
7107 Ok(())
7108 }
7109 }
7110
7111 impl fidl::encoding::ValueTypeMarker for SceneAddDirectionalLightCmd {
7112 type Borrowed<'a> = &'a Self;
7113 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7114 value
7115 }
7116 }
7117
7118 unsafe impl fidl::encoding::TypeMarker for SceneAddDirectionalLightCmd {
7119 type Owned = Self;
7120
7121 #[inline(always)]
7122 fn inline_align(_context: fidl::encoding::Context) -> usize {
7123 4
7124 }
7125
7126 #[inline(always)]
7127 fn inline_size(_context: fidl::encoding::Context) -> usize {
7128 8
7129 }
7130 #[inline(always)]
7131 fn encode_is_copy() -> bool {
7132 true
7133 }
7134
7135 #[inline(always)]
7136 fn decode_is_copy() -> bool {
7137 true
7138 }
7139 }
7140
7141 unsafe impl<D: fidl::encoding::ResourceDialect>
7142 fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for &SceneAddDirectionalLightCmd
7143 {
7144 #[inline]
7145 unsafe fn encode(
7146 self,
7147 encoder: &mut fidl::encoding::Encoder<'_, D>,
7148 offset: usize,
7149 _depth: fidl::encoding::Depth,
7150 ) -> fidl::Result<()> {
7151 encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7152 unsafe {
7153 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7155 (buf_ptr as *mut SceneAddDirectionalLightCmd)
7156 .write_unaligned((self as *const SceneAddDirectionalLightCmd).read());
7157 }
7160 Ok(())
7161 }
7162 }
7163 unsafe impl<
7164 D: fidl::encoding::ResourceDialect,
7165 T0: fidl::encoding::Encode<u32, D>,
7166 T1: fidl::encoding::Encode<u32, D>,
7167 > fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for (T0, T1)
7168 {
7169 #[inline]
7170 unsafe fn encode(
7171 self,
7172 encoder: &mut fidl::encoding::Encoder<'_, D>,
7173 offset: usize,
7174 depth: fidl::encoding::Depth,
7175 ) -> fidl::Result<()> {
7176 encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7177 self.0.encode(encoder, offset + 0, depth)?;
7181 self.1.encode(encoder, offset + 4, depth)?;
7182 Ok(())
7183 }
7184 }
7185
7186 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7187 for SceneAddDirectionalLightCmd
7188 {
7189 #[inline(always)]
7190 fn new_empty() -> Self {
7191 Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7192 }
7193
7194 #[inline]
7195 unsafe fn decode(
7196 &mut self,
7197 decoder: &mut fidl::encoding::Decoder<'_, D>,
7198 offset: usize,
7199 _depth: fidl::encoding::Depth,
7200 ) -> fidl::Result<()> {
7201 decoder.debug_check_bounds::<Self>(offset);
7202 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7203 unsafe {
7206 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7207 }
7208 Ok(())
7209 }
7210 }
7211
7212 impl fidl::encoding::ValueTypeMarker for SceneAddPointLightCmd {
7213 type Borrowed<'a> = &'a Self;
7214 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7215 value
7216 }
7217 }
7218
7219 unsafe impl fidl::encoding::TypeMarker for SceneAddPointLightCmd {
7220 type Owned = Self;
7221
7222 #[inline(always)]
7223 fn inline_align(_context: fidl::encoding::Context) -> usize {
7224 4
7225 }
7226
7227 #[inline(always)]
7228 fn inline_size(_context: fidl::encoding::Context) -> usize {
7229 8
7230 }
7231 #[inline(always)]
7232 fn encode_is_copy() -> bool {
7233 true
7234 }
7235
7236 #[inline(always)]
7237 fn decode_is_copy() -> bool {
7238 true
7239 }
7240 }
7241
7242 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneAddPointLightCmd, D>
7243 for &SceneAddPointLightCmd
7244 {
7245 #[inline]
7246 unsafe fn encode(
7247 self,
7248 encoder: &mut fidl::encoding::Encoder<'_, D>,
7249 offset: usize,
7250 _depth: fidl::encoding::Depth,
7251 ) -> fidl::Result<()> {
7252 encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7253 unsafe {
7254 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7256 (buf_ptr as *mut SceneAddPointLightCmd)
7257 .write_unaligned((self as *const SceneAddPointLightCmd).read());
7258 }
7261 Ok(())
7262 }
7263 }
7264 unsafe impl<
7265 D: fidl::encoding::ResourceDialect,
7266 T0: fidl::encoding::Encode<u32, D>,
7267 T1: fidl::encoding::Encode<u32, D>,
7268 > fidl::encoding::Encode<SceneAddPointLightCmd, D> for (T0, T1)
7269 {
7270 #[inline]
7271 unsafe fn encode(
7272 self,
7273 encoder: &mut fidl::encoding::Encoder<'_, D>,
7274 offset: usize,
7275 depth: fidl::encoding::Depth,
7276 ) -> fidl::Result<()> {
7277 encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7278 self.0.encode(encoder, offset + 0, depth)?;
7282 self.1.encode(encoder, offset + 4, depth)?;
7283 Ok(())
7284 }
7285 }
7286
7287 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneAddPointLightCmd {
7288 #[inline(always)]
7289 fn new_empty() -> Self {
7290 Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7291 }
7292
7293 #[inline]
7294 unsafe fn decode(
7295 &mut self,
7296 decoder: &mut fidl::encoding::Decoder<'_, D>,
7297 offset: usize,
7298 _depth: fidl::encoding::Depth,
7299 ) -> fidl::Result<()> {
7300 decoder.debug_check_bounds::<Self>(offset);
7301 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7302 unsafe {
7305 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7306 }
7307 Ok(())
7308 }
7309 }
7310
7311 impl fidl::encoding::ValueTypeMarker for SceneArgs {
7312 type Borrowed<'a> = &'a Self;
7313 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7314 value
7315 }
7316 }
7317
7318 unsafe impl fidl::encoding::TypeMarker for SceneArgs {
7319 type Owned = Self;
7320
7321 #[inline(always)]
7322 fn inline_align(_context: fidl::encoding::Context) -> usize {
7323 4
7324 }
7325
7326 #[inline(always)]
7327 fn inline_size(_context: fidl::encoding::Context) -> usize {
7328 4
7329 }
7330 #[inline(always)]
7331 fn encode_is_copy() -> bool {
7332 true
7333 }
7334
7335 #[inline(always)]
7336 fn decode_is_copy() -> bool {
7337 true
7338 }
7339 }
7340
7341 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneArgs, D>
7342 for &SceneArgs
7343 {
7344 #[inline]
7345 unsafe fn encode(
7346 self,
7347 encoder: &mut fidl::encoding::Encoder<'_, D>,
7348 offset: usize,
7349 _depth: fidl::encoding::Depth,
7350 ) -> fidl::Result<()> {
7351 encoder.debug_check_bounds::<SceneArgs>(offset);
7352 unsafe {
7353 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7355 (buf_ptr as *mut SceneArgs).write_unaligned((self as *const SceneArgs).read());
7356 }
7359 Ok(())
7360 }
7361 }
7362 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7363 fidl::encoding::Encode<SceneArgs, D> for (T0,)
7364 {
7365 #[inline]
7366 unsafe fn encode(
7367 self,
7368 encoder: &mut fidl::encoding::Encoder<'_, D>,
7369 offset: usize,
7370 depth: fidl::encoding::Depth,
7371 ) -> fidl::Result<()> {
7372 encoder.debug_check_bounds::<SceneArgs>(offset);
7373 self.0.encode(encoder, offset + 0, depth)?;
7377 Ok(())
7378 }
7379 }
7380
7381 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneArgs {
7382 #[inline(always)]
7383 fn new_empty() -> Self {
7384 Self { dummy: fidl::new_empty!(u32, D) }
7385 }
7386
7387 #[inline]
7388 unsafe fn decode(
7389 &mut self,
7390 decoder: &mut fidl::encoding::Decoder<'_, D>,
7391 offset: usize,
7392 _depth: fidl::encoding::Depth,
7393 ) -> fidl::Result<()> {
7394 decoder.debug_check_bounds::<Self>(offset);
7395 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7396 unsafe {
7399 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7400 }
7401 Ok(())
7402 }
7403 }
7404
7405 impl fidl::encoding::ValueTypeMarker for SendSizeChangeHintCmdHack {
7406 type Borrowed<'a> = &'a Self;
7407 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7408 value
7409 }
7410 }
7411
7412 unsafe impl fidl::encoding::TypeMarker for SendSizeChangeHintCmdHack {
7413 type Owned = Self;
7414
7415 #[inline(always)]
7416 fn inline_align(_context: fidl::encoding::Context) -> usize {
7417 4
7418 }
7419
7420 #[inline(always)]
7421 fn inline_size(_context: fidl::encoding::Context) -> usize {
7422 12
7423 }
7424 }
7425
7426 unsafe impl<D: fidl::encoding::ResourceDialect>
7427 fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for &SendSizeChangeHintCmdHack
7428 {
7429 #[inline]
7430 unsafe fn encode(
7431 self,
7432 encoder: &mut fidl::encoding::Encoder<'_, D>,
7433 offset: usize,
7434 _depth: fidl::encoding::Depth,
7435 ) -> fidl::Result<()> {
7436 encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7437 fidl::encoding::Encode::<SendSizeChangeHintCmdHack, D>::encode(
7439 (
7440 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
7441 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
7442 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
7443 ),
7444 encoder,
7445 offset,
7446 _depth,
7447 )
7448 }
7449 }
7450 unsafe impl<
7451 D: fidl::encoding::ResourceDialect,
7452 T0: fidl::encoding::Encode<u32, D>,
7453 T1: fidl::encoding::Encode<f32, D>,
7454 T2: fidl::encoding::Encode<f32, D>,
7455 > fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for (T0, T1, T2)
7456 {
7457 #[inline]
7458 unsafe fn encode(
7459 self,
7460 encoder: &mut fidl::encoding::Encoder<'_, D>,
7461 offset: usize,
7462 depth: fidl::encoding::Depth,
7463 ) -> fidl::Result<()> {
7464 encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7465 self.0.encode(encoder, offset + 0, depth)?;
7469 self.1.encode(encoder, offset + 4, depth)?;
7470 self.2.encode(encoder, offset + 8, depth)?;
7471 Ok(())
7472 }
7473 }
7474
7475 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7476 for SendSizeChangeHintCmdHack
7477 {
7478 #[inline(always)]
7479 fn new_empty() -> Self {
7480 Self {
7481 node_id: fidl::new_empty!(u32, D),
7482 width_change_factor: fidl::new_empty!(f32, D),
7483 height_change_factor: fidl::new_empty!(f32, D),
7484 }
7485 }
7486
7487 #[inline]
7488 unsafe fn decode(
7489 &mut self,
7490 decoder: &mut fidl::encoding::Decoder<'_, D>,
7491 offset: usize,
7492 _depth: fidl::encoding::Depth,
7493 ) -> fidl::Result<()> {
7494 decoder.debug_check_bounds::<Self>(offset);
7495 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
7497 fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
7498 fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
7499 Ok(())
7500 }
7501 }
7502
7503 impl fidl::encoding::ValueTypeMarker for SetAnchorCmd {
7504 type Borrowed<'a> = &'a Self;
7505 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7506 value
7507 }
7508 }
7509
7510 unsafe impl fidl::encoding::TypeMarker for SetAnchorCmd {
7511 type Owned = Self;
7512
7513 #[inline(always)]
7514 fn inline_align(_context: fidl::encoding::Context) -> usize {
7515 4
7516 }
7517
7518 #[inline(always)]
7519 fn inline_size(_context: fidl::encoding::Context) -> usize {
7520 20
7521 }
7522 }
7523
7524 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetAnchorCmd, D>
7525 for &SetAnchorCmd
7526 {
7527 #[inline]
7528 unsafe fn encode(
7529 self,
7530 encoder: &mut fidl::encoding::Encoder<'_, D>,
7531 offset: usize,
7532 _depth: fidl::encoding::Depth,
7533 ) -> fidl::Result<()> {
7534 encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7535 fidl::encoding::Encode::<SetAnchorCmd, D>::encode(
7537 (
7538 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
7539 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
7540 ),
7541 encoder,
7542 offset,
7543 _depth,
7544 )
7545 }
7546 }
7547 unsafe impl<
7548 D: fidl::encoding::ResourceDialect,
7549 T0: fidl::encoding::Encode<u32, D>,
7550 T1: fidl::encoding::Encode<Vector3Value, D>,
7551 > fidl::encoding::Encode<SetAnchorCmd, D> for (T0, T1)
7552 {
7553 #[inline]
7554 unsafe fn encode(
7555 self,
7556 encoder: &mut fidl::encoding::Encoder<'_, D>,
7557 offset: usize,
7558 depth: fidl::encoding::Depth,
7559 ) -> fidl::Result<()> {
7560 encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7561 self.0.encode(encoder, offset + 0, depth)?;
7565 self.1.encode(encoder, offset + 4, depth)?;
7566 Ok(())
7567 }
7568 }
7569
7570 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetAnchorCmd {
7571 #[inline(always)]
7572 fn new_empty() -> Self {
7573 Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
7574 }
7575
7576 #[inline]
7577 unsafe fn decode(
7578 &mut self,
7579 decoder: &mut fidl::encoding::Decoder<'_, D>,
7580 offset: usize,
7581 _depth: fidl::encoding::Depth,
7582 ) -> fidl::Result<()> {
7583 decoder.debug_check_bounds::<Self>(offset);
7584 fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
7586 fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
7587 Ok(())
7588 }
7589 }
7590
7591 impl fidl::encoding::ValueTypeMarker for SetCameraClipSpaceTransformCmd {
7592 type Borrowed<'a> = &'a Self;
7593 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7594 value
7595 }
7596 }
7597
7598 unsafe impl fidl::encoding::TypeMarker for SetCameraClipSpaceTransformCmd {
7599 type Owned = Self;
7600
7601 #[inline(always)]
7602 fn inline_align(_context: fidl::encoding::Context) -> usize {
7603 4
7604 }
7605
7606 #[inline(always)]
7607 fn inline_size(_context: fidl::encoding::Context) -> usize {
7608 16
7609 }
7610 }
7611
7612 unsafe impl<D: fidl::encoding::ResourceDialect>
7613 fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D>
7614 for &SetCameraClipSpaceTransformCmd
7615 {
7616 #[inline]
7617 unsafe fn encode(
7618 self,
7619 encoder: &mut fidl::encoding::Encoder<'_, D>,
7620 offset: usize,
7621 _depth: fidl::encoding::Depth,
7622 ) -> fidl::Result<()> {
7623 encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7624 fidl::encoding::Encode::<SetCameraClipSpaceTransformCmd, D>::encode(
7626 (
7627 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7628 <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
7629 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
7630 ),
7631 encoder,
7632 offset,
7633 _depth,
7634 )
7635 }
7636 }
7637 unsafe impl<
7638 D: fidl::encoding::ResourceDialect,
7639 T0: fidl::encoding::Encode<u32, D>,
7640 T1: fidl::encoding::Encode<Vec2, D>,
7641 T2: fidl::encoding::Encode<f32, D>,
7642 > fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D> for (T0, T1, T2)
7643 {
7644 #[inline]
7645 unsafe fn encode(
7646 self,
7647 encoder: &mut fidl::encoding::Encoder<'_, D>,
7648 offset: usize,
7649 depth: fidl::encoding::Depth,
7650 ) -> fidl::Result<()> {
7651 encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7652 self.0.encode(encoder, offset + 0, depth)?;
7656 self.1.encode(encoder, offset + 4, depth)?;
7657 self.2.encode(encoder, offset + 12, depth)?;
7658 Ok(())
7659 }
7660 }
7661
7662 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7663 for SetCameraClipSpaceTransformCmd
7664 {
7665 #[inline(always)]
7666 fn new_empty() -> Self {
7667 Self {
7668 camera_id: fidl::new_empty!(u32, D),
7669 translation: fidl::new_empty!(Vec2, D),
7670 scale: fidl::new_empty!(f32, D),
7671 }
7672 }
7673
7674 #[inline]
7675 unsafe fn decode(
7676 &mut self,
7677 decoder: &mut fidl::encoding::Decoder<'_, D>,
7678 offset: usize,
7679 _depth: fidl::encoding::Depth,
7680 ) -> fidl::Result<()> {
7681 decoder.debug_check_bounds::<Self>(offset);
7682 fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7684 fidl::decode!(Vec2, D, &mut self.translation, decoder, offset + 4, _depth)?;
7685 fidl::decode!(f32, D, &mut self.scale, decoder, offset + 12, _depth)?;
7686 Ok(())
7687 }
7688 }
7689
7690 impl fidl::encoding::ValueTypeMarker for SetCameraCmd {
7691 type Borrowed<'a> = &'a Self;
7692 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7693 value
7694 }
7695 }
7696
7697 unsafe impl fidl::encoding::TypeMarker for SetCameraCmd {
7698 type Owned = Self;
7699
7700 #[inline(always)]
7701 fn inline_align(_context: fidl::encoding::Context) -> usize {
7702 4
7703 }
7704
7705 #[inline(always)]
7706 fn inline_size(_context: fidl::encoding::Context) -> usize {
7707 8
7708 }
7709 #[inline(always)]
7710 fn encode_is_copy() -> bool {
7711 true
7712 }
7713
7714 #[inline(always)]
7715 fn decode_is_copy() -> bool {
7716 true
7717 }
7718 }
7719
7720 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraCmd, D>
7721 for &SetCameraCmd
7722 {
7723 #[inline]
7724 unsafe fn encode(
7725 self,
7726 encoder: &mut fidl::encoding::Encoder<'_, D>,
7727 offset: usize,
7728 _depth: fidl::encoding::Depth,
7729 ) -> fidl::Result<()> {
7730 encoder.debug_check_bounds::<SetCameraCmd>(offset);
7731 unsafe {
7732 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7734 (buf_ptr as *mut SetCameraCmd)
7735 .write_unaligned((self as *const SetCameraCmd).read());
7736 }
7739 Ok(())
7740 }
7741 }
7742 unsafe impl<
7743 D: fidl::encoding::ResourceDialect,
7744 T0: fidl::encoding::Encode<u32, D>,
7745 T1: fidl::encoding::Encode<u32, D>,
7746 > fidl::encoding::Encode<SetCameraCmd, D> for (T0, T1)
7747 {
7748 #[inline]
7749 unsafe fn encode(
7750 self,
7751 encoder: &mut fidl::encoding::Encoder<'_, D>,
7752 offset: usize,
7753 depth: fidl::encoding::Depth,
7754 ) -> fidl::Result<()> {
7755 encoder.debug_check_bounds::<SetCameraCmd>(offset);
7756 self.0.encode(encoder, offset + 0, depth)?;
7760 self.1.encode(encoder, offset + 4, depth)?;
7761 Ok(())
7762 }
7763 }
7764
7765 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraCmd {
7766 #[inline(always)]
7767 fn new_empty() -> Self {
7768 Self { renderer_id: fidl::new_empty!(u32, D), camera_id: fidl::new_empty!(u32, D) }
7769 }
7770
7771 #[inline]
7772 unsafe fn decode(
7773 &mut self,
7774 decoder: &mut fidl::encoding::Decoder<'_, D>,
7775 offset: usize,
7776 _depth: fidl::encoding::Depth,
7777 ) -> fidl::Result<()> {
7778 decoder.debug_check_bounds::<Self>(offset);
7779 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7780 unsafe {
7783 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7784 }
7785 Ok(())
7786 }
7787 }
7788
7789 impl fidl::encoding::ValueTypeMarker for SetCameraPoseBufferCmd {
7790 type Borrowed<'a> = &'a Self;
7791 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7792 value
7793 }
7794 }
7795
7796 unsafe impl fidl::encoding::TypeMarker for SetCameraPoseBufferCmd {
7797 type Owned = Self;
7798
7799 #[inline(always)]
7800 fn inline_align(_context: fidl::encoding::Context) -> usize {
7801 8
7802 }
7803
7804 #[inline(always)]
7805 fn inline_size(_context: fidl::encoding::Context) -> usize {
7806 32
7807 }
7808 }
7809
7810 unsafe impl<D: fidl::encoding::ResourceDialect>
7811 fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for &SetCameraPoseBufferCmd
7812 {
7813 #[inline]
7814 unsafe fn encode(
7815 self,
7816 encoder: &mut fidl::encoding::Encoder<'_, D>,
7817 offset: usize,
7818 _depth: fidl::encoding::Depth,
7819 ) -> fidl::Result<()> {
7820 encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7821 unsafe {
7822 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7824 (buf_ptr as *mut SetCameraPoseBufferCmd)
7825 .write_unaligned((self as *const SetCameraPoseBufferCmd).read());
7826 let padding_ptr = buf_ptr.offset(8) as *mut u64;
7829 let padding_mask = 0xffffffff00000000u64;
7830 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
7831 }
7832 Ok(())
7833 }
7834 }
7835 unsafe impl<
7836 D: fidl::encoding::ResourceDialect,
7837 T0: fidl::encoding::Encode<u32, D>,
7838 T1: fidl::encoding::Encode<u32, D>,
7839 T2: fidl::encoding::Encode<u32, D>,
7840 T3: fidl::encoding::Encode<i64, D>,
7841 T4: fidl::encoding::Encode<u64, D>,
7842 > fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for (T0, T1, T2, T3, T4)
7843 {
7844 #[inline]
7845 unsafe fn encode(
7846 self,
7847 encoder: &mut fidl::encoding::Encoder<'_, D>,
7848 offset: usize,
7849 depth: fidl::encoding::Depth,
7850 ) -> fidl::Result<()> {
7851 encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7852 unsafe {
7855 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
7856 (ptr as *mut u64).write_unaligned(0);
7857 }
7858 self.0.encode(encoder, offset + 0, depth)?;
7860 self.1.encode(encoder, offset + 4, depth)?;
7861 self.2.encode(encoder, offset + 8, depth)?;
7862 self.3.encode(encoder, offset + 16, depth)?;
7863 self.4.encode(encoder, offset + 24, depth)?;
7864 Ok(())
7865 }
7866 }
7867
7868 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7869 for SetCameraPoseBufferCmd
7870 {
7871 #[inline(always)]
7872 fn new_empty() -> Self {
7873 Self {
7874 camera_id: fidl::new_empty!(u32, D),
7875 buffer_id: fidl::new_empty!(u32, D),
7876 num_entries: fidl::new_empty!(u32, D),
7877 base_time: fidl::new_empty!(i64, D),
7878 time_interval: fidl::new_empty!(u64, D),
7879 }
7880 }
7881
7882 #[inline]
7883 unsafe fn decode(
7884 &mut self,
7885 decoder: &mut fidl::encoding::Decoder<'_, D>,
7886 offset: usize,
7887 _depth: fidl::encoding::Depth,
7888 ) -> fidl::Result<()> {
7889 decoder.debug_check_bounds::<Self>(offset);
7890 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7891 let ptr = unsafe { buf_ptr.offset(8) };
7893 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7894 let mask = 0xffffffff00000000u64;
7895 let maskedval = padval & mask;
7896 if maskedval != 0 {
7897 return Err(fidl::Error::NonZeroPadding {
7898 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
7899 });
7900 }
7901 unsafe {
7903 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
7904 }
7905 Ok(())
7906 }
7907 }
7908
7909 impl fidl::encoding::ValueTypeMarker for SetCameraProjectionCmd {
7910 type Borrowed<'a> = &'a Self;
7911 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7912 value
7913 }
7914 }
7915
7916 unsafe impl fidl::encoding::TypeMarker for SetCameraProjectionCmd {
7917 type Owned = Self;
7918
7919 #[inline(always)]
7920 fn inline_align(_context: fidl::encoding::Context) -> usize {
7921 4
7922 }
7923
7924 #[inline(always)]
7925 fn inline_size(_context: fidl::encoding::Context) -> usize {
7926 12
7927 }
7928 }
7929
7930 unsafe impl<D: fidl::encoding::ResourceDialect>
7931 fidl::encoding::Encode<SetCameraProjectionCmd, D> for &SetCameraProjectionCmd
7932 {
7933 #[inline]
7934 unsafe fn encode(
7935 self,
7936 encoder: &mut fidl::encoding::Encoder<'_, D>,
7937 offset: usize,
7938 _depth: fidl::encoding::Depth,
7939 ) -> fidl::Result<()> {
7940 encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7941 fidl::encoding::Encode::<SetCameraProjectionCmd, D>::encode(
7943 (
7944 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7945 <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.fovy),
7946 ),
7947 encoder,
7948 offset,
7949 _depth,
7950 )
7951 }
7952 }
7953 unsafe impl<
7954 D: fidl::encoding::ResourceDialect,
7955 T0: fidl::encoding::Encode<u32, D>,
7956 T1: fidl::encoding::Encode<FloatValue, D>,
7957 > fidl::encoding::Encode<SetCameraProjectionCmd, D> for (T0, T1)
7958 {
7959 #[inline]
7960 unsafe fn encode(
7961 self,
7962 encoder: &mut fidl::encoding::Encoder<'_, D>,
7963 offset: usize,
7964 depth: fidl::encoding::Depth,
7965 ) -> fidl::Result<()> {
7966 encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7967 self.0.encode(encoder, offset + 0, depth)?;
7971 self.1.encode(encoder, offset + 4, depth)?;
7972 Ok(())
7973 }
7974 }
7975
7976 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7977 for SetCameraProjectionCmd
7978 {
7979 #[inline(always)]
7980 fn new_empty() -> Self {
7981 Self { camera_id: fidl::new_empty!(u32, D), fovy: fidl::new_empty!(FloatValue, D) }
7982 }
7983
7984 #[inline]
7985 unsafe fn decode(
7986 &mut self,
7987 decoder: &mut fidl::encoding::Decoder<'_, D>,
7988 offset: usize,
7989 _depth: fidl::encoding::Depth,
7990 ) -> fidl::Result<()> {
7991 decoder.debug_check_bounds::<Self>(offset);
7992 fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7994 fidl::decode!(FloatValue, D, &mut self.fovy, decoder, offset + 4, _depth)?;
7995 Ok(())
7996 }
7997 }
7998
7999 impl fidl::encoding::ValueTypeMarker for SetCameraTransformCmd {
8000 type Borrowed<'a> = &'a Self;
8001 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8002 value
8003 }
8004 }
8005
8006 unsafe impl fidl::encoding::TypeMarker for SetCameraTransformCmd {
8007 type Owned = Self;
8008
8009 #[inline(always)]
8010 fn inline_align(_context: fidl::encoding::Context) -> usize {
8011 4
8012 }
8013
8014 #[inline(always)]
8015 fn inline_size(_context: fidl::encoding::Context) -> usize {
8016 52
8017 }
8018 }
8019
8020 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraTransformCmd, D>
8021 for &SetCameraTransformCmd
8022 {
8023 #[inline]
8024 unsafe fn encode(
8025 self,
8026 encoder: &mut fidl::encoding::Encoder<'_, D>,
8027 offset: usize,
8028 _depth: fidl::encoding::Depth,
8029 ) -> fidl::Result<()> {
8030 encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
8031 fidl::encoding::Encode::<SetCameraTransformCmd, D>::encode(
8033 (
8034 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
8035 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_position),
8036 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_look_at),
8037 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_up),
8038 ),
8039 encoder,
8040 offset,
8041 _depth,
8042 )
8043 }
8044 }
8045 unsafe impl<
8046 D: fidl::encoding::ResourceDialect,
8047 T0: fidl::encoding::Encode<u32, D>,
8048 T1: fidl::encoding::Encode<Vector3Value, D>,
8049 T2: fidl::encoding::Encode<Vector3Value, D>,
8050 T3: fidl::encoding::Encode<Vector3Value, D>,
8051 > fidl::encoding::Encode<SetCameraTransformCmd, D> for (T0, T1, T2, T3)
8052 {
8053 #[inline]
8054 unsafe fn encode(
8055 self,
8056 encoder: &mut fidl::encoding::Encoder<'_, D>,
8057 offset: usize,
8058 depth: fidl::encoding::Depth,
8059 ) -> fidl::Result<()> {
8060 encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
8061 self.0.encode(encoder, offset + 0, depth)?;
8065 self.1.encode(encoder, offset + 4, depth)?;
8066 self.2.encode(encoder, offset + 20, depth)?;
8067 self.3.encode(encoder, offset + 36, depth)?;
8068 Ok(())
8069 }
8070 }
8071
8072 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraTransformCmd {
8073 #[inline(always)]
8074 fn new_empty() -> Self {
8075 Self {
8076 camera_id: fidl::new_empty!(u32, D),
8077 eye_position: fidl::new_empty!(Vector3Value, D),
8078 eye_look_at: fidl::new_empty!(Vector3Value, D),
8079 eye_up: fidl::new_empty!(Vector3Value, D),
8080 }
8081 }
8082
8083 #[inline]
8084 unsafe fn decode(
8085 &mut self,
8086 decoder: &mut fidl::encoding::Decoder<'_, D>,
8087 offset: usize,
8088 _depth: fidl::encoding::Depth,
8089 ) -> fidl::Result<()> {
8090 decoder.debug_check_bounds::<Self>(offset);
8091 fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
8093 fidl::decode!(Vector3Value, D, &mut self.eye_position, decoder, offset + 4, _depth)?;
8094 fidl::decode!(Vector3Value, D, &mut self.eye_look_at, decoder, offset + 20, _depth)?;
8095 fidl::decode!(Vector3Value, D, &mut self.eye_up, decoder, offset + 36, _depth)?;
8096 Ok(())
8097 }
8098 }
8099
8100 impl fidl::encoding::ValueTypeMarker for SetClipCmd {
8101 type Borrowed<'a> = &'a Self;
8102 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8103 value
8104 }
8105 }
8106
8107 unsafe impl fidl::encoding::TypeMarker for SetClipCmd {
8108 type Owned = Self;
8109
8110 #[inline(always)]
8111 fn inline_align(_context: fidl::encoding::Context) -> usize {
8112 4
8113 }
8114
8115 #[inline(always)]
8116 fn inline_size(_context: fidl::encoding::Context) -> usize {
8117 12
8118 }
8119 }
8120
8121 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipCmd, D>
8122 for &SetClipCmd
8123 {
8124 #[inline]
8125 unsafe fn encode(
8126 self,
8127 encoder: &mut fidl::encoding::Encoder<'_, D>,
8128 offset: usize,
8129 _depth: fidl::encoding::Depth,
8130 ) -> fidl::Result<()> {
8131 encoder.debug_check_bounds::<SetClipCmd>(offset);
8132 fidl::encoding::Encode::<SetClipCmd, D>::encode(
8134 (
8135 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8136 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_id),
8137 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_to_self),
8138 ),
8139 encoder,
8140 offset,
8141 _depth,
8142 )
8143 }
8144 }
8145 unsafe impl<
8146 D: fidl::encoding::ResourceDialect,
8147 T0: fidl::encoding::Encode<u32, D>,
8148 T1: fidl::encoding::Encode<u32, D>,
8149 T2: fidl::encoding::Encode<bool, D>,
8150 > fidl::encoding::Encode<SetClipCmd, D> for (T0, T1, T2)
8151 {
8152 #[inline]
8153 unsafe fn encode(
8154 self,
8155 encoder: &mut fidl::encoding::Encoder<'_, D>,
8156 offset: usize,
8157 depth: fidl::encoding::Depth,
8158 ) -> fidl::Result<()> {
8159 encoder.debug_check_bounds::<SetClipCmd>(offset);
8160 unsafe {
8163 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8164 (ptr as *mut u32).write_unaligned(0);
8165 }
8166 self.0.encode(encoder, offset + 0, depth)?;
8168 self.1.encode(encoder, offset + 4, depth)?;
8169 self.2.encode(encoder, offset + 8, depth)?;
8170 Ok(())
8171 }
8172 }
8173
8174 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipCmd {
8175 #[inline(always)]
8176 fn new_empty() -> Self {
8177 Self {
8178 node_id: fidl::new_empty!(u32, D),
8179 clip_id: fidl::new_empty!(u32, D),
8180 clip_to_self: fidl::new_empty!(bool, D),
8181 }
8182 }
8183
8184 #[inline]
8185 unsafe fn decode(
8186 &mut self,
8187 decoder: &mut fidl::encoding::Decoder<'_, D>,
8188 offset: usize,
8189 _depth: fidl::encoding::Depth,
8190 ) -> fidl::Result<()> {
8191 decoder.debug_check_bounds::<Self>(offset);
8192 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8194 let padval = unsafe { (ptr as *const u32).read_unaligned() };
8195 let mask = 0xffffff00u32;
8196 let maskedval = padval & mask;
8197 if maskedval != 0 {
8198 return Err(fidl::Error::NonZeroPadding {
8199 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8200 });
8201 }
8202 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8203 fidl::decode!(u32, D, &mut self.clip_id, decoder, offset + 4, _depth)?;
8204 fidl::decode!(bool, D, &mut self.clip_to_self, decoder, offset + 8, _depth)?;
8205 Ok(())
8206 }
8207 }
8208
8209 impl fidl::encoding::ValueTypeMarker for SetClipPlanesCmd {
8210 type Borrowed<'a> = &'a Self;
8211 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8212 value
8213 }
8214 }
8215
8216 unsafe impl fidl::encoding::TypeMarker for SetClipPlanesCmd {
8217 type Owned = Self;
8218
8219 #[inline(always)]
8220 fn inline_align(_context: fidl::encoding::Context) -> usize {
8221 8
8222 }
8223
8224 #[inline(always)]
8225 fn inline_size(_context: fidl::encoding::Context) -> usize {
8226 24
8227 }
8228 }
8229
8230 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipPlanesCmd, D>
8231 for &SetClipPlanesCmd
8232 {
8233 #[inline]
8234 unsafe fn encode(
8235 self,
8236 encoder: &mut fidl::encoding::Encoder<'_, D>,
8237 offset: usize,
8238 _depth: fidl::encoding::Depth,
8239 ) -> fidl::Result<()> {
8240 encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8241 fidl::encoding::Encode::<SetClipPlanesCmd, D>::encode(
8243 (
8244 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8245 <fidl::encoding::UnboundedVector<Plane3> as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_planes),
8246 ),
8247 encoder, offset, _depth
8248 )
8249 }
8250 }
8251 unsafe impl<
8252 D: fidl::encoding::ResourceDialect,
8253 T0: fidl::encoding::Encode<u32, D>,
8254 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Plane3>, D>,
8255 > fidl::encoding::Encode<SetClipPlanesCmd, D> for (T0, T1)
8256 {
8257 #[inline]
8258 unsafe fn encode(
8259 self,
8260 encoder: &mut fidl::encoding::Encoder<'_, D>,
8261 offset: usize,
8262 depth: fidl::encoding::Depth,
8263 ) -> fidl::Result<()> {
8264 encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8265 unsafe {
8268 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8269 (ptr as *mut u64).write_unaligned(0);
8270 }
8271 self.0.encode(encoder, offset + 0, depth)?;
8273 self.1.encode(encoder, offset + 8, depth)?;
8274 Ok(())
8275 }
8276 }
8277
8278 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipPlanesCmd {
8279 #[inline(always)]
8280 fn new_empty() -> Self {
8281 Self {
8282 node_id: fidl::new_empty!(u32, D),
8283 clip_planes: fidl::new_empty!(fidl::encoding::UnboundedVector<Plane3>, D),
8284 }
8285 }
8286
8287 #[inline]
8288 unsafe fn decode(
8289 &mut self,
8290 decoder: &mut fidl::encoding::Decoder<'_, D>,
8291 offset: usize,
8292 _depth: fidl::encoding::Depth,
8293 ) -> fidl::Result<()> {
8294 decoder.debug_check_bounds::<Self>(offset);
8295 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8297 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8298 let mask = 0xffffffff00000000u64;
8299 let maskedval = padval & mask;
8300 if maskedval != 0 {
8301 return Err(fidl::Error::NonZeroPadding {
8302 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8303 });
8304 }
8305 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8306 fidl::decode!(
8307 fidl::encoding::UnboundedVector<Plane3>,
8308 D,
8309 &mut self.clip_planes,
8310 decoder,
8311 offset + 8,
8312 _depth
8313 )?;
8314 Ok(())
8315 }
8316 }
8317
8318 impl fidl::encoding::ValueTypeMarker for SetColorCmd {
8319 type Borrowed<'a> = &'a Self;
8320 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8321 value
8322 }
8323 }
8324
8325 unsafe impl fidl::encoding::TypeMarker for SetColorCmd {
8326 type Owned = Self;
8327
8328 #[inline(always)]
8329 fn inline_align(_context: fidl::encoding::Context) -> usize {
8330 4
8331 }
8332
8333 #[inline(always)]
8334 fn inline_size(_context: fidl::encoding::Context) -> usize {
8335 12
8336 }
8337 #[inline(always)]
8338 fn encode_is_copy() -> bool {
8339 true
8340 }
8341
8342 #[inline(always)]
8343 fn decode_is_copy() -> bool {
8344 true
8345 }
8346 }
8347
8348 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetColorCmd, D>
8349 for &SetColorCmd
8350 {
8351 #[inline]
8352 unsafe fn encode(
8353 self,
8354 encoder: &mut fidl::encoding::Encoder<'_, D>,
8355 offset: usize,
8356 _depth: fidl::encoding::Depth,
8357 ) -> fidl::Result<()> {
8358 encoder.debug_check_bounds::<SetColorCmd>(offset);
8359 unsafe {
8360 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8362 (buf_ptr as *mut SetColorCmd).write_unaligned((self as *const SetColorCmd).read());
8363 }
8366 Ok(())
8367 }
8368 }
8369 unsafe impl<
8370 D: fidl::encoding::ResourceDialect,
8371 T0: fidl::encoding::Encode<u32, D>,
8372 T1: fidl::encoding::Encode<ColorRgbaValue, D>,
8373 > fidl::encoding::Encode<SetColorCmd, D> for (T0, T1)
8374 {
8375 #[inline]
8376 unsafe fn encode(
8377 self,
8378 encoder: &mut fidl::encoding::Encoder<'_, D>,
8379 offset: usize,
8380 depth: fidl::encoding::Depth,
8381 ) -> fidl::Result<()> {
8382 encoder.debug_check_bounds::<SetColorCmd>(offset);
8383 self.0.encode(encoder, offset + 0, depth)?;
8387 self.1.encode(encoder, offset + 4, depth)?;
8388 Ok(())
8389 }
8390 }
8391
8392 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetColorCmd {
8393 #[inline(always)]
8394 fn new_empty() -> Self {
8395 Self {
8396 material_id: fidl::new_empty!(u32, D),
8397 color: fidl::new_empty!(ColorRgbaValue, D),
8398 }
8399 }
8400
8401 #[inline]
8402 unsafe fn decode(
8403 &mut self,
8404 decoder: &mut fidl::encoding::Decoder<'_, D>,
8405 offset: usize,
8406 _depth: fidl::encoding::Depth,
8407 ) -> fidl::Result<()> {
8408 decoder.debug_check_bounds::<Self>(offset);
8409 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8410 unsafe {
8413 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
8414 }
8415 Ok(())
8416 }
8417 }
8418
8419 impl fidl::encoding::ValueTypeMarker for SetDisableClippingCmd {
8420 type Borrowed<'a> = &'a Self;
8421 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8422 value
8423 }
8424 }
8425
8426 unsafe impl fidl::encoding::TypeMarker for SetDisableClippingCmd {
8427 type Owned = Self;
8428
8429 #[inline(always)]
8430 fn inline_align(_context: fidl::encoding::Context) -> usize {
8431 4
8432 }
8433
8434 #[inline(always)]
8435 fn inline_size(_context: fidl::encoding::Context) -> usize {
8436 8
8437 }
8438 }
8439
8440 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetDisableClippingCmd, D>
8441 for &SetDisableClippingCmd
8442 {
8443 #[inline]
8444 unsafe fn encode(
8445 self,
8446 encoder: &mut fidl::encoding::Encoder<'_, D>,
8447 offset: usize,
8448 _depth: fidl::encoding::Depth,
8449 ) -> fidl::Result<()> {
8450 encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8451 fidl::encoding::Encode::<SetDisableClippingCmd, D>::encode(
8453 (
8454 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
8455 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_clipping),
8456 ),
8457 encoder,
8458 offset,
8459 _depth,
8460 )
8461 }
8462 }
8463 unsafe impl<
8464 D: fidl::encoding::ResourceDialect,
8465 T0: fidl::encoding::Encode<u32, D>,
8466 T1: fidl::encoding::Encode<bool, D>,
8467 > fidl::encoding::Encode<SetDisableClippingCmd, D> for (T0, T1)
8468 {
8469 #[inline]
8470 unsafe fn encode(
8471 self,
8472 encoder: &mut fidl::encoding::Encoder<'_, D>,
8473 offset: usize,
8474 depth: fidl::encoding::Depth,
8475 ) -> fidl::Result<()> {
8476 encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8477 unsafe {
8480 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8481 (ptr as *mut u32).write_unaligned(0);
8482 }
8483 self.0.encode(encoder, offset + 0, depth)?;
8485 self.1.encode(encoder, offset + 4, depth)?;
8486 Ok(())
8487 }
8488 }
8489
8490 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetDisableClippingCmd {
8491 #[inline(always)]
8492 fn new_empty() -> Self {
8493 Self {
8494 renderer_id: fidl::new_empty!(u32, D),
8495 disable_clipping: fidl::new_empty!(bool, D),
8496 }
8497 }
8498
8499 #[inline]
8500 unsafe fn decode(
8501 &mut self,
8502 decoder: &mut fidl::encoding::Decoder<'_, D>,
8503 offset: usize,
8504 _depth: fidl::encoding::Depth,
8505 ) -> fidl::Result<()> {
8506 decoder.debug_check_bounds::<Self>(offset);
8507 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8509 let padval = unsafe { (ptr as *const u32).read_unaligned() };
8510 let mask = 0xffffff00u32;
8511 let maskedval = padval & mask;
8512 if maskedval != 0 {
8513 return Err(fidl::Error::NonZeroPadding {
8514 padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8515 });
8516 }
8517 fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
8518 fidl::decode!(bool, D, &mut self.disable_clipping, decoder, offset + 4, _depth)?;
8519 Ok(())
8520 }
8521 }
8522
8523 impl fidl::encoding::ValueTypeMarker for SetDisplayColorConversionCmdHack {
8524 type Borrowed<'a> = &'a Self;
8525 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8526 value
8527 }
8528 }
8529
8530 unsafe impl fidl::encoding::TypeMarker for SetDisplayColorConversionCmdHack {
8531 type Owned = Self;
8532
8533 #[inline(always)]
8534 fn inline_align(_context: fidl::encoding::Context) -> usize {
8535 4
8536 }
8537
8538 #[inline(always)]
8539 fn inline_size(_context: fidl::encoding::Context) -> usize {
8540 64
8541 }
8542 }
8543
8544 unsafe impl<D: fidl::encoding::ResourceDialect>
8545 fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D>
8546 for &SetDisplayColorConversionCmdHack
8547 {
8548 #[inline]
8549 unsafe fn encode(
8550 self,
8551 encoder: &mut fidl::encoding::Encoder<'_, D>,
8552 offset: usize,
8553 _depth: fidl::encoding::Depth,
8554 ) -> fidl::Result<()> {
8555 encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8556 fidl::encoding::Encode::<SetDisplayColorConversionCmdHack, D>::encode(
8558 (
8559 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.compositor_id),
8560 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8561 &self.preoffsets,
8562 ),
8563 <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(
8564 &self.matrix,
8565 ),
8566 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8567 &self.postoffsets,
8568 ),
8569 ),
8570 encoder,
8571 offset,
8572 _depth,
8573 )
8574 }
8575 }
8576 unsafe impl<
8577 D: fidl::encoding::ResourceDialect,
8578 T0: fidl::encoding::Encode<u32, D>,
8579 T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8580 T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
8581 T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8582 > fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D> for (T0, T1, T2, T3)
8583 {
8584 #[inline]
8585 unsafe fn encode(
8586 self,
8587 encoder: &mut fidl::encoding::Encoder<'_, D>,
8588 offset: usize,
8589 depth: fidl::encoding::Depth,
8590 ) -> fidl::Result<()> {
8591 encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8592 self.0.encode(encoder, offset + 0, depth)?;
8596 self.1.encode(encoder, offset + 4, depth)?;
8597 self.2.encode(encoder, offset + 16, depth)?;
8598 self.3.encode(encoder, offset + 52, depth)?;
8599 Ok(())
8600 }
8601 }
8602
8603 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8604 for SetDisplayColorConversionCmdHack
8605 {
8606 #[inline(always)]
8607 fn new_empty() -> Self {
8608 Self {
8609 compositor_id: fidl::new_empty!(u32, D),
8610 preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8611 matrix: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
8612 postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8613 }
8614 }
8615
8616 #[inline]
8617 unsafe fn decode(
8618 &mut self,
8619 decoder: &mut fidl::encoding::Decoder<'_, D>,
8620 offset: usize,
8621 _depth: fidl::encoding::Depth,
8622 ) -> fidl::Result<()> {
8623 decoder.debug_check_bounds::<Self>(offset);
8624 fidl::decode!(u32, D, &mut self.compositor_id, decoder, offset + 0, _depth)?;
8626 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 4, _depth)?;
8627 fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.matrix, decoder, offset + 16, _depth)?;
8628 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 52, _depth)?;
8629 Ok(())
8630 }
8631 }
8632
8633 impl fidl::encoding::ValueTypeMarker for SetDisplayMinimumRgbCmdHack {
8634 type Borrowed<'a> = &'a Self;
8635 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8636 value
8637 }
8638 }
8639
8640 unsafe impl fidl::encoding::TypeMarker for SetDisplayMinimumRgbCmdHack {
8641 type Owned = Self;
8642
8643 #[inline(always)]
8644 fn inline_align(_context: fidl::encoding::Context) -> usize {
8645 1
8646 }
8647
8648 #[inline(always)]
8649 fn inline_size(_context: fidl::encoding::Context) -> usize {
8650 1
8651 }
8652 #[inline(always)]
8653 fn encode_is_copy() -> bool {
8654 true
8655 }
8656
8657 #[inline(always)]
8658 fn decode_is_copy() -> bool {
8659 true
8660 }
8661 }
8662
8663 unsafe impl<D: fidl::encoding::ResourceDialect>
8664 fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for &SetDisplayMinimumRgbCmdHack
8665 {
8666 #[inline]
8667 unsafe fn encode(
8668 self,
8669 encoder: &mut fidl::encoding::Encoder<'_, D>,
8670 offset: usize,
8671 _depth: fidl::encoding::Depth,
8672 ) -> fidl::Result<()> {
8673 encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8674 unsafe {
8675 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8677 (buf_ptr as *mut SetDisplayMinimumRgbCmdHack)
8678 .write_unaligned((self as *const SetDisplayMinimumRgbCmdHack).read());
8679 }
8682 Ok(())
8683 }
8684 }
8685 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
8686 fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for (T0,)
8687 {
8688 #[inline]
8689 unsafe fn encode(
8690 self,
8691 encoder: &mut fidl::encoding::Encoder<'_, D>,
8692 offset: usize,
8693 depth: fidl::encoding::Depth,
8694 ) -> fidl::Result<()> {
8695 encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8696 self.0.encode(encoder, offset + 0, depth)?;
8700 Ok(())
8701 }
8702 }
8703
8704 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8705 for SetDisplayMinimumRgbCmdHack
8706 {
8707 #[inline(always)]
8708 fn new_empty() -> Self {
8709 Self { min_value: fidl::new_empty!(u8, D) }
8710 }
8711
8712 #[inline]
8713 unsafe fn decode(
8714 &mut self,
8715 decoder: &mut fidl::encoding::Decoder<'_, D>,
8716 offset: usize,
8717 _depth: fidl::encoding::Depth,
8718 ) -> fidl::Result<()> {
8719 decoder.debug_check_bounds::<Self>(offset);
8720 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8721 unsafe {
8724 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
8725 }
8726 Ok(())
8727 }
8728 }
8729
8730 impl fidl::encoding::ValueTypeMarker for SetDisplayRotationCmdHack {
8731 type Borrowed<'a> = &'a Self;
8732 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8733 value
8734 }
8735 }
8736
8737 unsafe impl fidl::encoding::TypeMarker for SetDisplayRotationCmdHack {
8738 type Owned = Self;
8739
8740 #[inline(always)]
8741 fn inline_align(_context: fidl::encoding::Context) -> usize {
8742 4
8743 }
8744
8745 #[inline(always)]
8746 fn inline_size(_context: fidl::encoding::Context) -> usize {
8747 8
8748 }
8749 #[inline(always)]
8750 fn encode_is_copy() -> bool {
8751 true
8752 }
8753
8754 #[inline(always)]
8755 fn decode_is_copy() -> bool {
8756 true
8757 }
8758 }
8759
8760 unsafe impl<D: fidl::encoding::ResourceDialect>
8761 fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for &SetDisplayRotationCmdHack
8762 {
8763 #[inline]
8764 unsafe fn encode(
8765 self,
8766 encoder: &mut fidl::encoding::Encoder<'_, D>,
8767 offset: usize,
8768 _depth: fidl::encoding::Depth,
8769 ) -> fidl::Result<()> {
8770 encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8771 unsafe {
8772 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8774 (buf_ptr as *mut SetDisplayRotationCmdHack)
8775 .write_unaligned((self as *const SetDisplayRotationCmdHack).read());
8776 }
8779 Ok(())
8780 }
8781 }
8782 unsafe impl<
8783 D: fidl::encoding::ResourceDialect,
8784 T0: fidl::encoding::Encode<u32, D>,
8785 T1: fidl::encoding::Encode<u32, D>,
8786 > fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for (T0, T1)
8787 {
8788 #[inline]
8789 unsafe fn encode(
8790 self,
8791 encoder: &mut fidl::encoding::Encoder<'_, D>,
8792 offset: usize,
8793 depth: fidl::encoding::Depth,
8794 ) -> fidl::Result<()> {
8795 encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8796 self.0.encode(encoder, offset + 0, depth)?;
8800 self.1.encode(encoder, offset + 4, depth)?;
8801 Ok(())
8802 }
8803 }
8804
8805 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8806 for SetDisplayRotationCmdHack
8807 {
8808 #[inline(always)]
8809 fn new_empty() -> Self {
8810 Self {
8811 compositor_id: fidl::new_empty!(u32, D),
8812 rotation_degrees: fidl::new_empty!(u32, D),
8813 }
8814 }
8815
8816 #[inline]
8817 unsafe fn decode(
8818 &mut self,
8819 decoder: &mut fidl::encoding::Decoder<'_, D>,
8820 offset: usize,
8821 _depth: fidl::encoding::Depth,
8822 ) -> fidl::Result<()> {
8823 decoder.debug_check_bounds::<Self>(offset);
8824 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8825 unsafe {
8828 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8829 }
8830 Ok(())
8831 }
8832 }
8833
8834 impl fidl::encoding::ValueTypeMarker for SetEnableDebugViewBoundsCmd {
8835 type Borrowed<'a> = &'a Self;
8836 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8837 value
8838 }
8839 }
8840
8841 unsafe impl fidl::encoding::TypeMarker for SetEnableDebugViewBoundsCmd {
8842 type Owned = Self;
8843
8844 #[inline(always)]
8845 fn inline_align(_context: fidl::encoding::Context) -> usize {
8846 4
8847 }
8848
8849 #[inline(always)]
8850 fn inline_size(_context: fidl::encoding::Context) -> usize {
8851 8
8852 }
8853 }
8854
8855 unsafe impl<D: fidl::encoding::ResourceDialect>
8856 fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for &SetEnableDebugViewBoundsCmd
8857 {
8858 #[inline]
8859 unsafe fn encode(
8860 self,
8861 encoder: &mut fidl::encoding::Encoder<'_, D>,
8862 offset: usize,
8863 _depth: fidl::encoding::Depth,
8864 ) -> fidl::Result<()> {
8865 encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8866 fidl::encoding::Encode::<SetEnableDebugViewBoundsCmd, D>::encode(
8868 (
8869 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
8870 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable),
8871 ),
8872 encoder,
8873 offset,
8874 _depth,
8875 )
8876 }
8877 }
8878 unsafe impl<
8879 D: fidl::encoding::ResourceDialect,
8880 T0: fidl::encoding::Encode<u32, D>,
8881 T1: fidl::encoding::Encode<bool, D>,
8882 > fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for (T0, T1)
8883 {
8884 #[inline]
8885 unsafe fn encode(
8886 self,
8887 encoder: &mut fidl::encoding::Encoder<'_, D>,
8888 offset: usize,
8889 depth: fidl::encoding::Depth,
8890 ) -> fidl::Result<()> {
8891 encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8892 unsafe {
8895 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8896 (ptr as *mut u32).write_unaligned(0);
8897 }
8898 self.0.encode(encoder, offset + 0, depth)?;
8900 self.1.encode(encoder, offset + 4, depth)?;
8901 Ok(())
8902 }
8903 }
8904
8905 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8906 for SetEnableDebugViewBoundsCmd
8907 {
8908 #[inline(always)]
8909 fn new_empty() -> Self {
8910 Self { view_id: fidl::new_empty!(u32, D), enable: fidl::new_empty!(bool, D) }
8911 }
8912
8913 #[inline]
8914 unsafe fn decode(
8915 &mut self,
8916 decoder: &mut fidl::encoding::Decoder<'_, D>,
8917 offset: usize,
8918 _depth: fidl::encoding::Depth,
8919 ) -> fidl::Result<()> {
8920 decoder.debug_check_bounds::<Self>(offset);
8921 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8923 let padval = unsafe { (ptr as *const u32).read_unaligned() };
8924 let mask = 0xffffff00u32;
8925 let maskedval = padval & mask;
8926 if maskedval != 0 {
8927 return Err(fidl::Error::NonZeroPadding {
8928 padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8929 });
8930 }
8931 fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
8932 fidl::decode!(bool, D, &mut self.enable, decoder, offset + 4, _depth)?;
8933 Ok(())
8934 }
8935 }
8936
8937 impl fidl::encoding::ValueTypeMarker for SetEventMaskCmd {
8938 type Borrowed<'a> = &'a Self;
8939 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8940 value
8941 }
8942 }
8943
8944 unsafe impl fidl::encoding::TypeMarker for SetEventMaskCmd {
8945 type Owned = Self;
8946
8947 #[inline(always)]
8948 fn inline_align(_context: fidl::encoding::Context) -> usize {
8949 4
8950 }
8951
8952 #[inline(always)]
8953 fn inline_size(_context: fidl::encoding::Context) -> usize {
8954 8
8955 }
8956 #[inline(always)]
8957 fn encode_is_copy() -> bool {
8958 true
8959 }
8960
8961 #[inline(always)]
8962 fn decode_is_copy() -> bool {
8963 true
8964 }
8965 }
8966
8967 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetEventMaskCmd, D>
8968 for &SetEventMaskCmd
8969 {
8970 #[inline]
8971 unsafe fn encode(
8972 self,
8973 encoder: &mut fidl::encoding::Encoder<'_, D>,
8974 offset: usize,
8975 _depth: fidl::encoding::Depth,
8976 ) -> fidl::Result<()> {
8977 encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
8978 unsafe {
8979 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8981 (buf_ptr as *mut SetEventMaskCmd)
8982 .write_unaligned((self as *const SetEventMaskCmd).read());
8983 }
8986 Ok(())
8987 }
8988 }
8989 unsafe impl<
8990 D: fidl::encoding::ResourceDialect,
8991 T0: fidl::encoding::Encode<u32, D>,
8992 T1: fidl::encoding::Encode<u32, D>,
8993 > fidl::encoding::Encode<SetEventMaskCmd, D> for (T0, T1)
8994 {
8995 #[inline]
8996 unsafe fn encode(
8997 self,
8998 encoder: &mut fidl::encoding::Encoder<'_, D>,
8999 offset: usize,
9000 depth: fidl::encoding::Depth,
9001 ) -> fidl::Result<()> {
9002 encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
9003 self.0.encode(encoder, offset + 0, depth)?;
9007 self.1.encode(encoder, offset + 4, depth)?;
9008 Ok(())
9009 }
9010 }
9011
9012 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetEventMaskCmd {
9013 #[inline(always)]
9014 fn new_empty() -> Self {
9015 Self { id: fidl::new_empty!(u32, D), event_mask: fidl::new_empty!(u32, D) }
9016 }
9017
9018 #[inline]
9019 unsafe fn decode(
9020 &mut self,
9021 decoder: &mut fidl::encoding::Decoder<'_, D>,
9022 offset: usize,
9023 _depth: fidl::encoding::Depth,
9024 ) -> fidl::Result<()> {
9025 decoder.debug_check_bounds::<Self>(offset);
9026 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9027 unsafe {
9030 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9031 }
9032 Ok(())
9033 }
9034 }
9035
9036 impl fidl::encoding::ValueTypeMarker for SetHitTestBehaviorCmd {
9037 type Borrowed<'a> = &'a Self;
9038 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9039 value
9040 }
9041 }
9042
9043 unsafe impl fidl::encoding::TypeMarker for SetHitTestBehaviorCmd {
9044 type Owned = Self;
9045
9046 #[inline(always)]
9047 fn inline_align(_context: fidl::encoding::Context) -> usize {
9048 4
9049 }
9050
9051 #[inline(always)]
9052 fn inline_size(_context: fidl::encoding::Context) -> usize {
9053 8
9054 }
9055 }
9056
9057 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetHitTestBehaviorCmd, D>
9058 for &SetHitTestBehaviorCmd
9059 {
9060 #[inline]
9061 unsafe fn encode(
9062 self,
9063 encoder: &mut fidl::encoding::Encoder<'_, D>,
9064 offset: usize,
9065 _depth: fidl::encoding::Depth,
9066 ) -> fidl::Result<()> {
9067 encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9068 fidl::encoding::Encode::<SetHitTestBehaviorCmd, D>::encode(
9070 (
9071 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9072 <HitTestBehavior as fidl::encoding::ValueTypeMarker>::borrow(
9073 &self.hit_test_behavior,
9074 ),
9075 ),
9076 encoder,
9077 offset,
9078 _depth,
9079 )
9080 }
9081 }
9082 unsafe impl<
9083 D: fidl::encoding::ResourceDialect,
9084 T0: fidl::encoding::Encode<u32, D>,
9085 T1: fidl::encoding::Encode<HitTestBehavior, D>,
9086 > fidl::encoding::Encode<SetHitTestBehaviorCmd, D> for (T0, T1)
9087 {
9088 #[inline]
9089 unsafe fn encode(
9090 self,
9091 encoder: &mut fidl::encoding::Encoder<'_, D>,
9092 offset: usize,
9093 depth: fidl::encoding::Depth,
9094 ) -> fidl::Result<()> {
9095 encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9096 self.0.encode(encoder, offset + 0, depth)?;
9100 self.1.encode(encoder, offset + 4, depth)?;
9101 Ok(())
9102 }
9103 }
9104
9105 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetHitTestBehaviorCmd {
9106 #[inline(always)]
9107 fn new_empty() -> Self {
9108 Self {
9109 node_id: fidl::new_empty!(u32, D),
9110 hit_test_behavior: fidl::new_empty!(HitTestBehavior, D),
9111 }
9112 }
9113
9114 #[inline]
9115 unsafe fn decode(
9116 &mut self,
9117 decoder: &mut fidl::encoding::Decoder<'_, D>,
9118 offset: usize,
9119 _depth: fidl::encoding::Depth,
9120 ) -> fidl::Result<()> {
9121 decoder.debug_check_bounds::<Self>(offset);
9122 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9124 fidl::decode!(
9125 HitTestBehavior,
9126 D,
9127 &mut self.hit_test_behavior,
9128 decoder,
9129 offset + 4,
9130 _depth
9131 )?;
9132 Ok(())
9133 }
9134 }
9135
9136 impl fidl::encoding::ValueTypeMarker for SetImportFocusCmdDeprecated {
9137 type Borrowed<'a> = &'a Self;
9138 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9139 value
9140 }
9141 }
9142
9143 unsafe impl fidl::encoding::TypeMarker for SetImportFocusCmdDeprecated {
9144 type Owned = Self;
9145
9146 #[inline(always)]
9147 fn inline_align(_context: fidl::encoding::Context) -> usize {
9148 1
9149 }
9150
9151 #[inline(always)]
9152 fn inline_size(_context: fidl::encoding::Context) -> usize {
9153 1
9154 }
9155 }
9156
9157 unsafe impl<D: fidl::encoding::ResourceDialect>
9158 fidl::encoding::Encode<SetImportFocusCmdDeprecated, D> for &SetImportFocusCmdDeprecated
9159 {
9160 #[inline]
9161 unsafe fn encode(
9162 self,
9163 encoder: &mut fidl::encoding::Encoder<'_, D>,
9164 offset: usize,
9165 _depth: fidl::encoding::Depth,
9166 ) -> fidl::Result<()> {
9167 encoder.debug_check_bounds::<SetImportFocusCmdDeprecated>(offset);
9168 encoder.write_num(0u8, offset);
9169 Ok(())
9170 }
9171 }
9172
9173 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9174 for SetImportFocusCmdDeprecated
9175 {
9176 #[inline(always)]
9177 fn new_empty() -> Self {
9178 Self
9179 }
9180
9181 #[inline]
9182 unsafe fn decode(
9183 &mut self,
9184 decoder: &mut fidl::encoding::Decoder<'_, D>,
9185 offset: usize,
9186 _depth: fidl::encoding::Depth,
9187 ) -> fidl::Result<()> {
9188 decoder.debug_check_bounds::<Self>(offset);
9189 match decoder.read_num::<u8>(offset) {
9190 0 => Ok(()),
9191 _ => Err(fidl::Error::Invalid),
9192 }
9193 }
9194 }
9195
9196 impl fidl::encoding::ValueTypeMarker for SetLabelCmd {
9197 type Borrowed<'a> = &'a Self;
9198 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9199 value
9200 }
9201 }
9202
9203 unsafe impl fidl::encoding::TypeMarker for SetLabelCmd {
9204 type Owned = Self;
9205
9206 #[inline(always)]
9207 fn inline_align(_context: fidl::encoding::Context) -> usize {
9208 8
9209 }
9210
9211 #[inline(always)]
9212 fn inline_size(_context: fidl::encoding::Context) -> usize {
9213 24
9214 }
9215 }
9216
9217 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLabelCmd, D>
9218 for &SetLabelCmd
9219 {
9220 #[inline]
9221 unsafe fn encode(
9222 self,
9223 encoder: &mut fidl::encoding::Encoder<'_, D>,
9224 offset: usize,
9225 _depth: fidl::encoding::Depth,
9226 ) -> fidl::Result<()> {
9227 encoder.debug_check_bounds::<SetLabelCmd>(offset);
9228 fidl::encoding::Encode::<SetLabelCmd, D>::encode(
9230 (
9231 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9232 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9233 &self.label,
9234 ),
9235 ),
9236 encoder,
9237 offset,
9238 _depth,
9239 )
9240 }
9241 }
9242 unsafe impl<
9243 D: fidl::encoding::ResourceDialect,
9244 T0: fidl::encoding::Encode<u32, D>,
9245 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9246 > fidl::encoding::Encode<SetLabelCmd, D> for (T0, T1)
9247 {
9248 #[inline]
9249 unsafe fn encode(
9250 self,
9251 encoder: &mut fidl::encoding::Encoder<'_, D>,
9252 offset: usize,
9253 depth: fidl::encoding::Depth,
9254 ) -> fidl::Result<()> {
9255 encoder.debug_check_bounds::<SetLabelCmd>(offset);
9256 unsafe {
9259 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9260 (ptr as *mut u64).write_unaligned(0);
9261 }
9262 self.0.encode(encoder, offset + 0, depth)?;
9264 self.1.encode(encoder, offset + 8, depth)?;
9265 Ok(())
9266 }
9267 }
9268
9269 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLabelCmd {
9270 #[inline(always)]
9271 fn new_empty() -> Self {
9272 Self {
9273 id: fidl::new_empty!(u32, D),
9274 label: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9275 }
9276 }
9277
9278 #[inline]
9279 unsafe fn decode(
9280 &mut self,
9281 decoder: &mut fidl::encoding::Decoder<'_, D>,
9282 offset: usize,
9283 _depth: fidl::encoding::Depth,
9284 ) -> fidl::Result<()> {
9285 decoder.debug_check_bounds::<Self>(offset);
9286 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9288 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9289 let mask = 0xffffffff00000000u64;
9290 let maskedval = padval & mask;
9291 if maskedval != 0 {
9292 return Err(fidl::Error::NonZeroPadding {
9293 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9294 });
9295 }
9296 fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
9297 fidl::decode!(
9298 fidl::encoding::UnboundedString,
9299 D,
9300 &mut self.label,
9301 decoder,
9302 offset + 8,
9303 _depth
9304 )?;
9305 Ok(())
9306 }
9307 }
9308
9309 impl fidl::encoding::ValueTypeMarker for SetLayerStackCmd {
9310 type Borrowed<'a> = &'a Self;
9311 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9312 value
9313 }
9314 }
9315
9316 unsafe impl fidl::encoding::TypeMarker for SetLayerStackCmd {
9317 type Owned = Self;
9318
9319 #[inline(always)]
9320 fn inline_align(_context: fidl::encoding::Context) -> usize {
9321 4
9322 }
9323
9324 #[inline(always)]
9325 fn inline_size(_context: fidl::encoding::Context) -> usize {
9326 8
9327 }
9328 #[inline(always)]
9329 fn encode_is_copy() -> bool {
9330 true
9331 }
9332
9333 #[inline(always)]
9334 fn decode_is_copy() -> bool {
9335 true
9336 }
9337 }
9338
9339 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLayerStackCmd, D>
9340 for &SetLayerStackCmd
9341 {
9342 #[inline]
9343 unsafe fn encode(
9344 self,
9345 encoder: &mut fidl::encoding::Encoder<'_, D>,
9346 offset: usize,
9347 _depth: fidl::encoding::Depth,
9348 ) -> fidl::Result<()> {
9349 encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9350 unsafe {
9351 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9353 (buf_ptr as *mut SetLayerStackCmd)
9354 .write_unaligned((self as *const SetLayerStackCmd).read());
9355 }
9358 Ok(())
9359 }
9360 }
9361 unsafe impl<
9362 D: fidl::encoding::ResourceDialect,
9363 T0: fidl::encoding::Encode<u32, D>,
9364 T1: fidl::encoding::Encode<u32, D>,
9365 > fidl::encoding::Encode<SetLayerStackCmd, D> for (T0, T1)
9366 {
9367 #[inline]
9368 unsafe fn encode(
9369 self,
9370 encoder: &mut fidl::encoding::Encoder<'_, D>,
9371 offset: usize,
9372 depth: fidl::encoding::Depth,
9373 ) -> fidl::Result<()> {
9374 encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9375 self.0.encode(encoder, offset + 0, depth)?;
9379 self.1.encode(encoder, offset + 4, depth)?;
9380 Ok(())
9381 }
9382 }
9383
9384 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLayerStackCmd {
9385 #[inline(always)]
9386 fn new_empty() -> Self {
9387 Self {
9388 compositor_id: fidl::new_empty!(u32, D),
9389 layer_stack_id: fidl::new_empty!(u32, D),
9390 }
9391 }
9392
9393 #[inline]
9394 unsafe fn decode(
9395 &mut self,
9396 decoder: &mut fidl::encoding::Decoder<'_, D>,
9397 offset: usize,
9398 _depth: fidl::encoding::Depth,
9399 ) -> fidl::Result<()> {
9400 decoder.debug_check_bounds::<Self>(offset);
9401 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9402 unsafe {
9405 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9406 }
9407 Ok(())
9408 }
9409 }
9410
9411 impl fidl::encoding::ValueTypeMarker for SetLightColorCmd {
9412 type Borrowed<'a> = &'a Self;
9413 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9414 value
9415 }
9416 }
9417
9418 unsafe impl fidl::encoding::TypeMarker for SetLightColorCmd {
9419 type Owned = Self;
9420
9421 #[inline(always)]
9422 fn inline_align(_context: fidl::encoding::Context) -> usize {
9423 4
9424 }
9425
9426 #[inline(always)]
9427 fn inline_size(_context: fidl::encoding::Context) -> usize {
9428 20
9429 }
9430 }
9431
9432 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightColorCmd, D>
9433 for &SetLightColorCmd
9434 {
9435 #[inline]
9436 unsafe fn encode(
9437 self,
9438 encoder: &mut fidl::encoding::Encoder<'_, D>,
9439 offset: usize,
9440 _depth: fidl::encoding::Depth,
9441 ) -> fidl::Result<()> {
9442 encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9443 fidl::encoding::Encode::<SetLightColorCmd, D>::encode(
9445 (
9446 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9447 <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
9448 ),
9449 encoder,
9450 offset,
9451 _depth,
9452 )
9453 }
9454 }
9455 unsafe impl<
9456 D: fidl::encoding::ResourceDialect,
9457 T0: fidl::encoding::Encode<u32, D>,
9458 T1: fidl::encoding::Encode<ColorRgbValue, D>,
9459 > fidl::encoding::Encode<SetLightColorCmd, D> for (T0, T1)
9460 {
9461 #[inline]
9462 unsafe fn encode(
9463 self,
9464 encoder: &mut fidl::encoding::Encoder<'_, D>,
9465 offset: usize,
9466 depth: fidl::encoding::Depth,
9467 ) -> fidl::Result<()> {
9468 encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9469 self.0.encode(encoder, offset + 0, depth)?;
9473 self.1.encode(encoder, offset + 4, depth)?;
9474 Ok(())
9475 }
9476 }
9477
9478 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightColorCmd {
9479 #[inline(always)]
9480 fn new_empty() -> Self {
9481 Self { light_id: fidl::new_empty!(u32, D), color: fidl::new_empty!(ColorRgbValue, D) }
9482 }
9483
9484 #[inline]
9485 unsafe fn decode(
9486 &mut self,
9487 decoder: &mut fidl::encoding::Decoder<'_, D>,
9488 offset: usize,
9489 _depth: fidl::encoding::Depth,
9490 ) -> fidl::Result<()> {
9491 decoder.debug_check_bounds::<Self>(offset);
9492 fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9494 fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
9495 Ok(())
9496 }
9497 }
9498
9499 impl fidl::encoding::ValueTypeMarker for SetLightDirectionCmd {
9500 type Borrowed<'a> = &'a Self;
9501 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9502 value
9503 }
9504 }
9505
9506 unsafe impl fidl::encoding::TypeMarker for SetLightDirectionCmd {
9507 type Owned = Self;
9508
9509 #[inline(always)]
9510 fn inline_align(_context: fidl::encoding::Context) -> usize {
9511 4
9512 }
9513
9514 #[inline(always)]
9515 fn inline_size(_context: fidl::encoding::Context) -> usize {
9516 20
9517 }
9518 }
9519
9520 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightDirectionCmd, D>
9521 for &SetLightDirectionCmd
9522 {
9523 #[inline]
9524 unsafe fn encode(
9525 self,
9526 encoder: &mut fidl::encoding::Encoder<'_, D>,
9527 offset: usize,
9528 _depth: fidl::encoding::Depth,
9529 ) -> fidl::Result<()> {
9530 encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9531 fidl::encoding::Encode::<SetLightDirectionCmd, D>::encode(
9533 (
9534 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9535 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.direction),
9536 ),
9537 encoder,
9538 offset,
9539 _depth,
9540 )
9541 }
9542 }
9543 unsafe impl<
9544 D: fidl::encoding::ResourceDialect,
9545 T0: fidl::encoding::Encode<u32, D>,
9546 T1: fidl::encoding::Encode<Vector3Value, D>,
9547 > fidl::encoding::Encode<SetLightDirectionCmd, D> for (T0, T1)
9548 {
9549 #[inline]
9550 unsafe fn encode(
9551 self,
9552 encoder: &mut fidl::encoding::Encoder<'_, D>,
9553 offset: usize,
9554 depth: fidl::encoding::Depth,
9555 ) -> fidl::Result<()> {
9556 encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9557 self.0.encode(encoder, offset + 0, depth)?;
9561 self.1.encode(encoder, offset + 4, depth)?;
9562 Ok(())
9563 }
9564 }
9565
9566 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightDirectionCmd {
9567 #[inline(always)]
9568 fn new_empty() -> Self {
9569 Self {
9570 light_id: fidl::new_empty!(u32, D),
9571 direction: fidl::new_empty!(Vector3Value, D),
9572 }
9573 }
9574
9575 #[inline]
9576 unsafe fn decode(
9577 &mut self,
9578 decoder: &mut fidl::encoding::Decoder<'_, D>,
9579 offset: usize,
9580 _depth: fidl::encoding::Depth,
9581 ) -> fidl::Result<()> {
9582 decoder.debug_check_bounds::<Self>(offset);
9583 fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9585 fidl::decode!(Vector3Value, D, &mut self.direction, decoder, offset + 4, _depth)?;
9586 Ok(())
9587 }
9588 }
9589
9590 impl fidl::encoding::ValueTypeMarker for SetMaterialCmd {
9591 type Borrowed<'a> = &'a Self;
9592 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9593 value
9594 }
9595 }
9596
9597 unsafe impl fidl::encoding::TypeMarker for SetMaterialCmd {
9598 type Owned = Self;
9599
9600 #[inline(always)]
9601 fn inline_align(_context: fidl::encoding::Context) -> usize {
9602 4
9603 }
9604
9605 #[inline(always)]
9606 fn inline_size(_context: fidl::encoding::Context) -> usize {
9607 8
9608 }
9609 #[inline(always)]
9610 fn encode_is_copy() -> bool {
9611 true
9612 }
9613
9614 #[inline(always)]
9615 fn decode_is_copy() -> bool {
9616 true
9617 }
9618 }
9619
9620 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetMaterialCmd, D>
9621 for &SetMaterialCmd
9622 {
9623 #[inline]
9624 unsafe fn encode(
9625 self,
9626 encoder: &mut fidl::encoding::Encoder<'_, D>,
9627 offset: usize,
9628 _depth: fidl::encoding::Depth,
9629 ) -> fidl::Result<()> {
9630 encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9631 unsafe {
9632 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9634 (buf_ptr as *mut SetMaterialCmd)
9635 .write_unaligned((self as *const SetMaterialCmd).read());
9636 }
9639 Ok(())
9640 }
9641 }
9642 unsafe impl<
9643 D: fidl::encoding::ResourceDialect,
9644 T0: fidl::encoding::Encode<u32, D>,
9645 T1: fidl::encoding::Encode<u32, D>,
9646 > fidl::encoding::Encode<SetMaterialCmd, D> for (T0, T1)
9647 {
9648 #[inline]
9649 unsafe fn encode(
9650 self,
9651 encoder: &mut fidl::encoding::Encoder<'_, D>,
9652 offset: usize,
9653 depth: fidl::encoding::Depth,
9654 ) -> fidl::Result<()> {
9655 encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9656 self.0.encode(encoder, offset + 0, depth)?;
9660 self.1.encode(encoder, offset + 4, depth)?;
9661 Ok(())
9662 }
9663 }
9664
9665 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetMaterialCmd {
9666 #[inline(always)]
9667 fn new_empty() -> Self {
9668 Self { node_id: fidl::new_empty!(u32, D), material_id: fidl::new_empty!(u32, D) }
9669 }
9670
9671 #[inline]
9672 unsafe fn decode(
9673 &mut self,
9674 decoder: &mut fidl::encoding::Decoder<'_, D>,
9675 offset: usize,
9676 _depth: fidl::encoding::Depth,
9677 ) -> fidl::Result<()> {
9678 decoder.debug_check_bounds::<Self>(offset);
9679 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9680 unsafe {
9683 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9684 }
9685 Ok(())
9686 }
9687 }
9688
9689 impl fidl::encoding::ValueTypeMarker for SetOpacityCmd {
9690 type Borrowed<'a> = &'a Self;
9691 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9692 value
9693 }
9694 }
9695
9696 unsafe impl fidl::encoding::TypeMarker for SetOpacityCmd {
9697 type Owned = Self;
9698
9699 #[inline(always)]
9700 fn inline_align(_context: fidl::encoding::Context) -> usize {
9701 4
9702 }
9703
9704 #[inline(always)]
9705 fn inline_size(_context: fidl::encoding::Context) -> usize {
9706 8
9707 }
9708 }
9709
9710 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetOpacityCmd, D>
9711 for &SetOpacityCmd
9712 {
9713 #[inline]
9714 unsafe fn encode(
9715 self,
9716 encoder: &mut fidl::encoding::Encoder<'_, D>,
9717 offset: usize,
9718 _depth: fidl::encoding::Depth,
9719 ) -> fidl::Result<()> {
9720 encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9721 fidl::encoding::Encode::<SetOpacityCmd, D>::encode(
9723 (
9724 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9725 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.opacity),
9726 ),
9727 encoder,
9728 offset,
9729 _depth,
9730 )
9731 }
9732 }
9733 unsafe impl<
9734 D: fidl::encoding::ResourceDialect,
9735 T0: fidl::encoding::Encode<u32, D>,
9736 T1: fidl::encoding::Encode<f32, D>,
9737 > fidl::encoding::Encode<SetOpacityCmd, D> for (T0, T1)
9738 {
9739 #[inline]
9740 unsafe fn encode(
9741 self,
9742 encoder: &mut fidl::encoding::Encoder<'_, D>,
9743 offset: usize,
9744 depth: fidl::encoding::Depth,
9745 ) -> fidl::Result<()> {
9746 encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9747 self.0.encode(encoder, offset + 0, depth)?;
9751 self.1.encode(encoder, offset + 4, depth)?;
9752 Ok(())
9753 }
9754 }
9755
9756 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetOpacityCmd {
9757 #[inline(always)]
9758 fn new_empty() -> Self {
9759 Self { node_id: fidl::new_empty!(u32, D), opacity: fidl::new_empty!(f32, D) }
9760 }
9761
9762 #[inline]
9763 unsafe fn decode(
9764 &mut self,
9765 decoder: &mut fidl::encoding::Decoder<'_, D>,
9766 offset: usize,
9767 _depth: fidl::encoding::Depth,
9768 ) -> fidl::Result<()> {
9769 decoder.debug_check_bounds::<Self>(offset);
9770 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9772 fidl::decode!(f32, D, &mut self.opacity, decoder, offset + 4, _depth)?;
9773 Ok(())
9774 }
9775 }
9776
9777 impl fidl::encoding::ValueTypeMarker for SetPointLightFalloffCmd {
9778 type Borrowed<'a> = &'a Self;
9779 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9780 value
9781 }
9782 }
9783
9784 unsafe impl fidl::encoding::TypeMarker for SetPointLightFalloffCmd {
9785 type Owned = Self;
9786
9787 #[inline(always)]
9788 fn inline_align(_context: fidl::encoding::Context) -> usize {
9789 4
9790 }
9791
9792 #[inline(always)]
9793 fn inline_size(_context: fidl::encoding::Context) -> usize {
9794 12
9795 }
9796 }
9797
9798 unsafe impl<D: fidl::encoding::ResourceDialect>
9799 fidl::encoding::Encode<SetPointLightFalloffCmd, D> for &SetPointLightFalloffCmd
9800 {
9801 #[inline]
9802 unsafe fn encode(
9803 self,
9804 encoder: &mut fidl::encoding::Encoder<'_, D>,
9805 offset: usize,
9806 _depth: fidl::encoding::Depth,
9807 ) -> fidl::Result<()> {
9808 encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9809 fidl::encoding::Encode::<SetPointLightFalloffCmd, D>::encode(
9811 (
9812 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9813 <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.falloff),
9814 ),
9815 encoder,
9816 offset,
9817 _depth,
9818 )
9819 }
9820 }
9821 unsafe impl<
9822 D: fidl::encoding::ResourceDialect,
9823 T0: fidl::encoding::Encode<u32, D>,
9824 T1: fidl::encoding::Encode<FloatValue, D>,
9825 > fidl::encoding::Encode<SetPointLightFalloffCmd, D> for (T0, T1)
9826 {
9827 #[inline]
9828 unsafe fn encode(
9829 self,
9830 encoder: &mut fidl::encoding::Encoder<'_, D>,
9831 offset: usize,
9832 depth: fidl::encoding::Depth,
9833 ) -> fidl::Result<()> {
9834 encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9835 self.0.encode(encoder, offset + 0, depth)?;
9839 self.1.encode(encoder, offset + 4, depth)?;
9840 Ok(())
9841 }
9842 }
9843
9844 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9845 for SetPointLightFalloffCmd
9846 {
9847 #[inline(always)]
9848 fn new_empty() -> Self {
9849 Self { light_id: fidl::new_empty!(u32, D), falloff: fidl::new_empty!(FloatValue, D) }
9850 }
9851
9852 #[inline]
9853 unsafe fn decode(
9854 &mut self,
9855 decoder: &mut fidl::encoding::Decoder<'_, D>,
9856 offset: usize,
9857 _depth: fidl::encoding::Depth,
9858 ) -> fidl::Result<()> {
9859 decoder.debug_check_bounds::<Self>(offset);
9860 fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9862 fidl::decode!(FloatValue, D, &mut self.falloff, decoder, offset + 4, _depth)?;
9863 Ok(())
9864 }
9865 }
9866
9867 impl fidl::encoding::ValueTypeMarker for SetPointLightPositionCmd {
9868 type Borrowed<'a> = &'a Self;
9869 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9870 value
9871 }
9872 }
9873
9874 unsafe impl fidl::encoding::TypeMarker for SetPointLightPositionCmd {
9875 type Owned = Self;
9876
9877 #[inline(always)]
9878 fn inline_align(_context: fidl::encoding::Context) -> usize {
9879 4
9880 }
9881
9882 #[inline(always)]
9883 fn inline_size(_context: fidl::encoding::Context) -> usize {
9884 20
9885 }
9886 }
9887
9888 unsafe impl<D: fidl::encoding::ResourceDialect>
9889 fidl::encoding::Encode<SetPointLightPositionCmd, D> for &SetPointLightPositionCmd
9890 {
9891 #[inline]
9892 unsafe fn encode(
9893 self,
9894 encoder: &mut fidl::encoding::Encoder<'_, D>,
9895 offset: usize,
9896 _depth: fidl::encoding::Depth,
9897 ) -> fidl::Result<()> {
9898 encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9899 fidl::encoding::Encode::<SetPointLightPositionCmd, D>::encode(
9901 (
9902 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9903 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.position),
9904 ),
9905 encoder,
9906 offset,
9907 _depth,
9908 )
9909 }
9910 }
9911 unsafe impl<
9912 D: fidl::encoding::ResourceDialect,
9913 T0: fidl::encoding::Encode<u32, D>,
9914 T1: fidl::encoding::Encode<Vector3Value, D>,
9915 > fidl::encoding::Encode<SetPointLightPositionCmd, D> for (T0, T1)
9916 {
9917 #[inline]
9918 unsafe fn encode(
9919 self,
9920 encoder: &mut fidl::encoding::Encoder<'_, D>,
9921 offset: usize,
9922 depth: fidl::encoding::Depth,
9923 ) -> fidl::Result<()> {
9924 encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9925 self.0.encode(encoder, offset + 0, depth)?;
9929 self.1.encode(encoder, offset + 4, depth)?;
9930 Ok(())
9931 }
9932 }
9933
9934 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9935 for SetPointLightPositionCmd
9936 {
9937 #[inline(always)]
9938 fn new_empty() -> Self {
9939 Self { light_id: fidl::new_empty!(u32, D), position: fidl::new_empty!(Vector3Value, D) }
9940 }
9941
9942 #[inline]
9943 unsafe fn decode(
9944 &mut self,
9945 decoder: &mut fidl::encoding::Decoder<'_, D>,
9946 offset: usize,
9947 _depth: fidl::encoding::Depth,
9948 ) -> fidl::Result<()> {
9949 decoder.debug_check_bounds::<Self>(offset);
9950 fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9952 fidl::decode!(Vector3Value, D, &mut self.position, decoder, offset + 4, _depth)?;
9953 Ok(())
9954 }
9955 }
9956
9957 impl fidl::encoding::ValueTypeMarker for SetRendererCmd {
9958 type Borrowed<'a> = &'a Self;
9959 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9960 value
9961 }
9962 }
9963
9964 unsafe impl fidl::encoding::TypeMarker for SetRendererCmd {
9965 type Owned = Self;
9966
9967 #[inline(always)]
9968 fn inline_align(_context: fidl::encoding::Context) -> usize {
9969 4
9970 }
9971
9972 #[inline(always)]
9973 fn inline_size(_context: fidl::encoding::Context) -> usize {
9974 8
9975 }
9976 #[inline(always)]
9977 fn encode_is_copy() -> bool {
9978 true
9979 }
9980
9981 #[inline(always)]
9982 fn decode_is_copy() -> bool {
9983 true
9984 }
9985 }
9986
9987 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererCmd, D>
9988 for &SetRendererCmd
9989 {
9990 #[inline]
9991 unsafe fn encode(
9992 self,
9993 encoder: &mut fidl::encoding::Encoder<'_, D>,
9994 offset: usize,
9995 _depth: fidl::encoding::Depth,
9996 ) -> fidl::Result<()> {
9997 encoder.debug_check_bounds::<SetRendererCmd>(offset);
9998 unsafe {
9999 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10001 (buf_ptr as *mut SetRendererCmd)
10002 .write_unaligned((self as *const SetRendererCmd).read());
10003 }
10006 Ok(())
10007 }
10008 }
10009 unsafe impl<
10010 D: fidl::encoding::ResourceDialect,
10011 T0: fidl::encoding::Encode<u32, D>,
10012 T1: fidl::encoding::Encode<u32, D>,
10013 > fidl::encoding::Encode<SetRendererCmd, D> for (T0, T1)
10014 {
10015 #[inline]
10016 unsafe fn encode(
10017 self,
10018 encoder: &mut fidl::encoding::Encoder<'_, D>,
10019 offset: usize,
10020 depth: fidl::encoding::Depth,
10021 ) -> fidl::Result<()> {
10022 encoder.debug_check_bounds::<SetRendererCmd>(offset);
10023 self.0.encode(encoder, offset + 0, depth)?;
10027 self.1.encode(encoder, offset + 4, depth)?;
10028 Ok(())
10029 }
10030 }
10031
10032 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererCmd {
10033 #[inline(always)]
10034 fn new_empty() -> Self {
10035 Self { layer_id: fidl::new_empty!(u32, D), renderer_id: fidl::new_empty!(u32, D) }
10036 }
10037
10038 #[inline]
10039 unsafe fn decode(
10040 &mut self,
10041 decoder: &mut fidl::encoding::Decoder<'_, D>,
10042 offset: usize,
10043 _depth: fidl::encoding::Depth,
10044 ) -> fidl::Result<()> {
10045 decoder.debug_check_bounds::<Self>(offset);
10046 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10047 unsafe {
10050 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10051 }
10052 Ok(())
10053 }
10054 }
10055
10056 impl fidl::encoding::ValueTypeMarker for SetRendererParamCmd {
10057 type Borrowed<'a> = &'a Self;
10058 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10059 value
10060 }
10061 }
10062
10063 unsafe impl fidl::encoding::TypeMarker for SetRendererParamCmd {
10064 type Owned = Self;
10065
10066 #[inline(always)]
10067 fn inline_align(_context: fidl::encoding::Context) -> usize {
10068 8
10069 }
10070
10071 #[inline(always)]
10072 fn inline_size(_context: fidl::encoding::Context) -> usize {
10073 24
10074 }
10075 }
10076
10077 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererParamCmd, D>
10078 for &SetRendererParamCmd
10079 {
10080 #[inline]
10081 unsafe fn encode(
10082 self,
10083 encoder: &mut fidl::encoding::Encoder<'_, D>,
10084 offset: usize,
10085 _depth: fidl::encoding::Depth,
10086 ) -> fidl::Result<()> {
10087 encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10088 fidl::encoding::Encode::<SetRendererParamCmd, D>::encode(
10090 (
10091 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
10092 <RendererParam as fidl::encoding::ValueTypeMarker>::borrow(&self.param),
10093 ),
10094 encoder,
10095 offset,
10096 _depth,
10097 )
10098 }
10099 }
10100 unsafe impl<
10101 D: fidl::encoding::ResourceDialect,
10102 T0: fidl::encoding::Encode<u32, D>,
10103 T1: fidl::encoding::Encode<RendererParam, D>,
10104 > fidl::encoding::Encode<SetRendererParamCmd, D> for (T0, T1)
10105 {
10106 #[inline]
10107 unsafe fn encode(
10108 self,
10109 encoder: &mut fidl::encoding::Encoder<'_, D>,
10110 offset: usize,
10111 depth: fidl::encoding::Depth,
10112 ) -> fidl::Result<()> {
10113 encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10114 unsafe {
10117 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10118 (ptr as *mut u64).write_unaligned(0);
10119 }
10120 self.0.encode(encoder, offset + 0, depth)?;
10122 self.1.encode(encoder, offset + 8, depth)?;
10123 Ok(())
10124 }
10125 }
10126
10127 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererParamCmd {
10128 #[inline(always)]
10129 fn new_empty() -> Self {
10130 Self {
10131 renderer_id: fidl::new_empty!(u32, D),
10132 param: fidl::new_empty!(RendererParam, D),
10133 }
10134 }
10135
10136 #[inline]
10137 unsafe fn decode(
10138 &mut self,
10139 decoder: &mut fidl::encoding::Decoder<'_, D>,
10140 offset: usize,
10141 _depth: fidl::encoding::Depth,
10142 ) -> fidl::Result<()> {
10143 decoder.debug_check_bounds::<Self>(offset);
10144 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10146 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10147 let mask = 0xffffffff00000000u64;
10148 let maskedval = padval & mask;
10149 if maskedval != 0 {
10150 return Err(fidl::Error::NonZeroPadding {
10151 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10152 });
10153 }
10154 fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
10155 fidl::decode!(RendererParam, D, &mut self.param, decoder, offset + 8, _depth)?;
10156 Ok(())
10157 }
10158 }
10159
10160 impl fidl::encoding::ValueTypeMarker for SetRotationCmd {
10161 type Borrowed<'a> = &'a Self;
10162 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10163 value
10164 }
10165 }
10166
10167 unsafe impl fidl::encoding::TypeMarker for SetRotationCmd {
10168 type Owned = Self;
10169
10170 #[inline(always)]
10171 fn inline_align(_context: fidl::encoding::Context) -> usize {
10172 4
10173 }
10174
10175 #[inline(always)]
10176 fn inline_size(_context: fidl::encoding::Context) -> usize {
10177 24
10178 }
10179 }
10180
10181 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRotationCmd, D>
10182 for &SetRotationCmd
10183 {
10184 #[inline]
10185 unsafe fn encode(
10186 self,
10187 encoder: &mut fidl::encoding::Encoder<'_, D>,
10188 offset: usize,
10189 _depth: fidl::encoding::Depth,
10190 ) -> fidl::Result<()> {
10191 encoder.debug_check_bounds::<SetRotationCmd>(offset);
10192 fidl::encoding::Encode::<SetRotationCmd, D>::encode(
10194 (
10195 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10196 <QuaternionValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10197 ),
10198 encoder,
10199 offset,
10200 _depth,
10201 )
10202 }
10203 }
10204 unsafe impl<
10205 D: fidl::encoding::ResourceDialect,
10206 T0: fidl::encoding::Encode<u32, D>,
10207 T1: fidl::encoding::Encode<QuaternionValue, D>,
10208 > fidl::encoding::Encode<SetRotationCmd, D> for (T0, T1)
10209 {
10210 #[inline]
10211 unsafe fn encode(
10212 self,
10213 encoder: &mut fidl::encoding::Encoder<'_, D>,
10214 offset: usize,
10215 depth: fidl::encoding::Depth,
10216 ) -> fidl::Result<()> {
10217 encoder.debug_check_bounds::<SetRotationCmd>(offset);
10218 self.0.encode(encoder, offset + 0, depth)?;
10222 self.1.encode(encoder, offset + 4, depth)?;
10223 Ok(())
10224 }
10225 }
10226
10227 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRotationCmd {
10228 #[inline(always)]
10229 fn new_empty() -> Self {
10230 Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(QuaternionValue, D) }
10231 }
10232
10233 #[inline]
10234 unsafe fn decode(
10235 &mut self,
10236 decoder: &mut fidl::encoding::Decoder<'_, D>,
10237 offset: usize,
10238 _depth: fidl::encoding::Depth,
10239 ) -> fidl::Result<()> {
10240 decoder.debug_check_bounds::<Self>(offset);
10241 fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10243 fidl::decode!(QuaternionValue, D, &mut self.value, decoder, offset + 4, _depth)?;
10244 Ok(())
10245 }
10246 }
10247
10248 impl fidl::encoding::ValueTypeMarker for SetScaleCmd {
10249 type Borrowed<'a> = &'a Self;
10250 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10251 value
10252 }
10253 }
10254
10255 unsafe impl fidl::encoding::TypeMarker for SetScaleCmd {
10256 type Owned = Self;
10257
10258 #[inline(always)]
10259 fn inline_align(_context: fidl::encoding::Context) -> usize {
10260 4
10261 }
10262
10263 #[inline(always)]
10264 fn inline_size(_context: fidl::encoding::Context) -> usize {
10265 20
10266 }
10267 }
10268
10269 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetScaleCmd, D>
10270 for &SetScaleCmd
10271 {
10272 #[inline]
10273 unsafe fn encode(
10274 self,
10275 encoder: &mut fidl::encoding::Encoder<'_, D>,
10276 offset: usize,
10277 _depth: fidl::encoding::Depth,
10278 ) -> fidl::Result<()> {
10279 encoder.debug_check_bounds::<SetScaleCmd>(offset);
10280 fidl::encoding::Encode::<SetScaleCmd, D>::encode(
10282 (
10283 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10284 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10285 ),
10286 encoder,
10287 offset,
10288 _depth,
10289 )
10290 }
10291 }
10292 unsafe impl<
10293 D: fidl::encoding::ResourceDialect,
10294 T0: fidl::encoding::Encode<u32, D>,
10295 T1: fidl::encoding::Encode<Vector3Value, D>,
10296 > fidl::encoding::Encode<SetScaleCmd, D> for (T0, T1)
10297 {
10298 #[inline]
10299 unsafe fn encode(
10300 self,
10301 encoder: &mut fidl::encoding::Encoder<'_, D>,
10302 offset: usize,
10303 depth: fidl::encoding::Depth,
10304 ) -> fidl::Result<()> {
10305 encoder.debug_check_bounds::<SetScaleCmd>(offset);
10306 self.0.encode(encoder, offset + 0, depth)?;
10310 self.1.encode(encoder, offset + 4, depth)?;
10311 Ok(())
10312 }
10313 }
10314
10315 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetScaleCmd {
10316 #[inline(always)]
10317 fn new_empty() -> Self {
10318 Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
10319 }
10320
10321 #[inline]
10322 unsafe fn decode(
10323 &mut self,
10324 decoder: &mut fidl::encoding::Decoder<'_, D>,
10325 offset: usize,
10326 _depth: fidl::encoding::Depth,
10327 ) -> fidl::Result<()> {
10328 decoder.debug_check_bounds::<Self>(offset);
10329 fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10331 fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10332 Ok(())
10333 }
10334 }
10335
10336 impl fidl::encoding::ValueTypeMarker for SetSemanticVisibilityCmd {
10337 type Borrowed<'a> = &'a Self;
10338 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10339 value
10340 }
10341 }
10342
10343 unsafe impl fidl::encoding::TypeMarker for SetSemanticVisibilityCmd {
10344 type Owned = Self;
10345
10346 #[inline(always)]
10347 fn inline_align(_context: fidl::encoding::Context) -> usize {
10348 4
10349 }
10350
10351 #[inline(always)]
10352 fn inline_size(_context: fidl::encoding::Context) -> usize {
10353 8
10354 }
10355 }
10356
10357 unsafe impl<D: fidl::encoding::ResourceDialect>
10358 fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for &SetSemanticVisibilityCmd
10359 {
10360 #[inline]
10361 unsafe fn encode(
10362 self,
10363 encoder: &mut fidl::encoding::Encoder<'_, D>,
10364 offset: usize,
10365 _depth: fidl::encoding::Depth,
10366 ) -> fidl::Result<()> {
10367 encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10368 fidl::encoding::Encode::<SetSemanticVisibilityCmd, D>::encode(
10370 (
10371 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
10372 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.visible),
10373 ),
10374 encoder,
10375 offset,
10376 _depth,
10377 )
10378 }
10379 }
10380 unsafe impl<
10381 D: fidl::encoding::ResourceDialect,
10382 T0: fidl::encoding::Encode<u32, D>,
10383 T1: fidl::encoding::Encode<bool, D>,
10384 > fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for (T0, T1)
10385 {
10386 #[inline]
10387 unsafe fn encode(
10388 self,
10389 encoder: &mut fidl::encoding::Encoder<'_, D>,
10390 offset: usize,
10391 depth: fidl::encoding::Depth,
10392 ) -> fidl::Result<()> {
10393 encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10394 unsafe {
10397 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
10398 (ptr as *mut u32).write_unaligned(0);
10399 }
10400 self.0.encode(encoder, offset + 0, depth)?;
10402 self.1.encode(encoder, offset + 4, depth)?;
10403 Ok(())
10404 }
10405 }
10406
10407 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10408 for SetSemanticVisibilityCmd
10409 {
10410 #[inline(always)]
10411 fn new_empty() -> Self {
10412 Self { node_id: fidl::new_empty!(u32, D), visible: fidl::new_empty!(bool, D) }
10413 }
10414
10415 #[inline]
10416 unsafe fn decode(
10417 &mut self,
10418 decoder: &mut fidl::encoding::Decoder<'_, D>,
10419 offset: usize,
10420 _depth: fidl::encoding::Depth,
10421 ) -> fidl::Result<()> {
10422 decoder.debug_check_bounds::<Self>(offset);
10423 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
10425 let padval = unsafe { (ptr as *const u32).read_unaligned() };
10426 let mask = 0xffffff00u32;
10427 let maskedval = padval & mask;
10428 if maskedval != 0 {
10429 return Err(fidl::Error::NonZeroPadding {
10430 padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
10431 });
10432 }
10433 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
10434 fidl::decode!(bool, D, &mut self.visible, decoder, offset + 4, _depth)?;
10435 Ok(())
10436 }
10437 }
10438
10439 impl fidl::encoding::ValueTypeMarker for SetShapeCmd {
10440 type Borrowed<'a> = &'a Self;
10441 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10442 value
10443 }
10444 }
10445
10446 unsafe impl fidl::encoding::TypeMarker for SetShapeCmd {
10447 type Owned = Self;
10448
10449 #[inline(always)]
10450 fn inline_align(_context: fidl::encoding::Context) -> usize {
10451 4
10452 }
10453
10454 #[inline(always)]
10455 fn inline_size(_context: fidl::encoding::Context) -> usize {
10456 8
10457 }
10458 #[inline(always)]
10459 fn encode_is_copy() -> bool {
10460 true
10461 }
10462
10463 #[inline(always)]
10464 fn decode_is_copy() -> bool {
10465 true
10466 }
10467 }
10468
10469 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetShapeCmd, D>
10470 for &SetShapeCmd
10471 {
10472 #[inline]
10473 unsafe fn encode(
10474 self,
10475 encoder: &mut fidl::encoding::Encoder<'_, D>,
10476 offset: usize,
10477 _depth: fidl::encoding::Depth,
10478 ) -> fidl::Result<()> {
10479 encoder.debug_check_bounds::<SetShapeCmd>(offset);
10480 unsafe {
10481 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10483 (buf_ptr as *mut SetShapeCmd).write_unaligned((self as *const SetShapeCmd).read());
10484 }
10487 Ok(())
10488 }
10489 }
10490 unsafe impl<
10491 D: fidl::encoding::ResourceDialect,
10492 T0: fidl::encoding::Encode<u32, D>,
10493 T1: fidl::encoding::Encode<u32, D>,
10494 > fidl::encoding::Encode<SetShapeCmd, D> for (T0, T1)
10495 {
10496 #[inline]
10497 unsafe fn encode(
10498 self,
10499 encoder: &mut fidl::encoding::Encoder<'_, D>,
10500 offset: usize,
10501 depth: fidl::encoding::Depth,
10502 ) -> fidl::Result<()> {
10503 encoder.debug_check_bounds::<SetShapeCmd>(offset);
10504 self.0.encode(encoder, offset + 0, depth)?;
10508 self.1.encode(encoder, offset + 4, depth)?;
10509 Ok(())
10510 }
10511 }
10512
10513 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetShapeCmd {
10514 #[inline(always)]
10515 fn new_empty() -> Self {
10516 Self { node_id: fidl::new_empty!(u32, D), shape_id: fidl::new_empty!(u32, D) }
10517 }
10518
10519 #[inline]
10520 unsafe fn decode(
10521 &mut self,
10522 decoder: &mut fidl::encoding::Decoder<'_, D>,
10523 offset: usize,
10524 _depth: fidl::encoding::Depth,
10525 ) -> fidl::Result<()> {
10526 decoder.debug_check_bounds::<Self>(offset);
10527 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10528 unsafe {
10531 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10532 }
10533 Ok(())
10534 }
10535 }
10536
10537 impl fidl::encoding::ValueTypeMarker for SetSizeCmd {
10538 type Borrowed<'a> = &'a Self;
10539 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10540 value
10541 }
10542 }
10543
10544 unsafe impl fidl::encoding::TypeMarker for SetSizeCmd {
10545 type Owned = Self;
10546
10547 #[inline(always)]
10548 fn inline_align(_context: fidl::encoding::Context) -> usize {
10549 4
10550 }
10551
10552 #[inline(always)]
10553 fn inline_size(_context: fidl::encoding::Context) -> usize {
10554 16
10555 }
10556 }
10557
10558 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetSizeCmd, D>
10559 for &SetSizeCmd
10560 {
10561 #[inline]
10562 unsafe fn encode(
10563 self,
10564 encoder: &mut fidl::encoding::Encoder<'_, D>,
10565 offset: usize,
10566 _depth: fidl::encoding::Depth,
10567 ) -> fidl::Result<()> {
10568 encoder.debug_check_bounds::<SetSizeCmd>(offset);
10569 fidl::encoding::Encode::<SetSizeCmd, D>::encode(
10571 (
10572 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10573 <Vector2Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10574 ),
10575 encoder,
10576 offset,
10577 _depth,
10578 )
10579 }
10580 }
10581 unsafe impl<
10582 D: fidl::encoding::ResourceDialect,
10583 T0: fidl::encoding::Encode<u32, D>,
10584 T1: fidl::encoding::Encode<Vector2Value, D>,
10585 > fidl::encoding::Encode<SetSizeCmd, D> for (T0, T1)
10586 {
10587 #[inline]
10588 unsafe fn encode(
10589 self,
10590 encoder: &mut fidl::encoding::Encoder<'_, D>,
10591 offset: usize,
10592 depth: fidl::encoding::Depth,
10593 ) -> fidl::Result<()> {
10594 encoder.debug_check_bounds::<SetSizeCmd>(offset);
10595 self.0.encode(encoder, offset + 0, depth)?;
10599 self.1.encode(encoder, offset + 4, depth)?;
10600 Ok(())
10601 }
10602 }
10603
10604 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetSizeCmd {
10605 #[inline(always)]
10606 fn new_empty() -> Self {
10607 Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector2Value, D) }
10608 }
10609
10610 #[inline]
10611 unsafe fn decode(
10612 &mut self,
10613 decoder: &mut fidl::encoding::Decoder<'_, D>,
10614 offset: usize,
10615 _depth: fidl::encoding::Depth,
10616 ) -> fidl::Result<()> {
10617 decoder.debug_check_bounds::<Self>(offset);
10618 fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10620 fidl::decode!(Vector2Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10621 Ok(())
10622 }
10623 }
10624
10625 impl fidl::encoding::ValueTypeMarker for SetStereoCameraProjectionCmd {
10626 type Borrowed<'a> = &'a Self;
10627 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10628 value
10629 }
10630 }
10631
10632 unsafe impl fidl::encoding::TypeMarker for SetStereoCameraProjectionCmd {
10633 type Owned = Self;
10634
10635 #[inline(always)]
10636 fn inline_align(_context: fidl::encoding::Context) -> usize {
10637 4
10638 }
10639
10640 #[inline(always)]
10641 fn inline_size(_context: fidl::encoding::Context) -> usize {
10642 140
10643 }
10644 }
10645
10646 unsafe impl<D: fidl::encoding::ResourceDialect>
10647 fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for &SetStereoCameraProjectionCmd
10648 {
10649 #[inline]
10650 unsafe fn encode(
10651 self,
10652 encoder: &mut fidl::encoding::Encoder<'_, D>,
10653 offset: usize,
10654 _depth: fidl::encoding::Depth,
10655 ) -> fidl::Result<()> {
10656 encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10657 fidl::encoding::Encode::<SetStereoCameraProjectionCmd, D>::encode(
10659 (
10660 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
10661 <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10662 &self.left_projection,
10663 ),
10664 <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10665 &self.right_projection,
10666 ),
10667 ),
10668 encoder,
10669 offset,
10670 _depth,
10671 )
10672 }
10673 }
10674 unsafe impl<
10675 D: fidl::encoding::ResourceDialect,
10676 T0: fidl::encoding::Encode<u32, D>,
10677 T1: fidl::encoding::Encode<Matrix4Value, D>,
10678 T2: fidl::encoding::Encode<Matrix4Value, D>,
10679 > fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for (T0, T1, T2)
10680 {
10681 #[inline]
10682 unsafe fn encode(
10683 self,
10684 encoder: &mut fidl::encoding::Encoder<'_, D>,
10685 offset: usize,
10686 depth: fidl::encoding::Depth,
10687 ) -> fidl::Result<()> {
10688 encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10689 self.0.encode(encoder, offset + 0, depth)?;
10693 self.1.encode(encoder, offset + 4, depth)?;
10694 self.2.encode(encoder, offset + 72, depth)?;
10695 Ok(())
10696 }
10697 }
10698
10699 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10700 for SetStereoCameraProjectionCmd
10701 {
10702 #[inline(always)]
10703 fn new_empty() -> Self {
10704 Self {
10705 camera_id: fidl::new_empty!(u32, D),
10706 left_projection: fidl::new_empty!(Matrix4Value, D),
10707 right_projection: fidl::new_empty!(Matrix4Value, D),
10708 }
10709 }
10710
10711 #[inline]
10712 unsafe fn decode(
10713 &mut self,
10714 decoder: &mut fidl::encoding::Decoder<'_, D>,
10715 offset: usize,
10716 _depth: fidl::encoding::Depth,
10717 ) -> fidl::Result<()> {
10718 decoder.debug_check_bounds::<Self>(offset);
10719 fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
10721 fidl::decode!(Matrix4Value, D, &mut self.left_projection, decoder, offset + 4, _depth)?;
10722 fidl::decode!(
10723 Matrix4Value,
10724 D,
10725 &mut self.right_projection,
10726 decoder,
10727 offset + 72,
10728 _depth
10729 )?;
10730 Ok(())
10731 }
10732 }
10733
10734 impl fidl::encoding::ValueTypeMarker for SetTagCmd {
10735 type Borrowed<'a> = &'a Self;
10736 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10737 value
10738 }
10739 }
10740
10741 unsafe impl fidl::encoding::TypeMarker for SetTagCmd {
10742 type Owned = Self;
10743
10744 #[inline(always)]
10745 fn inline_align(_context: fidl::encoding::Context) -> usize {
10746 4
10747 }
10748
10749 #[inline(always)]
10750 fn inline_size(_context: fidl::encoding::Context) -> usize {
10751 8
10752 }
10753 #[inline(always)]
10754 fn encode_is_copy() -> bool {
10755 true
10756 }
10757
10758 #[inline(always)]
10759 fn decode_is_copy() -> bool {
10760 true
10761 }
10762 }
10763
10764 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTagCmd, D>
10765 for &SetTagCmd
10766 {
10767 #[inline]
10768 unsafe fn encode(
10769 self,
10770 encoder: &mut fidl::encoding::Encoder<'_, D>,
10771 offset: usize,
10772 _depth: fidl::encoding::Depth,
10773 ) -> fidl::Result<()> {
10774 encoder.debug_check_bounds::<SetTagCmd>(offset);
10775 unsafe {
10776 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10778 (buf_ptr as *mut SetTagCmd).write_unaligned((self as *const SetTagCmd).read());
10779 }
10782 Ok(())
10783 }
10784 }
10785 unsafe impl<
10786 D: fidl::encoding::ResourceDialect,
10787 T0: fidl::encoding::Encode<u32, D>,
10788 T1: fidl::encoding::Encode<u32, D>,
10789 > fidl::encoding::Encode<SetTagCmd, D> for (T0, T1)
10790 {
10791 #[inline]
10792 unsafe fn encode(
10793 self,
10794 encoder: &mut fidl::encoding::Encoder<'_, D>,
10795 offset: usize,
10796 depth: fidl::encoding::Depth,
10797 ) -> fidl::Result<()> {
10798 encoder.debug_check_bounds::<SetTagCmd>(offset);
10799 self.0.encode(encoder, offset + 0, depth)?;
10803 self.1.encode(encoder, offset + 4, depth)?;
10804 Ok(())
10805 }
10806 }
10807
10808 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTagCmd {
10809 #[inline(always)]
10810 fn new_empty() -> Self {
10811 Self { node_id: fidl::new_empty!(u32, D), tag_value: fidl::new_empty!(u32, D) }
10812 }
10813
10814 #[inline]
10815 unsafe fn decode(
10816 &mut self,
10817 decoder: &mut fidl::encoding::Decoder<'_, D>,
10818 offset: usize,
10819 _depth: fidl::encoding::Depth,
10820 ) -> fidl::Result<()> {
10821 decoder.debug_check_bounds::<Self>(offset);
10822 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10823 unsafe {
10826 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10827 }
10828 Ok(())
10829 }
10830 }
10831
10832 impl fidl::encoding::ValueTypeMarker for SetTextureCmd {
10833 type Borrowed<'a> = &'a Self;
10834 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10835 value
10836 }
10837 }
10838
10839 unsafe impl fidl::encoding::TypeMarker for SetTextureCmd {
10840 type Owned = Self;
10841
10842 #[inline(always)]
10843 fn inline_align(_context: fidl::encoding::Context) -> usize {
10844 4
10845 }
10846
10847 #[inline(always)]
10848 fn inline_size(_context: fidl::encoding::Context) -> usize {
10849 8
10850 }
10851 #[inline(always)]
10852 fn encode_is_copy() -> bool {
10853 true
10854 }
10855
10856 #[inline(always)]
10857 fn decode_is_copy() -> bool {
10858 true
10859 }
10860 }
10861
10862 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTextureCmd, D>
10863 for &SetTextureCmd
10864 {
10865 #[inline]
10866 unsafe fn encode(
10867 self,
10868 encoder: &mut fidl::encoding::Encoder<'_, D>,
10869 offset: usize,
10870 _depth: fidl::encoding::Depth,
10871 ) -> fidl::Result<()> {
10872 encoder.debug_check_bounds::<SetTextureCmd>(offset);
10873 unsafe {
10874 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10876 (buf_ptr as *mut SetTextureCmd)
10877 .write_unaligned((self as *const SetTextureCmd).read());
10878 }
10881 Ok(())
10882 }
10883 }
10884 unsafe impl<
10885 D: fidl::encoding::ResourceDialect,
10886 T0: fidl::encoding::Encode<u32, D>,
10887 T1: fidl::encoding::Encode<u32, D>,
10888 > fidl::encoding::Encode<SetTextureCmd, D> for (T0, T1)
10889 {
10890 #[inline]
10891 unsafe fn encode(
10892 self,
10893 encoder: &mut fidl::encoding::Encoder<'_, D>,
10894 offset: usize,
10895 depth: fidl::encoding::Depth,
10896 ) -> fidl::Result<()> {
10897 encoder.debug_check_bounds::<SetTextureCmd>(offset);
10898 self.0.encode(encoder, offset + 0, depth)?;
10902 self.1.encode(encoder, offset + 4, depth)?;
10903 Ok(())
10904 }
10905 }
10906
10907 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTextureCmd {
10908 #[inline(always)]
10909 fn new_empty() -> Self {
10910 Self { material_id: fidl::new_empty!(u32, D), texture_id: fidl::new_empty!(u32, D) }
10911 }
10912
10913 #[inline]
10914 unsafe fn decode(
10915 &mut self,
10916 decoder: &mut fidl::encoding::Decoder<'_, D>,
10917 offset: usize,
10918 _depth: fidl::encoding::Depth,
10919 ) -> fidl::Result<()> {
10920 decoder.debug_check_bounds::<Self>(offset);
10921 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10922 unsafe {
10925 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10926 }
10927 Ok(())
10928 }
10929 }
10930
10931 impl fidl::encoding::ValueTypeMarker for SetTranslationCmd {
10932 type Borrowed<'a> = &'a Self;
10933 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10934 value
10935 }
10936 }
10937
10938 unsafe impl fidl::encoding::TypeMarker for SetTranslationCmd {
10939 type Owned = Self;
10940
10941 #[inline(always)]
10942 fn inline_align(_context: fidl::encoding::Context) -> usize {
10943 4
10944 }
10945
10946 #[inline(always)]
10947 fn inline_size(_context: fidl::encoding::Context) -> usize {
10948 20
10949 }
10950 }
10951
10952 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTranslationCmd, D>
10953 for &SetTranslationCmd
10954 {
10955 #[inline]
10956 unsafe fn encode(
10957 self,
10958 encoder: &mut fidl::encoding::Encoder<'_, D>,
10959 offset: usize,
10960 _depth: fidl::encoding::Depth,
10961 ) -> fidl::Result<()> {
10962 encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10963 fidl::encoding::Encode::<SetTranslationCmd, D>::encode(
10965 (
10966 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10967 <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10968 ),
10969 encoder,
10970 offset,
10971 _depth,
10972 )
10973 }
10974 }
10975 unsafe impl<
10976 D: fidl::encoding::ResourceDialect,
10977 T0: fidl::encoding::Encode<u32, D>,
10978 T1: fidl::encoding::Encode<Vector3Value, D>,
10979 > fidl::encoding::Encode<SetTranslationCmd, D> for (T0, T1)
10980 {
10981 #[inline]
10982 unsafe fn encode(
10983 self,
10984 encoder: &mut fidl::encoding::Encoder<'_, D>,
10985 offset: usize,
10986 depth: fidl::encoding::Depth,
10987 ) -> fidl::Result<()> {
10988 encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10989 self.0.encode(encoder, offset + 0, depth)?;
10993 self.1.encode(encoder, offset + 4, depth)?;
10994 Ok(())
10995 }
10996 }
10997
10998 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTranslationCmd {
10999 #[inline(always)]
11000 fn new_empty() -> Self {
11001 Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
11002 }
11003
11004 #[inline]
11005 unsafe fn decode(
11006 &mut self,
11007 decoder: &mut fidl::encoding::Decoder<'_, D>,
11008 offset: usize,
11009 _depth: fidl::encoding::Depth,
11010 ) -> fidl::Result<()> {
11011 decoder.debug_check_bounds::<Self>(offset);
11012 fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
11014 fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
11015 Ok(())
11016 }
11017 }
11018
11019 impl fidl::encoding::ValueTypeMarker for SetViewHolderBoundsColorCmd {
11020 type Borrowed<'a> = &'a Self;
11021 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11022 value
11023 }
11024 }
11025
11026 unsafe impl fidl::encoding::TypeMarker for SetViewHolderBoundsColorCmd {
11027 type Owned = Self;
11028
11029 #[inline(always)]
11030 fn inline_align(_context: fidl::encoding::Context) -> usize {
11031 4
11032 }
11033
11034 #[inline(always)]
11035 fn inline_size(_context: fidl::encoding::Context) -> usize {
11036 20
11037 }
11038 }
11039
11040 unsafe impl<D: fidl::encoding::ResourceDialect>
11041 fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for &SetViewHolderBoundsColorCmd
11042 {
11043 #[inline]
11044 unsafe fn encode(
11045 self,
11046 encoder: &mut fidl::encoding::Encoder<'_, D>,
11047 offset: usize,
11048 _depth: fidl::encoding::Depth,
11049 ) -> fidl::Result<()> {
11050 encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
11051 fidl::encoding::Encode::<SetViewHolderBoundsColorCmd, D>::encode(
11053 (
11054 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
11055 <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
11056 ),
11057 encoder,
11058 offset,
11059 _depth,
11060 )
11061 }
11062 }
11063 unsafe impl<
11064 D: fidl::encoding::ResourceDialect,
11065 T0: fidl::encoding::Encode<u32, D>,
11066 T1: fidl::encoding::Encode<ColorRgbValue, D>,
11067 > fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for (T0, T1)
11068 {
11069 #[inline]
11070 unsafe fn encode(
11071 self,
11072 encoder: &mut fidl::encoding::Encoder<'_, D>,
11073 offset: usize,
11074 depth: fidl::encoding::Depth,
11075 ) -> fidl::Result<()> {
11076 encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
11077 self.0.encode(encoder, offset + 0, depth)?;
11081 self.1.encode(encoder, offset + 4, depth)?;
11082 Ok(())
11083 }
11084 }
11085
11086 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11087 for SetViewHolderBoundsColorCmd
11088 {
11089 #[inline(always)]
11090 fn new_empty() -> Self {
11091 Self {
11092 view_holder_id: fidl::new_empty!(u32, D),
11093 color: fidl::new_empty!(ColorRgbValue, D),
11094 }
11095 }
11096
11097 #[inline]
11098 unsafe fn decode(
11099 &mut self,
11100 decoder: &mut fidl::encoding::Decoder<'_, D>,
11101 offset: usize,
11102 _depth: fidl::encoding::Depth,
11103 ) -> fidl::Result<()> {
11104 decoder.debug_check_bounds::<Self>(offset);
11105 fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11107 fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
11108 Ok(())
11109 }
11110 }
11111
11112 impl fidl::encoding::ValueTypeMarker for SetViewPropertiesCmd {
11113 type Borrowed<'a> = &'a Self;
11114 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11115 value
11116 }
11117 }
11118
11119 unsafe impl fidl::encoding::TypeMarker for SetViewPropertiesCmd {
11120 type Owned = Self;
11121
11122 #[inline(always)]
11123 fn inline_align(_context: fidl::encoding::Context) -> usize {
11124 4
11125 }
11126
11127 #[inline(always)]
11128 fn inline_size(_context: fidl::encoding::Context) -> usize {
11129 56
11130 }
11131 }
11132
11133 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetViewPropertiesCmd, D>
11134 for &SetViewPropertiesCmd
11135 {
11136 #[inline]
11137 unsafe fn encode(
11138 self,
11139 encoder: &mut fidl::encoding::Encoder<'_, D>,
11140 offset: usize,
11141 _depth: fidl::encoding::Depth,
11142 ) -> fidl::Result<()> {
11143 encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11144 fidl::encoding::Encode::<SetViewPropertiesCmd, D>::encode(
11146 (
11147 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
11148 <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11149 ),
11150 encoder,
11151 offset,
11152 _depth,
11153 )
11154 }
11155 }
11156 unsafe impl<
11157 D: fidl::encoding::ResourceDialect,
11158 T0: fidl::encoding::Encode<u32, D>,
11159 T1: fidl::encoding::Encode<ViewProperties, D>,
11160 > fidl::encoding::Encode<SetViewPropertiesCmd, D> for (T0, T1)
11161 {
11162 #[inline]
11163 unsafe fn encode(
11164 self,
11165 encoder: &mut fidl::encoding::Encoder<'_, D>,
11166 offset: usize,
11167 depth: fidl::encoding::Depth,
11168 ) -> fidl::Result<()> {
11169 encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11170 self.0.encode(encoder, offset + 0, depth)?;
11174 self.1.encode(encoder, offset + 4, depth)?;
11175 Ok(())
11176 }
11177 }
11178
11179 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetViewPropertiesCmd {
11180 #[inline(always)]
11181 fn new_empty() -> Self {
11182 Self {
11183 view_holder_id: fidl::new_empty!(u32, D),
11184 properties: fidl::new_empty!(ViewProperties, D),
11185 }
11186 }
11187
11188 #[inline]
11189 unsafe fn decode(
11190 &mut self,
11191 decoder: &mut fidl::encoding::Decoder<'_, D>,
11192 offset: usize,
11193 _depth: fidl::encoding::Depth,
11194 ) -> fidl::Result<()> {
11195 decoder.debug_check_bounds::<Self>(offset);
11196 fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11198 fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11199 Ok(())
11200 }
11201 }
11202
11203 impl fidl::encoding::ValueTypeMarker for ShapeNodeArgs {
11204 type Borrowed<'a> = &'a Self;
11205 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11206 value
11207 }
11208 }
11209
11210 unsafe impl fidl::encoding::TypeMarker for ShapeNodeArgs {
11211 type Owned = Self;
11212
11213 #[inline(always)]
11214 fn inline_align(_context: fidl::encoding::Context) -> usize {
11215 4
11216 }
11217
11218 #[inline(always)]
11219 fn inline_size(_context: fidl::encoding::Context) -> usize {
11220 4
11221 }
11222 #[inline(always)]
11223 fn encode_is_copy() -> bool {
11224 true
11225 }
11226
11227 #[inline(always)]
11228 fn decode_is_copy() -> bool {
11229 true
11230 }
11231 }
11232
11233 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ShapeNodeArgs, D>
11234 for &ShapeNodeArgs
11235 {
11236 #[inline]
11237 unsafe fn encode(
11238 self,
11239 encoder: &mut fidl::encoding::Encoder<'_, D>,
11240 offset: usize,
11241 _depth: fidl::encoding::Depth,
11242 ) -> fidl::Result<()> {
11243 encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11244 unsafe {
11245 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11247 (buf_ptr as *mut ShapeNodeArgs)
11248 .write_unaligned((self as *const ShapeNodeArgs).read());
11249 }
11252 Ok(())
11253 }
11254 }
11255 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11256 fidl::encoding::Encode<ShapeNodeArgs, D> for (T0,)
11257 {
11258 #[inline]
11259 unsafe fn encode(
11260 self,
11261 encoder: &mut fidl::encoding::Encoder<'_, D>,
11262 offset: usize,
11263 depth: fidl::encoding::Depth,
11264 ) -> fidl::Result<()> {
11265 encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11266 self.0.encode(encoder, offset + 0, depth)?;
11270 Ok(())
11271 }
11272 }
11273
11274 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShapeNodeArgs {
11275 #[inline(always)]
11276 fn new_empty() -> Self {
11277 Self { unused: fidl::new_empty!(u32, D) }
11278 }
11279
11280 #[inline]
11281 unsafe fn decode(
11282 &mut self,
11283 decoder: &mut fidl::encoding::Decoder<'_, D>,
11284 offset: usize,
11285 _depth: fidl::encoding::Depth,
11286 ) -> fidl::Result<()> {
11287 decoder.debug_check_bounds::<Self>(offset);
11288 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11289 unsafe {
11292 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11293 }
11294 Ok(())
11295 }
11296 }
11297
11298 impl fidl::encoding::ValueTypeMarker for SizeChangeHintEvent {
11299 type Borrowed<'a> = &'a Self;
11300 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11301 value
11302 }
11303 }
11304
11305 unsafe impl fidl::encoding::TypeMarker for SizeChangeHintEvent {
11306 type Owned = Self;
11307
11308 #[inline(always)]
11309 fn inline_align(_context: fidl::encoding::Context) -> usize {
11310 4
11311 }
11312
11313 #[inline(always)]
11314 fn inline_size(_context: fidl::encoding::Context) -> usize {
11315 12
11316 }
11317 }
11318
11319 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SizeChangeHintEvent, D>
11320 for &SizeChangeHintEvent
11321 {
11322 #[inline]
11323 unsafe fn encode(
11324 self,
11325 encoder: &mut fidl::encoding::Encoder<'_, D>,
11326 offset: usize,
11327 _depth: fidl::encoding::Depth,
11328 ) -> fidl::Result<()> {
11329 encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11330 fidl::encoding::Encode::<SizeChangeHintEvent, D>::encode(
11332 (
11333 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
11334 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
11335 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
11336 ),
11337 encoder,
11338 offset,
11339 _depth,
11340 )
11341 }
11342 }
11343 unsafe impl<
11344 D: fidl::encoding::ResourceDialect,
11345 T0: fidl::encoding::Encode<u32, D>,
11346 T1: fidl::encoding::Encode<f32, D>,
11347 T2: fidl::encoding::Encode<f32, D>,
11348 > fidl::encoding::Encode<SizeChangeHintEvent, D> for (T0, T1, T2)
11349 {
11350 #[inline]
11351 unsafe fn encode(
11352 self,
11353 encoder: &mut fidl::encoding::Encoder<'_, D>,
11354 offset: usize,
11355 depth: fidl::encoding::Depth,
11356 ) -> fidl::Result<()> {
11357 encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11358 self.0.encode(encoder, offset + 0, depth)?;
11362 self.1.encode(encoder, offset + 4, depth)?;
11363 self.2.encode(encoder, offset + 8, depth)?;
11364 Ok(())
11365 }
11366 }
11367
11368 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SizeChangeHintEvent {
11369 #[inline(always)]
11370 fn new_empty() -> Self {
11371 Self {
11372 node_id: fidl::new_empty!(u32, D),
11373 width_change_factor: fidl::new_empty!(f32, D),
11374 height_change_factor: fidl::new_empty!(f32, D),
11375 }
11376 }
11377
11378 #[inline]
11379 unsafe fn decode(
11380 &mut self,
11381 decoder: &mut fidl::encoding::Decoder<'_, D>,
11382 offset: usize,
11383 _depth: fidl::encoding::Depth,
11384 ) -> fidl::Result<()> {
11385 decoder.debug_check_bounds::<Self>(offset);
11386 fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
11388 fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
11389 fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
11390 Ok(())
11391 }
11392 }
11393
11394 impl fidl::encoding::ValueTypeMarker for StereoCameraArgs {
11395 type Borrowed<'a> = &'a Self;
11396 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11397 value
11398 }
11399 }
11400
11401 unsafe impl fidl::encoding::TypeMarker for StereoCameraArgs {
11402 type Owned = Self;
11403
11404 #[inline(always)]
11405 fn inline_align(_context: fidl::encoding::Context) -> usize {
11406 4
11407 }
11408
11409 #[inline(always)]
11410 fn inline_size(_context: fidl::encoding::Context) -> usize {
11411 4
11412 }
11413 #[inline(always)]
11414 fn encode_is_copy() -> bool {
11415 true
11416 }
11417
11418 #[inline(always)]
11419 fn decode_is_copy() -> bool {
11420 true
11421 }
11422 }
11423
11424 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StereoCameraArgs, D>
11425 for &StereoCameraArgs
11426 {
11427 #[inline]
11428 unsafe fn encode(
11429 self,
11430 encoder: &mut fidl::encoding::Encoder<'_, D>,
11431 offset: usize,
11432 _depth: fidl::encoding::Depth,
11433 ) -> fidl::Result<()> {
11434 encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11435 unsafe {
11436 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11438 (buf_ptr as *mut StereoCameraArgs)
11439 .write_unaligned((self as *const StereoCameraArgs).read());
11440 }
11443 Ok(())
11444 }
11445 }
11446 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11447 fidl::encoding::Encode<StereoCameraArgs, D> for (T0,)
11448 {
11449 #[inline]
11450 unsafe fn encode(
11451 self,
11452 encoder: &mut fidl::encoding::Encoder<'_, D>,
11453 offset: usize,
11454 depth: fidl::encoding::Depth,
11455 ) -> fidl::Result<()> {
11456 encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11457 self.0.encode(encoder, offset + 0, depth)?;
11461 Ok(())
11462 }
11463 }
11464
11465 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StereoCameraArgs {
11466 #[inline(always)]
11467 fn new_empty() -> Self {
11468 Self { scene_id: fidl::new_empty!(u32, D) }
11469 }
11470
11471 #[inline]
11472 unsafe fn decode(
11473 &mut self,
11474 decoder: &mut fidl::encoding::Decoder<'_, D>,
11475 offset: usize,
11476 _depth: fidl::encoding::Depth,
11477 ) -> fidl::Result<()> {
11478 decoder.debug_check_bounds::<Self>(offset);
11479 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11480 unsafe {
11483 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11484 }
11485 Ok(())
11486 }
11487 }
11488
11489 impl fidl::encoding::ValueTypeMarker for VariableArgs {
11490 type Borrowed<'a> = &'a Self;
11491 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11492 value
11493 }
11494 }
11495
11496 unsafe impl fidl::encoding::TypeMarker for VariableArgs {
11497 type Owned = Self;
11498
11499 #[inline(always)]
11500 fn inline_align(_context: fidl::encoding::Context) -> usize {
11501 8
11502 }
11503
11504 #[inline(always)]
11505 fn inline_size(_context: fidl::encoding::Context) -> usize {
11506 24
11507 }
11508 }
11509
11510 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VariableArgs, D>
11511 for &VariableArgs
11512 {
11513 #[inline]
11514 unsafe fn encode(
11515 self,
11516 encoder: &mut fidl::encoding::Encoder<'_, D>,
11517 offset: usize,
11518 _depth: fidl::encoding::Depth,
11519 ) -> fidl::Result<()> {
11520 encoder.debug_check_bounds::<VariableArgs>(offset);
11521 fidl::encoding::Encode::<VariableArgs, D>::encode(
11523 (
11524 <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
11525 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.initial_value),
11526 ),
11527 encoder,
11528 offset,
11529 _depth,
11530 )
11531 }
11532 }
11533 unsafe impl<
11534 D: fidl::encoding::ResourceDialect,
11535 T0: fidl::encoding::Encode<ValueType, D>,
11536 T1: fidl::encoding::Encode<Value, D>,
11537 > fidl::encoding::Encode<VariableArgs, D> for (T0, T1)
11538 {
11539 #[inline]
11540 unsafe fn encode(
11541 self,
11542 encoder: &mut fidl::encoding::Encoder<'_, D>,
11543 offset: usize,
11544 depth: fidl::encoding::Depth,
11545 ) -> fidl::Result<()> {
11546 encoder.debug_check_bounds::<VariableArgs>(offset);
11547 unsafe {
11550 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11551 (ptr as *mut u64).write_unaligned(0);
11552 }
11553 self.0.encode(encoder, offset + 0, depth)?;
11555 self.1.encode(encoder, offset + 8, depth)?;
11556 Ok(())
11557 }
11558 }
11559
11560 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VariableArgs {
11561 #[inline(always)]
11562 fn new_empty() -> Self {
11563 Self {
11564 type_: fidl::new_empty!(ValueType, D),
11565 initial_value: fidl::new_empty!(Value, D),
11566 }
11567 }
11568
11569 #[inline]
11570 unsafe fn decode(
11571 &mut self,
11572 decoder: &mut fidl::encoding::Decoder<'_, D>,
11573 offset: usize,
11574 _depth: fidl::encoding::Depth,
11575 ) -> fidl::Result<()> {
11576 decoder.debug_check_bounds::<Self>(offset);
11577 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11579 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11580 let mask = 0xffffffff00000000u64;
11581 let maskedval = padval & mask;
11582 if maskedval != 0 {
11583 return Err(fidl::Error::NonZeroPadding {
11584 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11585 });
11586 }
11587 fidl::decode!(ValueType, D, &mut self.type_, decoder, offset + 0, _depth)?;
11588 fidl::decode!(Value, D, &mut self.initial_value, decoder, offset + 8, _depth)?;
11589 Ok(())
11590 }
11591 }
11592
11593 impl fidl::encoding::ValueTypeMarker for Vector2Value {
11594 type Borrowed<'a> = &'a Self;
11595 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11596 value
11597 }
11598 }
11599
11600 unsafe impl fidl::encoding::TypeMarker for Vector2Value {
11601 type Owned = Self;
11602
11603 #[inline(always)]
11604 fn inline_align(_context: fidl::encoding::Context) -> usize {
11605 4
11606 }
11607
11608 #[inline(always)]
11609 fn inline_size(_context: fidl::encoding::Context) -> usize {
11610 12
11611 }
11612 }
11613
11614 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector2Value, D>
11615 for &Vector2Value
11616 {
11617 #[inline]
11618 unsafe fn encode(
11619 self,
11620 encoder: &mut fidl::encoding::Encoder<'_, D>,
11621 offset: usize,
11622 _depth: fidl::encoding::Depth,
11623 ) -> fidl::Result<()> {
11624 encoder.debug_check_bounds::<Vector2Value>(offset);
11625 fidl::encoding::Encode::<Vector2Value, D>::encode(
11627 (
11628 <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11629 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11630 ),
11631 encoder,
11632 offset,
11633 _depth,
11634 )
11635 }
11636 }
11637 unsafe impl<
11638 D: fidl::encoding::ResourceDialect,
11639 T0: fidl::encoding::Encode<Vec2, D>,
11640 T1: fidl::encoding::Encode<u32, D>,
11641 > fidl::encoding::Encode<Vector2Value, D> for (T0, T1)
11642 {
11643 #[inline]
11644 unsafe fn encode(
11645 self,
11646 encoder: &mut fidl::encoding::Encoder<'_, D>,
11647 offset: usize,
11648 depth: fidl::encoding::Depth,
11649 ) -> fidl::Result<()> {
11650 encoder.debug_check_bounds::<Vector2Value>(offset);
11651 self.0.encode(encoder, offset + 0, depth)?;
11655 self.1.encode(encoder, offset + 8, depth)?;
11656 Ok(())
11657 }
11658 }
11659
11660 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector2Value {
11661 #[inline(always)]
11662 fn new_empty() -> Self {
11663 Self { value: fidl::new_empty!(Vec2, D), variable_id: fidl::new_empty!(u32, D) }
11664 }
11665
11666 #[inline]
11667 unsafe fn decode(
11668 &mut self,
11669 decoder: &mut fidl::encoding::Decoder<'_, D>,
11670 offset: usize,
11671 _depth: fidl::encoding::Depth,
11672 ) -> fidl::Result<()> {
11673 decoder.debug_check_bounds::<Self>(offset);
11674 fidl::decode!(Vec2, D, &mut self.value, decoder, offset + 0, _depth)?;
11676 fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 8, _depth)?;
11677 Ok(())
11678 }
11679 }
11680
11681 impl fidl::encoding::ValueTypeMarker for Vector3Value {
11682 type Borrowed<'a> = &'a Self;
11683 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11684 value
11685 }
11686 }
11687
11688 unsafe impl fidl::encoding::TypeMarker for Vector3Value {
11689 type Owned = Self;
11690
11691 #[inline(always)]
11692 fn inline_align(_context: fidl::encoding::Context) -> usize {
11693 4
11694 }
11695
11696 #[inline(always)]
11697 fn inline_size(_context: fidl::encoding::Context) -> usize {
11698 16
11699 }
11700 }
11701
11702 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector3Value, D>
11703 for &Vector3Value
11704 {
11705 #[inline]
11706 unsafe fn encode(
11707 self,
11708 encoder: &mut fidl::encoding::Encoder<'_, D>,
11709 offset: usize,
11710 _depth: fidl::encoding::Depth,
11711 ) -> fidl::Result<()> {
11712 encoder.debug_check_bounds::<Vector3Value>(offset);
11713 fidl::encoding::Encode::<Vector3Value, D>::encode(
11715 (
11716 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11717 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11718 ),
11719 encoder,
11720 offset,
11721 _depth,
11722 )
11723 }
11724 }
11725 unsafe impl<
11726 D: fidl::encoding::ResourceDialect,
11727 T0: fidl::encoding::Encode<Vec3, D>,
11728 T1: fidl::encoding::Encode<u32, D>,
11729 > fidl::encoding::Encode<Vector3Value, D> for (T0, T1)
11730 {
11731 #[inline]
11732 unsafe fn encode(
11733 self,
11734 encoder: &mut fidl::encoding::Encoder<'_, D>,
11735 offset: usize,
11736 depth: fidl::encoding::Depth,
11737 ) -> fidl::Result<()> {
11738 encoder.debug_check_bounds::<Vector3Value>(offset);
11739 self.0.encode(encoder, offset + 0, depth)?;
11743 self.1.encode(encoder, offset + 12, depth)?;
11744 Ok(())
11745 }
11746 }
11747
11748 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector3Value {
11749 #[inline(always)]
11750 fn new_empty() -> Self {
11751 Self { value: fidl::new_empty!(Vec3, D), variable_id: fidl::new_empty!(u32, D) }
11752 }
11753
11754 #[inline]
11755 unsafe fn decode(
11756 &mut self,
11757 decoder: &mut fidl::encoding::Decoder<'_, D>,
11758 offset: usize,
11759 _depth: fidl::encoding::Depth,
11760 ) -> fidl::Result<()> {
11761 decoder.debug_check_bounds::<Self>(offset);
11762 fidl::decode!(Vec3, D, &mut self.value, decoder, offset + 0, _depth)?;
11764 fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
11765 Ok(())
11766 }
11767 }
11768
11769 impl fidl::encoding::ValueTypeMarker for Vector4Value {
11770 type Borrowed<'a> = &'a Self;
11771 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11772 value
11773 }
11774 }
11775
11776 unsafe impl fidl::encoding::TypeMarker for Vector4Value {
11777 type Owned = Self;
11778
11779 #[inline(always)]
11780 fn inline_align(_context: fidl::encoding::Context) -> usize {
11781 4
11782 }
11783
11784 #[inline(always)]
11785 fn inline_size(_context: fidl::encoding::Context) -> usize {
11786 20
11787 }
11788 }
11789
11790 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector4Value, D>
11791 for &Vector4Value
11792 {
11793 #[inline]
11794 unsafe fn encode(
11795 self,
11796 encoder: &mut fidl::encoding::Encoder<'_, D>,
11797 offset: usize,
11798 _depth: fidl::encoding::Depth,
11799 ) -> fidl::Result<()> {
11800 encoder.debug_check_bounds::<Vector4Value>(offset);
11801 fidl::encoding::Encode::<Vector4Value, D>::encode(
11803 (
11804 <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11805 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11806 ),
11807 encoder,
11808 offset,
11809 _depth,
11810 )
11811 }
11812 }
11813 unsafe impl<
11814 D: fidl::encoding::ResourceDialect,
11815 T0: fidl::encoding::Encode<Vec4, D>,
11816 T1: fidl::encoding::Encode<u32, D>,
11817 > fidl::encoding::Encode<Vector4Value, D> for (T0, T1)
11818 {
11819 #[inline]
11820 unsafe fn encode(
11821 self,
11822 encoder: &mut fidl::encoding::Encoder<'_, D>,
11823 offset: usize,
11824 depth: fidl::encoding::Depth,
11825 ) -> fidl::Result<()> {
11826 encoder.debug_check_bounds::<Vector4Value>(offset);
11827 self.0.encode(encoder, offset + 0, depth)?;
11831 self.1.encode(encoder, offset + 16, depth)?;
11832 Ok(())
11833 }
11834 }
11835
11836 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector4Value {
11837 #[inline(always)]
11838 fn new_empty() -> Self {
11839 Self { value: fidl::new_empty!(Vec4, D), variable_id: fidl::new_empty!(u32, D) }
11840 }
11841
11842 #[inline]
11843 unsafe fn decode(
11844 &mut self,
11845 decoder: &mut fidl::encoding::Decoder<'_, D>,
11846 offset: usize,
11847 _depth: fidl::encoding::Depth,
11848 ) -> fidl::Result<()> {
11849 decoder.debug_check_bounds::<Self>(offset);
11850 fidl::decode!(Vec4, D, &mut self.value, decoder, offset + 0, _depth)?;
11852 fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
11853 Ok(())
11854 }
11855 }
11856
11857 impl fidl::encoding::ValueTypeMarker for ViewAttachedToSceneEvent {
11858 type Borrowed<'a> = &'a Self;
11859 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11860 value
11861 }
11862 }
11863
11864 unsafe impl fidl::encoding::TypeMarker for ViewAttachedToSceneEvent {
11865 type Owned = Self;
11866
11867 #[inline(always)]
11868 fn inline_align(_context: fidl::encoding::Context) -> usize {
11869 4
11870 }
11871
11872 #[inline(always)]
11873 fn inline_size(_context: fidl::encoding::Context) -> usize {
11874 56
11875 }
11876 }
11877
11878 unsafe impl<D: fidl::encoding::ResourceDialect>
11879 fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for &ViewAttachedToSceneEvent
11880 {
11881 #[inline]
11882 unsafe fn encode(
11883 self,
11884 encoder: &mut fidl::encoding::Encoder<'_, D>,
11885 offset: usize,
11886 _depth: fidl::encoding::Depth,
11887 ) -> fidl::Result<()> {
11888 encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11889 fidl::encoding::Encode::<ViewAttachedToSceneEvent, D>::encode(
11891 (
11892 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
11893 <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11894 ),
11895 encoder,
11896 offset,
11897 _depth,
11898 )
11899 }
11900 }
11901 unsafe impl<
11902 D: fidl::encoding::ResourceDialect,
11903 T0: fidl::encoding::Encode<u32, D>,
11904 T1: fidl::encoding::Encode<ViewProperties, D>,
11905 > fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for (T0, T1)
11906 {
11907 #[inline]
11908 unsafe fn encode(
11909 self,
11910 encoder: &mut fidl::encoding::Encoder<'_, D>,
11911 offset: usize,
11912 depth: fidl::encoding::Depth,
11913 ) -> fidl::Result<()> {
11914 encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11915 self.0.encode(encoder, offset + 0, depth)?;
11919 self.1.encode(encoder, offset + 4, depth)?;
11920 Ok(())
11921 }
11922 }
11923
11924 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11925 for ViewAttachedToSceneEvent
11926 {
11927 #[inline(always)]
11928 fn new_empty() -> Self {
11929 Self {
11930 view_id: fidl::new_empty!(u32, D),
11931 properties: fidl::new_empty!(ViewProperties, D),
11932 }
11933 }
11934
11935 #[inline]
11936 unsafe fn decode(
11937 &mut self,
11938 decoder: &mut fidl::encoding::Decoder<'_, D>,
11939 offset: usize,
11940 _depth: fidl::encoding::Depth,
11941 ) -> fidl::Result<()> {
11942 decoder.debug_check_bounds::<Self>(offset);
11943 fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
11945 fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11946 Ok(())
11947 }
11948 }
11949
11950 impl fidl::encoding::ValueTypeMarker for ViewConnectedEvent {
11951 type Borrowed<'a> = &'a Self;
11952 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11953 value
11954 }
11955 }
11956
11957 unsafe impl fidl::encoding::TypeMarker for ViewConnectedEvent {
11958 type Owned = Self;
11959
11960 #[inline(always)]
11961 fn inline_align(_context: fidl::encoding::Context) -> usize {
11962 4
11963 }
11964
11965 #[inline(always)]
11966 fn inline_size(_context: fidl::encoding::Context) -> usize {
11967 4
11968 }
11969 #[inline(always)]
11970 fn encode_is_copy() -> bool {
11971 true
11972 }
11973
11974 #[inline(always)]
11975 fn decode_is_copy() -> bool {
11976 true
11977 }
11978 }
11979
11980 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewConnectedEvent, D>
11981 for &ViewConnectedEvent
11982 {
11983 #[inline]
11984 unsafe fn encode(
11985 self,
11986 encoder: &mut fidl::encoding::Encoder<'_, D>,
11987 offset: usize,
11988 _depth: fidl::encoding::Depth,
11989 ) -> fidl::Result<()> {
11990 encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
11991 unsafe {
11992 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11994 (buf_ptr as *mut ViewConnectedEvent)
11995 .write_unaligned((self as *const ViewConnectedEvent).read());
11996 }
11999 Ok(())
12000 }
12001 }
12002 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12003 fidl::encoding::Encode<ViewConnectedEvent, D> for (T0,)
12004 {
12005 #[inline]
12006 unsafe fn encode(
12007 self,
12008 encoder: &mut fidl::encoding::Encoder<'_, D>,
12009 offset: usize,
12010 depth: fidl::encoding::Depth,
12011 ) -> fidl::Result<()> {
12012 encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
12013 self.0.encode(encoder, offset + 0, depth)?;
12017 Ok(())
12018 }
12019 }
12020
12021 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewConnectedEvent {
12022 #[inline(always)]
12023 fn new_empty() -> Self {
12024 Self { view_holder_id: fidl::new_empty!(u32, D) }
12025 }
12026
12027 #[inline]
12028 unsafe fn decode(
12029 &mut self,
12030 decoder: &mut fidl::encoding::Decoder<'_, D>,
12031 offset: usize,
12032 _depth: fidl::encoding::Depth,
12033 ) -> fidl::Result<()> {
12034 decoder.debug_check_bounds::<Self>(offset);
12035 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12036 unsafe {
12039 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12040 }
12041 Ok(())
12042 }
12043 }
12044
12045 impl fidl::encoding::ValueTypeMarker for ViewDetachedFromSceneEvent {
12046 type Borrowed<'a> = &'a Self;
12047 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12048 value
12049 }
12050 }
12051
12052 unsafe impl fidl::encoding::TypeMarker for ViewDetachedFromSceneEvent {
12053 type Owned = Self;
12054
12055 #[inline(always)]
12056 fn inline_align(_context: fidl::encoding::Context) -> usize {
12057 4
12058 }
12059
12060 #[inline(always)]
12061 fn inline_size(_context: fidl::encoding::Context) -> usize {
12062 4
12063 }
12064 #[inline(always)]
12065 fn encode_is_copy() -> bool {
12066 true
12067 }
12068
12069 #[inline(always)]
12070 fn decode_is_copy() -> bool {
12071 true
12072 }
12073 }
12074
12075 unsafe impl<D: fidl::encoding::ResourceDialect>
12076 fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for &ViewDetachedFromSceneEvent
12077 {
12078 #[inline]
12079 unsafe fn encode(
12080 self,
12081 encoder: &mut fidl::encoding::Encoder<'_, D>,
12082 offset: usize,
12083 _depth: fidl::encoding::Depth,
12084 ) -> fidl::Result<()> {
12085 encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12086 unsafe {
12087 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12089 (buf_ptr as *mut ViewDetachedFromSceneEvent)
12090 .write_unaligned((self as *const ViewDetachedFromSceneEvent).read());
12091 }
12094 Ok(())
12095 }
12096 }
12097 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12098 fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for (T0,)
12099 {
12100 #[inline]
12101 unsafe fn encode(
12102 self,
12103 encoder: &mut fidl::encoding::Encoder<'_, D>,
12104 offset: usize,
12105 depth: fidl::encoding::Depth,
12106 ) -> fidl::Result<()> {
12107 encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12108 self.0.encode(encoder, offset + 0, depth)?;
12112 Ok(())
12113 }
12114 }
12115
12116 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12117 for ViewDetachedFromSceneEvent
12118 {
12119 #[inline(always)]
12120 fn new_empty() -> Self {
12121 Self { view_id: fidl::new_empty!(u32, D) }
12122 }
12123
12124 #[inline]
12125 unsafe fn decode(
12126 &mut self,
12127 decoder: &mut fidl::encoding::Decoder<'_, D>,
12128 offset: usize,
12129 _depth: fidl::encoding::Depth,
12130 ) -> fidl::Result<()> {
12131 decoder.debug_check_bounds::<Self>(offset);
12132 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12133 unsafe {
12136 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12137 }
12138 Ok(())
12139 }
12140 }
12141
12142 impl fidl::encoding::ValueTypeMarker for ViewDisconnectedEvent {
12143 type Borrowed<'a> = &'a Self;
12144 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12145 value
12146 }
12147 }
12148
12149 unsafe impl fidl::encoding::TypeMarker for ViewDisconnectedEvent {
12150 type Owned = Self;
12151
12152 #[inline(always)]
12153 fn inline_align(_context: fidl::encoding::Context) -> usize {
12154 4
12155 }
12156
12157 #[inline(always)]
12158 fn inline_size(_context: fidl::encoding::Context) -> usize {
12159 4
12160 }
12161 #[inline(always)]
12162 fn encode_is_copy() -> bool {
12163 true
12164 }
12165
12166 #[inline(always)]
12167 fn decode_is_copy() -> bool {
12168 true
12169 }
12170 }
12171
12172 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewDisconnectedEvent, D>
12173 for &ViewDisconnectedEvent
12174 {
12175 #[inline]
12176 unsafe fn encode(
12177 self,
12178 encoder: &mut fidl::encoding::Encoder<'_, D>,
12179 offset: usize,
12180 _depth: fidl::encoding::Depth,
12181 ) -> fidl::Result<()> {
12182 encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12183 unsafe {
12184 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12186 (buf_ptr as *mut ViewDisconnectedEvent)
12187 .write_unaligned((self as *const ViewDisconnectedEvent).read());
12188 }
12191 Ok(())
12192 }
12193 }
12194 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12195 fidl::encoding::Encode<ViewDisconnectedEvent, D> for (T0,)
12196 {
12197 #[inline]
12198 unsafe fn encode(
12199 self,
12200 encoder: &mut fidl::encoding::Encoder<'_, D>,
12201 offset: usize,
12202 depth: fidl::encoding::Depth,
12203 ) -> fidl::Result<()> {
12204 encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12205 self.0.encode(encoder, offset + 0, depth)?;
12209 Ok(())
12210 }
12211 }
12212
12213 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewDisconnectedEvent {
12214 #[inline(always)]
12215 fn new_empty() -> Self {
12216 Self { view_holder_id: fidl::new_empty!(u32, D) }
12217 }
12218
12219 #[inline]
12220 unsafe fn decode(
12221 &mut self,
12222 decoder: &mut fidl::encoding::Decoder<'_, D>,
12223 offset: usize,
12224 _depth: fidl::encoding::Depth,
12225 ) -> fidl::Result<()> {
12226 decoder.debug_check_bounds::<Self>(offset);
12227 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12228 unsafe {
12231 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12232 }
12233 Ok(())
12234 }
12235 }
12236
12237 impl fidl::encoding::ValueTypeMarker for ViewHolderConnectedEvent {
12238 type Borrowed<'a> = &'a Self;
12239 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12240 value
12241 }
12242 }
12243
12244 unsafe impl fidl::encoding::TypeMarker for ViewHolderConnectedEvent {
12245 type Owned = Self;
12246
12247 #[inline(always)]
12248 fn inline_align(_context: fidl::encoding::Context) -> usize {
12249 4
12250 }
12251
12252 #[inline(always)]
12253 fn inline_size(_context: fidl::encoding::Context) -> usize {
12254 4
12255 }
12256 #[inline(always)]
12257 fn encode_is_copy() -> bool {
12258 true
12259 }
12260
12261 #[inline(always)]
12262 fn decode_is_copy() -> bool {
12263 true
12264 }
12265 }
12266
12267 unsafe impl<D: fidl::encoding::ResourceDialect>
12268 fidl::encoding::Encode<ViewHolderConnectedEvent, D> for &ViewHolderConnectedEvent
12269 {
12270 #[inline]
12271 unsafe fn encode(
12272 self,
12273 encoder: &mut fidl::encoding::Encoder<'_, D>,
12274 offset: usize,
12275 _depth: fidl::encoding::Depth,
12276 ) -> fidl::Result<()> {
12277 encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12278 unsafe {
12279 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12281 (buf_ptr as *mut ViewHolderConnectedEvent)
12282 .write_unaligned((self as *const ViewHolderConnectedEvent).read());
12283 }
12286 Ok(())
12287 }
12288 }
12289 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12290 fidl::encoding::Encode<ViewHolderConnectedEvent, D> for (T0,)
12291 {
12292 #[inline]
12293 unsafe fn encode(
12294 self,
12295 encoder: &mut fidl::encoding::Encoder<'_, D>,
12296 offset: usize,
12297 depth: fidl::encoding::Depth,
12298 ) -> fidl::Result<()> {
12299 encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12300 self.0.encode(encoder, offset + 0, depth)?;
12304 Ok(())
12305 }
12306 }
12307
12308 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12309 for ViewHolderConnectedEvent
12310 {
12311 #[inline(always)]
12312 fn new_empty() -> Self {
12313 Self { view_id: fidl::new_empty!(u32, D) }
12314 }
12315
12316 #[inline]
12317 unsafe fn decode(
12318 &mut self,
12319 decoder: &mut fidl::encoding::Decoder<'_, D>,
12320 offset: usize,
12321 _depth: fidl::encoding::Depth,
12322 ) -> fidl::Result<()> {
12323 decoder.debug_check_bounds::<Self>(offset);
12324 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12325 unsafe {
12328 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12329 }
12330 Ok(())
12331 }
12332 }
12333
12334 impl fidl::encoding::ValueTypeMarker for ViewHolderDisconnectedEvent {
12335 type Borrowed<'a> = &'a Self;
12336 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12337 value
12338 }
12339 }
12340
12341 unsafe impl fidl::encoding::TypeMarker for ViewHolderDisconnectedEvent {
12342 type Owned = Self;
12343
12344 #[inline(always)]
12345 fn inline_align(_context: fidl::encoding::Context) -> usize {
12346 4
12347 }
12348
12349 #[inline(always)]
12350 fn inline_size(_context: fidl::encoding::Context) -> usize {
12351 4
12352 }
12353 #[inline(always)]
12354 fn encode_is_copy() -> bool {
12355 true
12356 }
12357
12358 #[inline(always)]
12359 fn decode_is_copy() -> bool {
12360 true
12361 }
12362 }
12363
12364 unsafe impl<D: fidl::encoding::ResourceDialect>
12365 fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for &ViewHolderDisconnectedEvent
12366 {
12367 #[inline]
12368 unsafe fn encode(
12369 self,
12370 encoder: &mut fidl::encoding::Encoder<'_, D>,
12371 offset: usize,
12372 _depth: fidl::encoding::Depth,
12373 ) -> fidl::Result<()> {
12374 encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12375 unsafe {
12376 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12378 (buf_ptr as *mut ViewHolderDisconnectedEvent)
12379 .write_unaligned((self as *const ViewHolderDisconnectedEvent).read());
12380 }
12383 Ok(())
12384 }
12385 }
12386 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12387 fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for (T0,)
12388 {
12389 #[inline]
12390 unsafe fn encode(
12391 self,
12392 encoder: &mut fidl::encoding::Encoder<'_, D>,
12393 offset: usize,
12394 depth: fidl::encoding::Depth,
12395 ) -> fidl::Result<()> {
12396 encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12397 self.0.encode(encoder, offset + 0, depth)?;
12401 Ok(())
12402 }
12403 }
12404
12405 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12406 for ViewHolderDisconnectedEvent
12407 {
12408 #[inline(always)]
12409 fn new_empty() -> Self {
12410 Self { view_id: fidl::new_empty!(u32, D) }
12411 }
12412
12413 #[inline]
12414 unsafe fn decode(
12415 &mut self,
12416 decoder: &mut fidl::encoding::Decoder<'_, D>,
12417 offset: usize,
12418 _depth: fidl::encoding::Depth,
12419 ) -> fidl::Result<()> {
12420 decoder.debug_check_bounds::<Self>(offset);
12421 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12422 unsafe {
12425 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12426 }
12427 Ok(())
12428 }
12429 }
12430
12431 impl fidl::encoding::ValueTypeMarker for ViewProperties {
12432 type Borrowed<'a> = &'a Self;
12433 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12434 value
12435 }
12436 }
12437
12438 unsafe impl fidl::encoding::TypeMarker for ViewProperties {
12439 type Owned = Self;
12440
12441 #[inline(always)]
12442 fn inline_align(_context: fidl::encoding::Context) -> usize {
12443 4
12444 }
12445
12446 #[inline(always)]
12447 fn inline_size(_context: fidl::encoding::Context) -> usize {
12448 52
12449 }
12450 }
12451
12452 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewProperties, D>
12453 for &ViewProperties
12454 {
12455 #[inline]
12456 unsafe fn encode(
12457 self,
12458 encoder: &mut fidl::encoding::Encoder<'_, D>,
12459 offset: usize,
12460 _depth: fidl::encoding::Depth,
12461 ) -> fidl::Result<()> {
12462 encoder.debug_check_bounds::<ViewProperties>(offset);
12463 fidl::encoding::Encode::<ViewProperties, D>::encode(
12465 (
12466 <BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
12467 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_min),
12468 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_max),
12469 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.focus_change),
12470 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.downward_input),
12471 ),
12472 encoder,
12473 offset,
12474 _depth,
12475 )
12476 }
12477 }
12478 unsafe impl<
12479 D: fidl::encoding::ResourceDialect,
12480 T0: fidl::encoding::Encode<BoundingBox, D>,
12481 T1: fidl::encoding::Encode<Vec3, D>,
12482 T2: fidl::encoding::Encode<Vec3, D>,
12483 T3: fidl::encoding::Encode<bool, D>,
12484 T4: fidl::encoding::Encode<bool, D>,
12485 > fidl::encoding::Encode<ViewProperties, D> for (T0, T1, T2, T3, T4)
12486 {
12487 #[inline]
12488 unsafe fn encode(
12489 self,
12490 encoder: &mut fidl::encoding::Encoder<'_, D>,
12491 offset: usize,
12492 depth: fidl::encoding::Depth,
12493 ) -> fidl::Result<()> {
12494 encoder.debug_check_bounds::<ViewProperties>(offset);
12495 unsafe {
12498 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
12499 (ptr as *mut u32).write_unaligned(0);
12500 }
12501 self.0.encode(encoder, offset + 0, depth)?;
12503 self.1.encode(encoder, offset + 24, depth)?;
12504 self.2.encode(encoder, offset + 36, depth)?;
12505 self.3.encode(encoder, offset + 48, depth)?;
12506 self.4.encode(encoder, offset + 49, depth)?;
12507 Ok(())
12508 }
12509 }
12510
12511 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewProperties {
12512 #[inline(always)]
12513 fn new_empty() -> Self {
12514 Self {
12515 bounding_box: fidl::new_empty!(BoundingBox, D),
12516 inset_from_min: fidl::new_empty!(Vec3, D),
12517 inset_from_max: fidl::new_empty!(Vec3, D),
12518 focus_change: fidl::new_empty!(bool, D),
12519 downward_input: fidl::new_empty!(bool, D),
12520 }
12521 }
12522
12523 #[inline]
12524 unsafe fn decode(
12525 &mut self,
12526 decoder: &mut fidl::encoding::Decoder<'_, D>,
12527 offset: usize,
12528 _depth: fidl::encoding::Depth,
12529 ) -> fidl::Result<()> {
12530 decoder.debug_check_bounds::<Self>(offset);
12531 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
12533 let padval = unsafe { (ptr as *const u32).read_unaligned() };
12534 let mask = 0xffff0000u32;
12535 let maskedval = padval & mask;
12536 if maskedval != 0 {
12537 return Err(fidl::Error::NonZeroPadding {
12538 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
12539 });
12540 }
12541 fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 0, _depth)?;
12542 fidl::decode!(Vec3, D, &mut self.inset_from_min, decoder, offset + 24, _depth)?;
12543 fidl::decode!(Vec3, D, &mut self.inset_from_max, decoder, offset + 36, _depth)?;
12544 fidl::decode!(bool, D, &mut self.focus_change, decoder, offset + 48, _depth)?;
12545 fidl::decode!(bool, D, &mut self.downward_input, decoder, offset + 49, _depth)?;
12546 Ok(())
12547 }
12548 }
12549
12550 impl fidl::encoding::ValueTypeMarker for ViewPropertiesChangedEvent {
12551 type Borrowed<'a> = &'a Self;
12552 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12553 value
12554 }
12555 }
12556
12557 unsafe impl fidl::encoding::TypeMarker for ViewPropertiesChangedEvent {
12558 type Owned = Self;
12559
12560 #[inline(always)]
12561 fn inline_align(_context: fidl::encoding::Context) -> usize {
12562 4
12563 }
12564
12565 #[inline(always)]
12566 fn inline_size(_context: fidl::encoding::Context) -> usize {
12567 56
12568 }
12569 }
12570
12571 unsafe impl<D: fidl::encoding::ResourceDialect>
12572 fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for &ViewPropertiesChangedEvent
12573 {
12574 #[inline]
12575 unsafe fn encode(
12576 self,
12577 encoder: &mut fidl::encoding::Encoder<'_, D>,
12578 offset: usize,
12579 _depth: fidl::encoding::Depth,
12580 ) -> fidl::Result<()> {
12581 encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12582 fidl::encoding::Encode::<ViewPropertiesChangedEvent, D>::encode(
12584 (
12585 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
12586 <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
12587 ),
12588 encoder,
12589 offset,
12590 _depth,
12591 )
12592 }
12593 }
12594 unsafe impl<
12595 D: fidl::encoding::ResourceDialect,
12596 T0: fidl::encoding::Encode<u32, D>,
12597 T1: fidl::encoding::Encode<ViewProperties, D>,
12598 > fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for (T0, T1)
12599 {
12600 #[inline]
12601 unsafe fn encode(
12602 self,
12603 encoder: &mut fidl::encoding::Encoder<'_, D>,
12604 offset: usize,
12605 depth: fidl::encoding::Depth,
12606 ) -> fidl::Result<()> {
12607 encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12608 self.0.encode(encoder, offset + 0, depth)?;
12612 self.1.encode(encoder, offset + 4, depth)?;
12613 Ok(())
12614 }
12615 }
12616
12617 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12618 for ViewPropertiesChangedEvent
12619 {
12620 #[inline(always)]
12621 fn new_empty() -> Self {
12622 Self {
12623 view_id: fidl::new_empty!(u32, D),
12624 properties: fidl::new_empty!(ViewProperties, D),
12625 }
12626 }
12627
12628 #[inline]
12629 unsafe fn decode(
12630 &mut self,
12631 decoder: &mut fidl::encoding::Decoder<'_, D>,
12632 offset: usize,
12633 _depth: fidl::encoding::Depth,
12634 ) -> fidl::Result<()> {
12635 decoder.debug_check_bounds::<Self>(offset);
12636 fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
12638 fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
12639 Ok(())
12640 }
12641 }
12642
12643 impl fidl::encoding::ValueTypeMarker for ViewState {
12644 type Borrowed<'a> = &'a Self;
12645 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12646 value
12647 }
12648 }
12649
12650 unsafe impl fidl::encoding::TypeMarker for ViewState {
12651 type Owned = Self;
12652
12653 #[inline(always)]
12654 fn inline_align(_context: fidl::encoding::Context) -> usize {
12655 1
12656 }
12657
12658 #[inline(always)]
12659 fn inline_size(_context: fidl::encoding::Context) -> usize {
12660 1
12661 }
12662 }
12663
12664 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewState, D>
12665 for &ViewState
12666 {
12667 #[inline]
12668 unsafe fn encode(
12669 self,
12670 encoder: &mut fidl::encoding::Encoder<'_, D>,
12671 offset: usize,
12672 _depth: fidl::encoding::Depth,
12673 ) -> fidl::Result<()> {
12674 encoder.debug_check_bounds::<ViewState>(offset);
12675 fidl::encoding::Encode::<ViewState, D>::encode(
12677 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_rendering),),
12678 encoder,
12679 offset,
12680 _depth,
12681 )
12682 }
12683 }
12684 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12685 fidl::encoding::Encode<ViewState, D> for (T0,)
12686 {
12687 #[inline]
12688 unsafe fn encode(
12689 self,
12690 encoder: &mut fidl::encoding::Encoder<'_, D>,
12691 offset: usize,
12692 depth: fidl::encoding::Depth,
12693 ) -> fidl::Result<()> {
12694 encoder.debug_check_bounds::<ViewState>(offset);
12695 self.0.encode(encoder, offset + 0, depth)?;
12699 Ok(())
12700 }
12701 }
12702
12703 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewState {
12704 #[inline(always)]
12705 fn new_empty() -> Self {
12706 Self { is_rendering: fidl::new_empty!(bool, D) }
12707 }
12708
12709 #[inline]
12710 unsafe fn decode(
12711 &mut self,
12712 decoder: &mut fidl::encoding::Decoder<'_, D>,
12713 offset: usize,
12714 _depth: fidl::encoding::Depth,
12715 ) -> fidl::Result<()> {
12716 decoder.debug_check_bounds::<Self>(offset);
12717 fidl::decode!(bool, D, &mut self.is_rendering, decoder, offset + 0, _depth)?;
12719 Ok(())
12720 }
12721 }
12722
12723 impl fidl::encoding::ValueTypeMarker for ViewStateChangedEvent {
12724 type Borrowed<'a> = &'a Self;
12725 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12726 value
12727 }
12728 }
12729
12730 unsafe impl fidl::encoding::TypeMarker for ViewStateChangedEvent {
12731 type Owned = Self;
12732
12733 #[inline(always)]
12734 fn inline_align(_context: fidl::encoding::Context) -> usize {
12735 4
12736 }
12737
12738 #[inline(always)]
12739 fn inline_size(_context: fidl::encoding::Context) -> usize {
12740 8
12741 }
12742 }
12743
12744 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewStateChangedEvent, D>
12745 for &ViewStateChangedEvent
12746 {
12747 #[inline]
12748 unsafe fn encode(
12749 self,
12750 encoder: &mut fidl::encoding::Encoder<'_, D>,
12751 offset: usize,
12752 _depth: fidl::encoding::Depth,
12753 ) -> fidl::Result<()> {
12754 encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12755 fidl::encoding::Encode::<ViewStateChangedEvent, D>::encode(
12757 (
12758 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
12759 <ViewState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
12760 ),
12761 encoder,
12762 offset,
12763 _depth,
12764 )
12765 }
12766 }
12767 unsafe impl<
12768 D: fidl::encoding::ResourceDialect,
12769 T0: fidl::encoding::Encode<u32, D>,
12770 T1: fidl::encoding::Encode<ViewState, D>,
12771 > fidl::encoding::Encode<ViewStateChangedEvent, D> for (T0, T1)
12772 {
12773 #[inline]
12774 unsafe fn encode(
12775 self,
12776 encoder: &mut fidl::encoding::Encoder<'_, D>,
12777 offset: usize,
12778 depth: fidl::encoding::Depth,
12779 ) -> fidl::Result<()> {
12780 encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12781 unsafe {
12784 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
12785 (ptr as *mut u32).write_unaligned(0);
12786 }
12787 self.0.encode(encoder, offset + 0, depth)?;
12789 self.1.encode(encoder, offset + 4, depth)?;
12790 Ok(())
12791 }
12792 }
12793
12794 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewStateChangedEvent {
12795 #[inline(always)]
12796 fn new_empty() -> Self {
12797 Self { view_holder_id: fidl::new_empty!(u32, D), state: fidl::new_empty!(ViewState, D) }
12798 }
12799
12800 #[inline]
12801 unsafe fn decode(
12802 &mut self,
12803 decoder: &mut fidl::encoding::Decoder<'_, D>,
12804 offset: usize,
12805 _depth: fidl::encoding::Depth,
12806 ) -> fidl::Result<()> {
12807 decoder.debug_check_bounds::<Self>(offset);
12808 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
12810 let padval = unsafe { (ptr as *const u32).read_unaligned() };
12811 let mask = 0xffffff00u32;
12812 let maskedval = padval & mask;
12813 if maskedval != 0 {
12814 return Err(fidl::Error::NonZeroPadding {
12815 padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
12816 });
12817 }
12818 fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
12819 fidl::decode!(ViewState, D, &mut self.state, decoder, offset + 4, _depth)?;
12820 Ok(())
12821 }
12822 }
12823
12824 impl fidl::encoding::ValueTypeMarker for Mat4 {
12825 type Borrowed<'a> = &'a Self;
12826 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12827 value
12828 }
12829 }
12830
12831 unsafe impl fidl::encoding::TypeMarker for Mat4 {
12832 type Owned = Self;
12833
12834 #[inline(always)]
12835 fn inline_align(_context: fidl::encoding::Context) -> usize {
12836 4
12837 }
12838
12839 #[inline(always)]
12840 fn inline_size(_context: fidl::encoding::Context) -> usize {
12841 64
12842 }
12843 }
12844
12845 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Mat4, D> for &Mat4 {
12846 #[inline]
12847 unsafe fn encode(
12848 self,
12849 encoder: &mut fidl::encoding::Encoder<'_, D>,
12850 offset: usize,
12851 _depth: fidl::encoding::Depth,
12852 ) -> fidl::Result<()> {
12853 encoder.debug_check_bounds::<Mat4>(offset);
12854 fidl::encoding::Encode::<Mat4, D>::encode(
12856 (<fidl::encoding::Array<f32, 16> as fidl::encoding::ValueTypeMarker>::borrow(
12857 &self.matrix,
12858 ),),
12859 encoder,
12860 offset,
12861 _depth,
12862 )
12863 }
12864 }
12865 unsafe impl<
12866 D: fidl::encoding::ResourceDialect,
12867 T0: fidl::encoding::Encode<fidl::encoding::Array<f32, 16>, D>,
12868 > fidl::encoding::Encode<Mat4, D> for (T0,)
12869 {
12870 #[inline]
12871 unsafe fn encode(
12872 self,
12873 encoder: &mut fidl::encoding::Encoder<'_, D>,
12874 offset: usize,
12875 depth: fidl::encoding::Depth,
12876 ) -> fidl::Result<()> {
12877 encoder.debug_check_bounds::<Mat4>(offset);
12878 self.0.encode(encoder, offset + 0, depth)?;
12882 Ok(())
12883 }
12884 }
12885
12886 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Mat4 {
12887 #[inline(always)]
12888 fn new_empty() -> Self {
12889 Self { matrix: fidl::new_empty!(fidl::encoding::Array<f32, 16>, D) }
12890 }
12891
12892 #[inline]
12893 unsafe fn decode(
12894 &mut self,
12895 decoder: &mut fidl::encoding::Decoder<'_, D>,
12896 offset: usize,
12897 _depth: fidl::encoding::Depth,
12898 ) -> fidl::Result<()> {
12899 decoder.debug_check_bounds::<Self>(offset);
12900 fidl::decode!(fidl::encoding::Array<f32, 16>, D, &mut self.matrix, decoder, offset + 0, _depth)?;
12902 Ok(())
12903 }
12904 }
12905
12906 impl fidl::encoding::ValueTypeMarker for Vec2 {
12907 type Borrowed<'a> = &'a Self;
12908 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12909 value
12910 }
12911 }
12912
12913 unsafe impl fidl::encoding::TypeMarker for Vec2 {
12914 type Owned = Self;
12915
12916 #[inline(always)]
12917 fn inline_align(_context: fidl::encoding::Context) -> usize {
12918 4
12919 }
12920
12921 #[inline(always)]
12922 fn inline_size(_context: fidl::encoding::Context) -> usize {
12923 8
12924 }
12925 }
12926
12927 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec2, D> for &Vec2 {
12928 #[inline]
12929 unsafe fn encode(
12930 self,
12931 encoder: &mut fidl::encoding::Encoder<'_, D>,
12932 offset: usize,
12933 _depth: fidl::encoding::Depth,
12934 ) -> fidl::Result<()> {
12935 encoder.debug_check_bounds::<Vec2>(offset);
12936 fidl::encoding::Encode::<Vec2, D>::encode(
12938 (
12939 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
12940 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
12941 ),
12942 encoder,
12943 offset,
12944 _depth,
12945 )
12946 }
12947 }
12948 unsafe impl<
12949 D: fidl::encoding::ResourceDialect,
12950 T0: fidl::encoding::Encode<f32, D>,
12951 T1: fidl::encoding::Encode<f32, D>,
12952 > fidl::encoding::Encode<Vec2, D> for (T0, T1)
12953 {
12954 #[inline]
12955 unsafe fn encode(
12956 self,
12957 encoder: &mut fidl::encoding::Encoder<'_, D>,
12958 offset: usize,
12959 depth: fidl::encoding::Depth,
12960 ) -> fidl::Result<()> {
12961 encoder.debug_check_bounds::<Vec2>(offset);
12962 self.0.encode(encoder, offset + 0, depth)?;
12966 self.1.encode(encoder, offset + 4, depth)?;
12967 Ok(())
12968 }
12969 }
12970
12971 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec2 {
12972 #[inline(always)]
12973 fn new_empty() -> Self {
12974 Self { x: fidl::new_empty!(f32, D), y: fidl::new_empty!(f32, D) }
12975 }
12976
12977 #[inline]
12978 unsafe fn decode(
12979 &mut self,
12980 decoder: &mut fidl::encoding::Decoder<'_, D>,
12981 offset: usize,
12982 _depth: fidl::encoding::Depth,
12983 ) -> fidl::Result<()> {
12984 decoder.debug_check_bounds::<Self>(offset);
12985 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
12987 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
12988 Ok(())
12989 }
12990 }
12991
12992 impl fidl::encoding::ValueTypeMarker for Vec3 {
12993 type Borrowed<'a> = &'a Self;
12994 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12995 value
12996 }
12997 }
12998
12999 unsafe impl fidl::encoding::TypeMarker for Vec3 {
13000 type Owned = Self;
13001
13002 #[inline(always)]
13003 fn inline_align(_context: fidl::encoding::Context) -> usize {
13004 4
13005 }
13006
13007 #[inline(always)]
13008 fn inline_size(_context: fidl::encoding::Context) -> usize {
13009 12
13010 }
13011 }
13012
13013 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec3, D> for &Vec3 {
13014 #[inline]
13015 unsafe fn encode(
13016 self,
13017 encoder: &mut fidl::encoding::Encoder<'_, D>,
13018 offset: usize,
13019 _depth: fidl::encoding::Depth,
13020 ) -> fidl::Result<()> {
13021 encoder.debug_check_bounds::<Vec3>(offset);
13022 fidl::encoding::Encode::<Vec3, D>::encode(
13024 (
13025 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
13026 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
13027 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
13028 ),
13029 encoder,
13030 offset,
13031 _depth,
13032 )
13033 }
13034 }
13035 unsafe impl<
13036 D: fidl::encoding::ResourceDialect,
13037 T0: fidl::encoding::Encode<f32, D>,
13038 T1: fidl::encoding::Encode<f32, D>,
13039 T2: fidl::encoding::Encode<f32, D>,
13040 > fidl::encoding::Encode<Vec3, D> for (T0, T1, T2)
13041 {
13042 #[inline]
13043 unsafe fn encode(
13044 self,
13045 encoder: &mut fidl::encoding::Encoder<'_, D>,
13046 offset: usize,
13047 depth: fidl::encoding::Depth,
13048 ) -> fidl::Result<()> {
13049 encoder.debug_check_bounds::<Vec3>(offset);
13050 self.0.encode(encoder, offset + 0, depth)?;
13054 self.1.encode(encoder, offset + 4, depth)?;
13055 self.2.encode(encoder, offset + 8, depth)?;
13056 Ok(())
13057 }
13058 }
13059
13060 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec3 {
13061 #[inline(always)]
13062 fn new_empty() -> Self {
13063 Self {
13064 x: fidl::new_empty!(f32, D),
13065 y: fidl::new_empty!(f32, D),
13066 z: fidl::new_empty!(f32, D),
13067 }
13068 }
13069
13070 #[inline]
13071 unsafe fn decode(
13072 &mut self,
13073 decoder: &mut fidl::encoding::Decoder<'_, D>,
13074 offset: usize,
13075 _depth: fidl::encoding::Depth,
13076 ) -> fidl::Result<()> {
13077 decoder.debug_check_bounds::<Self>(offset);
13078 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13080 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13081 fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13082 Ok(())
13083 }
13084 }
13085
13086 impl fidl::encoding::ValueTypeMarker for Vec4 {
13087 type Borrowed<'a> = &'a Self;
13088 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13089 value
13090 }
13091 }
13092
13093 unsafe impl fidl::encoding::TypeMarker for Vec4 {
13094 type Owned = Self;
13095
13096 #[inline(always)]
13097 fn inline_align(_context: fidl::encoding::Context) -> usize {
13098 4
13099 }
13100
13101 #[inline(always)]
13102 fn inline_size(_context: fidl::encoding::Context) -> usize {
13103 16
13104 }
13105 }
13106
13107 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec4, D> for &Vec4 {
13108 #[inline]
13109 unsafe fn encode(
13110 self,
13111 encoder: &mut fidl::encoding::Encoder<'_, D>,
13112 offset: usize,
13113 _depth: fidl::encoding::Depth,
13114 ) -> fidl::Result<()> {
13115 encoder.debug_check_bounds::<Vec4>(offset);
13116 fidl::encoding::Encode::<Vec4, D>::encode(
13118 (
13119 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
13120 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
13121 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
13122 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
13123 ),
13124 encoder,
13125 offset,
13126 _depth,
13127 )
13128 }
13129 }
13130 unsafe impl<
13131 D: fidl::encoding::ResourceDialect,
13132 T0: fidl::encoding::Encode<f32, D>,
13133 T1: fidl::encoding::Encode<f32, D>,
13134 T2: fidl::encoding::Encode<f32, D>,
13135 T3: fidl::encoding::Encode<f32, D>,
13136 > fidl::encoding::Encode<Vec4, D> for (T0, T1, T2, T3)
13137 {
13138 #[inline]
13139 unsafe fn encode(
13140 self,
13141 encoder: &mut fidl::encoding::Encoder<'_, D>,
13142 offset: usize,
13143 depth: fidl::encoding::Depth,
13144 ) -> fidl::Result<()> {
13145 encoder.debug_check_bounds::<Vec4>(offset);
13146 self.0.encode(encoder, offset + 0, depth)?;
13150 self.1.encode(encoder, offset + 4, depth)?;
13151 self.2.encode(encoder, offset + 8, depth)?;
13152 self.3.encode(encoder, offset + 12, depth)?;
13153 Ok(())
13154 }
13155 }
13156
13157 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec4 {
13158 #[inline(always)]
13159 fn new_empty() -> Self {
13160 Self {
13161 x: fidl::new_empty!(f32, D),
13162 y: fidl::new_empty!(f32, D),
13163 z: fidl::new_empty!(f32, D),
13164 w: fidl::new_empty!(f32, D),
13165 }
13166 }
13167
13168 #[inline]
13169 unsafe fn decode(
13170 &mut self,
13171 decoder: &mut fidl::encoding::Decoder<'_, D>,
13172 offset: usize,
13173 _depth: fidl::encoding::Depth,
13174 ) -> fidl::Result<()> {
13175 decoder.debug_check_bounds::<Self>(offset);
13176 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13178 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13179 fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13180 fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
13181 Ok(())
13182 }
13183 }
13184
13185 impl fidl::encoding::ValueTypeMarker for Event {
13186 type Borrowed<'a> = &'a Self;
13187 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13188 value
13189 }
13190 }
13191
13192 unsafe impl fidl::encoding::TypeMarker for Event {
13193 type Owned = Self;
13194
13195 #[inline(always)]
13196 fn inline_align(_context: fidl::encoding::Context) -> usize {
13197 8
13198 }
13199
13200 #[inline(always)]
13201 fn inline_size(_context: fidl::encoding::Context) -> usize {
13202 16
13203 }
13204 }
13205
13206 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Event, D> for &Event {
13207 #[inline]
13208 unsafe fn encode(
13209 self,
13210 encoder: &mut fidl::encoding::Encoder<'_, D>,
13211 offset: usize,
13212 _depth: fidl::encoding::Depth,
13213 ) -> fidl::Result<()> {
13214 encoder.debug_check_bounds::<Event>(offset);
13215 encoder.write_num::<u64>(self.ordinal(), offset);
13216 match self {
13217 Event::Metrics(ref val) => fidl::encoding::encode_in_envelope::<MetricsEvent, D>(
13218 <MetricsEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13219 encoder,
13220 offset + 8,
13221 _depth,
13222 ),
13223 Event::SizeChangeHint(ref val) => {
13224 fidl::encoding::encode_in_envelope::<SizeChangeHintEvent, D>(
13225 <SizeChangeHintEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13226 encoder,
13227 offset + 8,
13228 _depth,
13229 )
13230 }
13231 Event::ImportUnbound(ref val) => {
13232 fidl::encoding::encode_in_envelope::<ImportUnboundEvent, D>(
13233 <ImportUnboundEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13234 encoder,
13235 offset + 8,
13236 _depth,
13237 )
13238 }
13239 Event::ViewConnected(ref val) => {
13240 fidl::encoding::encode_in_envelope::<ViewConnectedEvent, D>(
13241 <ViewConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13242 encoder,
13243 offset + 8,
13244 _depth,
13245 )
13246 }
13247 Event::ViewDisconnected(ref val) => {
13248 fidl::encoding::encode_in_envelope::<ViewDisconnectedEvent, D>(
13249 <ViewDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13250 encoder,
13251 offset + 8,
13252 _depth,
13253 )
13254 }
13255 Event::ViewHolderDisconnected(ref val) => fidl::encoding::encode_in_envelope::<
13256 ViewHolderDisconnectedEvent,
13257 D,
13258 >(
13259 <ViewHolderDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13260 encoder,
13261 offset + 8,
13262 _depth,
13263 ),
13264 Event::ViewAttachedToScene(ref val) => {
13265 fidl::encoding::encode_in_envelope::<ViewAttachedToSceneEvent, D>(
13266 <ViewAttachedToSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13267 encoder,
13268 offset + 8,
13269 _depth,
13270 )
13271 }
13272 Event::ViewDetachedFromScene(ref val) => fidl::encoding::encode_in_envelope::<
13273 ViewDetachedFromSceneEvent,
13274 D,
13275 >(
13276 <ViewDetachedFromSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13277 encoder,
13278 offset + 8,
13279 _depth,
13280 ),
13281 Event::ViewPropertiesChanged(ref val) => fidl::encoding::encode_in_envelope::<
13282 ViewPropertiesChangedEvent,
13283 D,
13284 >(
13285 <ViewPropertiesChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13286 encoder,
13287 offset + 8,
13288 _depth,
13289 ),
13290 Event::ViewStateChanged(ref val) => {
13291 fidl::encoding::encode_in_envelope::<ViewStateChangedEvent, D>(
13292 <ViewStateChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13293 encoder,
13294 offset + 8,
13295 _depth,
13296 )
13297 }
13298 Event::ViewHolderConnected(ref val) => {
13299 fidl::encoding::encode_in_envelope::<ViewHolderConnectedEvent, D>(
13300 <ViewHolderConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13301 encoder,
13302 offset + 8,
13303 _depth,
13304 )
13305 }
13306 }
13307 }
13308 }
13309
13310 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Event {
13311 #[inline(always)]
13312 fn new_empty() -> Self {
13313 Self::Metrics(fidl::new_empty!(MetricsEvent, D))
13314 }
13315
13316 #[inline]
13317 unsafe fn decode(
13318 &mut self,
13319 decoder: &mut fidl::encoding::Decoder<'_, D>,
13320 offset: usize,
13321 mut depth: fidl::encoding::Depth,
13322 ) -> fidl::Result<()> {
13323 decoder.debug_check_bounds::<Self>(offset);
13324 #[allow(unused_variables)]
13325 let next_out_of_line = decoder.next_out_of_line();
13326 let handles_before = decoder.remaining_handles();
13327 let (ordinal, inlined, num_bytes, num_handles) =
13328 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13329
13330 let member_inline_size = match ordinal {
13331 1 => <MetricsEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13332 2 => <SizeChangeHintEvent as fidl::encoding::TypeMarker>::inline_size(
13333 decoder.context,
13334 ),
13335 3 => {
13336 <ImportUnboundEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13337 }
13338 4 => {
13339 <ViewConnectedEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13340 }
13341 5 => <ViewDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13342 decoder.context,
13343 ),
13344 6 => <ViewHolderDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13345 decoder.context,
13346 ),
13347 7 => <ViewAttachedToSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13348 decoder.context,
13349 ),
13350 8 => <ViewDetachedFromSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13351 decoder.context,
13352 ),
13353 9 => <ViewPropertiesChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13354 decoder.context,
13355 ),
13356 10 => <ViewStateChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13357 decoder.context,
13358 ),
13359 11 => <ViewHolderConnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13360 decoder.context,
13361 ),
13362 _ => return Err(fidl::Error::UnknownUnionTag),
13363 };
13364
13365 if inlined != (member_inline_size <= 4) {
13366 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13367 }
13368 let _inner_offset;
13369 if inlined {
13370 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13371 _inner_offset = offset + 8;
13372 } else {
13373 depth.increment()?;
13374 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13375 }
13376 match ordinal {
13377 1 => {
13378 #[allow(irrefutable_let_patterns)]
13379 if let Event::Metrics(_) = self {
13380 } else {
13382 *self = Event::Metrics(fidl::new_empty!(MetricsEvent, D));
13384 }
13385 #[allow(irrefutable_let_patterns)]
13386 if let Event::Metrics(ref mut val) = self {
13387 fidl::decode!(MetricsEvent, D, val, decoder, _inner_offset, depth)?;
13388 } else {
13389 unreachable!()
13390 }
13391 }
13392 2 => {
13393 #[allow(irrefutable_let_patterns)]
13394 if let Event::SizeChangeHint(_) = self {
13395 } else {
13397 *self = Event::SizeChangeHint(fidl::new_empty!(SizeChangeHintEvent, D));
13399 }
13400 #[allow(irrefutable_let_patterns)]
13401 if let Event::SizeChangeHint(ref mut val) = self {
13402 fidl::decode!(SizeChangeHintEvent, D, val, decoder, _inner_offset, depth)?;
13403 } else {
13404 unreachable!()
13405 }
13406 }
13407 3 => {
13408 #[allow(irrefutable_let_patterns)]
13409 if let Event::ImportUnbound(_) = self {
13410 } else {
13412 *self = Event::ImportUnbound(fidl::new_empty!(ImportUnboundEvent, D));
13414 }
13415 #[allow(irrefutable_let_patterns)]
13416 if let Event::ImportUnbound(ref mut val) = self {
13417 fidl::decode!(ImportUnboundEvent, D, val, decoder, _inner_offset, depth)?;
13418 } else {
13419 unreachable!()
13420 }
13421 }
13422 4 => {
13423 #[allow(irrefutable_let_patterns)]
13424 if let Event::ViewConnected(_) = self {
13425 } else {
13427 *self = Event::ViewConnected(fidl::new_empty!(ViewConnectedEvent, D));
13429 }
13430 #[allow(irrefutable_let_patterns)]
13431 if let Event::ViewConnected(ref mut val) = self {
13432 fidl::decode!(ViewConnectedEvent, D, val, decoder, _inner_offset, depth)?;
13433 } else {
13434 unreachable!()
13435 }
13436 }
13437 5 => {
13438 #[allow(irrefutable_let_patterns)]
13439 if let Event::ViewDisconnected(_) = self {
13440 } else {
13442 *self = Event::ViewDisconnected(fidl::new_empty!(ViewDisconnectedEvent, D));
13444 }
13445 #[allow(irrefutable_let_patterns)]
13446 if let Event::ViewDisconnected(ref mut val) = self {
13447 fidl::decode!(
13448 ViewDisconnectedEvent,
13449 D,
13450 val,
13451 decoder,
13452 _inner_offset,
13453 depth
13454 )?;
13455 } else {
13456 unreachable!()
13457 }
13458 }
13459 6 => {
13460 #[allow(irrefutable_let_patterns)]
13461 if let Event::ViewHolderDisconnected(_) = self {
13462 } else {
13464 *self = Event::ViewHolderDisconnected(fidl::new_empty!(
13466 ViewHolderDisconnectedEvent,
13467 D
13468 ));
13469 }
13470 #[allow(irrefutable_let_patterns)]
13471 if let Event::ViewHolderDisconnected(ref mut val) = self {
13472 fidl::decode!(
13473 ViewHolderDisconnectedEvent,
13474 D,
13475 val,
13476 decoder,
13477 _inner_offset,
13478 depth
13479 )?;
13480 } else {
13481 unreachable!()
13482 }
13483 }
13484 7 => {
13485 #[allow(irrefutable_let_patterns)]
13486 if let Event::ViewAttachedToScene(_) = self {
13487 } else {
13489 *self = Event::ViewAttachedToScene(fidl::new_empty!(
13491 ViewAttachedToSceneEvent,
13492 D
13493 ));
13494 }
13495 #[allow(irrefutable_let_patterns)]
13496 if let Event::ViewAttachedToScene(ref mut val) = self {
13497 fidl::decode!(
13498 ViewAttachedToSceneEvent,
13499 D,
13500 val,
13501 decoder,
13502 _inner_offset,
13503 depth
13504 )?;
13505 } else {
13506 unreachable!()
13507 }
13508 }
13509 8 => {
13510 #[allow(irrefutable_let_patterns)]
13511 if let Event::ViewDetachedFromScene(_) = self {
13512 } else {
13514 *self = Event::ViewDetachedFromScene(fidl::new_empty!(
13516 ViewDetachedFromSceneEvent,
13517 D
13518 ));
13519 }
13520 #[allow(irrefutable_let_patterns)]
13521 if let Event::ViewDetachedFromScene(ref mut val) = self {
13522 fidl::decode!(
13523 ViewDetachedFromSceneEvent,
13524 D,
13525 val,
13526 decoder,
13527 _inner_offset,
13528 depth
13529 )?;
13530 } else {
13531 unreachable!()
13532 }
13533 }
13534 9 => {
13535 #[allow(irrefutable_let_patterns)]
13536 if let Event::ViewPropertiesChanged(_) = self {
13537 } else {
13539 *self = Event::ViewPropertiesChanged(fidl::new_empty!(
13541 ViewPropertiesChangedEvent,
13542 D
13543 ));
13544 }
13545 #[allow(irrefutable_let_patterns)]
13546 if let Event::ViewPropertiesChanged(ref mut val) = self {
13547 fidl::decode!(
13548 ViewPropertiesChangedEvent,
13549 D,
13550 val,
13551 decoder,
13552 _inner_offset,
13553 depth
13554 )?;
13555 } else {
13556 unreachable!()
13557 }
13558 }
13559 10 => {
13560 #[allow(irrefutable_let_patterns)]
13561 if let Event::ViewStateChanged(_) = self {
13562 } else {
13564 *self = Event::ViewStateChanged(fidl::new_empty!(ViewStateChangedEvent, D));
13566 }
13567 #[allow(irrefutable_let_patterns)]
13568 if let Event::ViewStateChanged(ref mut val) = self {
13569 fidl::decode!(
13570 ViewStateChangedEvent,
13571 D,
13572 val,
13573 decoder,
13574 _inner_offset,
13575 depth
13576 )?;
13577 } else {
13578 unreachable!()
13579 }
13580 }
13581 11 => {
13582 #[allow(irrefutable_let_patterns)]
13583 if let Event::ViewHolderConnected(_) = self {
13584 } else {
13586 *self = Event::ViewHolderConnected(fidl::new_empty!(
13588 ViewHolderConnectedEvent,
13589 D
13590 ));
13591 }
13592 #[allow(irrefutable_let_patterns)]
13593 if let Event::ViewHolderConnected(ref mut val) = self {
13594 fidl::decode!(
13595 ViewHolderConnectedEvent,
13596 D,
13597 val,
13598 decoder,
13599 _inner_offset,
13600 depth
13601 )?;
13602 } else {
13603 unreachable!()
13604 }
13605 }
13606 ordinal => panic!("unexpected ordinal {:?}", ordinal),
13607 }
13608 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13609 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13610 }
13611 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13612 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13613 }
13614 Ok(())
13615 }
13616 }
13617
13618 impl fidl::encoding::ValueTypeMarker for RendererParam {
13619 type Borrowed<'a> = &'a Self;
13620 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13621 value
13622 }
13623 }
13624
13625 unsafe impl fidl::encoding::TypeMarker for RendererParam {
13626 type Owned = Self;
13627
13628 #[inline(always)]
13629 fn inline_align(_context: fidl::encoding::Context) -> usize {
13630 8
13631 }
13632
13633 #[inline(always)]
13634 fn inline_size(_context: fidl::encoding::Context) -> usize {
13635 16
13636 }
13637 }
13638
13639 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererParam, D>
13640 for &RendererParam
13641 {
13642 #[inline]
13643 unsafe fn encode(
13644 self,
13645 encoder: &mut fidl::encoding::Encoder<'_, D>,
13646 offset: usize,
13647 _depth: fidl::encoding::Depth,
13648 ) -> fidl::Result<()> {
13649 encoder.debug_check_bounds::<RendererParam>(offset);
13650 encoder.write_num::<u64>(self.ordinal(), offset);
13651 match self {
13652 RendererParam::ShadowTechnique(ref val) => {
13653 fidl::encoding::encode_in_envelope::<ShadowTechnique, D>(
13654 <ShadowTechnique as fidl::encoding::ValueTypeMarker>::borrow(val),
13655 encoder,
13656 offset + 8,
13657 _depth,
13658 )
13659 }
13660 RendererParam::Reserved(ref val) => {
13661 fidl::encoding::encode_in_envelope::<RenderFrequency, D>(
13662 <RenderFrequency as fidl::encoding::ValueTypeMarker>::borrow(val),
13663 encoder,
13664 offset + 8,
13665 _depth,
13666 )
13667 }
13668 RendererParam::EnableDebugging(ref val) => {
13669 fidl::encoding::encode_in_envelope::<bool, D>(
13670 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
13671 encoder,
13672 offset + 8,
13673 _depth,
13674 )
13675 }
13676 }
13677 }
13678 }
13679
13680 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererParam {
13681 #[inline(always)]
13682 fn new_empty() -> Self {
13683 Self::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D))
13684 }
13685
13686 #[inline]
13687 unsafe fn decode(
13688 &mut self,
13689 decoder: &mut fidl::encoding::Decoder<'_, D>,
13690 offset: usize,
13691 mut depth: fidl::encoding::Depth,
13692 ) -> fidl::Result<()> {
13693 decoder.debug_check_bounds::<Self>(offset);
13694 #[allow(unused_variables)]
13695 let next_out_of_line = decoder.next_out_of_line();
13696 let handles_before = decoder.remaining_handles();
13697 let (ordinal, inlined, num_bytes, num_handles) =
13698 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13699
13700 let member_inline_size = match ordinal {
13701 1 => <ShadowTechnique as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13702 2 => <RenderFrequency as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13703 3 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13704 _ => return Err(fidl::Error::UnknownUnionTag),
13705 };
13706
13707 if inlined != (member_inline_size <= 4) {
13708 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13709 }
13710 let _inner_offset;
13711 if inlined {
13712 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13713 _inner_offset = offset + 8;
13714 } else {
13715 depth.increment()?;
13716 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13717 }
13718 match ordinal {
13719 1 => {
13720 #[allow(irrefutable_let_patterns)]
13721 if let RendererParam::ShadowTechnique(_) = self {
13722 } else {
13724 *self =
13726 RendererParam::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D));
13727 }
13728 #[allow(irrefutable_let_patterns)]
13729 if let RendererParam::ShadowTechnique(ref mut val) = self {
13730 fidl::decode!(ShadowTechnique, D, val, decoder, _inner_offset, depth)?;
13731 } else {
13732 unreachable!()
13733 }
13734 }
13735 2 => {
13736 #[allow(irrefutable_let_patterns)]
13737 if let RendererParam::Reserved(_) = self {
13738 } else {
13740 *self = RendererParam::Reserved(fidl::new_empty!(RenderFrequency, D));
13742 }
13743 #[allow(irrefutable_let_patterns)]
13744 if let RendererParam::Reserved(ref mut val) = self {
13745 fidl::decode!(RenderFrequency, D, val, decoder, _inner_offset, depth)?;
13746 } else {
13747 unreachable!()
13748 }
13749 }
13750 3 => {
13751 #[allow(irrefutable_let_patterns)]
13752 if let RendererParam::EnableDebugging(_) = self {
13753 } else {
13755 *self = RendererParam::EnableDebugging(fidl::new_empty!(bool, D));
13757 }
13758 #[allow(irrefutable_let_patterns)]
13759 if let RendererParam::EnableDebugging(ref mut val) = self {
13760 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
13761 } else {
13762 unreachable!()
13763 }
13764 }
13765 ordinal => panic!("unexpected ordinal {:?}", ordinal),
13766 }
13767 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13768 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13769 }
13770 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13771 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13772 }
13773 Ok(())
13774 }
13775 }
13776
13777 impl fidl::encoding::ValueTypeMarker for Value {
13778 type Borrowed<'a> = &'a Self;
13779 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13780 value
13781 }
13782 }
13783
13784 unsafe impl fidl::encoding::TypeMarker for Value {
13785 type Owned = Self;
13786
13787 #[inline(always)]
13788 fn inline_align(_context: fidl::encoding::Context) -> usize {
13789 8
13790 }
13791
13792 #[inline(always)]
13793 fn inline_size(_context: fidl::encoding::Context) -> usize {
13794 16
13795 }
13796 }
13797
13798 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
13799 #[inline]
13800 unsafe fn encode(
13801 self,
13802 encoder: &mut fidl::encoding::Encoder<'_, D>,
13803 offset: usize,
13804 _depth: fidl::encoding::Depth,
13805 ) -> fidl::Result<()> {
13806 encoder.debug_check_bounds::<Value>(offset);
13807 encoder.write_num::<u64>(self.ordinal(), offset);
13808 match self {
13809 Value::Vector1(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13810 <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13811 encoder,
13812 offset + 8,
13813 _depth,
13814 ),
13815 Value::Vector2(ref val) => fidl::encoding::encode_in_envelope::<Vec2, D>(
13816 <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(val),
13817 encoder,
13818 offset + 8,
13819 _depth,
13820 ),
13821 Value::Vector3(ref val) => fidl::encoding::encode_in_envelope::<Vec3, D>(
13822 <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(val),
13823 encoder,
13824 offset + 8,
13825 _depth,
13826 ),
13827 Value::Vector4(ref val) => fidl::encoding::encode_in_envelope::<Vec4, D>(
13828 <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13829 encoder,
13830 offset + 8,
13831 _depth,
13832 ),
13833 Value::Matrix4x4(ref val) => fidl::encoding::encode_in_envelope::<Mat4, D>(
13834 <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13835 encoder,
13836 offset + 8,
13837 _depth,
13838 ),
13839 Value::ColorRgba(ref val) => fidl::encoding::encode_in_envelope::<ColorRgba, D>(
13840 <ColorRgba as fidl::encoding::ValueTypeMarker>::borrow(val),
13841 encoder,
13842 offset + 8,
13843 _depth,
13844 ),
13845 Value::ColorRgb(ref val) => fidl::encoding::encode_in_envelope::<ColorRgb, D>(
13846 <ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(val),
13847 encoder,
13848 offset + 8,
13849 _depth,
13850 ),
13851 Value::Degrees(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13852 <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13853 encoder,
13854 offset + 8,
13855 _depth,
13856 ),
13857 Value::Quaternion(ref val) => fidl::encoding::encode_in_envelope::<Quaternion, D>(
13858 <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(val),
13859 encoder,
13860 offset + 8,
13861 _depth,
13862 ),
13863 Value::Transform(ref val) => {
13864 fidl::encoding::encode_in_envelope::<FactoredTransform, D>(
13865 <FactoredTransform as fidl::encoding::ValueTypeMarker>::borrow(val),
13866 encoder,
13867 offset + 8,
13868 _depth,
13869 )
13870 }
13871 Value::VariableId(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
13872 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13873 encoder,
13874 offset + 8,
13875 _depth,
13876 ),
13877 }
13878 }
13879 }
13880
13881 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
13882 #[inline(always)]
13883 fn new_empty() -> Self {
13884 Self::Vector1(fidl::new_empty!(f32, D))
13885 }
13886
13887 #[inline]
13888 unsafe fn decode(
13889 &mut self,
13890 decoder: &mut fidl::encoding::Decoder<'_, D>,
13891 offset: usize,
13892 mut depth: fidl::encoding::Depth,
13893 ) -> fidl::Result<()> {
13894 decoder.debug_check_bounds::<Self>(offset);
13895 #[allow(unused_variables)]
13896 let next_out_of_line = decoder.next_out_of_line();
13897 let handles_before = decoder.remaining_handles();
13898 let (ordinal, inlined, num_bytes, num_handles) =
13899 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13900
13901 let member_inline_size = match ordinal {
13902 1 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13903 2 => <Vec2 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13904 3 => <Vec3 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13905 4 => <Vec4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13906 5 => <Mat4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13907 6 => <ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13908 7 => <ColorRgb as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13909 8 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13910 9 => <Quaternion as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13911 10 => {
13912 <FactoredTransform as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13913 }
13914 11 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13915 _ => return Err(fidl::Error::UnknownUnionTag),
13916 };
13917
13918 if inlined != (member_inline_size <= 4) {
13919 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13920 }
13921 let _inner_offset;
13922 if inlined {
13923 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13924 _inner_offset = offset + 8;
13925 } else {
13926 depth.increment()?;
13927 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13928 }
13929 match ordinal {
13930 1 => {
13931 #[allow(irrefutable_let_patterns)]
13932 if let Value::Vector1(_) = self {
13933 } else {
13935 *self = Value::Vector1(fidl::new_empty!(f32, D));
13937 }
13938 #[allow(irrefutable_let_patterns)]
13939 if let Value::Vector1(ref mut val) = self {
13940 fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
13941 } else {
13942 unreachable!()
13943 }
13944 }
13945 2 => {
13946 #[allow(irrefutable_let_patterns)]
13947 if let Value::Vector2(_) = self {
13948 } else {
13950 *self = Value::Vector2(fidl::new_empty!(Vec2, D));
13952 }
13953 #[allow(irrefutable_let_patterns)]
13954 if let Value::Vector2(ref mut val) = self {
13955 fidl::decode!(Vec2, D, val, decoder, _inner_offset, depth)?;
13956 } else {
13957 unreachable!()
13958 }
13959 }
13960 3 => {
13961 #[allow(irrefutable_let_patterns)]
13962 if let Value::Vector3(_) = self {
13963 } else {
13965 *self = Value::Vector3(fidl::new_empty!(Vec3, D));
13967 }
13968 #[allow(irrefutable_let_patterns)]
13969 if let Value::Vector3(ref mut val) = self {
13970 fidl::decode!(Vec3, D, val, decoder, _inner_offset, depth)?;
13971 } else {
13972 unreachable!()
13973 }
13974 }
13975 4 => {
13976 #[allow(irrefutable_let_patterns)]
13977 if let Value::Vector4(_) = self {
13978 } else {
13980 *self = Value::Vector4(fidl::new_empty!(Vec4, D));
13982 }
13983 #[allow(irrefutable_let_patterns)]
13984 if let Value::Vector4(ref mut val) = self {
13985 fidl::decode!(Vec4, D, val, decoder, _inner_offset, depth)?;
13986 } else {
13987 unreachable!()
13988 }
13989 }
13990 5 => {
13991 #[allow(irrefutable_let_patterns)]
13992 if let Value::Matrix4x4(_) = self {
13993 } else {
13995 *self = Value::Matrix4x4(fidl::new_empty!(Mat4, D));
13997 }
13998 #[allow(irrefutable_let_patterns)]
13999 if let Value::Matrix4x4(ref mut val) = self {
14000 fidl::decode!(Mat4, D, val, decoder, _inner_offset, depth)?;
14001 } else {
14002 unreachable!()
14003 }
14004 }
14005 6 => {
14006 #[allow(irrefutable_let_patterns)]
14007 if let Value::ColorRgba(_) = self {
14008 } else {
14010 *self = Value::ColorRgba(fidl::new_empty!(ColorRgba, D));
14012 }
14013 #[allow(irrefutable_let_patterns)]
14014 if let Value::ColorRgba(ref mut val) = self {
14015 fidl::decode!(ColorRgba, D, val, decoder, _inner_offset, depth)?;
14016 } else {
14017 unreachable!()
14018 }
14019 }
14020 7 => {
14021 #[allow(irrefutable_let_patterns)]
14022 if let Value::ColorRgb(_) = self {
14023 } else {
14025 *self = Value::ColorRgb(fidl::new_empty!(ColorRgb, D));
14027 }
14028 #[allow(irrefutable_let_patterns)]
14029 if let Value::ColorRgb(ref mut val) = self {
14030 fidl::decode!(ColorRgb, D, val, decoder, _inner_offset, depth)?;
14031 } else {
14032 unreachable!()
14033 }
14034 }
14035 8 => {
14036 #[allow(irrefutable_let_patterns)]
14037 if let Value::Degrees(_) = self {
14038 } else {
14040 *self = Value::Degrees(fidl::new_empty!(f32, D));
14042 }
14043 #[allow(irrefutable_let_patterns)]
14044 if let Value::Degrees(ref mut val) = self {
14045 fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
14046 } else {
14047 unreachable!()
14048 }
14049 }
14050 9 => {
14051 #[allow(irrefutable_let_patterns)]
14052 if let Value::Quaternion(_) = self {
14053 } else {
14055 *self = Value::Quaternion(fidl::new_empty!(Quaternion, D));
14057 }
14058 #[allow(irrefutable_let_patterns)]
14059 if let Value::Quaternion(ref mut val) = self {
14060 fidl::decode!(Quaternion, D, val, decoder, _inner_offset, depth)?;
14061 } else {
14062 unreachable!()
14063 }
14064 }
14065 10 => {
14066 #[allow(irrefutable_let_patterns)]
14067 if let Value::Transform(_) = self {
14068 } else {
14070 *self = Value::Transform(fidl::new_empty!(FactoredTransform, D));
14072 }
14073 #[allow(irrefutable_let_patterns)]
14074 if let Value::Transform(ref mut val) = self {
14075 fidl::decode!(FactoredTransform, D, val, decoder, _inner_offset, depth)?;
14076 } else {
14077 unreachable!()
14078 }
14079 }
14080 11 => {
14081 #[allow(irrefutable_let_patterns)]
14082 if let Value::VariableId(_) = self {
14083 } else {
14085 *self = Value::VariableId(fidl::new_empty!(u32, D));
14087 }
14088 #[allow(irrefutable_let_patterns)]
14089 if let Value::VariableId(ref mut val) = self {
14090 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
14091 } else {
14092 unreachable!()
14093 }
14094 }
14095 ordinal => panic!("unexpected ordinal {:?}", ordinal),
14096 }
14097 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14098 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14099 }
14100 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14101 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14102 }
14103 Ok(())
14104 }
14105 }
14106}