fidl_fuchsia_ui_gfx__common/
fidl_fuchsia_ui_gfx__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// Maximum length for a resource label.
12pub const LABEL_MAX_LENGTH: u32 = 32;
13
14/// Reports metrics information.
15/// This event type is only reported for node resources.
16pub const METRICS_EVENT_MASK: u32 = 1;
17
18pub const SIZE_CHANGE_HINT_EVENT_MASK: u32 = 2;
19
20/// Describes how nodes interact with hit testings.
21#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
22#[repr(u32)]
23pub enum HitTestBehavior {
24    /// Apply hit testing to the node's content, its parts, and its children.
25    KDefault = 0,
26    /// Suppress hit testing of the node and everything it contains.
27    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
46/// Describes an exported resource that is to be imported by an
47/// ImportResourceCmd.
48///
49/// NOTE: Currently just an enum of importable resource types, but may later be
50/// expanded to express concepts like "meshes with a particular vertex format".
51#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
52#[repr(u32)]
53pub enum ImportSpec {
54    Node = 0,
55}
56
57impl ImportSpec {
58    #[inline]
59    pub fn from_primitive(prim: u32) -> Option<Self> {
60        match prim {
61            0 => Some(Self::Node),
62            _ => None,
63        }
64    }
65
66    #[inline]
67    pub const fn into_primitive(self) -> u32 {
68        self as u32
69    }
70}
71
72/// Set a mesh's indices and vertices.
73///
74/// `mesh_id` refs the Mesh to be updated.
75/// `index_buffer_id` refs a Buffer that contains the mesh indices.
76/// `index_format` defines how the index buffer data is to be interpreted.
77/// `index_offset` number of bytes from the start of the index Buffer.
78/// `index_count` number of indices.
79/// `vertex_buffer_id` refs a Buffer that contains the mesh vertices.
80/// `vertex_format` defines how the vertex buffer data is to be interpreted.
81/// `vertex_offset` number of bytes from the start of the vertex Buffer.
82/// `vertex_count` number of vertices.
83/// `bounding_box` must contain all vertices within the specified range.
84///
85/// The MeshVertexFormat defines which per-vertex attributes are provided by the
86/// mesh, and the size of each attribute (and therefore the size of each vertex).
87/// The attributes are ordered within the vertex in the same order that they
88/// appear within the MeshVertexFormat struct.  For example, if the values are
89/// kVector3, kNone and kVector2, then:
90///   - each vertex has a position and UV-coordinates, but no surface normal.
91///   - the 3D position occupies bytes 0-11 (3 dimensions * 4 bytes per float32).
92///   - the UV coords occupy bytes 12-19, since no surface normal is provided.
93#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
94#[repr(u32)]
95pub enum MeshIndexFormat {
96    KUint16 = 1,
97    KUint32 = 2,
98}
99
100impl MeshIndexFormat {
101    #[inline]
102    pub fn from_primitive(prim: u32) -> Option<Self> {
103        match prim {
104            1 => Some(Self::KUint16),
105            2 => Some(Self::KUint32),
106            _ => None,
107        }
108    }
109
110    #[inline]
111    pub const fn into_primitive(self) -> u32 {
112        self as u32
113    }
114}
115
116#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
117#[repr(u32)]
118pub enum RenderFrequency {
119    WhenRequested = 0,
120    Continuously = 1,
121}
122
123impl RenderFrequency {
124    #[inline]
125    pub fn from_primitive(prim: u32) -> Option<Self> {
126        match prim {
127            0 => Some(Self::WhenRequested),
128            1 => Some(Self::Continuously),
129            _ => None,
130        }
131    }
132
133    #[inline]
134    pub const fn into_primitive(self) -> u32 {
135        self as u32
136    }
137}
138
139/// Represents the shadow algorithm that the `Renderer` should use when lighting
140/// the scene.
141#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
142#[repr(u32)]
143pub enum ShadowTechnique {
144    /// No shadows.
145    Unshadowed = 0,
146    /// Default.  Screen-space, depth-buffer based shadows; SSDO-ish.
147    ScreenSpace = 1,
148    /// Basic shadow map.
149    ShadowMap = 2,
150    /// Moment shadow map (see http:///momentsingraphics.de).
151    MomentShadowMap = 3,
152    /// Stencil shadow volume.
153    StencilShadowVolume = 4,
154}
155
156impl ShadowTechnique {
157    #[inline]
158    pub fn from_primitive(prim: u32) -> Option<Self> {
159        match prim {
160            0 => Some(Self::Unshadowed),
161            1 => Some(Self::ScreenSpace),
162            2 => Some(Self::ShadowMap),
163            3 => Some(Self::MomentShadowMap),
164            4 => Some(Self::StencilShadowVolume),
165            _ => None,
166        }
167    }
168
169    #[inline]
170    pub const fn into_primitive(self) -> u32 {
171        self as u32
172    }
173}
174
175#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
176#[repr(u32)]
177pub enum ValueType {
178    KNone = 0,
179    KVector1 = 1,
180    KVector2 = 2,
181    KVector3 = 3,
182    KVector4 = 4,
183    KMatrix4 = 5,
184    KColorRgb = 6,
185    KColorRgba = 7,
186    KQuaternion = 8,
187    KFactoredTransform = 9,
188}
189
190impl ValueType {
191    #[inline]
192    pub fn from_primitive(prim: u32) -> Option<Self> {
193        match prim {
194            0 => Some(Self::KNone),
195            1 => Some(Self::KVector1),
196            2 => Some(Self::KVector2),
197            3 => Some(Self::KVector3),
198            4 => Some(Self::KVector4),
199            5 => Some(Self::KMatrix4),
200            6 => Some(Self::KColorRgb),
201            7 => Some(Self::KColorRgba),
202            8 => Some(Self::KQuaternion),
203            9 => Some(Self::KFactoredTransform),
204            _ => None,
205        }
206    }
207
208    #[inline]
209    pub const fn into_primitive(self) -> u32 {
210        self as u32
211    }
212}
213
214/// Add a node as a child to another node.
215///
216/// Constraints:
217/// - `id` refs a Node with the has_children characteristic.
218/// - `child_id` refs any Node.
219///
220/// Discussion:
221/// The child node is first removed from its existing parent, as if DetachCmd
222/// was applied first.
223#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
224#[repr(C)]
225pub struct AddChildCmd {
226    pub node_id: u32,
227    pub child_id: u32,
228}
229
230impl fidl::Persistable for AddChildCmd {}
231
232/// Add a layer to a layer stack.
233/// Constraints:
234/// - `layer_stack_id` refs a `LayerStack`.
235/// - `layer_id` refs a `Layer`.
236/// - The layer must not already belong to a different stack; it must first be
237///   detached.
238#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
239#[repr(C)]
240pub struct AddLayerCmd {
241    pub layer_stack_id: u32,
242    pub layer_id: u32,
243}
244
245impl fidl::Persistable for AddLayerCmd {}
246
247/// Adds the light specified by `light_id` specified by `light_id` to the scene
248/// identified by `scene_id`.
249#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
250#[repr(C)]
251pub struct AddLightCmd {
252    pub scene_id: u32,
253    pub light_id: u32,
254}
255
256impl fidl::Persistable for AddLightCmd {}
257
258/// Add a node as a part of another node.  The implications of being a part
259/// rather than a child differ based on the type of the part.  However, one
260/// implication is constant: removing all of a node's children (e.g. via
261/// DetachChildrenCmd) does not affect its parts.  This is similar to the
262/// "shadow DOM" in a web browser: the controls of a <video> element are
263/// implemented as using the shadow DOM, and do no show up amongst the children
264/// of that element.
265///
266/// Constraints:
267/// - `id` refs a Node with the has_parts characteristic.
268/// - `part_id` refs any Node.
269///
270/// Discussion:
271/// The part node is first removed from its existing parent, as if DetachCmd
272/// was applied first.
273#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
274#[repr(C)]
275pub struct AddPartCmd {
276    pub node_id: u32,
277    pub part_id: u32,
278}
279
280impl fidl::Persistable for AddPartCmd {}
281
282/// An AmbientLight is a Light that is is assumed to be everywhere in the scene,
283/// in all directions.
284///
285/// Supported commands:
286/// - SetLightColor
287#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
288#[repr(C)]
289pub struct AmbientLightArgs {
290    pub dummy: u32,
291}
292
293impl fidl::Persistable for AmbientLightArgs {}
294
295#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
296pub struct BindMeshBuffersCmd {
297    pub mesh_id: u32,
298    pub index_buffer_id: u32,
299    pub index_format: MeshIndexFormat,
300    pub index_offset: u64,
301    pub index_count: u32,
302    pub vertex_buffer_id: u32,
303    pub vertex_format: MeshVertexFormat,
304    pub vertex_offset: u64,
305    pub vertex_count: u32,
306    pub bounding_box: BoundingBox,
307}
308
309impl fidl::Persistable for BindMeshBuffersCmd {}
310
311/// Represents an axis-aligned bounding box.
312///
313/// If any of the dimensions has a negative extent (e.g. max.x < min.x) then the
314/// bounding box is treated as empty. It is valid for a client to define an
315/// empty bounding box.
316///
317/// An "empty bounding box" is one that does not admit a point inhabitant.
318/// Note that a zero-volume, zero-area bounding box (e.g., a point like
319/// (0,0,0)-(0,0,0), or a line like (0,0,0)-(1,0,0)) is thus not empty.
320#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
321pub struct BoundingBox {
322    pub min: Vec3,
323    pub max: Vec3,
324}
325
326impl fidl::Persistable for BoundingBox {}
327
328/// A buffer mapped to a range of `Memory`.
329#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
330#[repr(C)]
331pub struct BufferArgs {
332    pub memory_id: u32,
333    pub memory_offset: u32,
334    pub num_bytes: u32,
335}
336
337impl fidl::Persistable for BufferArgs {}
338
339/// A Camera is used to render a Scene from a particular viewpoint.  This is
340/// achieved by setting a Renderer to use the camera.
341///
342/// The following commands may be applied to a Camera:
343/// - SetCameraTransform
344/// - SetCameraProjection
345/// - SetCameraPoseBuffer
346#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
347#[repr(C)]
348pub struct CameraArgs {
349    /// The scene that the camera is viewing.
350    pub scene_id: u32,
351}
352
353impl fidl::Persistable for CameraArgs {}
354
355#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
356pub struct CircleArgs {
357    pub radius: Value,
358}
359
360impl fidl::Persistable for CircleArgs {}
361
362/// Characteristics:
363/// - has_parent
364/// - is_clip
365/// - has_parts
366#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
367#[repr(C)]
368pub struct ClipNodeArgs {
369    pub unused: u32,
370}
371
372impl fidl::Persistable for ClipNodeArgs {}
373
374#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
375pub struct ColorRgb {
376    pub red: f32,
377    pub green: f32,
378    pub blue: f32,
379}
380
381impl fidl::Persistable for ColorRgb {}
382
383/// A value that is specified explicitly by `value` if `variable_id` is zero,
384/// or is the value produced by the resource identified by `variable_id`, e.g.
385/// an animation or expression.  In the latter case, the value produced by the
386/// resource must be a ColorRgb, and `value` is ignored.
387#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
388pub struct ColorRgbValue {
389    pub value: ColorRgb,
390    pub variable_id: u32,
391}
392
393impl fidl::Persistable for ColorRgbValue {}
394
395/// sRGB color space and nonlinear transfer function.
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397#[repr(C)]
398pub struct ColorRgba {
399    pub red: u8,
400    pub green: u8,
401    pub blue: u8,
402    pub alpha: u8,
403}
404
405impl fidl::Persistable for ColorRgba {}
406
407/// A value that is specified explicitly by `value` if `variable_id` is zero,
408/// or is the value produced by the resource identified by `variable_id`, e.g.
409/// an animation or expression.  In the latter case, the value produced by the
410/// resource must be a ColorRgba, and `value` is ignored.
411#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
412#[repr(C)]
413pub struct ColorRgbaValue {
414    pub value: ColorRgba,
415    pub variable_id: u32,
416}
417
418impl fidl::Persistable for ColorRgbaValue {}
419
420/// A Compositor draws its `LayerStack` into a framebuffer provided by its
421/// attached `Display`, if any.  If no display is attached, nothing is rendered.
422#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
423#[repr(C)]
424pub struct CompositorArgs {
425    pub dummy: u32,
426}
427
428impl fidl::Persistable for CompositorArgs {}
429
430/// Detaches all of a node's children (but not its parts).
431#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
432#[repr(C)]
433pub struct DetachChildrenCmd {
434    pub node_id: u32,
435}
436
437impl fidl::Persistable for DetachChildrenCmd {}
438
439/// Detaches a parentable object from its parent (e.g. a node from a parent node,
440/// or a layer from a layer stack).  It is illegal to apply this command to a
441/// non-parentable object.  No-op if the target object currently has no parent.
442///
443/// Constraints:
444/// - `id` refs a parentable object
445///
446/// Discussion:
447/// For nodes, this command will detach a node from its parent, regardless of
448/// whether it is a part or a child of its parent.
449#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
450#[repr(C)]
451pub struct DetachCmd {
452    pub id: u32,
453}
454
455impl fidl::Persistable for DetachCmd {}
456
457/// Detach the light specified by `light_id` from the scene that it is attached
458/// to, if any.
459#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
460#[repr(C)]
461pub struct DetachLightCmd {
462    pub light_id: u32,
463}
464
465impl fidl::Persistable for DetachLightCmd {}
466
467/// Detach all lights from the scene specified by `scene_id`.
468#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
469#[repr(C)]
470pub struct DetachLightsCmd {
471    pub scene_id: u32,
472}
473
474impl fidl::Persistable for DetachLightsCmd {}
475
476/// A DirectionalLight is a Light that is emitted from a point at infinity.
477///
478/// Although the light is directional, the light has some amount of angular
479/// dispersion (i.e., the light is not fully columnated). For simplicity, we
480/// assume the dispersion of the light source is symmetric about the light's
481/// primary direction.
482///
483/// Supported commands:
484/// - SetLightColor
485/// - SetLightDirection
486#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
487#[repr(C)]
488pub struct DirectionalLightArgs {
489    pub dummy: u32,
490}
491
492impl fidl::Persistable for DirectionalLightArgs {}
493
494/// A DisplayCompositor draws its attached `LayerStack` into an image that is
495/// presented on a display.
496#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
497#[repr(C)]
498pub struct DisplayCompositorArgs {
499    pub dummy: u32,
500}
501
502impl fidl::Persistable for DisplayCompositorArgs {}
503
504/// Provides information about a display.
505#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
506#[repr(C)]
507pub struct DisplayInfo {
508    /// The size of the display, in physical pixels.
509    pub width_in_px: u32,
510    pub height_in_px: u32,
511}
512
513impl fidl::Persistable for DisplayInfo {}
514
515/// Characteristics:
516/// - has_transform
517/// - has_children
518/// - has_parent
519/// - has_parts
520/// - has_clip
521#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
522#[repr(C)]
523pub struct EntityNodeArgs {
524    pub unused: u32,
525}
526
527impl fidl::Persistable for EntityNodeArgs {}
528
529#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
530pub struct FactoredTransform {
531    pub translation: Vec3,
532    pub scale: Vec3,
533    /// Point around which rotation and scaling occur.
534    pub anchor: Vec3,
535    pub rotation: Quaternion,
536}
537
538impl fidl::Persistable for FactoredTransform {}
539
540/// A value that is specified explicitly by `value` if `variable_id` is zero,
541/// or is the value produced by the resource identified by `variable_id`, e.g.
542/// an animation or expression.  In the latter case, the value produced by the
543/// resource must be a float32, and `value` is ignored.
544#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
545pub struct FloatValue {
546    pub value: f32,
547    pub variable_id: u32,
548}
549
550impl fidl::Persistable for FloatValue {}
551
552/// An image mapped to a range of a `Memory` resource.
553#[derive(Clone, Debug, PartialEq)]
554pub struct ImageArgs {
555    pub info: fidl_fuchsia_images__common::ImageInfo,
556    pub memory_id: u32,
557    pub memory_offset: u32,
558}
559
560impl fidl::Persistable for ImageArgs {}
561
562/// An image mapped to a range of a `Memory` resource.
563#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
564#[repr(C)]
565pub struct ImageArgs2 {
566    pub width: u32,
567    pub height: u32,
568    /// The id of a `BufferCollection`. Before creating this resource, the
569    /// buffer collection should be registered on the same `Session` with
570    /// `RegisterBufferCollection` and it should have its contraints set.
571    /// Once the buffers are allocated successfully (e.g. after calling
572    /// `WaitForBuffersAllocated`), the collection's id can be used to create
573    /// the image resource.
574    pub buffer_collection_id: u32,
575    /// The index of the VMO from the `BufferCollection` that backs this image.
576    pub buffer_collection_index: u32,
577}
578
579impl fidl::Persistable for ImageArgs2 {}
580
581/// Delivered when the imported resource with the given ID is no longer bound to
582/// its host resource, or if the imported resource can not be bound because
583/// the host resource is not available.
584#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
585#[repr(C)]
586pub struct ImportUnboundEvent {
587    pub resource_id: u32,
588}
589
590impl fidl::Persistable for ImportUnboundEvent {}
591
592/// A Layer is a 2-dimensional image that is drawn by a Compositor.  The
593/// contents of each Layer in a Layerstack are independent of each other.
594/// A layer is not drawn unless it has a camera, texture, or color.
595///
596/// Supported commands:
597/// - Detach
598/// - SetCamera
599/// - SetColor
600/// - SetTexture
601/// - SetSize (depth must be zero)
602/// - SetSize
603/// - SetTranslation (z component determines the relative Z-ordering of layers)
604/// - SetRotation (must rotate around Z-axis)
605/// - SetScale
606#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
607#[repr(C)]
608pub struct LayerArgs {
609    pub dummy: u32,
610}
611
612impl fidl::Persistable for LayerArgs {}
613
614/// A LayerStack is a stack of layers that are attached to a Compositor, which
615/// draws them in order of increasing Z-order (or rather, presents the illusion
616/// of drawing them in that order: it may apply any optimizations that don't
617/// affect the output).
618///
619/// Supported commands:
620/// - AddLayer
621#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
622#[repr(C)]
623pub struct LayerStackArgs {
624    pub dummy: u32,
625}
626
627impl fidl::Persistable for LayerStackArgs {}
628
629/// Simple texture-mapped material.
630///
631/// Supported commands:
632/// - SetTextureCmd: sets the texture, or it can be left as zero (no texture).
633///   The texture can be an Image or ImagePipe2.
634/// - SetColorCmd: sets the color.
635#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
636#[repr(C)]
637pub struct MaterialArgs {
638    pub dummy: u32,
639}
640
641impl fidl::Persistable for MaterialArgs {}
642
643/// A value that is specified explicitly by `value` if `variable_id` is zero,
644/// or is the value produced by the resource identified by `variable_id`, e.g.
645/// an animation or expression.  In the latter case, the value produced by the
646/// resource must be a vec4, and `value` is ignored.
647#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
648pub struct Matrix4Value {
649    pub value: Mat4,
650    pub variable_id: u32,
651}
652
653impl fidl::Persistable for Matrix4Value {}
654
655/// A Mesh cannot be rendered until it has been bound to vertex/index buffers;
656/// see BindMeshBuffersCmd.
657#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
658pub struct MeshArgs;
659
660impl fidl::Persistable for MeshArgs {}
661
662#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
663pub struct MeshVertexFormat {
664    /// kVector2 or kVector3.
665    pub position_type: ValueType,
666    /// kVector2 or kVector3 (must match position_type), or kNone.
667    pub normal_type: ValueType,
668    /// kVector2 or kNone.
669    pub tex_coord_type: ValueType,
670}
671
672impl fidl::Persistable for MeshVertexFormat {}
673
674/// Rendering target metrics associated with a node.
675/// See also `MetricsEvent`.
676#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
677pub struct Metrics {
678    /// The ratio between the size of one logical pixel within the node's local
679    /// coordinate system and the size of one physical pixel of the rendering
680    /// target.
681    ///
682    /// This scale factors change in relation to the resolution of the rendering
683    /// target and the scale transformations applied by containing nodes.
684    /// They are always strictly positive and non-zero.
685    ///
686    /// For example, suppose the rendering target is a high resolution display
687    /// with a device pixel ratio of 2.0 meaning that each logical pixel
688    /// within the model corresponds to two physical pixels of the display.
689    /// Assuming no scale transformations affect the node, then its metrics event
690    /// will report a scale factor of 2.0.
691    ///
692    /// Building on this example, if instead the node's parent applies a
693    /// scale transformation of 0.25 to the node, then the node's metrics event
694    /// will report a scale factor of 0.5 indicating that the node should render
695    /// its content at a reduced resolution and level of detail since a smaller
696    /// area of physical pixels (half the size in each dimension) will be rendered.
697    pub scale_x: f32,
698    pub scale_y: f32,
699    pub scale_z: f32,
700}
701
702impl fidl::Persistable for Metrics {}
703
704/// Provides rendering target metrics information about the specified node.
705///
706/// This event is delivered when the following conditions are true:
707/// - The node is a descendant of a `Scene`.
708/// - The node has `kMetricsEventMask` set to an enabled state.
709/// - The node's metrics have changed since they were last delivered, or since
710///   `kMetricsEventMask` transitioned from a disabled state to an enabled state.
711///
712/// Subscribe to this event to receive information about the scale factors you
713/// should apply when generating textures for your nodes.
714#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
715pub struct MetricsEvent {
716    pub node_id: u32,
717    pub metrics: Metrics,
718}
719
720impl fidl::Persistable for MetricsEvent {}
721
722/// Characteristics:
723/// - has_transform
724/// - has_parent
725/// - has_children
726/// - has_parts
727/// - has_opacity
728#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
729#[repr(C)]
730pub struct OpacityNodeArgsHack {
731    pub unused: u32,
732}
733
734impl fidl::Persistable for OpacityNodeArgsHack {}
735
736/// Oriented plane described by a normal vector and a distance
737/// from the origin along that vector.
738#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
739pub struct Plane3 {
740    pub dir: Vec3,
741    pub dist: f32,
742}
743
744impl fidl::Persistable for Plane3 {}
745
746/// A PointLight is a Light that emits light in all directions.  By default, the
747/// intensity of the light falls off according to the physically based
748/// "inverse-square law" (see Wikipedia), although it can be adjusted to other
749/// values for artistic effect.
750///
751/// Supported commands:
752/// - SetLightColor
753/// - SetPointLightPosition
754/// - SetPointLightFalloff
755#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
756#[repr(C)]
757pub struct PointLightArgs {
758    pub dummy: u32,
759}
760
761impl fidl::Persistable for PointLightArgs {}
762
763#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
764pub struct Quaternion {
765    pub x: f32,
766    pub y: f32,
767    pub z: f32,
768    pub w: f32,
769}
770
771impl fidl::Persistable for Quaternion {}
772
773/// A value that is specified explicitly by `value` if `variable_id` is zero,
774/// or is the value produced by the resource identified by `variable_id`, e.g.
775/// an animation or expression.  In the latter case, the value produced by the
776/// resource must be a Quaternion, and `value` is ignored.
777#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
778pub struct QuaternionValue {
779    pub value: Quaternion,
780    pub variable_id: u32,
781}
782
783impl fidl::Persistable for QuaternionValue {}
784
785/// Rectangle centered at (0,0).
786#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
787pub struct RectangleArgs {
788    pub width: Value,
789    pub height: Value,
790}
791
792impl fidl::Persistable for RectangleArgs {}
793
794/// Releases the client's reference to the resource; it is then illegal to use
795/// the ID in subsequent Commands.  Other references to the resource may exist,
796/// so releasing the resource does not result in its immediate destruction; it is
797/// only destroyed once the last reference is released.  For example, the
798/// resource may be required to render an in-progress frame, or it may be
799/// referred to by another resource).  However, the ID will be immediately
800/// unregistered, and may be reused to create a new resource.
801#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
802#[repr(C)]
803pub struct ReleaseResourceCmd {
804    /// ID of the resource to be dereferenced.
805    pub id: u32,
806}
807
808impl fidl::Persistable for ReleaseResourceCmd {}
809
810/// Remove all layers from a layer stack.
811/// Constraints
812/// - `layer_stack_id` refs a `LayerStack`.
813#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
814#[repr(C)]
815pub struct RemoveAllLayersCmd {
816    pub layer_stack_id: u32,
817}
818
819impl fidl::Persistable for RemoveAllLayersCmd {}
820
821/// Remove a layer from a layer stack.
822/// Constraints:
823/// - `layer_stack_id` refs a `LayerStack`.
824/// - `layer_id` refs a `Layer`.
825/// - The layer must belong to this stack.
826#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
827#[repr(C)]
828pub struct RemoveLayerCmd {
829    pub layer_stack_id: u32,
830    pub layer_id: u32,
831}
832
833impl fidl::Persistable for RemoveLayerCmd {}
834
835/// A Renderer renders a Scene via a Camera.
836///
837/// Supported commands:
838/// - SetCamera
839/// - SetRendererParam
840#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
841#[repr(C)]
842pub struct RendererArgs {
843    pub dummy: u32,
844}
845
846impl fidl::Persistable for RendererArgs {}
847
848/// RoundedRectangle centered at (0,0).  Legal parameter values must satisfy the
849/// constraint that the flat sides of the rectangle have non-negative length.
850/// In other words, the following constraints must hold:
851///   - top_left_radius + top_right_radius <= width
852///   - bottom_left_radius + bottom_right_radius <= width
853///   - top_left_radius + bottom_left_radius <= height
854///   - top_right_radius + bottom_right_radius <= height
855#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
856pub struct RoundedRectangleArgs {
857    pub width: Value,
858    pub height: Value,
859    pub top_left_radius: Value,
860    pub top_right_radius: Value,
861    pub bottom_right_radius: Value,
862    pub bottom_left_radius: Value,
863}
864
865impl fidl::Persistable for RoundedRectangleArgs {}
866
867/// Adds the light specified by `light_id` specified by `light_id` to the scene
868/// identified by `scene_id`.
869#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
870#[repr(C)]
871pub struct SceneAddAmbientLightCmd {
872    pub scene_id: u32,
873    pub light_id: u32,
874}
875
876impl fidl::Persistable for SceneAddAmbientLightCmd {}
877
878/// Adds the light specified by `light_id` specified by `light_id` to the scene
879/// identified by `scene_id`.
880#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
881#[repr(C)]
882pub struct SceneAddDirectionalLightCmd {
883    pub scene_id: u32,
884    pub light_id: u32,
885}
886
887impl fidl::Persistable for SceneAddDirectionalLightCmd {}
888
889/// Adds the light specified by `light_id` specified by `light_id` to the scene
890/// identified by `scene_id`.
891#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
892#[repr(C)]
893pub struct SceneAddPointLightCmd {
894    pub scene_id: u32,
895    pub light_id: u32,
896}
897
898impl fidl::Persistable for SceneAddPointLightCmd {}
899
900/// A Scene is the root of a scene-graph, and defines the rendering environment
901/// (lighting, etc.) for the tree of nodes beneath it.
902///
903/// Supported commands:
904/// - Add/RemoveLight
905/// - AddChild
906#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
907#[repr(C)]
908pub struct SceneArgs {
909    pub dummy: u32,
910}
911
912impl fidl::Persistable for SceneArgs {}
913
914/// Sends a hint about a pending size change to the given node and all nodes
915/// below. This is generally sent before an animation.
916///
917/// `width_change_factor` and `height_change_factor` is how much bigger or smaller
918/// the item is expected to be in the near future. This one number encapsulate
919/// both changes in scale, as well as changes to layout width and height.
920#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
921pub struct SendSizeChangeHintCmdHack {
922    pub node_id: u32,
923    pub width_change_factor: f32,
924    pub height_change_factor: f32,
925}
926
927impl fidl::Persistable for SendSizeChangeHintCmdHack {}
928
929/// Sets a Resource's (typically a Node's) anchor point.
930///
931/// Constraints:
932/// - `id` refs a Resource with the has_transform characteristic.
933#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
934pub struct SetAnchorCmd {
935    pub id: u32,
936    pub value: Vector3Value,
937}
938
939impl fidl::Persistable for SetAnchorCmd {}
940
941/// Sets a camera's 2D clip-space transform.
942///
943/// Constraints:
944/// - `camera_id` refs a `Camera`.
945/// - `translation` is the desired translation, in Vulkan NDC.
946/// - `scale` is the scale factor to apply on the x/y plane before translation.
947#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
948pub struct SetCameraClipSpaceTransformCmd {
949    pub camera_id: u32,
950    pub translation: Vec2,
951    pub scale: f32,
952}
953
954impl fidl::Persistable for SetCameraClipSpaceTransformCmd {}
955
956/// Sets a renderer's camera.
957///
958/// Constraints:
959/// - `renderer_id` refs a `Renderer`.
960/// - `camera_id` refs a `Camera`, or stops rendering by passing zero.
961/// - `matrix` is a value or variable of type kMatrix4x4.
962#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
963#[repr(C)]
964pub struct SetCameraCmd {
965    pub renderer_id: u32,
966    pub camera_id: u32,
967}
968
969impl fidl::Persistable for SetCameraCmd {}
970
971/// Sets the "pose buffer" for the camera identified by `camera_id`.
972/// This operation can be applied to both Cameras and StereoCameras.
973///
974/// This will override any position and rotation set for the camera and will
975/// make it take its position and rotation from the pose buffer each frame
976/// based on the presentation time for that frame.
977///
978/// A pose buffer represents a ring buffer of poses for a fixed number of time
979/// points in the future. Each entry in the buffer identified by `buffer_id` is
980/// a quaternion and a position layed out as follows:
981///
982/// struct Pose {
983///   // Quaternion
984///   float32 a;
985///   float32 b;
986///   float32 c;
987///   float32 d;
988///
989///   // Position
990///   float32 x;
991///   float32 y;
992///   float32 z;
993///
994///   // Reserved/Padding
995///   byte[4] reserved;
996/// }
997///
998/// The buffer can be thought of as a packed array of `num_entries` Pose structs
999/// and is required to be at least num_entries * sizeof(Pose) bytes.
1000///
1001/// The quaternions and positions are specified in the space of the camera's
1002/// parent node.
1003///
1004/// `base_time` is a base time point expressed in nanoseconds in the
1005/// `CLOCK_MONOTONIC` timebase and `time_interval` is the time in nanoseconds
1006/// between entries in the buffer. `base_time` must be in the past.
1007///
1008/// For a given point in time `t` expressed in nanoseconds in the
1009/// `CLOCK_MONOTONIC` timebase the index of the corresponding pose in
1010/// the pose buffer can be computed as follows:
1011///
1012/// index(t) = ((t - base_time) / time_interval) % num_entries
1013///
1014/// poses[index(t)] is valid for t over the time interval (t - time_interval, t]
1015/// and should be expected to updated continuously without synchronization
1016/// for the duration of that interval. If a single pose value is needed for
1017/// multiple non-atomic operations a value should be latched and stored outside
1018/// the pose buffer.
1019///
1020/// Because the poses are not protected by any synchronization primitives it is
1021/// possible that when a pose is latched it will be only partially updated, and
1022/// the pose being read will contain some components from the pose before it is
1023/// updated and some components from the updated pose. The safety of using these
1024/// "torn" poses relies on two things:
1025///
1026/// 1) Sequential poses written to poses[index(t)] are very similar to each
1027/// other numerically, so that if some components are taken from the first and
1028/// some are taken from another the result is numerically similar to both
1029///
1030/// 2) The space of positions and quaternions is locally flat at the scale of
1031/// changes between sequential updates, which guarantees that two poses which
1032/// are numerically similar also represent semantically similar poses (i.e.
1033/// there are no discontinuities which will cause a small numerical change in
1034/// the position or quaterninon to cause a large change in the encoded pose)
1035/// For positions this is guaranteed because Scenic uses a Euclidean 3-space
1036/// which is globally flat and for quaternions this is guaranteed because
1037/// quaternions encode rotation as points on a unit 4-sphere, and spheres are
1038/// locally flat. For more details on the encoding of rotations in quaterions
1039/// see https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
1040///
1041/// This commanderation is intended for late latching camera pose to support
1042/// low-latency motion-tracked rendering.
1043#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1044#[repr(C)]
1045pub struct SetCameraPoseBufferCmd {
1046    pub camera_id: u32,
1047    pub buffer_id: u32,
1048    pub num_entries: u32,
1049    pub base_time: i64,
1050    pub time_interval: u64,
1051}
1052
1053impl fidl::Persistable for SetCameraPoseBufferCmd {}
1054
1055/// Sets a camera's projection matrix.
1056/// This operation cannot be applied to a StereoCamera.
1057///
1058/// Constraints:
1059/// - `camera_id` refs a `Camera` that is not a `StereoCamera`.
1060/// - `fovy` is the Y-axis field of view, in radians.
1061///
1062/// NOTE: A default orthographic projection is specified by setting `fovy` to
1063/// zero.  In this case, the camera transform is ignored.
1064#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1065pub struct SetCameraProjectionCmd {
1066    pub camera_id: u32,
1067    pub fovy: FloatValue,
1068}
1069
1070impl fidl::Persistable for SetCameraProjectionCmd {}
1071
1072/// Sets a camera's view matrix.
1073/// This operation can be applied to both Cameras and StereoCameras.
1074///
1075/// Constraints:
1076/// - `camera_id` refs a `Camera`.
1077/// - `eye_position` is the position of the eye.
1078/// - `eye_look_at` is the point is the scene the that eye is pointed at.
1079/// - `eye_up` defines the camera's "up" vector.
1080#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1081pub struct SetCameraTransformCmd {
1082    pub camera_id: u32,
1083    pub eye_position: Vector3Value,
1084    pub eye_look_at: Vector3Value,
1085    pub eye_up: Vector3Value,
1086}
1087
1088impl fidl::Persistable for SetCameraTransformCmd {}
1089
1090/// Sets/clears a node's clip.  DEPRECATED: use SetClipPlanesCmd.
1091///
1092/// Constraints:
1093/// - `node_id` refs a `Node` with the has_clip characteristic.
1094/// - `clip_id` a `Node` with the is_clip characteristic, or nothing.  If the
1095///   referenced node is not rooted, then it will have no effect (since its
1096///   full world-transform cannot be determined).
1097/// - `clip_to_self` If false, children are only clipped to the region specified
1098///   by `clip_id`.  If true, children are additionally clipped to the node's
1099///   shape (as determined by its ShapeNode parts).
1100///
1101/// Discussion:
1102/// If a node has a clip, it will be applied to both the parts and the children
1103/// of the node.  Under some circumstances (TBD), a clip will not be applicable
1104/// to a node; in such cases it will be as though no clip has been specified for
1105/// the node.
1106#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1107pub struct SetClipCmd {
1108    pub node_id: u32,
1109    pub clip_id: u32,
1110    pub clip_to_self: bool,
1111}
1112
1113impl fidl::Persistable for SetClipCmd {}
1114
1115/// Sets the list of clip planes that apply to a Node and all of its children.  Replaces
1116/// the list set by any previous SetClipPlanesCmd.
1117///
1118/// - `node_id` refs a `Node` with the has_clip characteristic.
1119/// - `clip_planes` is the new list of oriented clip planes.
1120#[derive(Clone, Debug, PartialEq, PartialOrd)]
1121pub struct SetClipPlanesCmd {
1122    pub node_id: u32,
1123    pub clip_planes: Vec<Plane3>,
1124}
1125
1126impl fidl::Persistable for SetClipPlanesCmd {}
1127
1128/// Sets a material's color.
1129///
1130/// Constraints:
1131/// - `material_id` refs a `Material`.
1132///
1133/// If a texture is set on the material, then the value sampled from the texture
1134/// is multiplied by the color.
1135#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1136#[repr(C)]
1137pub struct SetColorCmd {
1138    pub material_id: u32,
1139    pub color: ColorRgbaValue,
1140}
1141
1142impl fidl::Persistable for SetColorCmd {}
1143
1144/// Set whether clipping should be disabled for the specified renderer.  For a
1145/// newly-created renderer, clipping will NOT be disabled (i.e. it will be
1146/// enabled).
1147///
1148/// NOTE: this disables visual clipping only; objects are still clipped for the
1149/// purposes of hit-testing.
1150///
1151/// `renderer_id` refs the target renderer.
1152/// `disable_clipping` specifies whether the clipping should be disabled.
1153#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1154pub struct SetDisableClippingCmd {
1155    pub renderer_id: u32,
1156    pub disable_clipping: bool,
1157}
1158
1159impl fidl::Persistable for SetDisableClippingCmd {}
1160
1161/// Set the color conversion applied to the compositor's display.
1162/// The conversion is applied to to each pixel according to the formula:
1163///
1164/// (matrix * (pixel + preoffsets)) + postoffsets
1165///
1166/// where pixel is a column vector consisting of the pixel's 3 components.
1167///
1168/// `matrix` is passed in row-major order. Clients will be responsible
1169/// for passing default values, when needed.
1170/// Default values are not currently supported in fidl.
1171/// Default Values:
1172///   preoffsets = [0 0 0]
1173///   matrix = [1 0 0 0 1 0 0 0 1]
1174///   postoffsets = [0 0 0]
1175#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1176pub struct SetDisplayColorConversionCmdHack {
1177    pub compositor_id: u32,
1178    pub preoffsets: [f32; 3],
1179    pub matrix: [f32; 9],
1180    pub postoffsets: [f32; 3],
1181}
1182
1183impl fidl::Persistable for SetDisplayColorConversionCmdHack {}
1184
1185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1186#[repr(C)]
1187pub struct SetDisplayMinimumRgbCmdHack {
1188    pub min_value: u8,
1189}
1190
1191impl fidl::Persistable for SetDisplayMinimumRgbCmdHack {}
1192
1193/// Depending on the device, the display might be rotated
1194/// with respect to what the lower level device controller
1195/// considers the physical orientation of pixels. The
1196/// compositors and layers must be in alignment with the
1197/// underlying physical orientation which means that for
1198/// certain operations like screenshotting, they cannot
1199/// provide results with the accurate orientation unless
1200/// they have information about how the higher-level display
1201/// is orienting the screen. The only legal values for the
1202/// rotation are 0, 90, 180, and 270, which are each
1203///  applied counterclockwise.
1204#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1205#[repr(C)]
1206pub struct SetDisplayRotationCmdHack {
1207    pub compositor_id: u32,
1208    pub rotation_degrees: u32,
1209}
1210
1211impl fidl::Persistable for SetDisplayRotationCmdHack {}
1212
1213#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1214pub struct SetEnableDebugViewBoundsCmd {
1215    pub view_id: u32,
1216    pub enable: bool,
1217}
1218
1219impl fidl::Persistable for SetEnableDebugViewBoundsCmd {}
1220
1221/// Sets which events a resource should deliver to the session listener.
1222/// This command replaces any prior event mask for the resource.
1223///
1224/// The initial event mask for a resource is zero, meaning no events are
1225/// reported.
1226///
1227/// Constraints:
1228/// - `resource_id` is a valid resource id
1229/// - `event_mask` is zero or a combination of `k*EventMask` bits OR'ed together.
1230#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1231#[repr(C)]
1232pub struct SetEventMaskCmd {
1233    pub id: u32,
1234    pub event_mask: u32,
1235}
1236
1237impl fidl::Persistable for SetEventMaskCmd {}
1238
1239/// Sets a node's hit test behavior.
1240///
1241/// Discussion:
1242/// By default, hit testing is performed on the node's content, its parts,
1243/// and its children.
1244#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1245pub struct SetHitTestBehaviorCmd {
1246    pub node_id: u32,
1247    pub hit_test_behavior: HitTestBehavior,
1248}
1249
1250impl fidl::Persistable for SetHitTestBehaviorCmd {}
1251
1252#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1253pub struct SetImportFocusCmdDeprecated;
1254
1255impl fidl::Persistable for SetImportFocusCmdDeprecated {}
1256
1257/// Sets/clears a label to help developers identify the purpose of the resource
1258/// when using diagnostic tools.
1259///
1260/// The label serves no functional purpose in the scene graph.  It exists only
1261/// to help developers understand its structure.  The scene manager may truncate
1262/// or discard labels at will.
1263///
1264/// Constraints:
1265/// - The label's maximum length is `kLabelMaxLength` characters.
1266/// - Setting the label to an empty string clears it.
1267#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1268pub struct SetLabelCmd {
1269    pub id: u32,
1270    pub label: String,
1271}
1272
1273impl fidl::Persistable for SetLabelCmd {}
1274
1275/// Set a compositor's layer stack, replacing the current stack (if any).
1276/// Constraints:
1277/// - `compositor_id` refs a `DisplayCompositor`.
1278/// - `layer_stack_id` refs a `LayerStack`.
1279#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1280#[repr(C)]
1281pub struct SetLayerStackCmd {
1282    pub compositor_id: u32,
1283    pub layer_stack_id: u32,
1284}
1285
1286impl fidl::Persistable for SetLayerStackCmd {}
1287
1288/// Sets the color of the Light identified by `light_id`.
1289#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1290pub struct SetLightColorCmd {
1291    pub light_id: u32,
1292    pub color: ColorRgbValue,
1293}
1294
1295impl fidl::Persistable for SetLightColorCmd {}
1296
1297/// Sets the direction of the DirectionalLight identified by `light_id`.
1298#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1299pub struct SetLightDirectionCmd {
1300    pub light_id: u32,
1301    pub direction: Vector3Value,
1302}
1303
1304impl fidl::Persistable for SetLightDirectionCmd {}
1305
1306/// Sets/clears a node's material.
1307///
1308/// Constraints:
1309/// - `node_id` refs a `Node` with the has_material characteristic.
1310/// - `material_id` refs a `Material`, or nothing.
1311/// - if this command causes the target to have both a `Shape` and a `Material`,
1312///   then these must be compatible with each other (see README.md regarding
1313///   "Shape/Material Compatibility").
1314///
1315/// Discussion:
1316/// In order to be painted, a node requires both a `Shape` and a `Material`.
1317/// Without a material, a node can still participate in hit-testing and clipping.
1318/// Without a shape, a node cannot do any of the above.
1319#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1320#[repr(C)]
1321pub struct SetMaterialCmd {
1322    pub node_id: u32,
1323    pub material_id: u32,
1324}
1325
1326impl fidl::Persistable for SetMaterialCmd {}
1327
1328/// Sets a node's opacity.
1329///
1330/// Constraints:
1331/// - `node_id` refs a `Node` with the has_opacity characteristic.
1332/// - `opacity` is in the range [0, 1].
1333#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1334pub struct SetOpacityCmd {
1335    pub node_id: u32,
1336    pub opacity: f32,
1337}
1338
1339impl fidl::Persistable for SetOpacityCmd {}
1340
1341/// Sets the falloff factor of the PointLight identified by `light_id`.
1342/// A value of 1.0 corresponds to the physically-based "inverse-square law"
1343/// (see Wikipedia).  Other values can be used for artistic effect, e.g. a
1344/// value of 0.0 means that the radiance of a surface is not dependant on
1345/// its distance from the light.
1346#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1347pub struct SetPointLightFalloffCmd {
1348    pub light_id: u32,
1349    pub falloff: FloatValue,
1350}
1351
1352impl fidl::Persistable for SetPointLightFalloffCmd {}
1353
1354/// Sets the position of the PointLight identified by `light_id`.
1355#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1356pub struct SetPointLightPositionCmd {
1357    pub light_id: u32,
1358    pub position: Vector3Value,
1359}
1360
1361impl fidl::Persistable for SetPointLightPositionCmd {}
1362
1363/// Set a layer's renderer, replacing the current renderer (if any).
1364/// Constraints:
1365/// - `layer_id` refs a `Layer`.
1366/// - `renderer_id` refs a `Renderer`.
1367#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1368#[repr(C)]
1369pub struct SetRendererCmd {
1370    pub layer_id: u32,
1371    pub renderer_id: u32,
1372}
1373
1374impl fidl::Persistable for SetRendererCmd {}
1375
1376/// Sets a parameter that affects how a renderer renders a scene.
1377///
1378/// `renderer_id` refs the Renderer that is being modified.
1379/// `param` describes the parameter that should be set, and to what.
1380#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1381pub struct SetRendererParamCmd {
1382    pub renderer_id: u32,
1383    pub param: RendererParam,
1384}
1385
1386impl fidl::Persistable for SetRendererParamCmd {}
1387
1388/// Sets a Resource's (typically a Node's) rotation.
1389///
1390/// Constraints:
1391/// - `id` refs a Resource with the has_transform characteristic.
1392///
1393/// Discussion:
1394/// Quaternions represent any rotation in a 3D coordinate system. Consisting of
1395/// [a,b,c,d], [a] represents the amount of rotation that should be applied and
1396/// [b,c,d] represents the vector around which the rotation is applied. This
1397/// conforms to the semantics of glm::quat.
1398#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1399pub struct SetRotationCmd {
1400    pub id: u32,
1401    pub value: QuaternionValue,
1402}
1403
1404impl fidl::Persistable for SetRotationCmd {}
1405
1406/// Sets a Resource's (typically a Node's) scale.
1407///
1408/// Constraints:
1409/// - `id` refs a Resource with the has_transform characteristic.
1410#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1411pub struct SetScaleCmd {
1412    pub id: u32,
1413    pub value: Vector3Value,
1414}
1415
1416impl fidl::Persistable for SetScaleCmd {}
1417
1418/// Sets a node's semantic visibility.
1419///
1420/// Discussion:
1421/// By default, all nodes are semantically visible. Semantically invisible nodes and their children
1422/// are ignored by hit tests performed for accessibility.
1423#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1424pub struct SetSemanticVisibilityCmd {
1425    pub node_id: u32,
1426    pub visible: bool,
1427}
1428
1429impl fidl::Persistable for SetSemanticVisibilityCmd {}
1430
1431/// Sets/clears a node's shape.
1432///
1433/// Constraints:
1434/// - `node_id` refs a `Node` with the has_shape characteristic.
1435/// - `shape_id` refs a `Shape`, or nothing.
1436/// - if this command causes the target to have both a `Shape` and a `Material`,
1437///   then these must be compatible with each other (see README.md regarding
1438///   "Shape/Material Compatibility").
1439///
1440/// Discussion:
1441/// In order to be painted, a node requires both a `Shape` and a `Material`.
1442/// Without a material, a node can still participate in hit-testing and clipping.
1443/// Without a shape, a node cannot do any of the above.
1444#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1445#[repr(C)]
1446pub struct SetShapeCmd {
1447    pub node_id: u32,
1448    pub shape_id: u32,
1449}
1450
1451impl fidl::Persistable for SetShapeCmd {}
1452
1453/// Sets an object's size.
1454///
1455/// Constraints:
1456/// - `id` refs a resizeable object.
1457/// - some objects that support this command may have additional constraints
1458///   (e.g. in some cases `depth` must be zero).
1459#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1460pub struct SetSizeCmd {
1461    pub id: u32,
1462    pub value: Vector2Value,
1463}
1464
1465impl fidl::Persistable for SetSizeCmd {}
1466
1467/// Sets a StereoCamera's projection matrices.
1468/// This operation can only be applied to a StereoCamera.
1469///
1470/// Constraints:
1471/// - `camera_id` refs a `StereoCamera`.
1472/// - `left_projection` is the projection matrix for the left eye.
1473/// - `right_projection` is the projection matrix for the right eye.
1474///
1475/// These projection matrices may also contain a transform in camera space for
1476/// their eye if needed.
1477#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1478pub struct SetStereoCameraProjectionCmd {
1479    pub camera_id: u32,
1480    pub left_projection: Matrix4Value,
1481    pub right_projection: Matrix4Value,
1482}
1483
1484impl fidl::Persistable for SetStereoCameraProjectionCmd {}
1485
1486/// Sets/clears a node's tag value.
1487///
1488/// A session can apply a tag value to any node to which it has access, including
1489/// imported nodes.  These tags are private to the session and cannot be read
1490/// or modified by other sessions.  When multiple sessions import the same node,
1491/// each session will only observe its own tag values.
1492///
1493/// Hit test results for a session only include nodes which the session has
1494/// tagged with a non-zero value.  Therefore a session can use tag values to
1495/// associate nodes with their functional purpose when picked.
1496///
1497/// Constraints:
1498/// - `node_id` refs a `Node`.
1499/// - `tag_value` is the tag value to assign, or 0 to remove the tag.
1500#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1501#[repr(C)]
1502pub struct SetTagCmd {
1503    pub node_id: u32,
1504    pub tag_value: u32,
1505}
1506
1507impl fidl::Persistable for SetTagCmd {}
1508
1509/// Sets/clears a material's texture.
1510///
1511/// Constraints:
1512/// - `material_id` refs a `Material`.
1513/// - `texture_id` refs a `Image`, `ImagePipe2`, or nothing.
1514///
1515/// If no texture is provided (i.e. `texture_id` is zero), a solid color is used.
1516/// If a texture is provided, then the value sampled from the texture is
1517/// multiplied by the color.
1518#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1519#[repr(C)]
1520pub struct SetTextureCmd {
1521    pub material_id: u32,
1522    pub texture_id: u32,
1523}
1524
1525impl fidl::Persistable for SetTextureCmd {}
1526
1527/// Sets a Resource's (typically a Node's) translation.
1528///
1529/// Constraints:
1530/// - `id` refs a Resource with the has_transform characteristic.
1531#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1532pub struct SetTranslationCmd {
1533    pub id: u32,
1534    pub value: Vector3Value,
1535}
1536
1537impl fidl::Persistable for SetTranslationCmd {}
1538
1539#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1540pub struct SetViewHolderBoundsColorCmd {
1541    pub view_holder_id: u32,
1542    pub color: ColorRgbValue,
1543}
1544
1545impl fidl::Persistable for SetViewHolderBoundsColorCmd {}
1546
1547/// Sets the properties for a ViewHolder's attached View.
1548///
1549/// Constraints:
1550/// - `view_holder_id` refs a `ViewHolder`.
1551#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1552pub struct SetViewPropertiesCmd {
1553    pub view_holder_id: u32,
1554    pub properties: ViewProperties,
1555}
1556
1557impl fidl::Persistable for SetViewPropertiesCmd {}
1558
1559/// Characteristics:
1560/// - has_parent
1561/// - has_shape
1562/// - has_material
1563#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1564#[repr(C)]
1565pub struct ShapeNodeArgs {
1566    pub unused: u32,
1567}
1568
1569impl fidl::Persistable for ShapeNodeArgs {}
1570
1571/// Delivered in response to a size change hint from a parent node
1572/// (SendSizeChangeHintCmd).
1573///
1574/// This event is delivered when the following conditions are true:
1575/// - The node has `kSizeChangeEventMask` set to an enabled state.
1576/// - A parent node has sent a SendSizeChangeHintCmd.
1577///
1578/// Subscribe to this event to receive information about how large textures you
1579/// will need in the near future for your nodes. The canonical use case is to
1580/// pre-allocate memory to avoid repeated re-allocations.
1581#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1582pub struct SizeChangeHintEvent {
1583    pub node_id: u32,
1584    pub width_change_factor: f32,
1585    pub height_change_factor: f32,
1586}
1587
1588impl fidl::Persistable for SizeChangeHintEvent {}
1589
1590/// A StereoCamera is a Camera that renders the scene in side-by-side stereo.
1591///
1592/// Any command which can be applied to a Camera can also be applied to a
1593/// StereoCamera.
1594/// Additional supported commands:
1595/// - SetStereoCameraProjection
1596#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1597#[repr(C)]
1598pub struct StereoCameraArgs {
1599    /// The scene that the camera is viewing.
1600    pub scene_id: u32,
1601}
1602
1603impl fidl::Persistable for StereoCameraArgs {}
1604
1605/// Describes a typed, client-modifiable value.
1606#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1607pub struct VariableArgs {
1608    pub type_: ValueType,
1609    pub initial_value: Value,
1610}
1611
1612impl fidl::Persistable for VariableArgs {}
1613
1614/// A value that is specified explicitly by `value` if `variable_id` is zero,
1615/// or is the value produced by the resource identified by `variable_id`, e.g.
1616/// an animation or expression.  In the latter case, the value produced by the
1617/// resource must be a vec2, and `value` is ignored.
1618#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1619pub struct Vector2Value {
1620    pub value: Vec2,
1621    pub variable_id: u32,
1622}
1623
1624impl fidl::Persistable for Vector2Value {}
1625
1626/// A value that is specified explicitly by `value` if `variable_id` is zero,
1627/// or is the value produced by the resource identified by `variable_id`, e.g.
1628/// an animation or expression.  In the latter case, the value produced by the
1629/// resource must be a vec3, and `value` is ignored.
1630#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1631pub struct Vector3Value {
1632    pub value: Vec3,
1633    pub variable_id: u32,
1634}
1635
1636impl fidl::Persistable for Vector3Value {}
1637
1638/// A value that is specified explicitly by `value` if `variable_id` is zero,
1639/// or is the value produced by the resource identified by `variable_id`, e.g.
1640/// an animation or expression.  In the latter case, the value produced by the
1641/// resource must be a vec4, and `value` is ignored.
1642#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1643pub struct Vector4Value {
1644    pub value: Vec4,
1645    pub variable_id: u32,
1646}
1647
1648impl fidl::Persistable for Vector4Value {}
1649
1650/// Delivered to a View's Session when the parent ViewHolder for the given View
1651/// becomes a part of a Scene.
1652///
1653/// A ViewHolder is considered to be part of a Scene if there is an unbroken
1654/// chain of parent-child relationships between the Scene node and the
1655/// ViewHolder node.
1656#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1657pub struct ViewAttachedToSceneEvent {
1658    pub view_id: u32,
1659    pub properties: ViewProperties,
1660}
1661
1662impl fidl::Persistable for ViewAttachedToSceneEvent {}
1663
1664/// Delivered to a ViewHolder's Session when its peer View is connected.
1665#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1666#[repr(C)]
1667pub struct ViewConnectedEvent {
1668    pub view_holder_id: u32,
1669}
1670
1671impl fidl::Persistable for ViewConnectedEvent {}
1672
1673/// Delivered to a View's Session when the parent ViewHolder for the given View
1674/// is no longer part of a scene.
1675///
1676/// This can happen if the ViewHolder is detached directly from the scene, or
1677/// if one of its parent nodes is.
1678///
1679/// A ViewHolder is considered to be part of a Scene if there is an unbroken
1680/// chain of parent-child relationships between the Scene node and the
1681/// ViewHolder node.
1682#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1683#[repr(C)]
1684pub struct ViewDetachedFromSceneEvent {
1685    pub view_id: u32,
1686}
1687
1688impl fidl::Persistable for ViewDetachedFromSceneEvent {}
1689
1690/// Delivered to a ViewHolder's Session when its peer View is disconnected or
1691/// destroyed.
1692///
1693/// If the View is destroyed before the connection is established, then this
1694/// event will be delivered immediately when the ViewHolder attempts to connect.
1695#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1696#[repr(C)]
1697pub struct ViewDisconnectedEvent {
1698    pub view_holder_id: u32,
1699}
1700
1701impl fidl::Persistable for ViewDisconnectedEvent {}
1702
1703/// Delivered to a View's Session when its peer ViewHolder is connected.
1704///
1705/// If the ViewHolder is destroyed before the connection is established, then
1706/// this event will not be delivered.
1707#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1708#[repr(C)]
1709pub struct ViewHolderConnectedEvent {
1710    pub view_id: u32,
1711}
1712
1713impl fidl::Persistable for ViewHolderConnectedEvent {}
1714
1715/// Delivered to a View's Session when its peer ViewHolder is disconnected or
1716/// destroyed.
1717///
1718/// If the ViewHolder is destroyed before the connection is established, then
1719/// this event will be delivered immediately when the View attempts to connect.
1720#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1721#[repr(C)]
1722pub struct ViewHolderDisconnectedEvent {
1723    pub view_id: u32,
1724}
1725
1726impl fidl::Persistable for ViewHolderDisconnectedEvent {}
1727
1728/// Represents the properties for a View.
1729#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1730pub struct ViewProperties {
1731    /// The View's bounding box extents can be defined as:
1732    ///    { bounding_box.min, bounding_box.max }
1733    /// Content contained within the View is clipped to this bounding box.
1734    pub bounding_box: BoundingBox,
1735    /// `insets_from_min` and `insets_from_max` specify the distances between the
1736    /// view's bounding box and that of its parent.
1737    ///
1738    /// These properties are not strictly enforced by Scenic, but only used
1739    /// as hints for clients and other components that receives ViewProperties:
1740    ///
1741    /// View clients can assume that anything drawn outside of
1742    ///    { bounding_box.min + inset_from_min, bounding_box.max - inset_from_max }
1743    /// may be obscured by an ancestor view. The reason for obscuring, and the rules
1744    /// surrounding it, is specific to each product.
1745    pub inset_from_min: Vec3,
1746    pub inset_from_max: Vec3,
1747    /// Whether the View can receive a focus event; default is true.  When
1748    /// false, and this View is eligible to receive a focus event, no
1749    /// focus/unfocus event is actually sent to any View.
1750    pub focus_change: bool,
1751    /// Whether the View allows geometrically underlying Views to receive input;
1752    /// default is true. When false, Scenic does not send input events to
1753    /// underlying Views.
1754    pub downward_input: bool,
1755}
1756
1757impl fidl::Persistable for ViewProperties {}
1758
1759/// Delivered when the parent ViewHolder for the given View makes a change to
1760/// the View's properties.
1761#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1762pub struct ViewPropertiesChangedEvent {
1763    pub view_id: u32,
1764    pub properties: ViewProperties,
1765}
1766
1767impl fidl::Persistable for ViewPropertiesChangedEvent {}
1768
1769/// Represents the state of a View in Scenic.
1770#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1771pub struct ViewState {
1772    /// Whether the View is rendering. Default is false. Delivered to the View's
1773    /// corresponding ViewHolder after the View's first frame render request.
1774    pub is_rendering: bool,
1775}
1776
1777impl fidl::Persistable for ViewState {}
1778
1779/// Delivered to a ViewHolder's Session when its peer View's state has changed.
1780#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1781pub struct ViewStateChangedEvent {
1782    pub view_holder_id: u32,
1783    pub state: ViewState,
1784}
1785
1786impl fidl::Persistable for ViewStateChangedEvent {}
1787
1788#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1789pub struct Mat4 {
1790    /// Column major order.
1791    pub matrix: [f32; 16],
1792}
1793
1794impl fidl::Persistable for Mat4 {}
1795
1796#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1797pub struct Vec2 {
1798    pub x: f32,
1799    pub y: f32,
1800}
1801
1802impl fidl::Persistable for Vec2 {}
1803
1804#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1805pub struct Vec3 {
1806    pub x: f32,
1807    pub y: f32,
1808    pub z: f32,
1809}
1810
1811impl fidl::Persistable for Vec3 {}
1812
1813#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1814pub struct Vec4 {
1815    pub x: f32,
1816    pub y: f32,
1817    pub z: f32,
1818    pub w: f32,
1819}
1820
1821impl fidl::Persistable for Vec4 {}
1822
1823/// These are all of the types of events which can be reported by a `Session`.
1824/// Use `SetEventMaskCmd` to enable event delivery for a resource.
1825#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1826pub enum Event {
1827    /// Events which are controlled by a mask.
1828    Metrics(MetricsEvent),
1829    SizeChangeHint(SizeChangeHintEvent),
1830    /// Events which are always delivered, regardless of mask.
1831    ImportUnbound(ImportUnboundEvent),
1832    ViewConnected(ViewConnectedEvent),
1833    ViewDisconnected(ViewDisconnectedEvent),
1834    ViewHolderDisconnected(ViewHolderDisconnectedEvent),
1835    ViewAttachedToScene(ViewAttachedToSceneEvent),
1836    ViewDetachedFromScene(ViewDetachedFromSceneEvent),
1837    ViewPropertiesChanged(ViewPropertiesChangedEvent),
1838    ViewStateChanged(ViewStateChangedEvent),
1839    ViewHolderConnected(ViewHolderConnectedEvent),
1840}
1841
1842impl Event {
1843    #[inline]
1844    pub fn ordinal(&self) -> u64 {
1845        match *self {
1846            Self::Metrics(_) => 1,
1847            Self::SizeChangeHint(_) => 2,
1848            Self::ImportUnbound(_) => 3,
1849            Self::ViewConnected(_) => 4,
1850            Self::ViewDisconnected(_) => 5,
1851            Self::ViewHolderDisconnected(_) => 6,
1852            Self::ViewAttachedToScene(_) => 7,
1853            Self::ViewDetachedFromScene(_) => 8,
1854            Self::ViewPropertiesChanged(_) => 9,
1855            Self::ViewStateChanged(_) => 10,
1856            Self::ViewHolderConnected(_) => 11,
1857        }
1858    }
1859}
1860
1861impl fidl::Persistable for Event {}
1862
1863/// These are all of the types of parameters that can be set to configure a
1864/// `Renderer`.
1865#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1866pub enum RendererParam {
1867    ShadowTechnique(ShadowTechnique),
1868    Reserved(RenderFrequency),
1869    EnableDebugging(bool),
1870}
1871
1872impl RendererParam {
1873    #[inline]
1874    pub fn ordinal(&self) -> u64 {
1875        match *self {
1876            Self::ShadowTechnique(_) => 1,
1877            Self::Reserved(_) => 2,
1878            Self::EnableDebugging(_) => 3,
1879        }
1880    }
1881}
1882
1883impl fidl::Persistable for RendererParam {}
1884
1885#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1886pub enum Value {
1887    Vector1(f32),
1888    Vector2(Vec2),
1889    Vector3(Vec3),
1890    Vector4(Vec4),
1891    Matrix4x4(Mat4),
1892    ColorRgba(ColorRgba),
1893    ColorRgb(ColorRgb),
1894    /// Degrees of counter-clockwise rotation in the XY plane.
1895    Degrees(f32),
1896    Quaternion(Quaternion),
1897    Transform(FactoredTransform),
1898    /// ID of a value-producing resource (an animation or an expression).
1899    /// The type of this value matches the type produced by the named resource.
1900    VariableId(u32),
1901}
1902
1903impl Value {
1904    #[inline]
1905    pub fn ordinal(&self) -> u64 {
1906        match *self {
1907            Self::Vector1(_) => 1,
1908            Self::Vector2(_) => 2,
1909            Self::Vector3(_) => 3,
1910            Self::Vector4(_) => 4,
1911            Self::Matrix4x4(_) => 5,
1912            Self::ColorRgba(_) => 6,
1913            Self::ColorRgb(_) => 7,
1914            Self::Degrees(_) => 8,
1915            Self::Quaternion(_) => 9,
1916            Self::Transform(_) => 10,
1917            Self::VariableId(_) => 11,
1918        }
1919    }
1920}
1921
1922impl fidl::Persistable for Value {}
1923
1924pub mod snapshot_callback_deprecated_ordinals {
1925    pub const ON_DATA: u64 = 0x11d1a93b419b7d9f;
1926}
1927
1928mod internal {
1929    use super::*;
1930    unsafe impl fidl::encoding::TypeMarker for HitTestBehavior {
1931        type Owned = Self;
1932
1933        #[inline(always)]
1934        fn inline_align(_context: fidl::encoding::Context) -> usize {
1935            std::mem::align_of::<u32>()
1936        }
1937
1938        #[inline(always)]
1939        fn inline_size(_context: fidl::encoding::Context) -> usize {
1940            std::mem::size_of::<u32>()
1941        }
1942
1943        #[inline(always)]
1944        fn encode_is_copy() -> bool {
1945            true
1946        }
1947
1948        #[inline(always)]
1949        fn decode_is_copy() -> bool {
1950            false
1951        }
1952    }
1953
1954    impl fidl::encoding::ValueTypeMarker for HitTestBehavior {
1955        type Borrowed<'a> = Self;
1956        #[inline(always)]
1957        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1958            *value
1959        }
1960    }
1961
1962    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1963        for HitTestBehavior
1964    {
1965        #[inline]
1966        unsafe fn encode(
1967            self,
1968            encoder: &mut fidl::encoding::Encoder<'_, D>,
1969            offset: usize,
1970            _depth: fidl::encoding::Depth,
1971        ) -> fidl::Result<()> {
1972            encoder.debug_check_bounds::<Self>(offset);
1973            encoder.write_num(self.into_primitive(), offset);
1974            Ok(())
1975        }
1976    }
1977
1978    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitTestBehavior {
1979        #[inline(always)]
1980        fn new_empty() -> Self {
1981            Self::KDefault
1982        }
1983
1984        #[inline]
1985        unsafe fn decode(
1986            &mut self,
1987            decoder: &mut fidl::encoding::Decoder<'_, D>,
1988            offset: usize,
1989            _depth: fidl::encoding::Depth,
1990        ) -> fidl::Result<()> {
1991            decoder.debug_check_bounds::<Self>(offset);
1992            let prim = decoder.read_num::<u32>(offset);
1993
1994            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1995            Ok(())
1996        }
1997    }
1998    unsafe impl fidl::encoding::TypeMarker for ImportSpec {
1999        type Owned = Self;
2000
2001        #[inline(always)]
2002        fn inline_align(_context: fidl::encoding::Context) -> usize {
2003            std::mem::align_of::<u32>()
2004        }
2005
2006        #[inline(always)]
2007        fn inline_size(_context: fidl::encoding::Context) -> usize {
2008            std::mem::size_of::<u32>()
2009        }
2010
2011        #[inline(always)]
2012        fn encode_is_copy() -> bool {
2013            true
2014        }
2015
2016        #[inline(always)]
2017        fn decode_is_copy() -> bool {
2018            false
2019        }
2020    }
2021
2022    impl fidl::encoding::ValueTypeMarker for ImportSpec {
2023        type Borrowed<'a> = Self;
2024        #[inline(always)]
2025        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2026            *value
2027        }
2028    }
2029
2030    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImportSpec {
2031        #[inline]
2032        unsafe fn encode(
2033            self,
2034            encoder: &mut fidl::encoding::Encoder<'_, D>,
2035            offset: usize,
2036            _depth: fidl::encoding::Depth,
2037        ) -> fidl::Result<()> {
2038            encoder.debug_check_bounds::<Self>(offset);
2039            encoder.write_num(self.into_primitive(), offset);
2040            Ok(())
2041        }
2042    }
2043
2044    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportSpec {
2045        #[inline(always)]
2046        fn new_empty() -> Self {
2047            Self::Node
2048        }
2049
2050        #[inline]
2051        unsafe fn decode(
2052            &mut self,
2053            decoder: &mut fidl::encoding::Decoder<'_, D>,
2054            offset: usize,
2055            _depth: fidl::encoding::Depth,
2056        ) -> fidl::Result<()> {
2057            decoder.debug_check_bounds::<Self>(offset);
2058            let prim = decoder.read_num::<u32>(offset);
2059
2060            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2061            Ok(())
2062        }
2063    }
2064    unsafe impl fidl::encoding::TypeMarker for MeshIndexFormat {
2065        type Owned = Self;
2066
2067        #[inline(always)]
2068        fn inline_align(_context: fidl::encoding::Context) -> usize {
2069            std::mem::align_of::<u32>()
2070        }
2071
2072        #[inline(always)]
2073        fn inline_size(_context: fidl::encoding::Context) -> usize {
2074            std::mem::size_of::<u32>()
2075        }
2076
2077        #[inline(always)]
2078        fn encode_is_copy() -> bool {
2079            true
2080        }
2081
2082        #[inline(always)]
2083        fn decode_is_copy() -> bool {
2084            false
2085        }
2086    }
2087
2088    impl fidl::encoding::ValueTypeMarker for MeshIndexFormat {
2089        type Borrowed<'a> = Self;
2090        #[inline(always)]
2091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2092            *value
2093        }
2094    }
2095
2096    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2097        for MeshIndexFormat
2098    {
2099        #[inline]
2100        unsafe fn encode(
2101            self,
2102            encoder: &mut fidl::encoding::Encoder<'_, D>,
2103            offset: usize,
2104            _depth: fidl::encoding::Depth,
2105        ) -> fidl::Result<()> {
2106            encoder.debug_check_bounds::<Self>(offset);
2107            encoder.write_num(self.into_primitive(), offset);
2108            Ok(())
2109        }
2110    }
2111
2112    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshIndexFormat {
2113        #[inline(always)]
2114        fn new_empty() -> Self {
2115            Self::KUint16
2116        }
2117
2118        #[inline]
2119        unsafe fn decode(
2120            &mut self,
2121            decoder: &mut fidl::encoding::Decoder<'_, D>,
2122            offset: usize,
2123            _depth: fidl::encoding::Depth,
2124        ) -> fidl::Result<()> {
2125            decoder.debug_check_bounds::<Self>(offset);
2126            let prim = decoder.read_num::<u32>(offset);
2127
2128            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2129            Ok(())
2130        }
2131    }
2132    unsafe impl fidl::encoding::TypeMarker for RenderFrequency {
2133        type Owned = Self;
2134
2135        #[inline(always)]
2136        fn inline_align(_context: fidl::encoding::Context) -> usize {
2137            std::mem::align_of::<u32>()
2138        }
2139
2140        #[inline(always)]
2141        fn inline_size(_context: fidl::encoding::Context) -> usize {
2142            std::mem::size_of::<u32>()
2143        }
2144
2145        #[inline(always)]
2146        fn encode_is_copy() -> bool {
2147            true
2148        }
2149
2150        #[inline(always)]
2151        fn decode_is_copy() -> bool {
2152            false
2153        }
2154    }
2155
2156    impl fidl::encoding::ValueTypeMarker for RenderFrequency {
2157        type Borrowed<'a> = Self;
2158        #[inline(always)]
2159        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2160            *value
2161        }
2162    }
2163
2164    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2165        for RenderFrequency
2166    {
2167        #[inline]
2168        unsafe fn encode(
2169            self,
2170            encoder: &mut fidl::encoding::Encoder<'_, D>,
2171            offset: usize,
2172            _depth: fidl::encoding::Depth,
2173        ) -> fidl::Result<()> {
2174            encoder.debug_check_bounds::<Self>(offset);
2175            encoder.write_num(self.into_primitive(), offset);
2176            Ok(())
2177        }
2178    }
2179
2180    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RenderFrequency {
2181        #[inline(always)]
2182        fn new_empty() -> Self {
2183            Self::WhenRequested
2184        }
2185
2186        #[inline]
2187        unsafe fn decode(
2188            &mut self,
2189            decoder: &mut fidl::encoding::Decoder<'_, D>,
2190            offset: usize,
2191            _depth: fidl::encoding::Depth,
2192        ) -> fidl::Result<()> {
2193            decoder.debug_check_bounds::<Self>(offset);
2194            let prim = decoder.read_num::<u32>(offset);
2195
2196            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2197            Ok(())
2198        }
2199    }
2200    unsafe impl fidl::encoding::TypeMarker for ShadowTechnique {
2201        type Owned = Self;
2202
2203        #[inline(always)]
2204        fn inline_align(_context: fidl::encoding::Context) -> usize {
2205            std::mem::align_of::<u32>()
2206        }
2207
2208        #[inline(always)]
2209        fn inline_size(_context: fidl::encoding::Context) -> usize {
2210            std::mem::size_of::<u32>()
2211        }
2212
2213        #[inline(always)]
2214        fn encode_is_copy() -> bool {
2215            true
2216        }
2217
2218        #[inline(always)]
2219        fn decode_is_copy() -> bool {
2220            false
2221        }
2222    }
2223
2224    impl fidl::encoding::ValueTypeMarker for ShadowTechnique {
2225        type Borrowed<'a> = Self;
2226        #[inline(always)]
2227        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2228            *value
2229        }
2230    }
2231
2232    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2233        for ShadowTechnique
2234    {
2235        #[inline]
2236        unsafe fn encode(
2237            self,
2238            encoder: &mut fidl::encoding::Encoder<'_, D>,
2239            offset: usize,
2240            _depth: fidl::encoding::Depth,
2241        ) -> fidl::Result<()> {
2242            encoder.debug_check_bounds::<Self>(offset);
2243            encoder.write_num(self.into_primitive(), offset);
2244            Ok(())
2245        }
2246    }
2247
2248    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShadowTechnique {
2249        #[inline(always)]
2250        fn new_empty() -> Self {
2251            Self::Unshadowed
2252        }
2253
2254        #[inline]
2255        unsafe fn decode(
2256            &mut self,
2257            decoder: &mut fidl::encoding::Decoder<'_, D>,
2258            offset: usize,
2259            _depth: fidl::encoding::Depth,
2260        ) -> fidl::Result<()> {
2261            decoder.debug_check_bounds::<Self>(offset);
2262            let prim = decoder.read_num::<u32>(offset);
2263
2264            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2265            Ok(())
2266        }
2267    }
2268    unsafe impl fidl::encoding::TypeMarker for ValueType {
2269        type Owned = Self;
2270
2271        #[inline(always)]
2272        fn inline_align(_context: fidl::encoding::Context) -> usize {
2273            std::mem::align_of::<u32>()
2274        }
2275
2276        #[inline(always)]
2277        fn inline_size(_context: fidl::encoding::Context) -> usize {
2278            std::mem::size_of::<u32>()
2279        }
2280
2281        #[inline(always)]
2282        fn encode_is_copy() -> bool {
2283            true
2284        }
2285
2286        #[inline(always)]
2287        fn decode_is_copy() -> bool {
2288            false
2289        }
2290    }
2291
2292    impl fidl::encoding::ValueTypeMarker for ValueType {
2293        type Borrowed<'a> = Self;
2294        #[inline(always)]
2295        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2296            *value
2297        }
2298    }
2299
2300    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ValueType {
2301        #[inline]
2302        unsafe fn encode(
2303            self,
2304            encoder: &mut fidl::encoding::Encoder<'_, D>,
2305            offset: usize,
2306            _depth: fidl::encoding::Depth,
2307        ) -> fidl::Result<()> {
2308            encoder.debug_check_bounds::<Self>(offset);
2309            encoder.write_num(self.into_primitive(), offset);
2310            Ok(())
2311        }
2312    }
2313
2314    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValueType {
2315        #[inline(always)]
2316        fn new_empty() -> Self {
2317            Self::KNone
2318        }
2319
2320        #[inline]
2321        unsafe fn decode(
2322            &mut self,
2323            decoder: &mut fidl::encoding::Decoder<'_, D>,
2324            offset: usize,
2325            _depth: fidl::encoding::Depth,
2326        ) -> fidl::Result<()> {
2327            decoder.debug_check_bounds::<Self>(offset);
2328            let prim = decoder.read_num::<u32>(offset);
2329
2330            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2331            Ok(())
2332        }
2333    }
2334
2335    impl fidl::encoding::ValueTypeMarker for AddChildCmd {
2336        type Borrowed<'a> = &'a Self;
2337        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2338            value
2339        }
2340    }
2341
2342    unsafe impl fidl::encoding::TypeMarker for AddChildCmd {
2343        type Owned = Self;
2344
2345        #[inline(always)]
2346        fn inline_align(_context: fidl::encoding::Context) -> usize {
2347            4
2348        }
2349
2350        #[inline(always)]
2351        fn inline_size(_context: fidl::encoding::Context) -> usize {
2352            8
2353        }
2354        #[inline(always)]
2355        fn encode_is_copy() -> bool {
2356            true
2357        }
2358
2359        #[inline(always)]
2360        fn decode_is_copy() -> bool {
2361            true
2362        }
2363    }
2364
2365    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddChildCmd, D>
2366        for &AddChildCmd
2367    {
2368        #[inline]
2369        unsafe fn encode(
2370            self,
2371            encoder: &mut fidl::encoding::Encoder<'_, D>,
2372            offset: usize,
2373            _depth: fidl::encoding::Depth,
2374        ) -> fidl::Result<()> {
2375            encoder.debug_check_bounds::<AddChildCmd>(offset);
2376            unsafe {
2377                // Copy the object into the buffer.
2378                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2379                (buf_ptr as *mut AddChildCmd).write_unaligned((self as *const AddChildCmd).read());
2380                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2381                // done second because the memcpy will write garbage to these bytes.
2382            }
2383            Ok(())
2384        }
2385    }
2386    unsafe impl<
2387        D: fidl::encoding::ResourceDialect,
2388        T0: fidl::encoding::Encode<u32, D>,
2389        T1: fidl::encoding::Encode<u32, D>,
2390    > fidl::encoding::Encode<AddChildCmd, D> for (T0, T1)
2391    {
2392        #[inline]
2393        unsafe fn encode(
2394            self,
2395            encoder: &mut fidl::encoding::Encoder<'_, D>,
2396            offset: usize,
2397            depth: fidl::encoding::Depth,
2398        ) -> fidl::Result<()> {
2399            encoder.debug_check_bounds::<AddChildCmd>(offset);
2400            // Zero out padding regions. There's no need to apply masks
2401            // because the unmasked parts will be overwritten by fields.
2402            // Write the fields.
2403            self.0.encode(encoder, offset + 0, depth)?;
2404            self.1.encode(encoder, offset + 4, depth)?;
2405            Ok(())
2406        }
2407    }
2408
2409    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddChildCmd {
2410        #[inline(always)]
2411        fn new_empty() -> Self {
2412            Self { node_id: fidl::new_empty!(u32, D), child_id: fidl::new_empty!(u32, D) }
2413        }
2414
2415        #[inline]
2416        unsafe fn decode(
2417            &mut self,
2418            decoder: &mut fidl::encoding::Decoder<'_, D>,
2419            offset: usize,
2420            _depth: fidl::encoding::Depth,
2421        ) -> fidl::Result<()> {
2422            decoder.debug_check_bounds::<Self>(offset);
2423            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2424            // Verify that padding bytes are zero.
2425            // Copy from the buffer into the object.
2426            unsafe {
2427                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2428            }
2429            Ok(())
2430        }
2431    }
2432
2433    impl fidl::encoding::ValueTypeMarker for AddLayerCmd {
2434        type Borrowed<'a> = &'a Self;
2435        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2436            value
2437        }
2438    }
2439
2440    unsafe impl fidl::encoding::TypeMarker for AddLayerCmd {
2441        type Owned = Self;
2442
2443        #[inline(always)]
2444        fn inline_align(_context: fidl::encoding::Context) -> usize {
2445            4
2446        }
2447
2448        #[inline(always)]
2449        fn inline_size(_context: fidl::encoding::Context) -> usize {
2450            8
2451        }
2452        #[inline(always)]
2453        fn encode_is_copy() -> bool {
2454            true
2455        }
2456
2457        #[inline(always)]
2458        fn decode_is_copy() -> bool {
2459            true
2460        }
2461    }
2462
2463    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLayerCmd, D>
2464        for &AddLayerCmd
2465    {
2466        #[inline]
2467        unsafe fn encode(
2468            self,
2469            encoder: &mut fidl::encoding::Encoder<'_, D>,
2470            offset: usize,
2471            _depth: fidl::encoding::Depth,
2472        ) -> fidl::Result<()> {
2473            encoder.debug_check_bounds::<AddLayerCmd>(offset);
2474            unsafe {
2475                // Copy the object into the buffer.
2476                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2477                (buf_ptr as *mut AddLayerCmd).write_unaligned((self as *const AddLayerCmd).read());
2478                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2479                // done second because the memcpy will write garbage to these bytes.
2480            }
2481            Ok(())
2482        }
2483    }
2484    unsafe impl<
2485        D: fidl::encoding::ResourceDialect,
2486        T0: fidl::encoding::Encode<u32, D>,
2487        T1: fidl::encoding::Encode<u32, D>,
2488    > fidl::encoding::Encode<AddLayerCmd, D> for (T0, T1)
2489    {
2490        #[inline]
2491        unsafe fn encode(
2492            self,
2493            encoder: &mut fidl::encoding::Encoder<'_, D>,
2494            offset: usize,
2495            depth: fidl::encoding::Depth,
2496        ) -> fidl::Result<()> {
2497            encoder.debug_check_bounds::<AddLayerCmd>(offset);
2498            // Zero out padding regions. There's no need to apply masks
2499            // because the unmasked parts will be overwritten by fields.
2500            // Write the fields.
2501            self.0.encode(encoder, offset + 0, depth)?;
2502            self.1.encode(encoder, offset + 4, depth)?;
2503            Ok(())
2504        }
2505    }
2506
2507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLayerCmd {
2508        #[inline(always)]
2509        fn new_empty() -> Self {
2510            Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
2511        }
2512
2513        #[inline]
2514        unsafe fn decode(
2515            &mut self,
2516            decoder: &mut fidl::encoding::Decoder<'_, D>,
2517            offset: usize,
2518            _depth: fidl::encoding::Depth,
2519        ) -> fidl::Result<()> {
2520            decoder.debug_check_bounds::<Self>(offset);
2521            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2522            // Verify that padding bytes are zero.
2523            // Copy from the buffer into the object.
2524            unsafe {
2525                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2526            }
2527            Ok(())
2528        }
2529    }
2530
2531    impl fidl::encoding::ValueTypeMarker for AddLightCmd {
2532        type Borrowed<'a> = &'a Self;
2533        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2534            value
2535        }
2536    }
2537
2538    unsafe impl fidl::encoding::TypeMarker for AddLightCmd {
2539        type Owned = Self;
2540
2541        #[inline(always)]
2542        fn inline_align(_context: fidl::encoding::Context) -> usize {
2543            4
2544        }
2545
2546        #[inline(always)]
2547        fn inline_size(_context: fidl::encoding::Context) -> usize {
2548            8
2549        }
2550        #[inline(always)]
2551        fn encode_is_copy() -> bool {
2552            true
2553        }
2554
2555        #[inline(always)]
2556        fn decode_is_copy() -> bool {
2557            true
2558        }
2559    }
2560
2561    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLightCmd, D>
2562        for &AddLightCmd
2563    {
2564        #[inline]
2565        unsafe fn encode(
2566            self,
2567            encoder: &mut fidl::encoding::Encoder<'_, D>,
2568            offset: usize,
2569            _depth: fidl::encoding::Depth,
2570        ) -> fidl::Result<()> {
2571            encoder.debug_check_bounds::<AddLightCmd>(offset);
2572            unsafe {
2573                // Copy the object into the buffer.
2574                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2575                (buf_ptr as *mut AddLightCmd).write_unaligned((self as *const AddLightCmd).read());
2576                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2577                // done second because the memcpy will write garbage to these bytes.
2578            }
2579            Ok(())
2580        }
2581    }
2582    unsafe impl<
2583        D: fidl::encoding::ResourceDialect,
2584        T0: fidl::encoding::Encode<u32, D>,
2585        T1: fidl::encoding::Encode<u32, D>,
2586    > fidl::encoding::Encode<AddLightCmd, D> for (T0, T1)
2587    {
2588        #[inline]
2589        unsafe fn encode(
2590            self,
2591            encoder: &mut fidl::encoding::Encoder<'_, D>,
2592            offset: usize,
2593            depth: fidl::encoding::Depth,
2594        ) -> fidl::Result<()> {
2595            encoder.debug_check_bounds::<AddLightCmd>(offset);
2596            // Zero out padding regions. There's no need to apply masks
2597            // because the unmasked parts will be overwritten by fields.
2598            // Write the fields.
2599            self.0.encode(encoder, offset + 0, depth)?;
2600            self.1.encode(encoder, offset + 4, depth)?;
2601            Ok(())
2602        }
2603    }
2604
2605    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLightCmd {
2606        #[inline(always)]
2607        fn new_empty() -> Self {
2608            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
2609        }
2610
2611        #[inline]
2612        unsafe fn decode(
2613            &mut self,
2614            decoder: &mut fidl::encoding::Decoder<'_, D>,
2615            offset: usize,
2616            _depth: fidl::encoding::Depth,
2617        ) -> fidl::Result<()> {
2618            decoder.debug_check_bounds::<Self>(offset);
2619            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2620            // Verify that padding bytes are zero.
2621            // Copy from the buffer into the object.
2622            unsafe {
2623                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2624            }
2625            Ok(())
2626        }
2627    }
2628
2629    impl fidl::encoding::ValueTypeMarker for AddPartCmd {
2630        type Borrowed<'a> = &'a Self;
2631        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2632            value
2633        }
2634    }
2635
2636    unsafe impl fidl::encoding::TypeMarker for AddPartCmd {
2637        type Owned = Self;
2638
2639        #[inline(always)]
2640        fn inline_align(_context: fidl::encoding::Context) -> usize {
2641            4
2642        }
2643
2644        #[inline(always)]
2645        fn inline_size(_context: fidl::encoding::Context) -> usize {
2646            8
2647        }
2648        #[inline(always)]
2649        fn encode_is_copy() -> bool {
2650            true
2651        }
2652
2653        #[inline(always)]
2654        fn decode_is_copy() -> bool {
2655            true
2656        }
2657    }
2658
2659    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddPartCmd, D>
2660        for &AddPartCmd
2661    {
2662        #[inline]
2663        unsafe fn encode(
2664            self,
2665            encoder: &mut fidl::encoding::Encoder<'_, D>,
2666            offset: usize,
2667            _depth: fidl::encoding::Depth,
2668        ) -> fidl::Result<()> {
2669            encoder.debug_check_bounds::<AddPartCmd>(offset);
2670            unsafe {
2671                // Copy the object into the buffer.
2672                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2673                (buf_ptr as *mut AddPartCmd).write_unaligned((self as *const AddPartCmd).read());
2674                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2675                // done second because the memcpy will write garbage to these bytes.
2676            }
2677            Ok(())
2678        }
2679    }
2680    unsafe impl<
2681        D: fidl::encoding::ResourceDialect,
2682        T0: fidl::encoding::Encode<u32, D>,
2683        T1: fidl::encoding::Encode<u32, D>,
2684    > fidl::encoding::Encode<AddPartCmd, D> for (T0, T1)
2685    {
2686        #[inline]
2687        unsafe fn encode(
2688            self,
2689            encoder: &mut fidl::encoding::Encoder<'_, D>,
2690            offset: usize,
2691            depth: fidl::encoding::Depth,
2692        ) -> fidl::Result<()> {
2693            encoder.debug_check_bounds::<AddPartCmd>(offset);
2694            // Zero out padding regions. There's no need to apply masks
2695            // because the unmasked parts will be overwritten by fields.
2696            // Write the fields.
2697            self.0.encode(encoder, offset + 0, depth)?;
2698            self.1.encode(encoder, offset + 4, depth)?;
2699            Ok(())
2700        }
2701    }
2702
2703    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddPartCmd {
2704        #[inline(always)]
2705        fn new_empty() -> Self {
2706            Self { node_id: fidl::new_empty!(u32, D), part_id: fidl::new_empty!(u32, D) }
2707        }
2708
2709        #[inline]
2710        unsafe fn decode(
2711            &mut self,
2712            decoder: &mut fidl::encoding::Decoder<'_, D>,
2713            offset: usize,
2714            _depth: fidl::encoding::Depth,
2715        ) -> fidl::Result<()> {
2716            decoder.debug_check_bounds::<Self>(offset);
2717            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2718            // Verify that padding bytes are zero.
2719            // Copy from the buffer into the object.
2720            unsafe {
2721                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2722            }
2723            Ok(())
2724        }
2725    }
2726
2727    impl fidl::encoding::ValueTypeMarker for AmbientLightArgs {
2728        type Borrowed<'a> = &'a Self;
2729        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2730            value
2731        }
2732    }
2733
2734    unsafe impl fidl::encoding::TypeMarker for AmbientLightArgs {
2735        type Owned = Self;
2736
2737        #[inline(always)]
2738        fn inline_align(_context: fidl::encoding::Context) -> usize {
2739            4
2740        }
2741
2742        #[inline(always)]
2743        fn inline_size(_context: fidl::encoding::Context) -> usize {
2744            4
2745        }
2746        #[inline(always)]
2747        fn encode_is_copy() -> bool {
2748            true
2749        }
2750
2751        #[inline(always)]
2752        fn decode_is_copy() -> bool {
2753            true
2754        }
2755    }
2756
2757    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AmbientLightArgs, D>
2758        for &AmbientLightArgs
2759    {
2760        #[inline]
2761        unsafe fn encode(
2762            self,
2763            encoder: &mut fidl::encoding::Encoder<'_, D>,
2764            offset: usize,
2765            _depth: fidl::encoding::Depth,
2766        ) -> fidl::Result<()> {
2767            encoder.debug_check_bounds::<AmbientLightArgs>(offset);
2768            unsafe {
2769                // Copy the object into the buffer.
2770                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2771                (buf_ptr as *mut AmbientLightArgs)
2772                    .write_unaligned((self as *const AmbientLightArgs).read());
2773                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2774                // done second because the memcpy will write garbage to these bytes.
2775            }
2776            Ok(())
2777        }
2778    }
2779    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2780        fidl::encoding::Encode<AmbientLightArgs, D> for (T0,)
2781    {
2782        #[inline]
2783        unsafe fn encode(
2784            self,
2785            encoder: &mut fidl::encoding::Encoder<'_, D>,
2786            offset: usize,
2787            depth: fidl::encoding::Depth,
2788        ) -> fidl::Result<()> {
2789            encoder.debug_check_bounds::<AmbientLightArgs>(offset);
2790            // Zero out padding regions. There's no need to apply masks
2791            // because the unmasked parts will be overwritten by fields.
2792            // Write the fields.
2793            self.0.encode(encoder, offset + 0, depth)?;
2794            Ok(())
2795        }
2796    }
2797
2798    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AmbientLightArgs {
2799        #[inline(always)]
2800        fn new_empty() -> Self {
2801            Self { dummy: fidl::new_empty!(u32, D) }
2802        }
2803
2804        #[inline]
2805        unsafe fn decode(
2806            &mut self,
2807            decoder: &mut fidl::encoding::Decoder<'_, D>,
2808            offset: usize,
2809            _depth: fidl::encoding::Depth,
2810        ) -> fidl::Result<()> {
2811            decoder.debug_check_bounds::<Self>(offset);
2812            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2813            // Verify that padding bytes are zero.
2814            // Copy from the buffer into the object.
2815            unsafe {
2816                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2817            }
2818            Ok(())
2819        }
2820    }
2821
2822    impl fidl::encoding::ValueTypeMarker for BindMeshBuffersCmd {
2823        type Borrowed<'a> = &'a Self;
2824        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2825            value
2826        }
2827    }
2828
2829    unsafe impl fidl::encoding::TypeMarker for BindMeshBuffersCmd {
2830        type Owned = Self;
2831
2832        #[inline(always)]
2833        fn inline_align(_context: fidl::encoding::Context) -> usize {
2834            8
2835        }
2836
2837        #[inline(always)]
2838        fn inline_size(_context: fidl::encoding::Context) -> usize {
2839            88
2840        }
2841    }
2842
2843    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BindMeshBuffersCmd, D>
2844        for &BindMeshBuffersCmd
2845    {
2846        #[inline]
2847        unsafe fn encode(
2848            self,
2849            encoder: &mut fidl::encoding::Encoder<'_, D>,
2850            offset: usize,
2851            _depth: fidl::encoding::Depth,
2852        ) -> fidl::Result<()> {
2853            encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
2854            // Delegate to tuple encoding.
2855            fidl::encoding::Encode::<BindMeshBuffersCmd, D>::encode(
2856                (
2857                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mesh_id),
2858                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_buffer_id),
2859                    <MeshIndexFormat as fidl::encoding::ValueTypeMarker>::borrow(
2860                        &self.index_format,
2861                    ),
2862                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_offset),
2863                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_count),
2864                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_buffer_id),
2865                    <MeshVertexFormat as fidl::encoding::ValueTypeMarker>::borrow(
2866                        &self.vertex_format,
2867                    ),
2868                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_offset),
2869                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_count),
2870                    <BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
2871                ),
2872                encoder,
2873                offset,
2874                _depth,
2875            )
2876        }
2877    }
2878    unsafe impl<
2879        D: fidl::encoding::ResourceDialect,
2880        T0: fidl::encoding::Encode<u32, D>,
2881        T1: fidl::encoding::Encode<u32, D>,
2882        T2: fidl::encoding::Encode<MeshIndexFormat, D>,
2883        T3: fidl::encoding::Encode<u64, D>,
2884        T4: fidl::encoding::Encode<u32, D>,
2885        T5: fidl::encoding::Encode<u32, D>,
2886        T6: fidl::encoding::Encode<MeshVertexFormat, D>,
2887        T7: fidl::encoding::Encode<u64, D>,
2888        T8: fidl::encoding::Encode<u32, D>,
2889        T9: fidl::encoding::Encode<BoundingBox, D>,
2890    > fidl::encoding::Encode<BindMeshBuffersCmd, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
2891    {
2892        #[inline]
2893        unsafe fn encode(
2894            self,
2895            encoder: &mut fidl::encoding::Encoder<'_, D>,
2896            offset: usize,
2897            depth: fidl::encoding::Depth,
2898        ) -> fidl::Result<()> {
2899            encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
2900            // Zero out padding regions. There's no need to apply masks
2901            // because the unmasked parts will be overwritten by fields.
2902            unsafe {
2903                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2904                (ptr as *mut u64).write_unaligned(0);
2905            }
2906            unsafe {
2907                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
2908                (ptr as *mut u64).write_unaligned(0);
2909            }
2910            unsafe {
2911                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(80);
2912                (ptr as *mut u64).write_unaligned(0);
2913            }
2914            // Write the fields.
2915            self.0.encode(encoder, offset + 0, depth)?;
2916            self.1.encode(encoder, offset + 4, depth)?;
2917            self.2.encode(encoder, offset + 8, depth)?;
2918            self.3.encode(encoder, offset + 16, depth)?;
2919            self.4.encode(encoder, offset + 24, depth)?;
2920            self.5.encode(encoder, offset + 28, depth)?;
2921            self.6.encode(encoder, offset + 32, depth)?;
2922            self.7.encode(encoder, offset + 48, depth)?;
2923            self.8.encode(encoder, offset + 56, depth)?;
2924            self.9.encode(encoder, offset + 60, depth)?;
2925            Ok(())
2926        }
2927    }
2928
2929    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BindMeshBuffersCmd {
2930        #[inline(always)]
2931        fn new_empty() -> Self {
2932            Self {
2933                mesh_id: fidl::new_empty!(u32, D),
2934                index_buffer_id: fidl::new_empty!(u32, D),
2935                index_format: fidl::new_empty!(MeshIndexFormat, D),
2936                index_offset: fidl::new_empty!(u64, D),
2937                index_count: fidl::new_empty!(u32, D),
2938                vertex_buffer_id: fidl::new_empty!(u32, D),
2939                vertex_format: fidl::new_empty!(MeshVertexFormat, D),
2940                vertex_offset: fidl::new_empty!(u64, D),
2941                vertex_count: fidl::new_empty!(u32, D),
2942                bounding_box: fidl::new_empty!(BoundingBox, D),
2943            }
2944        }
2945
2946        #[inline]
2947        unsafe fn decode(
2948            &mut self,
2949            decoder: &mut fidl::encoding::Decoder<'_, D>,
2950            offset: usize,
2951            _depth: fidl::encoding::Depth,
2952        ) -> fidl::Result<()> {
2953            decoder.debug_check_bounds::<Self>(offset);
2954            // Verify that padding bytes are zero.
2955            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2956            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2957            let mask = 0xffffffff00000000u64;
2958            let maskedval = padval & mask;
2959            if maskedval != 0 {
2960                return Err(fidl::Error::NonZeroPadding {
2961                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2962                });
2963            }
2964            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
2965            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2966            let mask = 0xffffffff00000000u64;
2967            let maskedval = padval & mask;
2968            if maskedval != 0 {
2969                return Err(fidl::Error::NonZeroPadding {
2970                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
2971                });
2972            }
2973            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
2974            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2975            let mask = 0xffffffff00000000u64;
2976            let maskedval = padval & mask;
2977            if maskedval != 0 {
2978                return Err(fidl::Error::NonZeroPadding {
2979                    padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
2980                });
2981            }
2982            fidl::decode!(u32, D, &mut self.mesh_id, decoder, offset + 0, _depth)?;
2983            fidl::decode!(u32, D, &mut self.index_buffer_id, decoder, offset + 4, _depth)?;
2984            fidl::decode!(MeshIndexFormat, D, &mut self.index_format, decoder, offset + 8, _depth)?;
2985            fidl::decode!(u64, D, &mut self.index_offset, decoder, offset + 16, _depth)?;
2986            fidl::decode!(u32, D, &mut self.index_count, decoder, offset + 24, _depth)?;
2987            fidl::decode!(u32, D, &mut self.vertex_buffer_id, decoder, offset + 28, _depth)?;
2988            fidl::decode!(
2989                MeshVertexFormat,
2990                D,
2991                &mut self.vertex_format,
2992                decoder,
2993                offset + 32,
2994                _depth
2995            )?;
2996            fidl::decode!(u64, D, &mut self.vertex_offset, decoder, offset + 48, _depth)?;
2997            fidl::decode!(u32, D, &mut self.vertex_count, decoder, offset + 56, _depth)?;
2998            fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 60, _depth)?;
2999            Ok(())
3000        }
3001    }
3002
3003    impl fidl::encoding::ValueTypeMarker for BoundingBox {
3004        type Borrowed<'a> = &'a Self;
3005        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3006            value
3007        }
3008    }
3009
3010    unsafe impl fidl::encoding::TypeMarker for BoundingBox {
3011        type Owned = Self;
3012
3013        #[inline(always)]
3014        fn inline_align(_context: fidl::encoding::Context) -> usize {
3015            4
3016        }
3017
3018        #[inline(always)]
3019        fn inline_size(_context: fidl::encoding::Context) -> usize {
3020            24
3021        }
3022    }
3023
3024    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BoundingBox, D>
3025        for &BoundingBox
3026    {
3027        #[inline]
3028        unsafe fn encode(
3029            self,
3030            encoder: &mut fidl::encoding::Encoder<'_, D>,
3031            offset: usize,
3032            _depth: fidl::encoding::Depth,
3033        ) -> fidl::Result<()> {
3034            encoder.debug_check_bounds::<BoundingBox>(offset);
3035            // Delegate to tuple encoding.
3036            fidl::encoding::Encode::<BoundingBox, D>::encode(
3037                (
3038                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.min),
3039                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.max),
3040                ),
3041                encoder,
3042                offset,
3043                _depth,
3044            )
3045        }
3046    }
3047    unsafe impl<
3048        D: fidl::encoding::ResourceDialect,
3049        T0: fidl::encoding::Encode<Vec3, D>,
3050        T1: fidl::encoding::Encode<Vec3, D>,
3051    > fidl::encoding::Encode<BoundingBox, D> for (T0, T1)
3052    {
3053        #[inline]
3054        unsafe fn encode(
3055            self,
3056            encoder: &mut fidl::encoding::Encoder<'_, D>,
3057            offset: usize,
3058            depth: fidl::encoding::Depth,
3059        ) -> fidl::Result<()> {
3060            encoder.debug_check_bounds::<BoundingBox>(offset);
3061            // Zero out padding regions. There's no need to apply masks
3062            // because the unmasked parts will be overwritten by fields.
3063            // Write the fields.
3064            self.0.encode(encoder, offset + 0, depth)?;
3065            self.1.encode(encoder, offset + 12, depth)?;
3066            Ok(())
3067        }
3068    }
3069
3070    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoundingBox {
3071        #[inline(always)]
3072        fn new_empty() -> Self {
3073            Self { min: fidl::new_empty!(Vec3, D), max: fidl::new_empty!(Vec3, D) }
3074        }
3075
3076        #[inline]
3077        unsafe fn decode(
3078            &mut self,
3079            decoder: &mut fidl::encoding::Decoder<'_, D>,
3080            offset: usize,
3081            _depth: fidl::encoding::Depth,
3082        ) -> fidl::Result<()> {
3083            decoder.debug_check_bounds::<Self>(offset);
3084            // Verify that padding bytes are zero.
3085            fidl::decode!(Vec3, D, &mut self.min, decoder, offset + 0, _depth)?;
3086            fidl::decode!(Vec3, D, &mut self.max, decoder, offset + 12, _depth)?;
3087            Ok(())
3088        }
3089    }
3090
3091    impl fidl::encoding::ValueTypeMarker for BufferArgs {
3092        type Borrowed<'a> = &'a Self;
3093        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3094            value
3095        }
3096    }
3097
3098    unsafe impl fidl::encoding::TypeMarker for BufferArgs {
3099        type Owned = Self;
3100
3101        #[inline(always)]
3102        fn inline_align(_context: fidl::encoding::Context) -> usize {
3103            4
3104        }
3105
3106        #[inline(always)]
3107        fn inline_size(_context: fidl::encoding::Context) -> usize {
3108            12
3109        }
3110        #[inline(always)]
3111        fn encode_is_copy() -> bool {
3112            true
3113        }
3114
3115        #[inline(always)]
3116        fn decode_is_copy() -> bool {
3117            true
3118        }
3119    }
3120
3121    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferArgs, D>
3122        for &BufferArgs
3123    {
3124        #[inline]
3125        unsafe fn encode(
3126            self,
3127            encoder: &mut fidl::encoding::Encoder<'_, D>,
3128            offset: usize,
3129            _depth: fidl::encoding::Depth,
3130        ) -> fidl::Result<()> {
3131            encoder.debug_check_bounds::<BufferArgs>(offset);
3132            unsafe {
3133                // Copy the object into the buffer.
3134                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3135                (buf_ptr as *mut BufferArgs).write_unaligned((self as *const BufferArgs).read());
3136                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3137                // done second because the memcpy will write garbage to these bytes.
3138            }
3139            Ok(())
3140        }
3141    }
3142    unsafe impl<
3143        D: fidl::encoding::ResourceDialect,
3144        T0: fidl::encoding::Encode<u32, D>,
3145        T1: fidl::encoding::Encode<u32, D>,
3146        T2: fidl::encoding::Encode<u32, D>,
3147    > fidl::encoding::Encode<BufferArgs, D> for (T0, T1, T2)
3148    {
3149        #[inline]
3150        unsafe fn encode(
3151            self,
3152            encoder: &mut fidl::encoding::Encoder<'_, D>,
3153            offset: usize,
3154            depth: fidl::encoding::Depth,
3155        ) -> fidl::Result<()> {
3156            encoder.debug_check_bounds::<BufferArgs>(offset);
3157            // Zero out padding regions. There's no need to apply masks
3158            // because the unmasked parts will be overwritten by fields.
3159            // Write the fields.
3160            self.0.encode(encoder, offset + 0, depth)?;
3161            self.1.encode(encoder, offset + 4, depth)?;
3162            self.2.encode(encoder, offset + 8, depth)?;
3163            Ok(())
3164        }
3165    }
3166
3167    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferArgs {
3168        #[inline(always)]
3169        fn new_empty() -> Self {
3170            Self {
3171                memory_id: fidl::new_empty!(u32, D),
3172                memory_offset: fidl::new_empty!(u32, D),
3173                num_bytes: fidl::new_empty!(u32, D),
3174            }
3175        }
3176
3177        #[inline]
3178        unsafe fn decode(
3179            &mut self,
3180            decoder: &mut fidl::encoding::Decoder<'_, D>,
3181            offset: usize,
3182            _depth: fidl::encoding::Depth,
3183        ) -> fidl::Result<()> {
3184            decoder.debug_check_bounds::<Self>(offset);
3185            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3186            // Verify that padding bytes are zero.
3187            // Copy from the buffer into the object.
3188            unsafe {
3189                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
3190            }
3191            Ok(())
3192        }
3193    }
3194
3195    impl fidl::encoding::ValueTypeMarker for CameraArgs {
3196        type Borrowed<'a> = &'a Self;
3197        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3198            value
3199        }
3200    }
3201
3202    unsafe impl fidl::encoding::TypeMarker for CameraArgs {
3203        type Owned = Self;
3204
3205        #[inline(always)]
3206        fn inline_align(_context: fidl::encoding::Context) -> usize {
3207            4
3208        }
3209
3210        #[inline(always)]
3211        fn inline_size(_context: fidl::encoding::Context) -> usize {
3212            4
3213        }
3214        #[inline(always)]
3215        fn encode_is_copy() -> bool {
3216            true
3217        }
3218
3219        #[inline(always)]
3220        fn decode_is_copy() -> bool {
3221            true
3222        }
3223    }
3224
3225    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CameraArgs, D>
3226        for &CameraArgs
3227    {
3228        #[inline]
3229        unsafe fn encode(
3230            self,
3231            encoder: &mut fidl::encoding::Encoder<'_, D>,
3232            offset: usize,
3233            _depth: fidl::encoding::Depth,
3234        ) -> fidl::Result<()> {
3235            encoder.debug_check_bounds::<CameraArgs>(offset);
3236            unsafe {
3237                // Copy the object into the buffer.
3238                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3239                (buf_ptr as *mut CameraArgs).write_unaligned((self as *const CameraArgs).read());
3240                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3241                // done second because the memcpy will write garbage to these bytes.
3242            }
3243            Ok(())
3244        }
3245    }
3246    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3247        fidl::encoding::Encode<CameraArgs, D> for (T0,)
3248    {
3249        #[inline]
3250        unsafe fn encode(
3251            self,
3252            encoder: &mut fidl::encoding::Encoder<'_, D>,
3253            offset: usize,
3254            depth: fidl::encoding::Depth,
3255        ) -> fidl::Result<()> {
3256            encoder.debug_check_bounds::<CameraArgs>(offset);
3257            // Zero out padding regions. There's no need to apply masks
3258            // because the unmasked parts will be overwritten by fields.
3259            // Write the fields.
3260            self.0.encode(encoder, offset + 0, depth)?;
3261            Ok(())
3262        }
3263    }
3264
3265    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CameraArgs {
3266        #[inline(always)]
3267        fn new_empty() -> Self {
3268            Self { scene_id: fidl::new_empty!(u32, D) }
3269        }
3270
3271        #[inline]
3272        unsafe fn decode(
3273            &mut self,
3274            decoder: &mut fidl::encoding::Decoder<'_, D>,
3275            offset: usize,
3276            _depth: fidl::encoding::Depth,
3277        ) -> fidl::Result<()> {
3278            decoder.debug_check_bounds::<Self>(offset);
3279            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3280            // Verify that padding bytes are zero.
3281            // Copy from the buffer into the object.
3282            unsafe {
3283                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3284            }
3285            Ok(())
3286        }
3287    }
3288
3289    impl fidl::encoding::ValueTypeMarker for CircleArgs {
3290        type Borrowed<'a> = &'a Self;
3291        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3292            value
3293        }
3294    }
3295
3296    unsafe impl fidl::encoding::TypeMarker for CircleArgs {
3297        type Owned = Self;
3298
3299        #[inline(always)]
3300        fn inline_align(_context: fidl::encoding::Context) -> usize {
3301            8
3302        }
3303
3304        #[inline(always)]
3305        fn inline_size(_context: fidl::encoding::Context) -> usize {
3306            16
3307        }
3308    }
3309
3310    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CircleArgs, D>
3311        for &CircleArgs
3312    {
3313        #[inline]
3314        unsafe fn encode(
3315            self,
3316            encoder: &mut fidl::encoding::Encoder<'_, D>,
3317            offset: usize,
3318            _depth: fidl::encoding::Depth,
3319        ) -> fidl::Result<()> {
3320            encoder.debug_check_bounds::<CircleArgs>(offset);
3321            // Delegate to tuple encoding.
3322            fidl::encoding::Encode::<CircleArgs, D>::encode(
3323                (<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.radius),),
3324                encoder,
3325                offset,
3326                _depth,
3327            )
3328        }
3329    }
3330    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Value, D>>
3331        fidl::encoding::Encode<CircleArgs, D> for (T0,)
3332    {
3333        #[inline]
3334        unsafe fn encode(
3335            self,
3336            encoder: &mut fidl::encoding::Encoder<'_, D>,
3337            offset: usize,
3338            depth: fidl::encoding::Depth,
3339        ) -> fidl::Result<()> {
3340            encoder.debug_check_bounds::<CircleArgs>(offset);
3341            // Zero out padding regions. There's no need to apply masks
3342            // because the unmasked parts will be overwritten by fields.
3343            // Write the fields.
3344            self.0.encode(encoder, offset + 0, depth)?;
3345            Ok(())
3346        }
3347    }
3348
3349    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CircleArgs {
3350        #[inline(always)]
3351        fn new_empty() -> Self {
3352            Self { radius: fidl::new_empty!(Value, D) }
3353        }
3354
3355        #[inline]
3356        unsafe fn decode(
3357            &mut self,
3358            decoder: &mut fidl::encoding::Decoder<'_, D>,
3359            offset: usize,
3360            _depth: fidl::encoding::Depth,
3361        ) -> fidl::Result<()> {
3362            decoder.debug_check_bounds::<Self>(offset);
3363            // Verify that padding bytes are zero.
3364            fidl::decode!(Value, D, &mut self.radius, decoder, offset + 0, _depth)?;
3365            Ok(())
3366        }
3367    }
3368
3369    impl fidl::encoding::ValueTypeMarker for ClipNodeArgs {
3370        type Borrowed<'a> = &'a Self;
3371        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3372            value
3373        }
3374    }
3375
3376    unsafe impl fidl::encoding::TypeMarker for ClipNodeArgs {
3377        type Owned = Self;
3378
3379        #[inline(always)]
3380        fn inline_align(_context: fidl::encoding::Context) -> usize {
3381            4
3382        }
3383
3384        #[inline(always)]
3385        fn inline_size(_context: fidl::encoding::Context) -> usize {
3386            4
3387        }
3388        #[inline(always)]
3389        fn encode_is_copy() -> bool {
3390            true
3391        }
3392
3393        #[inline(always)]
3394        fn decode_is_copy() -> bool {
3395            true
3396        }
3397    }
3398
3399    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClipNodeArgs, D>
3400        for &ClipNodeArgs
3401    {
3402        #[inline]
3403        unsafe fn encode(
3404            self,
3405            encoder: &mut fidl::encoding::Encoder<'_, D>,
3406            offset: usize,
3407            _depth: fidl::encoding::Depth,
3408        ) -> fidl::Result<()> {
3409            encoder.debug_check_bounds::<ClipNodeArgs>(offset);
3410            unsafe {
3411                // Copy the object into the buffer.
3412                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3413                (buf_ptr as *mut ClipNodeArgs)
3414                    .write_unaligned((self as *const ClipNodeArgs).read());
3415                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3416                // done second because the memcpy will write garbage to these bytes.
3417            }
3418            Ok(())
3419        }
3420    }
3421    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3422        fidl::encoding::Encode<ClipNodeArgs, D> for (T0,)
3423    {
3424        #[inline]
3425        unsafe fn encode(
3426            self,
3427            encoder: &mut fidl::encoding::Encoder<'_, D>,
3428            offset: usize,
3429            depth: fidl::encoding::Depth,
3430        ) -> fidl::Result<()> {
3431            encoder.debug_check_bounds::<ClipNodeArgs>(offset);
3432            // Zero out padding regions. There's no need to apply masks
3433            // because the unmasked parts will be overwritten by fields.
3434            // Write the fields.
3435            self.0.encode(encoder, offset + 0, depth)?;
3436            Ok(())
3437        }
3438    }
3439
3440    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClipNodeArgs {
3441        #[inline(always)]
3442        fn new_empty() -> Self {
3443            Self { unused: fidl::new_empty!(u32, D) }
3444        }
3445
3446        #[inline]
3447        unsafe fn decode(
3448            &mut self,
3449            decoder: &mut fidl::encoding::Decoder<'_, D>,
3450            offset: usize,
3451            _depth: fidl::encoding::Depth,
3452        ) -> fidl::Result<()> {
3453            decoder.debug_check_bounds::<Self>(offset);
3454            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3455            // Verify that padding bytes are zero.
3456            // Copy from the buffer into the object.
3457            unsafe {
3458                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3459            }
3460            Ok(())
3461        }
3462    }
3463
3464    impl fidl::encoding::ValueTypeMarker for ColorRgb {
3465        type Borrowed<'a> = &'a Self;
3466        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3467            value
3468        }
3469    }
3470
3471    unsafe impl fidl::encoding::TypeMarker for ColorRgb {
3472        type Owned = Self;
3473
3474        #[inline(always)]
3475        fn inline_align(_context: fidl::encoding::Context) -> usize {
3476            4
3477        }
3478
3479        #[inline(always)]
3480        fn inline_size(_context: fidl::encoding::Context) -> usize {
3481            12
3482        }
3483    }
3484
3485    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgb, D> for &ColorRgb {
3486        #[inline]
3487        unsafe fn encode(
3488            self,
3489            encoder: &mut fidl::encoding::Encoder<'_, D>,
3490            offset: usize,
3491            _depth: fidl::encoding::Depth,
3492        ) -> fidl::Result<()> {
3493            encoder.debug_check_bounds::<ColorRgb>(offset);
3494            // Delegate to tuple encoding.
3495            fidl::encoding::Encode::<ColorRgb, D>::encode(
3496                (
3497                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
3498                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
3499                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
3500                ),
3501                encoder,
3502                offset,
3503                _depth,
3504            )
3505        }
3506    }
3507    unsafe impl<
3508        D: fidl::encoding::ResourceDialect,
3509        T0: fidl::encoding::Encode<f32, D>,
3510        T1: fidl::encoding::Encode<f32, D>,
3511        T2: fidl::encoding::Encode<f32, D>,
3512    > fidl::encoding::Encode<ColorRgb, D> for (T0, T1, T2)
3513    {
3514        #[inline]
3515        unsafe fn encode(
3516            self,
3517            encoder: &mut fidl::encoding::Encoder<'_, D>,
3518            offset: usize,
3519            depth: fidl::encoding::Depth,
3520        ) -> fidl::Result<()> {
3521            encoder.debug_check_bounds::<ColorRgb>(offset);
3522            // Zero out padding regions. There's no need to apply masks
3523            // because the unmasked parts will be overwritten by fields.
3524            // Write the fields.
3525            self.0.encode(encoder, offset + 0, depth)?;
3526            self.1.encode(encoder, offset + 4, depth)?;
3527            self.2.encode(encoder, offset + 8, depth)?;
3528            Ok(())
3529        }
3530    }
3531
3532    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgb {
3533        #[inline(always)]
3534        fn new_empty() -> Self {
3535            Self {
3536                red: fidl::new_empty!(f32, D),
3537                green: fidl::new_empty!(f32, D),
3538                blue: fidl::new_empty!(f32, D),
3539            }
3540        }
3541
3542        #[inline]
3543        unsafe fn decode(
3544            &mut self,
3545            decoder: &mut fidl::encoding::Decoder<'_, D>,
3546            offset: usize,
3547            _depth: fidl::encoding::Depth,
3548        ) -> fidl::Result<()> {
3549            decoder.debug_check_bounds::<Self>(offset);
3550            // Verify that padding bytes are zero.
3551            fidl::decode!(f32, D, &mut self.red, decoder, offset + 0, _depth)?;
3552            fidl::decode!(f32, D, &mut self.green, decoder, offset + 4, _depth)?;
3553            fidl::decode!(f32, D, &mut self.blue, decoder, offset + 8, _depth)?;
3554            Ok(())
3555        }
3556    }
3557
3558    impl fidl::encoding::ValueTypeMarker for ColorRgbValue {
3559        type Borrowed<'a> = &'a Self;
3560        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3561            value
3562        }
3563    }
3564
3565    unsafe impl fidl::encoding::TypeMarker for ColorRgbValue {
3566        type Owned = Self;
3567
3568        #[inline(always)]
3569        fn inline_align(_context: fidl::encoding::Context) -> usize {
3570            4
3571        }
3572
3573        #[inline(always)]
3574        fn inline_size(_context: fidl::encoding::Context) -> usize {
3575            16
3576        }
3577    }
3578
3579    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbValue, D>
3580        for &ColorRgbValue
3581    {
3582        #[inline]
3583        unsafe fn encode(
3584            self,
3585            encoder: &mut fidl::encoding::Encoder<'_, D>,
3586            offset: usize,
3587            _depth: fidl::encoding::Depth,
3588        ) -> fidl::Result<()> {
3589            encoder.debug_check_bounds::<ColorRgbValue>(offset);
3590            // Delegate to tuple encoding.
3591            fidl::encoding::Encode::<ColorRgbValue, D>::encode(
3592                (
3593                    <ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3594                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
3595                ),
3596                encoder,
3597                offset,
3598                _depth,
3599            )
3600        }
3601    }
3602    unsafe impl<
3603        D: fidl::encoding::ResourceDialect,
3604        T0: fidl::encoding::Encode<ColorRgb, D>,
3605        T1: fidl::encoding::Encode<u32, D>,
3606    > fidl::encoding::Encode<ColorRgbValue, D> for (T0, T1)
3607    {
3608        #[inline]
3609        unsafe fn encode(
3610            self,
3611            encoder: &mut fidl::encoding::Encoder<'_, D>,
3612            offset: usize,
3613            depth: fidl::encoding::Depth,
3614        ) -> fidl::Result<()> {
3615            encoder.debug_check_bounds::<ColorRgbValue>(offset);
3616            // Zero out padding regions. There's no need to apply masks
3617            // because the unmasked parts will be overwritten by fields.
3618            // Write the fields.
3619            self.0.encode(encoder, offset + 0, depth)?;
3620            self.1.encode(encoder, offset + 12, depth)?;
3621            Ok(())
3622        }
3623    }
3624
3625    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbValue {
3626        #[inline(always)]
3627        fn new_empty() -> Self {
3628            Self { value: fidl::new_empty!(ColorRgb, D), variable_id: fidl::new_empty!(u32, D) }
3629        }
3630
3631        #[inline]
3632        unsafe fn decode(
3633            &mut self,
3634            decoder: &mut fidl::encoding::Decoder<'_, D>,
3635            offset: usize,
3636            _depth: fidl::encoding::Depth,
3637        ) -> fidl::Result<()> {
3638            decoder.debug_check_bounds::<Self>(offset);
3639            // Verify that padding bytes are zero.
3640            fidl::decode!(ColorRgb, D, &mut self.value, decoder, offset + 0, _depth)?;
3641            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
3642            Ok(())
3643        }
3644    }
3645
3646    impl fidl::encoding::ValueTypeMarker for ColorRgba {
3647        type Borrowed<'a> = &'a Self;
3648        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3649            value
3650        }
3651    }
3652
3653    unsafe impl fidl::encoding::TypeMarker for ColorRgba {
3654        type Owned = Self;
3655
3656        #[inline(always)]
3657        fn inline_align(_context: fidl::encoding::Context) -> usize {
3658            1
3659        }
3660
3661        #[inline(always)]
3662        fn inline_size(_context: fidl::encoding::Context) -> usize {
3663            4
3664        }
3665        #[inline(always)]
3666        fn encode_is_copy() -> bool {
3667            true
3668        }
3669
3670        #[inline(always)]
3671        fn decode_is_copy() -> bool {
3672            true
3673        }
3674    }
3675
3676    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgba, D>
3677        for &ColorRgba
3678    {
3679        #[inline]
3680        unsafe fn encode(
3681            self,
3682            encoder: &mut fidl::encoding::Encoder<'_, D>,
3683            offset: usize,
3684            _depth: fidl::encoding::Depth,
3685        ) -> fidl::Result<()> {
3686            encoder.debug_check_bounds::<ColorRgba>(offset);
3687            unsafe {
3688                // Copy the object into the buffer.
3689                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3690                (buf_ptr as *mut ColorRgba).write_unaligned((self as *const ColorRgba).read());
3691                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3692                // done second because the memcpy will write garbage to these bytes.
3693            }
3694            Ok(())
3695        }
3696    }
3697    unsafe impl<
3698        D: fidl::encoding::ResourceDialect,
3699        T0: fidl::encoding::Encode<u8, D>,
3700        T1: fidl::encoding::Encode<u8, D>,
3701        T2: fidl::encoding::Encode<u8, D>,
3702        T3: fidl::encoding::Encode<u8, D>,
3703    > fidl::encoding::Encode<ColorRgba, D> for (T0, T1, T2, T3)
3704    {
3705        #[inline]
3706        unsafe fn encode(
3707            self,
3708            encoder: &mut fidl::encoding::Encoder<'_, D>,
3709            offset: usize,
3710            depth: fidl::encoding::Depth,
3711        ) -> fidl::Result<()> {
3712            encoder.debug_check_bounds::<ColorRgba>(offset);
3713            // Zero out padding regions. There's no need to apply masks
3714            // because the unmasked parts will be overwritten by fields.
3715            // Write the fields.
3716            self.0.encode(encoder, offset + 0, depth)?;
3717            self.1.encode(encoder, offset + 1, depth)?;
3718            self.2.encode(encoder, offset + 2, depth)?;
3719            self.3.encode(encoder, offset + 3, depth)?;
3720            Ok(())
3721        }
3722    }
3723
3724    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgba {
3725        #[inline(always)]
3726        fn new_empty() -> Self {
3727            Self {
3728                red: fidl::new_empty!(u8, D),
3729                green: fidl::new_empty!(u8, D),
3730                blue: fidl::new_empty!(u8, D),
3731                alpha: fidl::new_empty!(u8, D),
3732            }
3733        }
3734
3735        #[inline]
3736        unsafe fn decode(
3737            &mut self,
3738            decoder: &mut fidl::encoding::Decoder<'_, D>,
3739            offset: usize,
3740            _depth: fidl::encoding::Depth,
3741        ) -> fidl::Result<()> {
3742            decoder.debug_check_bounds::<Self>(offset);
3743            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3744            // Verify that padding bytes are zero.
3745            // Copy from the buffer into the object.
3746            unsafe {
3747                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3748            }
3749            Ok(())
3750        }
3751    }
3752
3753    impl fidl::encoding::ValueTypeMarker for ColorRgbaValue {
3754        type Borrowed<'a> = &'a Self;
3755        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3756            value
3757        }
3758    }
3759
3760    unsafe impl fidl::encoding::TypeMarker for ColorRgbaValue {
3761        type Owned = Self;
3762
3763        #[inline(always)]
3764        fn inline_align(_context: fidl::encoding::Context) -> usize {
3765            4
3766        }
3767
3768        #[inline(always)]
3769        fn inline_size(_context: fidl::encoding::Context) -> usize {
3770            8
3771        }
3772        #[inline(always)]
3773        fn encode_is_copy() -> bool {
3774            true
3775        }
3776
3777        #[inline(always)]
3778        fn decode_is_copy() -> bool {
3779            true
3780        }
3781    }
3782
3783    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbaValue, D>
3784        for &ColorRgbaValue
3785    {
3786        #[inline]
3787        unsafe fn encode(
3788            self,
3789            encoder: &mut fidl::encoding::Encoder<'_, D>,
3790            offset: usize,
3791            _depth: fidl::encoding::Depth,
3792        ) -> fidl::Result<()> {
3793            encoder.debug_check_bounds::<ColorRgbaValue>(offset);
3794            unsafe {
3795                // Copy the object into the buffer.
3796                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3797                (buf_ptr as *mut ColorRgbaValue)
3798                    .write_unaligned((self as *const ColorRgbaValue).read());
3799                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3800                // done second because the memcpy will write garbage to these bytes.
3801            }
3802            Ok(())
3803        }
3804    }
3805    unsafe impl<
3806        D: fidl::encoding::ResourceDialect,
3807        T0: fidl::encoding::Encode<ColorRgba, D>,
3808        T1: fidl::encoding::Encode<u32, D>,
3809    > fidl::encoding::Encode<ColorRgbaValue, D> for (T0, T1)
3810    {
3811        #[inline]
3812        unsafe fn encode(
3813            self,
3814            encoder: &mut fidl::encoding::Encoder<'_, D>,
3815            offset: usize,
3816            depth: fidl::encoding::Depth,
3817        ) -> fidl::Result<()> {
3818            encoder.debug_check_bounds::<ColorRgbaValue>(offset);
3819            // Zero out padding regions. There's no need to apply masks
3820            // because the unmasked parts will be overwritten by fields.
3821            // Write the fields.
3822            self.0.encode(encoder, offset + 0, depth)?;
3823            self.1.encode(encoder, offset + 4, depth)?;
3824            Ok(())
3825        }
3826    }
3827
3828    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbaValue {
3829        #[inline(always)]
3830        fn new_empty() -> Self {
3831            Self { value: fidl::new_empty!(ColorRgba, D), variable_id: fidl::new_empty!(u32, D) }
3832        }
3833
3834        #[inline]
3835        unsafe fn decode(
3836            &mut self,
3837            decoder: &mut fidl::encoding::Decoder<'_, D>,
3838            offset: usize,
3839            _depth: fidl::encoding::Depth,
3840        ) -> fidl::Result<()> {
3841            decoder.debug_check_bounds::<Self>(offset);
3842            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3843            // Verify that padding bytes are zero.
3844            // Copy from the buffer into the object.
3845            unsafe {
3846                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3847            }
3848            Ok(())
3849        }
3850    }
3851
3852    impl fidl::encoding::ValueTypeMarker for CompositorArgs {
3853        type Borrowed<'a> = &'a Self;
3854        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3855            value
3856        }
3857    }
3858
3859    unsafe impl fidl::encoding::TypeMarker for CompositorArgs {
3860        type Owned = Self;
3861
3862        #[inline(always)]
3863        fn inline_align(_context: fidl::encoding::Context) -> usize {
3864            4
3865        }
3866
3867        #[inline(always)]
3868        fn inline_size(_context: fidl::encoding::Context) -> usize {
3869            4
3870        }
3871        #[inline(always)]
3872        fn encode_is_copy() -> bool {
3873            true
3874        }
3875
3876        #[inline(always)]
3877        fn decode_is_copy() -> bool {
3878            true
3879        }
3880    }
3881
3882    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompositorArgs, D>
3883        for &CompositorArgs
3884    {
3885        #[inline]
3886        unsafe fn encode(
3887            self,
3888            encoder: &mut fidl::encoding::Encoder<'_, D>,
3889            offset: usize,
3890            _depth: fidl::encoding::Depth,
3891        ) -> fidl::Result<()> {
3892            encoder.debug_check_bounds::<CompositorArgs>(offset);
3893            unsafe {
3894                // Copy the object into the buffer.
3895                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3896                (buf_ptr as *mut CompositorArgs)
3897                    .write_unaligned((self as *const CompositorArgs).read());
3898                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3899                // done second because the memcpy will write garbage to these bytes.
3900            }
3901            Ok(())
3902        }
3903    }
3904    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3905        fidl::encoding::Encode<CompositorArgs, D> for (T0,)
3906    {
3907        #[inline]
3908        unsafe fn encode(
3909            self,
3910            encoder: &mut fidl::encoding::Encoder<'_, D>,
3911            offset: usize,
3912            depth: fidl::encoding::Depth,
3913        ) -> fidl::Result<()> {
3914            encoder.debug_check_bounds::<CompositorArgs>(offset);
3915            // Zero out padding regions. There's no need to apply masks
3916            // because the unmasked parts will be overwritten by fields.
3917            // Write the fields.
3918            self.0.encode(encoder, offset + 0, depth)?;
3919            Ok(())
3920        }
3921    }
3922
3923    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositorArgs {
3924        #[inline(always)]
3925        fn new_empty() -> Self {
3926            Self { dummy: fidl::new_empty!(u32, D) }
3927        }
3928
3929        #[inline]
3930        unsafe fn decode(
3931            &mut self,
3932            decoder: &mut fidl::encoding::Decoder<'_, D>,
3933            offset: usize,
3934            _depth: fidl::encoding::Depth,
3935        ) -> fidl::Result<()> {
3936            decoder.debug_check_bounds::<Self>(offset);
3937            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3938            // Verify that padding bytes are zero.
3939            // Copy from the buffer into the object.
3940            unsafe {
3941                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3942            }
3943            Ok(())
3944        }
3945    }
3946
3947    impl fidl::encoding::ValueTypeMarker for DetachChildrenCmd {
3948        type Borrowed<'a> = &'a Self;
3949        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3950            value
3951        }
3952    }
3953
3954    unsafe impl fidl::encoding::TypeMarker for DetachChildrenCmd {
3955        type Owned = Self;
3956
3957        #[inline(always)]
3958        fn inline_align(_context: fidl::encoding::Context) -> usize {
3959            4
3960        }
3961
3962        #[inline(always)]
3963        fn inline_size(_context: fidl::encoding::Context) -> usize {
3964            4
3965        }
3966        #[inline(always)]
3967        fn encode_is_copy() -> bool {
3968            true
3969        }
3970
3971        #[inline(always)]
3972        fn decode_is_copy() -> bool {
3973            true
3974        }
3975    }
3976
3977    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachChildrenCmd, D>
3978        for &DetachChildrenCmd
3979    {
3980        #[inline]
3981        unsafe fn encode(
3982            self,
3983            encoder: &mut fidl::encoding::Encoder<'_, D>,
3984            offset: usize,
3985            _depth: fidl::encoding::Depth,
3986        ) -> fidl::Result<()> {
3987            encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
3988            unsafe {
3989                // Copy the object into the buffer.
3990                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3991                (buf_ptr as *mut DetachChildrenCmd)
3992                    .write_unaligned((self as *const DetachChildrenCmd).read());
3993                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3994                // done second because the memcpy will write garbage to these bytes.
3995            }
3996            Ok(())
3997        }
3998    }
3999    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4000        fidl::encoding::Encode<DetachChildrenCmd, D> for (T0,)
4001    {
4002        #[inline]
4003        unsafe fn encode(
4004            self,
4005            encoder: &mut fidl::encoding::Encoder<'_, D>,
4006            offset: usize,
4007            depth: fidl::encoding::Depth,
4008        ) -> fidl::Result<()> {
4009            encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
4010            // Zero out padding regions. There's no need to apply masks
4011            // because the unmasked parts will be overwritten by fields.
4012            // Write the fields.
4013            self.0.encode(encoder, offset + 0, depth)?;
4014            Ok(())
4015        }
4016    }
4017
4018    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachChildrenCmd {
4019        #[inline(always)]
4020        fn new_empty() -> Self {
4021            Self { node_id: fidl::new_empty!(u32, D) }
4022        }
4023
4024        #[inline]
4025        unsafe fn decode(
4026            &mut self,
4027            decoder: &mut fidl::encoding::Decoder<'_, D>,
4028            offset: usize,
4029            _depth: fidl::encoding::Depth,
4030        ) -> fidl::Result<()> {
4031            decoder.debug_check_bounds::<Self>(offset);
4032            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4033            // Verify that padding bytes are zero.
4034            // Copy from the buffer into the object.
4035            unsafe {
4036                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4037            }
4038            Ok(())
4039        }
4040    }
4041
4042    impl fidl::encoding::ValueTypeMarker for DetachCmd {
4043        type Borrowed<'a> = &'a Self;
4044        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4045            value
4046        }
4047    }
4048
4049    unsafe impl fidl::encoding::TypeMarker for DetachCmd {
4050        type Owned = Self;
4051
4052        #[inline(always)]
4053        fn inline_align(_context: fidl::encoding::Context) -> usize {
4054            4
4055        }
4056
4057        #[inline(always)]
4058        fn inline_size(_context: fidl::encoding::Context) -> usize {
4059            4
4060        }
4061        #[inline(always)]
4062        fn encode_is_copy() -> bool {
4063            true
4064        }
4065
4066        #[inline(always)]
4067        fn decode_is_copy() -> bool {
4068            true
4069        }
4070    }
4071
4072    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachCmd, D>
4073        for &DetachCmd
4074    {
4075        #[inline]
4076        unsafe fn encode(
4077            self,
4078            encoder: &mut fidl::encoding::Encoder<'_, D>,
4079            offset: usize,
4080            _depth: fidl::encoding::Depth,
4081        ) -> fidl::Result<()> {
4082            encoder.debug_check_bounds::<DetachCmd>(offset);
4083            unsafe {
4084                // Copy the object into the buffer.
4085                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4086                (buf_ptr as *mut DetachCmd).write_unaligned((self as *const DetachCmd).read());
4087                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4088                // done second because the memcpy will write garbage to these bytes.
4089            }
4090            Ok(())
4091        }
4092    }
4093    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4094        fidl::encoding::Encode<DetachCmd, D> for (T0,)
4095    {
4096        #[inline]
4097        unsafe fn encode(
4098            self,
4099            encoder: &mut fidl::encoding::Encoder<'_, D>,
4100            offset: usize,
4101            depth: fidl::encoding::Depth,
4102        ) -> fidl::Result<()> {
4103            encoder.debug_check_bounds::<DetachCmd>(offset);
4104            // Zero out padding regions. There's no need to apply masks
4105            // because the unmasked parts will be overwritten by fields.
4106            // Write the fields.
4107            self.0.encode(encoder, offset + 0, depth)?;
4108            Ok(())
4109        }
4110    }
4111
4112    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachCmd {
4113        #[inline(always)]
4114        fn new_empty() -> Self {
4115            Self { id: fidl::new_empty!(u32, D) }
4116        }
4117
4118        #[inline]
4119        unsafe fn decode(
4120            &mut self,
4121            decoder: &mut fidl::encoding::Decoder<'_, D>,
4122            offset: usize,
4123            _depth: fidl::encoding::Depth,
4124        ) -> fidl::Result<()> {
4125            decoder.debug_check_bounds::<Self>(offset);
4126            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4127            // Verify that padding bytes are zero.
4128            // Copy from the buffer into the object.
4129            unsafe {
4130                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4131            }
4132            Ok(())
4133        }
4134    }
4135
4136    impl fidl::encoding::ValueTypeMarker for DetachLightCmd {
4137        type Borrowed<'a> = &'a Self;
4138        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4139            value
4140        }
4141    }
4142
4143    unsafe impl fidl::encoding::TypeMarker for DetachLightCmd {
4144        type Owned = Self;
4145
4146        #[inline(always)]
4147        fn inline_align(_context: fidl::encoding::Context) -> usize {
4148            4
4149        }
4150
4151        #[inline(always)]
4152        fn inline_size(_context: fidl::encoding::Context) -> usize {
4153            4
4154        }
4155        #[inline(always)]
4156        fn encode_is_copy() -> bool {
4157            true
4158        }
4159
4160        #[inline(always)]
4161        fn decode_is_copy() -> bool {
4162            true
4163        }
4164    }
4165
4166    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightCmd, D>
4167        for &DetachLightCmd
4168    {
4169        #[inline]
4170        unsafe fn encode(
4171            self,
4172            encoder: &mut fidl::encoding::Encoder<'_, D>,
4173            offset: usize,
4174            _depth: fidl::encoding::Depth,
4175        ) -> fidl::Result<()> {
4176            encoder.debug_check_bounds::<DetachLightCmd>(offset);
4177            unsafe {
4178                // Copy the object into the buffer.
4179                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4180                (buf_ptr as *mut DetachLightCmd)
4181                    .write_unaligned((self as *const DetachLightCmd).read());
4182                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4183                // done second because the memcpy will write garbage to these bytes.
4184            }
4185            Ok(())
4186        }
4187    }
4188    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4189        fidl::encoding::Encode<DetachLightCmd, D> for (T0,)
4190    {
4191        #[inline]
4192        unsafe fn encode(
4193            self,
4194            encoder: &mut fidl::encoding::Encoder<'_, D>,
4195            offset: usize,
4196            depth: fidl::encoding::Depth,
4197        ) -> fidl::Result<()> {
4198            encoder.debug_check_bounds::<DetachLightCmd>(offset);
4199            // Zero out padding regions. There's no need to apply masks
4200            // because the unmasked parts will be overwritten by fields.
4201            // Write the fields.
4202            self.0.encode(encoder, offset + 0, depth)?;
4203            Ok(())
4204        }
4205    }
4206
4207    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightCmd {
4208        #[inline(always)]
4209        fn new_empty() -> Self {
4210            Self { light_id: fidl::new_empty!(u32, D) }
4211        }
4212
4213        #[inline]
4214        unsafe fn decode(
4215            &mut self,
4216            decoder: &mut fidl::encoding::Decoder<'_, D>,
4217            offset: usize,
4218            _depth: fidl::encoding::Depth,
4219        ) -> fidl::Result<()> {
4220            decoder.debug_check_bounds::<Self>(offset);
4221            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4222            // Verify that padding bytes are zero.
4223            // Copy from the buffer into the object.
4224            unsafe {
4225                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4226            }
4227            Ok(())
4228        }
4229    }
4230
4231    impl fidl::encoding::ValueTypeMarker for DetachLightsCmd {
4232        type Borrowed<'a> = &'a Self;
4233        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4234            value
4235        }
4236    }
4237
4238    unsafe impl fidl::encoding::TypeMarker for DetachLightsCmd {
4239        type Owned = Self;
4240
4241        #[inline(always)]
4242        fn inline_align(_context: fidl::encoding::Context) -> usize {
4243            4
4244        }
4245
4246        #[inline(always)]
4247        fn inline_size(_context: fidl::encoding::Context) -> usize {
4248            4
4249        }
4250        #[inline(always)]
4251        fn encode_is_copy() -> bool {
4252            true
4253        }
4254
4255        #[inline(always)]
4256        fn decode_is_copy() -> bool {
4257            true
4258        }
4259    }
4260
4261    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightsCmd, D>
4262        for &DetachLightsCmd
4263    {
4264        #[inline]
4265        unsafe fn encode(
4266            self,
4267            encoder: &mut fidl::encoding::Encoder<'_, D>,
4268            offset: usize,
4269            _depth: fidl::encoding::Depth,
4270        ) -> fidl::Result<()> {
4271            encoder.debug_check_bounds::<DetachLightsCmd>(offset);
4272            unsafe {
4273                // Copy the object into the buffer.
4274                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4275                (buf_ptr as *mut DetachLightsCmd)
4276                    .write_unaligned((self as *const DetachLightsCmd).read());
4277                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4278                // done second because the memcpy will write garbage to these bytes.
4279            }
4280            Ok(())
4281        }
4282    }
4283    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4284        fidl::encoding::Encode<DetachLightsCmd, D> for (T0,)
4285    {
4286        #[inline]
4287        unsafe fn encode(
4288            self,
4289            encoder: &mut fidl::encoding::Encoder<'_, D>,
4290            offset: usize,
4291            depth: fidl::encoding::Depth,
4292        ) -> fidl::Result<()> {
4293            encoder.debug_check_bounds::<DetachLightsCmd>(offset);
4294            // Zero out padding regions. There's no need to apply masks
4295            // because the unmasked parts will be overwritten by fields.
4296            // Write the fields.
4297            self.0.encode(encoder, offset + 0, depth)?;
4298            Ok(())
4299        }
4300    }
4301
4302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightsCmd {
4303        #[inline(always)]
4304        fn new_empty() -> Self {
4305            Self { scene_id: fidl::new_empty!(u32, D) }
4306        }
4307
4308        #[inline]
4309        unsafe fn decode(
4310            &mut self,
4311            decoder: &mut fidl::encoding::Decoder<'_, D>,
4312            offset: usize,
4313            _depth: fidl::encoding::Depth,
4314        ) -> fidl::Result<()> {
4315            decoder.debug_check_bounds::<Self>(offset);
4316            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4317            // Verify that padding bytes are zero.
4318            // Copy from the buffer into the object.
4319            unsafe {
4320                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4321            }
4322            Ok(())
4323        }
4324    }
4325
4326    impl fidl::encoding::ValueTypeMarker for DirectionalLightArgs {
4327        type Borrowed<'a> = &'a Self;
4328        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4329            value
4330        }
4331    }
4332
4333    unsafe impl fidl::encoding::TypeMarker for DirectionalLightArgs {
4334        type Owned = Self;
4335
4336        #[inline(always)]
4337        fn inline_align(_context: fidl::encoding::Context) -> usize {
4338            4
4339        }
4340
4341        #[inline(always)]
4342        fn inline_size(_context: fidl::encoding::Context) -> usize {
4343            4
4344        }
4345        #[inline(always)]
4346        fn encode_is_copy() -> bool {
4347            true
4348        }
4349
4350        #[inline(always)]
4351        fn decode_is_copy() -> bool {
4352            true
4353        }
4354    }
4355
4356    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectionalLightArgs, D>
4357        for &DirectionalLightArgs
4358    {
4359        #[inline]
4360        unsafe fn encode(
4361            self,
4362            encoder: &mut fidl::encoding::Encoder<'_, D>,
4363            offset: usize,
4364            _depth: fidl::encoding::Depth,
4365        ) -> fidl::Result<()> {
4366            encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
4367            unsafe {
4368                // Copy the object into the buffer.
4369                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4370                (buf_ptr as *mut DirectionalLightArgs)
4371                    .write_unaligned((self as *const DirectionalLightArgs).read());
4372                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4373                // done second because the memcpy will write garbage to these bytes.
4374            }
4375            Ok(())
4376        }
4377    }
4378    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4379        fidl::encoding::Encode<DirectionalLightArgs, D> for (T0,)
4380    {
4381        #[inline]
4382        unsafe fn encode(
4383            self,
4384            encoder: &mut fidl::encoding::Encoder<'_, D>,
4385            offset: usize,
4386            depth: fidl::encoding::Depth,
4387        ) -> fidl::Result<()> {
4388            encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
4389            // Zero out padding regions. There's no need to apply masks
4390            // because the unmasked parts will be overwritten by fields.
4391            // Write the fields.
4392            self.0.encode(encoder, offset + 0, depth)?;
4393            Ok(())
4394        }
4395    }
4396
4397    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectionalLightArgs {
4398        #[inline(always)]
4399        fn new_empty() -> Self {
4400            Self { dummy: fidl::new_empty!(u32, D) }
4401        }
4402
4403        #[inline]
4404        unsafe fn decode(
4405            &mut self,
4406            decoder: &mut fidl::encoding::Decoder<'_, D>,
4407            offset: usize,
4408            _depth: fidl::encoding::Depth,
4409        ) -> fidl::Result<()> {
4410            decoder.debug_check_bounds::<Self>(offset);
4411            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4412            // Verify that padding bytes are zero.
4413            // Copy from the buffer into the object.
4414            unsafe {
4415                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4416            }
4417            Ok(())
4418        }
4419    }
4420
4421    impl fidl::encoding::ValueTypeMarker for DisplayCompositorArgs {
4422        type Borrowed<'a> = &'a Self;
4423        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4424            value
4425        }
4426    }
4427
4428    unsafe impl fidl::encoding::TypeMarker for DisplayCompositorArgs {
4429        type Owned = Self;
4430
4431        #[inline(always)]
4432        fn inline_align(_context: fidl::encoding::Context) -> usize {
4433            4
4434        }
4435
4436        #[inline(always)]
4437        fn inline_size(_context: fidl::encoding::Context) -> usize {
4438            4
4439        }
4440        #[inline(always)]
4441        fn encode_is_copy() -> bool {
4442            true
4443        }
4444
4445        #[inline(always)]
4446        fn decode_is_copy() -> bool {
4447            true
4448        }
4449    }
4450
4451    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayCompositorArgs, D>
4452        for &DisplayCompositorArgs
4453    {
4454        #[inline]
4455        unsafe fn encode(
4456            self,
4457            encoder: &mut fidl::encoding::Encoder<'_, D>,
4458            offset: usize,
4459            _depth: fidl::encoding::Depth,
4460        ) -> fidl::Result<()> {
4461            encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
4462            unsafe {
4463                // Copy the object into the buffer.
4464                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4465                (buf_ptr as *mut DisplayCompositorArgs)
4466                    .write_unaligned((self as *const DisplayCompositorArgs).read());
4467                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4468                // done second because the memcpy will write garbage to these bytes.
4469            }
4470            Ok(())
4471        }
4472    }
4473    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4474        fidl::encoding::Encode<DisplayCompositorArgs, D> for (T0,)
4475    {
4476        #[inline]
4477        unsafe fn encode(
4478            self,
4479            encoder: &mut fidl::encoding::Encoder<'_, D>,
4480            offset: usize,
4481            depth: fidl::encoding::Depth,
4482        ) -> fidl::Result<()> {
4483            encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
4484            // Zero out padding regions. There's no need to apply masks
4485            // because the unmasked parts will be overwritten by fields.
4486            // Write the fields.
4487            self.0.encode(encoder, offset + 0, depth)?;
4488            Ok(())
4489        }
4490    }
4491
4492    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayCompositorArgs {
4493        #[inline(always)]
4494        fn new_empty() -> Self {
4495            Self { dummy: fidl::new_empty!(u32, D) }
4496        }
4497
4498        #[inline]
4499        unsafe fn decode(
4500            &mut self,
4501            decoder: &mut fidl::encoding::Decoder<'_, D>,
4502            offset: usize,
4503            _depth: fidl::encoding::Depth,
4504        ) -> fidl::Result<()> {
4505            decoder.debug_check_bounds::<Self>(offset);
4506            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4507            // Verify that padding bytes are zero.
4508            // Copy from the buffer into the object.
4509            unsafe {
4510                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4511            }
4512            Ok(())
4513        }
4514    }
4515
4516    impl fidl::encoding::ValueTypeMarker for DisplayInfo {
4517        type Borrowed<'a> = &'a Self;
4518        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4519            value
4520        }
4521    }
4522
4523    unsafe impl fidl::encoding::TypeMarker for DisplayInfo {
4524        type Owned = Self;
4525
4526        #[inline(always)]
4527        fn inline_align(_context: fidl::encoding::Context) -> usize {
4528            4
4529        }
4530
4531        #[inline(always)]
4532        fn inline_size(_context: fidl::encoding::Context) -> usize {
4533            8
4534        }
4535        #[inline(always)]
4536        fn encode_is_copy() -> bool {
4537            true
4538        }
4539
4540        #[inline(always)]
4541        fn decode_is_copy() -> bool {
4542            true
4543        }
4544    }
4545
4546    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayInfo, D>
4547        for &DisplayInfo
4548    {
4549        #[inline]
4550        unsafe fn encode(
4551            self,
4552            encoder: &mut fidl::encoding::Encoder<'_, D>,
4553            offset: usize,
4554            _depth: fidl::encoding::Depth,
4555        ) -> fidl::Result<()> {
4556            encoder.debug_check_bounds::<DisplayInfo>(offset);
4557            unsafe {
4558                // Copy the object into the buffer.
4559                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4560                (buf_ptr as *mut DisplayInfo).write_unaligned((self as *const DisplayInfo).read());
4561                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4562                // done second because the memcpy will write garbage to these bytes.
4563            }
4564            Ok(())
4565        }
4566    }
4567    unsafe impl<
4568        D: fidl::encoding::ResourceDialect,
4569        T0: fidl::encoding::Encode<u32, D>,
4570        T1: fidl::encoding::Encode<u32, D>,
4571    > fidl::encoding::Encode<DisplayInfo, D> for (T0, T1)
4572    {
4573        #[inline]
4574        unsafe fn encode(
4575            self,
4576            encoder: &mut fidl::encoding::Encoder<'_, D>,
4577            offset: usize,
4578            depth: fidl::encoding::Depth,
4579        ) -> fidl::Result<()> {
4580            encoder.debug_check_bounds::<DisplayInfo>(offset);
4581            // Zero out padding regions. There's no need to apply masks
4582            // because the unmasked parts will be overwritten by fields.
4583            // Write the fields.
4584            self.0.encode(encoder, offset + 0, depth)?;
4585            self.1.encode(encoder, offset + 4, depth)?;
4586            Ok(())
4587        }
4588    }
4589
4590    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayInfo {
4591        #[inline(always)]
4592        fn new_empty() -> Self {
4593            Self { width_in_px: fidl::new_empty!(u32, D), height_in_px: fidl::new_empty!(u32, D) }
4594        }
4595
4596        #[inline]
4597        unsafe fn decode(
4598            &mut self,
4599            decoder: &mut fidl::encoding::Decoder<'_, D>,
4600            offset: usize,
4601            _depth: fidl::encoding::Depth,
4602        ) -> fidl::Result<()> {
4603            decoder.debug_check_bounds::<Self>(offset);
4604            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4605            // Verify that padding bytes are zero.
4606            // Copy from the buffer into the object.
4607            unsafe {
4608                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4609            }
4610            Ok(())
4611        }
4612    }
4613
4614    impl fidl::encoding::ValueTypeMarker for EntityNodeArgs {
4615        type Borrowed<'a> = &'a Self;
4616        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4617            value
4618        }
4619    }
4620
4621    unsafe impl fidl::encoding::TypeMarker for EntityNodeArgs {
4622        type Owned = Self;
4623
4624        #[inline(always)]
4625        fn inline_align(_context: fidl::encoding::Context) -> usize {
4626            4
4627        }
4628
4629        #[inline(always)]
4630        fn inline_size(_context: fidl::encoding::Context) -> usize {
4631            4
4632        }
4633        #[inline(always)]
4634        fn encode_is_copy() -> bool {
4635            true
4636        }
4637
4638        #[inline(always)]
4639        fn decode_is_copy() -> bool {
4640            true
4641        }
4642    }
4643
4644    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EntityNodeArgs, D>
4645        for &EntityNodeArgs
4646    {
4647        #[inline]
4648        unsafe fn encode(
4649            self,
4650            encoder: &mut fidl::encoding::Encoder<'_, D>,
4651            offset: usize,
4652            _depth: fidl::encoding::Depth,
4653        ) -> fidl::Result<()> {
4654            encoder.debug_check_bounds::<EntityNodeArgs>(offset);
4655            unsafe {
4656                // Copy the object into the buffer.
4657                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4658                (buf_ptr as *mut EntityNodeArgs)
4659                    .write_unaligned((self as *const EntityNodeArgs).read());
4660                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4661                // done second because the memcpy will write garbage to these bytes.
4662            }
4663            Ok(())
4664        }
4665    }
4666    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4667        fidl::encoding::Encode<EntityNodeArgs, D> for (T0,)
4668    {
4669        #[inline]
4670        unsafe fn encode(
4671            self,
4672            encoder: &mut fidl::encoding::Encoder<'_, D>,
4673            offset: usize,
4674            depth: fidl::encoding::Depth,
4675        ) -> fidl::Result<()> {
4676            encoder.debug_check_bounds::<EntityNodeArgs>(offset);
4677            // Zero out padding regions. There's no need to apply masks
4678            // because the unmasked parts will be overwritten by fields.
4679            // Write the fields.
4680            self.0.encode(encoder, offset + 0, depth)?;
4681            Ok(())
4682        }
4683    }
4684
4685    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EntityNodeArgs {
4686        #[inline(always)]
4687        fn new_empty() -> Self {
4688            Self { unused: fidl::new_empty!(u32, D) }
4689        }
4690
4691        #[inline]
4692        unsafe fn decode(
4693            &mut self,
4694            decoder: &mut fidl::encoding::Decoder<'_, D>,
4695            offset: usize,
4696            _depth: fidl::encoding::Depth,
4697        ) -> fidl::Result<()> {
4698            decoder.debug_check_bounds::<Self>(offset);
4699            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4700            // Verify that padding bytes are zero.
4701            // Copy from the buffer into the object.
4702            unsafe {
4703                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4704            }
4705            Ok(())
4706        }
4707    }
4708
4709    impl fidl::encoding::ValueTypeMarker for FactoredTransform {
4710        type Borrowed<'a> = &'a Self;
4711        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4712            value
4713        }
4714    }
4715
4716    unsafe impl fidl::encoding::TypeMarker for FactoredTransform {
4717        type Owned = Self;
4718
4719        #[inline(always)]
4720        fn inline_align(_context: fidl::encoding::Context) -> usize {
4721            4
4722        }
4723
4724        #[inline(always)]
4725        fn inline_size(_context: fidl::encoding::Context) -> usize {
4726            52
4727        }
4728    }
4729
4730    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FactoredTransform, D>
4731        for &FactoredTransform
4732    {
4733        #[inline]
4734        unsafe fn encode(
4735            self,
4736            encoder: &mut fidl::encoding::Encoder<'_, D>,
4737            offset: usize,
4738            _depth: fidl::encoding::Depth,
4739        ) -> fidl::Result<()> {
4740            encoder.debug_check_bounds::<FactoredTransform>(offset);
4741            // Delegate to tuple encoding.
4742            fidl::encoding::Encode::<FactoredTransform, D>::encode(
4743                (
4744                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
4745                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
4746                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.anchor),
4747                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.rotation),
4748                ),
4749                encoder,
4750                offset,
4751                _depth,
4752            )
4753        }
4754    }
4755    unsafe impl<
4756        D: fidl::encoding::ResourceDialect,
4757        T0: fidl::encoding::Encode<Vec3, D>,
4758        T1: fidl::encoding::Encode<Vec3, D>,
4759        T2: fidl::encoding::Encode<Vec3, D>,
4760        T3: fidl::encoding::Encode<Quaternion, D>,
4761    > fidl::encoding::Encode<FactoredTransform, D> for (T0, T1, T2, T3)
4762    {
4763        #[inline]
4764        unsafe fn encode(
4765            self,
4766            encoder: &mut fidl::encoding::Encoder<'_, D>,
4767            offset: usize,
4768            depth: fidl::encoding::Depth,
4769        ) -> fidl::Result<()> {
4770            encoder.debug_check_bounds::<FactoredTransform>(offset);
4771            // Zero out padding regions. There's no need to apply masks
4772            // because the unmasked parts will be overwritten by fields.
4773            // Write the fields.
4774            self.0.encode(encoder, offset + 0, depth)?;
4775            self.1.encode(encoder, offset + 12, depth)?;
4776            self.2.encode(encoder, offset + 24, depth)?;
4777            self.3.encode(encoder, offset + 36, depth)?;
4778            Ok(())
4779        }
4780    }
4781
4782    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FactoredTransform {
4783        #[inline(always)]
4784        fn new_empty() -> Self {
4785            Self {
4786                translation: fidl::new_empty!(Vec3, D),
4787                scale: fidl::new_empty!(Vec3, D),
4788                anchor: fidl::new_empty!(Vec3, D),
4789                rotation: fidl::new_empty!(Quaternion, D),
4790            }
4791        }
4792
4793        #[inline]
4794        unsafe fn decode(
4795            &mut self,
4796            decoder: &mut fidl::encoding::Decoder<'_, D>,
4797            offset: usize,
4798            _depth: fidl::encoding::Depth,
4799        ) -> fidl::Result<()> {
4800            decoder.debug_check_bounds::<Self>(offset);
4801            // Verify that padding bytes are zero.
4802            fidl::decode!(Vec3, D, &mut self.translation, decoder, offset + 0, _depth)?;
4803            fidl::decode!(Vec3, D, &mut self.scale, decoder, offset + 12, _depth)?;
4804            fidl::decode!(Vec3, D, &mut self.anchor, decoder, offset + 24, _depth)?;
4805            fidl::decode!(Quaternion, D, &mut self.rotation, decoder, offset + 36, _depth)?;
4806            Ok(())
4807        }
4808    }
4809
4810    impl fidl::encoding::ValueTypeMarker for FloatValue {
4811        type Borrowed<'a> = &'a Self;
4812        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4813            value
4814        }
4815    }
4816
4817    unsafe impl fidl::encoding::TypeMarker for FloatValue {
4818        type Owned = Self;
4819
4820        #[inline(always)]
4821        fn inline_align(_context: fidl::encoding::Context) -> usize {
4822            4
4823        }
4824
4825        #[inline(always)]
4826        fn inline_size(_context: fidl::encoding::Context) -> usize {
4827            8
4828        }
4829    }
4830
4831    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FloatValue, D>
4832        for &FloatValue
4833    {
4834        #[inline]
4835        unsafe fn encode(
4836            self,
4837            encoder: &mut fidl::encoding::Encoder<'_, D>,
4838            offset: usize,
4839            _depth: fidl::encoding::Depth,
4840        ) -> fidl::Result<()> {
4841            encoder.debug_check_bounds::<FloatValue>(offset);
4842            // Delegate to tuple encoding.
4843            fidl::encoding::Encode::<FloatValue, D>::encode(
4844                (
4845                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4846                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
4847                ),
4848                encoder,
4849                offset,
4850                _depth,
4851            )
4852        }
4853    }
4854    unsafe impl<
4855        D: fidl::encoding::ResourceDialect,
4856        T0: fidl::encoding::Encode<f32, D>,
4857        T1: fidl::encoding::Encode<u32, D>,
4858    > fidl::encoding::Encode<FloatValue, D> for (T0, T1)
4859    {
4860        #[inline]
4861        unsafe fn encode(
4862            self,
4863            encoder: &mut fidl::encoding::Encoder<'_, D>,
4864            offset: usize,
4865            depth: fidl::encoding::Depth,
4866        ) -> fidl::Result<()> {
4867            encoder.debug_check_bounds::<FloatValue>(offset);
4868            // Zero out padding regions. There's no need to apply masks
4869            // because the unmasked parts will be overwritten by fields.
4870            // Write the fields.
4871            self.0.encode(encoder, offset + 0, depth)?;
4872            self.1.encode(encoder, offset + 4, depth)?;
4873            Ok(())
4874        }
4875    }
4876
4877    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FloatValue {
4878        #[inline(always)]
4879        fn new_empty() -> Self {
4880            Self { value: fidl::new_empty!(f32, D), variable_id: fidl::new_empty!(u32, D) }
4881        }
4882
4883        #[inline]
4884        unsafe fn decode(
4885            &mut self,
4886            decoder: &mut fidl::encoding::Decoder<'_, D>,
4887            offset: usize,
4888            _depth: fidl::encoding::Depth,
4889        ) -> fidl::Result<()> {
4890            decoder.debug_check_bounds::<Self>(offset);
4891            // Verify that padding bytes are zero.
4892            fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
4893            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 4, _depth)?;
4894            Ok(())
4895        }
4896    }
4897
4898    impl fidl::encoding::ValueTypeMarker for ImageArgs {
4899        type Borrowed<'a> = &'a Self;
4900        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4901            value
4902        }
4903    }
4904
4905    unsafe impl fidl::encoding::TypeMarker for ImageArgs {
4906        type Owned = Self;
4907
4908        #[inline(always)]
4909        fn inline_align(_context: fidl::encoding::Context) -> usize {
4910            4
4911        }
4912
4913        #[inline(always)]
4914        fn inline_size(_context: fidl::encoding::Context) -> usize {
4915            40
4916        }
4917    }
4918
4919    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs, D>
4920        for &ImageArgs
4921    {
4922        #[inline]
4923        unsafe fn encode(
4924            self,
4925            encoder: &mut fidl::encoding::Encoder<'_, D>,
4926            offset: usize,
4927            _depth: fidl::encoding::Depth,
4928        ) -> fidl::Result<()> {
4929            encoder.debug_check_bounds::<ImageArgs>(offset);
4930            // Delegate to tuple encoding.
4931            fidl::encoding::Encode::<ImageArgs, D>::encode(
4932                (
4933                    <fidl_fuchsia_images__common::ImageInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
4934                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_id),
4935                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_offset),
4936                ),
4937                encoder, offset, _depth
4938            )
4939        }
4940    }
4941    unsafe impl<
4942        D: fidl::encoding::ResourceDialect,
4943        T0: fidl::encoding::Encode<fidl_fuchsia_images__common::ImageInfo, D>,
4944        T1: fidl::encoding::Encode<u32, D>,
4945        T2: fidl::encoding::Encode<u32, D>,
4946    > fidl::encoding::Encode<ImageArgs, D> for (T0, T1, T2)
4947    {
4948        #[inline]
4949        unsafe fn encode(
4950            self,
4951            encoder: &mut fidl::encoding::Encoder<'_, D>,
4952            offset: usize,
4953            depth: fidl::encoding::Depth,
4954        ) -> fidl::Result<()> {
4955            encoder.debug_check_bounds::<ImageArgs>(offset);
4956            // Zero out padding regions. There's no need to apply masks
4957            // because the unmasked parts will be overwritten by fields.
4958            // Write the fields.
4959            self.0.encode(encoder, offset + 0, depth)?;
4960            self.1.encode(encoder, offset + 32, depth)?;
4961            self.2.encode(encoder, offset + 36, depth)?;
4962            Ok(())
4963        }
4964    }
4965
4966    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs {
4967        #[inline(always)]
4968        fn new_empty() -> Self {
4969            Self {
4970                info: fidl::new_empty!(fidl_fuchsia_images__common::ImageInfo, D),
4971                memory_id: fidl::new_empty!(u32, D),
4972                memory_offset: fidl::new_empty!(u32, D),
4973            }
4974        }
4975
4976        #[inline]
4977        unsafe fn decode(
4978            &mut self,
4979            decoder: &mut fidl::encoding::Decoder<'_, D>,
4980            offset: usize,
4981            _depth: fidl::encoding::Depth,
4982        ) -> fidl::Result<()> {
4983            decoder.debug_check_bounds::<Self>(offset);
4984            // Verify that padding bytes are zero.
4985            fidl::decode!(
4986                fidl_fuchsia_images__common::ImageInfo,
4987                D,
4988                &mut self.info,
4989                decoder,
4990                offset + 0,
4991                _depth
4992            )?;
4993            fidl::decode!(u32, D, &mut self.memory_id, decoder, offset + 32, _depth)?;
4994            fidl::decode!(u32, D, &mut self.memory_offset, decoder, offset + 36, _depth)?;
4995            Ok(())
4996        }
4997    }
4998
4999    impl fidl::encoding::ValueTypeMarker for ImageArgs2 {
5000        type Borrowed<'a> = &'a Self;
5001        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5002            value
5003        }
5004    }
5005
5006    unsafe impl fidl::encoding::TypeMarker for ImageArgs2 {
5007        type Owned = Self;
5008
5009        #[inline(always)]
5010        fn inline_align(_context: fidl::encoding::Context) -> usize {
5011            4
5012        }
5013
5014        #[inline(always)]
5015        fn inline_size(_context: fidl::encoding::Context) -> usize {
5016            16
5017        }
5018        #[inline(always)]
5019        fn encode_is_copy() -> bool {
5020            true
5021        }
5022
5023        #[inline(always)]
5024        fn decode_is_copy() -> bool {
5025            true
5026        }
5027    }
5028
5029    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs2, D>
5030        for &ImageArgs2
5031    {
5032        #[inline]
5033        unsafe fn encode(
5034            self,
5035            encoder: &mut fidl::encoding::Encoder<'_, D>,
5036            offset: usize,
5037            _depth: fidl::encoding::Depth,
5038        ) -> fidl::Result<()> {
5039            encoder.debug_check_bounds::<ImageArgs2>(offset);
5040            unsafe {
5041                // Copy the object into the buffer.
5042                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5043                (buf_ptr as *mut ImageArgs2).write_unaligned((self as *const ImageArgs2).read());
5044                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5045                // done second because the memcpy will write garbage to these bytes.
5046            }
5047            Ok(())
5048        }
5049    }
5050    unsafe impl<
5051        D: fidl::encoding::ResourceDialect,
5052        T0: fidl::encoding::Encode<u32, D>,
5053        T1: fidl::encoding::Encode<u32, D>,
5054        T2: fidl::encoding::Encode<u32, D>,
5055        T3: fidl::encoding::Encode<u32, D>,
5056    > fidl::encoding::Encode<ImageArgs2, D> for (T0, T1, T2, T3)
5057    {
5058        #[inline]
5059        unsafe fn encode(
5060            self,
5061            encoder: &mut fidl::encoding::Encoder<'_, D>,
5062            offset: usize,
5063            depth: fidl::encoding::Depth,
5064        ) -> fidl::Result<()> {
5065            encoder.debug_check_bounds::<ImageArgs2>(offset);
5066            // Zero out padding regions. There's no need to apply masks
5067            // because the unmasked parts will be overwritten by fields.
5068            // Write the fields.
5069            self.0.encode(encoder, offset + 0, depth)?;
5070            self.1.encode(encoder, offset + 4, depth)?;
5071            self.2.encode(encoder, offset + 8, depth)?;
5072            self.3.encode(encoder, offset + 12, depth)?;
5073            Ok(())
5074        }
5075    }
5076
5077    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs2 {
5078        #[inline(always)]
5079        fn new_empty() -> Self {
5080            Self {
5081                width: fidl::new_empty!(u32, D),
5082                height: fidl::new_empty!(u32, D),
5083                buffer_collection_id: fidl::new_empty!(u32, D),
5084                buffer_collection_index: fidl::new_empty!(u32, D),
5085            }
5086        }
5087
5088        #[inline]
5089        unsafe fn decode(
5090            &mut self,
5091            decoder: &mut fidl::encoding::Decoder<'_, D>,
5092            offset: usize,
5093            _depth: fidl::encoding::Depth,
5094        ) -> fidl::Result<()> {
5095            decoder.debug_check_bounds::<Self>(offset);
5096            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5097            // Verify that padding bytes are zero.
5098            // Copy from the buffer into the object.
5099            unsafe {
5100                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5101            }
5102            Ok(())
5103        }
5104    }
5105
5106    impl fidl::encoding::ValueTypeMarker for ImportUnboundEvent {
5107        type Borrowed<'a> = &'a Self;
5108        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5109            value
5110        }
5111    }
5112
5113    unsafe impl fidl::encoding::TypeMarker for ImportUnboundEvent {
5114        type Owned = Self;
5115
5116        #[inline(always)]
5117        fn inline_align(_context: fidl::encoding::Context) -> usize {
5118            4
5119        }
5120
5121        #[inline(always)]
5122        fn inline_size(_context: fidl::encoding::Context) -> usize {
5123            4
5124        }
5125        #[inline(always)]
5126        fn encode_is_copy() -> bool {
5127            true
5128        }
5129
5130        #[inline(always)]
5131        fn decode_is_copy() -> bool {
5132            true
5133        }
5134    }
5135
5136    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImportUnboundEvent, D>
5137        for &ImportUnboundEvent
5138    {
5139        #[inline]
5140        unsafe fn encode(
5141            self,
5142            encoder: &mut fidl::encoding::Encoder<'_, D>,
5143            offset: usize,
5144            _depth: fidl::encoding::Depth,
5145        ) -> fidl::Result<()> {
5146            encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5147            unsafe {
5148                // Copy the object into the buffer.
5149                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5150                (buf_ptr as *mut ImportUnboundEvent)
5151                    .write_unaligned((self as *const ImportUnboundEvent).read());
5152                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5153                // done second because the memcpy will write garbage to these bytes.
5154            }
5155            Ok(())
5156        }
5157    }
5158    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5159        fidl::encoding::Encode<ImportUnboundEvent, D> for (T0,)
5160    {
5161        #[inline]
5162        unsafe fn encode(
5163            self,
5164            encoder: &mut fidl::encoding::Encoder<'_, D>,
5165            offset: usize,
5166            depth: fidl::encoding::Depth,
5167        ) -> fidl::Result<()> {
5168            encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5169            // Zero out padding regions. There's no need to apply masks
5170            // because the unmasked parts will be overwritten by fields.
5171            // Write the fields.
5172            self.0.encode(encoder, offset + 0, depth)?;
5173            Ok(())
5174        }
5175    }
5176
5177    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportUnboundEvent {
5178        #[inline(always)]
5179        fn new_empty() -> Self {
5180            Self { resource_id: fidl::new_empty!(u32, D) }
5181        }
5182
5183        #[inline]
5184        unsafe fn decode(
5185            &mut self,
5186            decoder: &mut fidl::encoding::Decoder<'_, D>,
5187            offset: usize,
5188            _depth: fidl::encoding::Depth,
5189        ) -> fidl::Result<()> {
5190            decoder.debug_check_bounds::<Self>(offset);
5191            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5192            // Verify that padding bytes are zero.
5193            // Copy from the buffer into the object.
5194            unsafe {
5195                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5196            }
5197            Ok(())
5198        }
5199    }
5200
5201    impl fidl::encoding::ValueTypeMarker for LayerArgs {
5202        type Borrowed<'a> = &'a Self;
5203        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5204            value
5205        }
5206    }
5207
5208    unsafe impl fidl::encoding::TypeMarker for LayerArgs {
5209        type Owned = Self;
5210
5211        #[inline(always)]
5212        fn inline_align(_context: fidl::encoding::Context) -> usize {
5213            4
5214        }
5215
5216        #[inline(always)]
5217        fn inline_size(_context: fidl::encoding::Context) -> usize {
5218            4
5219        }
5220        #[inline(always)]
5221        fn encode_is_copy() -> bool {
5222            true
5223        }
5224
5225        #[inline(always)]
5226        fn decode_is_copy() -> bool {
5227            true
5228        }
5229    }
5230
5231    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerArgs, D>
5232        for &LayerArgs
5233    {
5234        #[inline]
5235        unsafe fn encode(
5236            self,
5237            encoder: &mut fidl::encoding::Encoder<'_, D>,
5238            offset: usize,
5239            _depth: fidl::encoding::Depth,
5240        ) -> fidl::Result<()> {
5241            encoder.debug_check_bounds::<LayerArgs>(offset);
5242            unsafe {
5243                // Copy the object into the buffer.
5244                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5245                (buf_ptr as *mut LayerArgs).write_unaligned((self as *const LayerArgs).read());
5246                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5247                // done second because the memcpy will write garbage to these bytes.
5248            }
5249            Ok(())
5250        }
5251    }
5252    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5253        fidl::encoding::Encode<LayerArgs, D> for (T0,)
5254    {
5255        #[inline]
5256        unsafe fn encode(
5257            self,
5258            encoder: &mut fidl::encoding::Encoder<'_, D>,
5259            offset: usize,
5260            depth: fidl::encoding::Depth,
5261        ) -> fidl::Result<()> {
5262            encoder.debug_check_bounds::<LayerArgs>(offset);
5263            // Zero out padding regions. There's no need to apply masks
5264            // because the unmasked parts will be overwritten by fields.
5265            // Write the fields.
5266            self.0.encode(encoder, offset + 0, depth)?;
5267            Ok(())
5268        }
5269    }
5270
5271    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerArgs {
5272        #[inline(always)]
5273        fn new_empty() -> Self {
5274            Self { dummy: fidl::new_empty!(u32, D) }
5275        }
5276
5277        #[inline]
5278        unsafe fn decode(
5279            &mut self,
5280            decoder: &mut fidl::encoding::Decoder<'_, D>,
5281            offset: usize,
5282            _depth: fidl::encoding::Depth,
5283        ) -> fidl::Result<()> {
5284            decoder.debug_check_bounds::<Self>(offset);
5285            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5286            // Verify that padding bytes are zero.
5287            // Copy from the buffer into the object.
5288            unsafe {
5289                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5290            }
5291            Ok(())
5292        }
5293    }
5294
5295    impl fidl::encoding::ValueTypeMarker for LayerStackArgs {
5296        type Borrowed<'a> = &'a Self;
5297        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5298            value
5299        }
5300    }
5301
5302    unsafe impl fidl::encoding::TypeMarker for LayerStackArgs {
5303        type Owned = Self;
5304
5305        #[inline(always)]
5306        fn inline_align(_context: fidl::encoding::Context) -> usize {
5307            4
5308        }
5309
5310        #[inline(always)]
5311        fn inline_size(_context: fidl::encoding::Context) -> usize {
5312            4
5313        }
5314        #[inline(always)]
5315        fn encode_is_copy() -> bool {
5316            true
5317        }
5318
5319        #[inline(always)]
5320        fn decode_is_copy() -> bool {
5321            true
5322        }
5323    }
5324
5325    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerStackArgs, D>
5326        for &LayerStackArgs
5327    {
5328        #[inline]
5329        unsafe fn encode(
5330            self,
5331            encoder: &mut fidl::encoding::Encoder<'_, D>,
5332            offset: usize,
5333            _depth: fidl::encoding::Depth,
5334        ) -> fidl::Result<()> {
5335            encoder.debug_check_bounds::<LayerStackArgs>(offset);
5336            unsafe {
5337                // Copy the object into the buffer.
5338                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5339                (buf_ptr as *mut LayerStackArgs)
5340                    .write_unaligned((self as *const LayerStackArgs).read());
5341                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5342                // done second because the memcpy will write garbage to these bytes.
5343            }
5344            Ok(())
5345        }
5346    }
5347    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5348        fidl::encoding::Encode<LayerStackArgs, D> for (T0,)
5349    {
5350        #[inline]
5351        unsafe fn encode(
5352            self,
5353            encoder: &mut fidl::encoding::Encoder<'_, D>,
5354            offset: usize,
5355            depth: fidl::encoding::Depth,
5356        ) -> fidl::Result<()> {
5357            encoder.debug_check_bounds::<LayerStackArgs>(offset);
5358            // Zero out padding regions. There's no need to apply masks
5359            // because the unmasked parts will be overwritten by fields.
5360            // Write the fields.
5361            self.0.encode(encoder, offset + 0, depth)?;
5362            Ok(())
5363        }
5364    }
5365
5366    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerStackArgs {
5367        #[inline(always)]
5368        fn new_empty() -> Self {
5369            Self { dummy: fidl::new_empty!(u32, D) }
5370        }
5371
5372        #[inline]
5373        unsafe fn decode(
5374            &mut self,
5375            decoder: &mut fidl::encoding::Decoder<'_, D>,
5376            offset: usize,
5377            _depth: fidl::encoding::Depth,
5378        ) -> fidl::Result<()> {
5379            decoder.debug_check_bounds::<Self>(offset);
5380            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5381            // Verify that padding bytes are zero.
5382            // Copy from the buffer into the object.
5383            unsafe {
5384                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5385            }
5386            Ok(())
5387        }
5388    }
5389
5390    impl fidl::encoding::ValueTypeMarker for MaterialArgs {
5391        type Borrowed<'a> = &'a Self;
5392        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5393            value
5394        }
5395    }
5396
5397    unsafe impl fidl::encoding::TypeMarker for MaterialArgs {
5398        type Owned = Self;
5399
5400        #[inline(always)]
5401        fn inline_align(_context: fidl::encoding::Context) -> usize {
5402            4
5403        }
5404
5405        #[inline(always)]
5406        fn inline_size(_context: fidl::encoding::Context) -> usize {
5407            4
5408        }
5409        #[inline(always)]
5410        fn encode_is_copy() -> bool {
5411            true
5412        }
5413
5414        #[inline(always)]
5415        fn decode_is_copy() -> bool {
5416            true
5417        }
5418    }
5419
5420    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MaterialArgs, D>
5421        for &MaterialArgs
5422    {
5423        #[inline]
5424        unsafe fn encode(
5425            self,
5426            encoder: &mut fidl::encoding::Encoder<'_, D>,
5427            offset: usize,
5428            _depth: fidl::encoding::Depth,
5429        ) -> fidl::Result<()> {
5430            encoder.debug_check_bounds::<MaterialArgs>(offset);
5431            unsafe {
5432                // Copy the object into the buffer.
5433                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5434                (buf_ptr as *mut MaterialArgs)
5435                    .write_unaligned((self as *const MaterialArgs).read());
5436                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5437                // done second because the memcpy will write garbage to these bytes.
5438            }
5439            Ok(())
5440        }
5441    }
5442    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5443        fidl::encoding::Encode<MaterialArgs, D> for (T0,)
5444    {
5445        #[inline]
5446        unsafe fn encode(
5447            self,
5448            encoder: &mut fidl::encoding::Encoder<'_, D>,
5449            offset: usize,
5450            depth: fidl::encoding::Depth,
5451        ) -> fidl::Result<()> {
5452            encoder.debug_check_bounds::<MaterialArgs>(offset);
5453            // Zero out padding regions. There's no need to apply masks
5454            // because the unmasked parts will be overwritten by fields.
5455            // Write the fields.
5456            self.0.encode(encoder, offset + 0, depth)?;
5457            Ok(())
5458        }
5459    }
5460
5461    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MaterialArgs {
5462        #[inline(always)]
5463        fn new_empty() -> Self {
5464            Self { dummy: fidl::new_empty!(u32, D) }
5465        }
5466
5467        #[inline]
5468        unsafe fn decode(
5469            &mut self,
5470            decoder: &mut fidl::encoding::Decoder<'_, D>,
5471            offset: usize,
5472            _depth: fidl::encoding::Depth,
5473        ) -> fidl::Result<()> {
5474            decoder.debug_check_bounds::<Self>(offset);
5475            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5476            // Verify that padding bytes are zero.
5477            // Copy from the buffer into the object.
5478            unsafe {
5479                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5480            }
5481            Ok(())
5482        }
5483    }
5484
5485    impl fidl::encoding::ValueTypeMarker for Matrix4Value {
5486        type Borrowed<'a> = &'a Self;
5487        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5488            value
5489        }
5490    }
5491
5492    unsafe impl fidl::encoding::TypeMarker for Matrix4Value {
5493        type Owned = Self;
5494
5495        #[inline(always)]
5496        fn inline_align(_context: fidl::encoding::Context) -> usize {
5497            4
5498        }
5499
5500        #[inline(always)]
5501        fn inline_size(_context: fidl::encoding::Context) -> usize {
5502            68
5503        }
5504    }
5505
5506    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Matrix4Value, D>
5507        for &Matrix4Value
5508    {
5509        #[inline]
5510        unsafe fn encode(
5511            self,
5512            encoder: &mut fidl::encoding::Encoder<'_, D>,
5513            offset: usize,
5514            _depth: fidl::encoding::Depth,
5515        ) -> fidl::Result<()> {
5516            encoder.debug_check_bounds::<Matrix4Value>(offset);
5517            // Delegate to tuple encoding.
5518            fidl::encoding::Encode::<Matrix4Value, D>::encode(
5519                (
5520                    <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5521                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
5522                ),
5523                encoder,
5524                offset,
5525                _depth,
5526            )
5527        }
5528    }
5529    unsafe impl<
5530        D: fidl::encoding::ResourceDialect,
5531        T0: fidl::encoding::Encode<Mat4, D>,
5532        T1: fidl::encoding::Encode<u32, D>,
5533    > fidl::encoding::Encode<Matrix4Value, D> for (T0, T1)
5534    {
5535        #[inline]
5536        unsafe fn encode(
5537            self,
5538            encoder: &mut fidl::encoding::Encoder<'_, D>,
5539            offset: usize,
5540            depth: fidl::encoding::Depth,
5541        ) -> fidl::Result<()> {
5542            encoder.debug_check_bounds::<Matrix4Value>(offset);
5543            // Zero out padding regions. There's no need to apply masks
5544            // because the unmasked parts will be overwritten by fields.
5545            // Write the fields.
5546            self.0.encode(encoder, offset + 0, depth)?;
5547            self.1.encode(encoder, offset + 64, depth)?;
5548            Ok(())
5549        }
5550    }
5551
5552    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Matrix4Value {
5553        #[inline(always)]
5554        fn new_empty() -> Self {
5555            Self { value: fidl::new_empty!(Mat4, D), variable_id: fidl::new_empty!(u32, D) }
5556        }
5557
5558        #[inline]
5559        unsafe fn decode(
5560            &mut self,
5561            decoder: &mut fidl::encoding::Decoder<'_, D>,
5562            offset: usize,
5563            _depth: fidl::encoding::Depth,
5564        ) -> fidl::Result<()> {
5565            decoder.debug_check_bounds::<Self>(offset);
5566            // Verify that padding bytes are zero.
5567            fidl::decode!(Mat4, D, &mut self.value, decoder, offset + 0, _depth)?;
5568            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 64, _depth)?;
5569            Ok(())
5570        }
5571    }
5572
5573    impl fidl::encoding::ValueTypeMarker for MeshArgs {
5574        type Borrowed<'a> = &'a Self;
5575        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5576            value
5577        }
5578    }
5579
5580    unsafe impl fidl::encoding::TypeMarker for MeshArgs {
5581        type Owned = Self;
5582
5583        #[inline(always)]
5584        fn inline_align(_context: fidl::encoding::Context) -> usize {
5585            1
5586        }
5587
5588        #[inline(always)]
5589        fn inline_size(_context: fidl::encoding::Context) -> usize {
5590            1
5591        }
5592    }
5593
5594    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshArgs, D> for &MeshArgs {
5595        #[inline]
5596        unsafe fn encode(
5597            self,
5598            encoder: &mut fidl::encoding::Encoder<'_, D>,
5599            offset: usize,
5600            _depth: fidl::encoding::Depth,
5601        ) -> fidl::Result<()> {
5602            encoder.debug_check_bounds::<MeshArgs>(offset);
5603            encoder.write_num(0u8, offset);
5604            Ok(())
5605        }
5606    }
5607
5608    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshArgs {
5609        #[inline(always)]
5610        fn new_empty() -> Self {
5611            Self
5612        }
5613
5614        #[inline]
5615        unsafe fn decode(
5616            &mut self,
5617            decoder: &mut fidl::encoding::Decoder<'_, D>,
5618            offset: usize,
5619            _depth: fidl::encoding::Depth,
5620        ) -> fidl::Result<()> {
5621            decoder.debug_check_bounds::<Self>(offset);
5622            match decoder.read_num::<u8>(offset) {
5623                0 => Ok(()),
5624                _ => Err(fidl::Error::Invalid),
5625            }
5626        }
5627    }
5628
5629    impl fidl::encoding::ValueTypeMarker for MeshVertexFormat {
5630        type Borrowed<'a> = &'a Self;
5631        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5632            value
5633        }
5634    }
5635
5636    unsafe impl fidl::encoding::TypeMarker for MeshVertexFormat {
5637        type Owned = Self;
5638
5639        #[inline(always)]
5640        fn inline_align(_context: fidl::encoding::Context) -> usize {
5641            4
5642        }
5643
5644        #[inline(always)]
5645        fn inline_size(_context: fidl::encoding::Context) -> usize {
5646            12
5647        }
5648    }
5649
5650    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshVertexFormat, D>
5651        for &MeshVertexFormat
5652    {
5653        #[inline]
5654        unsafe fn encode(
5655            self,
5656            encoder: &mut fidl::encoding::Encoder<'_, D>,
5657            offset: usize,
5658            _depth: fidl::encoding::Depth,
5659        ) -> fidl::Result<()> {
5660            encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5661            // Delegate to tuple encoding.
5662            fidl::encoding::Encode::<MeshVertexFormat, D>::encode(
5663                (
5664                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.position_type),
5665                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.normal_type),
5666                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.tex_coord_type),
5667                ),
5668                encoder,
5669                offset,
5670                _depth,
5671            )
5672        }
5673    }
5674    unsafe impl<
5675        D: fidl::encoding::ResourceDialect,
5676        T0: fidl::encoding::Encode<ValueType, D>,
5677        T1: fidl::encoding::Encode<ValueType, D>,
5678        T2: fidl::encoding::Encode<ValueType, D>,
5679    > fidl::encoding::Encode<MeshVertexFormat, D> for (T0, T1, T2)
5680    {
5681        #[inline]
5682        unsafe fn encode(
5683            self,
5684            encoder: &mut fidl::encoding::Encoder<'_, D>,
5685            offset: usize,
5686            depth: fidl::encoding::Depth,
5687        ) -> fidl::Result<()> {
5688            encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5689            // Zero out padding regions. There's no need to apply masks
5690            // because the unmasked parts will be overwritten by fields.
5691            // Write the fields.
5692            self.0.encode(encoder, offset + 0, depth)?;
5693            self.1.encode(encoder, offset + 4, depth)?;
5694            self.2.encode(encoder, offset + 8, depth)?;
5695            Ok(())
5696        }
5697    }
5698
5699    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshVertexFormat {
5700        #[inline(always)]
5701        fn new_empty() -> Self {
5702            Self {
5703                position_type: fidl::new_empty!(ValueType, D),
5704                normal_type: fidl::new_empty!(ValueType, D),
5705                tex_coord_type: fidl::new_empty!(ValueType, D),
5706            }
5707        }
5708
5709        #[inline]
5710        unsafe fn decode(
5711            &mut self,
5712            decoder: &mut fidl::encoding::Decoder<'_, D>,
5713            offset: usize,
5714            _depth: fidl::encoding::Depth,
5715        ) -> fidl::Result<()> {
5716            decoder.debug_check_bounds::<Self>(offset);
5717            // Verify that padding bytes are zero.
5718            fidl::decode!(ValueType, D, &mut self.position_type, decoder, offset + 0, _depth)?;
5719            fidl::decode!(ValueType, D, &mut self.normal_type, decoder, offset + 4, _depth)?;
5720            fidl::decode!(ValueType, D, &mut self.tex_coord_type, decoder, offset + 8, _depth)?;
5721            Ok(())
5722        }
5723    }
5724
5725    impl fidl::encoding::ValueTypeMarker for Metrics {
5726        type Borrowed<'a> = &'a Self;
5727        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5728            value
5729        }
5730    }
5731
5732    unsafe impl fidl::encoding::TypeMarker for Metrics {
5733        type Owned = Self;
5734
5735        #[inline(always)]
5736        fn inline_align(_context: fidl::encoding::Context) -> usize {
5737            4
5738        }
5739
5740        #[inline(always)]
5741        fn inline_size(_context: fidl::encoding::Context) -> usize {
5742            12
5743        }
5744    }
5745
5746    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metrics, D> for &Metrics {
5747        #[inline]
5748        unsafe fn encode(
5749            self,
5750            encoder: &mut fidl::encoding::Encoder<'_, D>,
5751            offset: usize,
5752            _depth: fidl::encoding::Depth,
5753        ) -> fidl::Result<()> {
5754            encoder.debug_check_bounds::<Metrics>(offset);
5755            // Delegate to tuple encoding.
5756            fidl::encoding::Encode::<Metrics, D>::encode(
5757                (
5758                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_x),
5759                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_y),
5760                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_z),
5761                ),
5762                encoder,
5763                offset,
5764                _depth,
5765            )
5766        }
5767    }
5768    unsafe impl<
5769        D: fidl::encoding::ResourceDialect,
5770        T0: fidl::encoding::Encode<f32, D>,
5771        T1: fidl::encoding::Encode<f32, D>,
5772        T2: fidl::encoding::Encode<f32, D>,
5773    > fidl::encoding::Encode<Metrics, D> for (T0, T1, T2)
5774    {
5775        #[inline]
5776        unsafe fn encode(
5777            self,
5778            encoder: &mut fidl::encoding::Encoder<'_, D>,
5779            offset: usize,
5780            depth: fidl::encoding::Depth,
5781        ) -> fidl::Result<()> {
5782            encoder.debug_check_bounds::<Metrics>(offset);
5783            // Zero out padding regions. There's no need to apply masks
5784            // because the unmasked parts will be overwritten by fields.
5785            // Write the fields.
5786            self.0.encode(encoder, offset + 0, depth)?;
5787            self.1.encode(encoder, offset + 4, depth)?;
5788            self.2.encode(encoder, offset + 8, depth)?;
5789            Ok(())
5790        }
5791    }
5792
5793    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metrics {
5794        #[inline(always)]
5795        fn new_empty() -> Self {
5796            Self {
5797                scale_x: fidl::new_empty!(f32, D),
5798                scale_y: fidl::new_empty!(f32, D),
5799                scale_z: fidl::new_empty!(f32, D),
5800            }
5801        }
5802
5803        #[inline]
5804        unsafe fn decode(
5805            &mut self,
5806            decoder: &mut fidl::encoding::Decoder<'_, D>,
5807            offset: usize,
5808            _depth: fidl::encoding::Depth,
5809        ) -> fidl::Result<()> {
5810            decoder.debug_check_bounds::<Self>(offset);
5811            // Verify that padding bytes are zero.
5812            fidl::decode!(f32, D, &mut self.scale_x, decoder, offset + 0, _depth)?;
5813            fidl::decode!(f32, D, &mut self.scale_y, decoder, offset + 4, _depth)?;
5814            fidl::decode!(f32, D, &mut self.scale_z, decoder, offset + 8, _depth)?;
5815            Ok(())
5816        }
5817    }
5818
5819    impl fidl::encoding::ValueTypeMarker for MetricsEvent {
5820        type Borrowed<'a> = &'a Self;
5821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5822            value
5823        }
5824    }
5825
5826    unsafe impl fidl::encoding::TypeMarker for MetricsEvent {
5827        type Owned = Self;
5828
5829        #[inline(always)]
5830        fn inline_align(_context: fidl::encoding::Context) -> usize {
5831            4
5832        }
5833
5834        #[inline(always)]
5835        fn inline_size(_context: fidl::encoding::Context) -> usize {
5836            16
5837        }
5838    }
5839
5840    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MetricsEvent, D>
5841        for &MetricsEvent
5842    {
5843        #[inline]
5844        unsafe fn encode(
5845            self,
5846            encoder: &mut fidl::encoding::Encoder<'_, D>,
5847            offset: usize,
5848            _depth: fidl::encoding::Depth,
5849        ) -> fidl::Result<()> {
5850            encoder.debug_check_bounds::<MetricsEvent>(offset);
5851            // Delegate to tuple encoding.
5852            fidl::encoding::Encode::<MetricsEvent, D>::encode(
5853                (
5854                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
5855                    <Metrics as fidl::encoding::ValueTypeMarker>::borrow(&self.metrics),
5856                ),
5857                encoder,
5858                offset,
5859                _depth,
5860            )
5861        }
5862    }
5863    unsafe impl<
5864        D: fidl::encoding::ResourceDialect,
5865        T0: fidl::encoding::Encode<u32, D>,
5866        T1: fidl::encoding::Encode<Metrics, D>,
5867    > fidl::encoding::Encode<MetricsEvent, D> for (T0, T1)
5868    {
5869        #[inline]
5870        unsafe fn encode(
5871            self,
5872            encoder: &mut fidl::encoding::Encoder<'_, D>,
5873            offset: usize,
5874            depth: fidl::encoding::Depth,
5875        ) -> fidl::Result<()> {
5876            encoder.debug_check_bounds::<MetricsEvent>(offset);
5877            // Zero out padding regions. There's no need to apply masks
5878            // because the unmasked parts will be overwritten by fields.
5879            // Write the fields.
5880            self.0.encode(encoder, offset + 0, depth)?;
5881            self.1.encode(encoder, offset + 4, depth)?;
5882            Ok(())
5883        }
5884    }
5885
5886    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MetricsEvent {
5887        #[inline(always)]
5888        fn new_empty() -> Self {
5889            Self { node_id: fidl::new_empty!(u32, D), metrics: fidl::new_empty!(Metrics, D) }
5890        }
5891
5892        #[inline]
5893        unsafe fn decode(
5894            &mut self,
5895            decoder: &mut fidl::encoding::Decoder<'_, D>,
5896            offset: usize,
5897            _depth: fidl::encoding::Depth,
5898        ) -> fidl::Result<()> {
5899            decoder.debug_check_bounds::<Self>(offset);
5900            // Verify that padding bytes are zero.
5901            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
5902            fidl::decode!(Metrics, D, &mut self.metrics, decoder, offset + 4, _depth)?;
5903            Ok(())
5904        }
5905    }
5906
5907    impl fidl::encoding::ValueTypeMarker for OpacityNodeArgsHack {
5908        type Borrowed<'a> = &'a Self;
5909        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5910            value
5911        }
5912    }
5913
5914    unsafe impl fidl::encoding::TypeMarker for OpacityNodeArgsHack {
5915        type Owned = Self;
5916
5917        #[inline(always)]
5918        fn inline_align(_context: fidl::encoding::Context) -> usize {
5919            4
5920        }
5921
5922        #[inline(always)]
5923        fn inline_size(_context: fidl::encoding::Context) -> usize {
5924            4
5925        }
5926        #[inline(always)]
5927        fn encode_is_copy() -> bool {
5928            true
5929        }
5930
5931        #[inline(always)]
5932        fn decode_is_copy() -> bool {
5933            true
5934        }
5935    }
5936
5937    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OpacityNodeArgsHack, D>
5938        for &OpacityNodeArgsHack
5939    {
5940        #[inline]
5941        unsafe fn encode(
5942            self,
5943            encoder: &mut fidl::encoding::Encoder<'_, D>,
5944            offset: usize,
5945            _depth: fidl::encoding::Depth,
5946        ) -> fidl::Result<()> {
5947            encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
5948            unsafe {
5949                // Copy the object into the buffer.
5950                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5951                (buf_ptr as *mut OpacityNodeArgsHack)
5952                    .write_unaligned((self as *const OpacityNodeArgsHack).read());
5953                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5954                // done second because the memcpy will write garbage to these bytes.
5955            }
5956            Ok(())
5957        }
5958    }
5959    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5960        fidl::encoding::Encode<OpacityNodeArgsHack, D> for (T0,)
5961    {
5962        #[inline]
5963        unsafe fn encode(
5964            self,
5965            encoder: &mut fidl::encoding::Encoder<'_, D>,
5966            offset: usize,
5967            depth: fidl::encoding::Depth,
5968        ) -> fidl::Result<()> {
5969            encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
5970            // Zero out padding regions. There's no need to apply masks
5971            // because the unmasked parts will be overwritten by fields.
5972            // Write the fields.
5973            self.0.encode(encoder, offset + 0, depth)?;
5974            Ok(())
5975        }
5976    }
5977
5978    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpacityNodeArgsHack {
5979        #[inline(always)]
5980        fn new_empty() -> Self {
5981            Self { unused: fidl::new_empty!(u32, D) }
5982        }
5983
5984        #[inline]
5985        unsafe fn decode(
5986            &mut self,
5987            decoder: &mut fidl::encoding::Decoder<'_, D>,
5988            offset: usize,
5989            _depth: fidl::encoding::Depth,
5990        ) -> fidl::Result<()> {
5991            decoder.debug_check_bounds::<Self>(offset);
5992            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5993            // Verify that padding bytes are zero.
5994            // Copy from the buffer into the object.
5995            unsafe {
5996                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5997            }
5998            Ok(())
5999        }
6000    }
6001
6002    impl fidl::encoding::ValueTypeMarker for Plane3 {
6003        type Borrowed<'a> = &'a Self;
6004        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6005            value
6006        }
6007    }
6008
6009    unsafe impl fidl::encoding::TypeMarker for Plane3 {
6010        type Owned = Self;
6011
6012        #[inline(always)]
6013        fn inline_align(_context: fidl::encoding::Context) -> usize {
6014            4
6015        }
6016
6017        #[inline(always)]
6018        fn inline_size(_context: fidl::encoding::Context) -> usize {
6019            16
6020        }
6021    }
6022
6023    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Plane3, D> for &Plane3 {
6024        #[inline]
6025        unsafe fn encode(
6026            self,
6027            encoder: &mut fidl::encoding::Encoder<'_, D>,
6028            offset: usize,
6029            _depth: fidl::encoding::Depth,
6030        ) -> fidl::Result<()> {
6031            encoder.debug_check_bounds::<Plane3>(offset);
6032            // Delegate to tuple encoding.
6033            fidl::encoding::Encode::<Plane3, D>::encode(
6034                (
6035                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.dir),
6036                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dist),
6037                ),
6038                encoder,
6039                offset,
6040                _depth,
6041            )
6042        }
6043    }
6044    unsafe impl<
6045        D: fidl::encoding::ResourceDialect,
6046        T0: fidl::encoding::Encode<Vec3, D>,
6047        T1: fidl::encoding::Encode<f32, D>,
6048    > fidl::encoding::Encode<Plane3, D> for (T0, T1)
6049    {
6050        #[inline]
6051        unsafe fn encode(
6052            self,
6053            encoder: &mut fidl::encoding::Encoder<'_, D>,
6054            offset: usize,
6055            depth: fidl::encoding::Depth,
6056        ) -> fidl::Result<()> {
6057            encoder.debug_check_bounds::<Plane3>(offset);
6058            // Zero out padding regions. There's no need to apply masks
6059            // because the unmasked parts will be overwritten by fields.
6060            // Write the fields.
6061            self.0.encode(encoder, offset + 0, depth)?;
6062            self.1.encode(encoder, offset + 12, depth)?;
6063            Ok(())
6064        }
6065    }
6066
6067    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Plane3 {
6068        #[inline(always)]
6069        fn new_empty() -> Self {
6070            Self { dir: fidl::new_empty!(Vec3, D), dist: fidl::new_empty!(f32, D) }
6071        }
6072
6073        #[inline]
6074        unsafe fn decode(
6075            &mut self,
6076            decoder: &mut fidl::encoding::Decoder<'_, D>,
6077            offset: usize,
6078            _depth: fidl::encoding::Depth,
6079        ) -> fidl::Result<()> {
6080            decoder.debug_check_bounds::<Self>(offset);
6081            // Verify that padding bytes are zero.
6082            fidl::decode!(Vec3, D, &mut self.dir, decoder, offset + 0, _depth)?;
6083            fidl::decode!(f32, D, &mut self.dist, decoder, offset + 12, _depth)?;
6084            Ok(())
6085        }
6086    }
6087
6088    impl fidl::encoding::ValueTypeMarker for PointLightArgs {
6089        type Borrowed<'a> = &'a Self;
6090        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6091            value
6092        }
6093    }
6094
6095    unsafe impl fidl::encoding::TypeMarker for PointLightArgs {
6096        type Owned = Self;
6097
6098        #[inline(always)]
6099        fn inline_align(_context: fidl::encoding::Context) -> usize {
6100            4
6101        }
6102
6103        #[inline(always)]
6104        fn inline_size(_context: fidl::encoding::Context) -> usize {
6105            4
6106        }
6107        #[inline(always)]
6108        fn encode_is_copy() -> bool {
6109            true
6110        }
6111
6112        #[inline(always)]
6113        fn decode_is_copy() -> bool {
6114            true
6115        }
6116    }
6117
6118    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PointLightArgs, D>
6119        for &PointLightArgs
6120    {
6121        #[inline]
6122        unsafe fn encode(
6123            self,
6124            encoder: &mut fidl::encoding::Encoder<'_, D>,
6125            offset: usize,
6126            _depth: fidl::encoding::Depth,
6127        ) -> fidl::Result<()> {
6128            encoder.debug_check_bounds::<PointLightArgs>(offset);
6129            unsafe {
6130                // Copy the object into the buffer.
6131                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6132                (buf_ptr as *mut PointLightArgs)
6133                    .write_unaligned((self as *const PointLightArgs).read());
6134                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6135                // done second because the memcpy will write garbage to these bytes.
6136            }
6137            Ok(())
6138        }
6139    }
6140    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6141        fidl::encoding::Encode<PointLightArgs, D> for (T0,)
6142    {
6143        #[inline]
6144        unsafe fn encode(
6145            self,
6146            encoder: &mut fidl::encoding::Encoder<'_, D>,
6147            offset: usize,
6148            depth: fidl::encoding::Depth,
6149        ) -> fidl::Result<()> {
6150            encoder.debug_check_bounds::<PointLightArgs>(offset);
6151            // Zero out padding regions. There's no need to apply masks
6152            // because the unmasked parts will be overwritten by fields.
6153            // Write the fields.
6154            self.0.encode(encoder, offset + 0, depth)?;
6155            Ok(())
6156        }
6157    }
6158
6159    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PointLightArgs {
6160        #[inline(always)]
6161        fn new_empty() -> Self {
6162            Self { dummy: fidl::new_empty!(u32, D) }
6163        }
6164
6165        #[inline]
6166        unsafe fn decode(
6167            &mut self,
6168            decoder: &mut fidl::encoding::Decoder<'_, D>,
6169            offset: usize,
6170            _depth: fidl::encoding::Depth,
6171        ) -> fidl::Result<()> {
6172            decoder.debug_check_bounds::<Self>(offset);
6173            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6174            // Verify that padding bytes are zero.
6175            // Copy from the buffer into the object.
6176            unsafe {
6177                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6178            }
6179            Ok(())
6180        }
6181    }
6182
6183    impl fidl::encoding::ValueTypeMarker for Quaternion {
6184        type Borrowed<'a> = &'a Self;
6185        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6186            value
6187        }
6188    }
6189
6190    unsafe impl fidl::encoding::TypeMarker for Quaternion {
6191        type Owned = Self;
6192
6193        #[inline(always)]
6194        fn inline_align(_context: fidl::encoding::Context) -> usize {
6195            4
6196        }
6197
6198        #[inline(always)]
6199        fn inline_size(_context: fidl::encoding::Context) -> usize {
6200            16
6201        }
6202    }
6203
6204    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Quaternion, D>
6205        for &Quaternion
6206    {
6207        #[inline]
6208        unsafe fn encode(
6209            self,
6210            encoder: &mut fidl::encoding::Encoder<'_, D>,
6211            offset: usize,
6212            _depth: fidl::encoding::Depth,
6213        ) -> fidl::Result<()> {
6214            encoder.debug_check_bounds::<Quaternion>(offset);
6215            // Delegate to tuple encoding.
6216            fidl::encoding::Encode::<Quaternion, D>::encode(
6217                (
6218                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
6219                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
6220                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
6221                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
6222                ),
6223                encoder,
6224                offset,
6225                _depth,
6226            )
6227        }
6228    }
6229    unsafe impl<
6230        D: fidl::encoding::ResourceDialect,
6231        T0: fidl::encoding::Encode<f32, D>,
6232        T1: fidl::encoding::Encode<f32, D>,
6233        T2: fidl::encoding::Encode<f32, D>,
6234        T3: fidl::encoding::Encode<f32, D>,
6235    > fidl::encoding::Encode<Quaternion, D> for (T0, T1, T2, T3)
6236    {
6237        #[inline]
6238        unsafe fn encode(
6239            self,
6240            encoder: &mut fidl::encoding::Encoder<'_, D>,
6241            offset: usize,
6242            depth: fidl::encoding::Depth,
6243        ) -> fidl::Result<()> {
6244            encoder.debug_check_bounds::<Quaternion>(offset);
6245            // Zero out padding regions. There's no need to apply masks
6246            // because the unmasked parts will be overwritten by fields.
6247            // Write the fields.
6248            self.0.encode(encoder, offset + 0, depth)?;
6249            self.1.encode(encoder, offset + 4, depth)?;
6250            self.2.encode(encoder, offset + 8, depth)?;
6251            self.3.encode(encoder, offset + 12, depth)?;
6252            Ok(())
6253        }
6254    }
6255
6256    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Quaternion {
6257        #[inline(always)]
6258        fn new_empty() -> Self {
6259            Self {
6260                x: fidl::new_empty!(f32, D),
6261                y: fidl::new_empty!(f32, D),
6262                z: fidl::new_empty!(f32, D),
6263                w: fidl::new_empty!(f32, D),
6264            }
6265        }
6266
6267        #[inline]
6268        unsafe fn decode(
6269            &mut self,
6270            decoder: &mut fidl::encoding::Decoder<'_, D>,
6271            offset: usize,
6272            _depth: fidl::encoding::Depth,
6273        ) -> fidl::Result<()> {
6274            decoder.debug_check_bounds::<Self>(offset);
6275            // Verify that padding bytes are zero.
6276            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
6277            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
6278            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
6279            fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
6280            Ok(())
6281        }
6282    }
6283
6284    impl fidl::encoding::ValueTypeMarker for QuaternionValue {
6285        type Borrowed<'a> = &'a Self;
6286        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6287            value
6288        }
6289    }
6290
6291    unsafe impl fidl::encoding::TypeMarker for QuaternionValue {
6292        type Owned = Self;
6293
6294        #[inline(always)]
6295        fn inline_align(_context: fidl::encoding::Context) -> usize {
6296            4
6297        }
6298
6299        #[inline(always)]
6300        fn inline_size(_context: fidl::encoding::Context) -> usize {
6301            20
6302        }
6303    }
6304
6305    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QuaternionValue, D>
6306        for &QuaternionValue
6307    {
6308        #[inline]
6309        unsafe fn encode(
6310            self,
6311            encoder: &mut fidl::encoding::Encoder<'_, D>,
6312            offset: usize,
6313            _depth: fidl::encoding::Depth,
6314        ) -> fidl::Result<()> {
6315            encoder.debug_check_bounds::<QuaternionValue>(offset);
6316            // Delegate to tuple encoding.
6317            fidl::encoding::Encode::<QuaternionValue, D>::encode(
6318                (
6319                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6320                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
6321                ),
6322                encoder,
6323                offset,
6324                _depth,
6325            )
6326        }
6327    }
6328    unsafe impl<
6329        D: fidl::encoding::ResourceDialect,
6330        T0: fidl::encoding::Encode<Quaternion, D>,
6331        T1: fidl::encoding::Encode<u32, D>,
6332    > fidl::encoding::Encode<QuaternionValue, D> for (T0, T1)
6333    {
6334        #[inline]
6335        unsafe fn encode(
6336            self,
6337            encoder: &mut fidl::encoding::Encoder<'_, D>,
6338            offset: usize,
6339            depth: fidl::encoding::Depth,
6340        ) -> fidl::Result<()> {
6341            encoder.debug_check_bounds::<QuaternionValue>(offset);
6342            // Zero out padding regions. There's no need to apply masks
6343            // because the unmasked parts will be overwritten by fields.
6344            // Write the fields.
6345            self.0.encode(encoder, offset + 0, depth)?;
6346            self.1.encode(encoder, offset + 16, depth)?;
6347            Ok(())
6348        }
6349    }
6350
6351    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QuaternionValue {
6352        #[inline(always)]
6353        fn new_empty() -> Self {
6354            Self { value: fidl::new_empty!(Quaternion, D), variable_id: fidl::new_empty!(u32, D) }
6355        }
6356
6357        #[inline]
6358        unsafe fn decode(
6359            &mut self,
6360            decoder: &mut fidl::encoding::Decoder<'_, D>,
6361            offset: usize,
6362            _depth: fidl::encoding::Depth,
6363        ) -> fidl::Result<()> {
6364            decoder.debug_check_bounds::<Self>(offset);
6365            // Verify that padding bytes are zero.
6366            fidl::decode!(Quaternion, D, &mut self.value, decoder, offset + 0, _depth)?;
6367            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
6368            Ok(())
6369        }
6370    }
6371
6372    impl fidl::encoding::ValueTypeMarker for RectangleArgs {
6373        type Borrowed<'a> = &'a Self;
6374        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6375            value
6376        }
6377    }
6378
6379    unsafe impl fidl::encoding::TypeMarker for RectangleArgs {
6380        type Owned = Self;
6381
6382        #[inline(always)]
6383        fn inline_align(_context: fidl::encoding::Context) -> usize {
6384            8
6385        }
6386
6387        #[inline(always)]
6388        fn inline_size(_context: fidl::encoding::Context) -> usize {
6389            32
6390        }
6391    }
6392
6393    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RectangleArgs, D>
6394        for &RectangleArgs
6395    {
6396        #[inline]
6397        unsafe fn encode(
6398            self,
6399            encoder: &mut fidl::encoding::Encoder<'_, D>,
6400            offset: usize,
6401            _depth: fidl::encoding::Depth,
6402        ) -> fidl::Result<()> {
6403            encoder.debug_check_bounds::<RectangleArgs>(offset);
6404            // Delegate to tuple encoding.
6405            fidl::encoding::Encode::<RectangleArgs, D>::encode(
6406                (
6407                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6408                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6409                ),
6410                encoder,
6411                offset,
6412                _depth,
6413            )
6414        }
6415    }
6416    unsafe impl<
6417        D: fidl::encoding::ResourceDialect,
6418        T0: fidl::encoding::Encode<Value, D>,
6419        T1: fidl::encoding::Encode<Value, D>,
6420    > fidl::encoding::Encode<RectangleArgs, D> for (T0, T1)
6421    {
6422        #[inline]
6423        unsafe fn encode(
6424            self,
6425            encoder: &mut fidl::encoding::Encoder<'_, D>,
6426            offset: usize,
6427            depth: fidl::encoding::Depth,
6428        ) -> fidl::Result<()> {
6429            encoder.debug_check_bounds::<RectangleArgs>(offset);
6430            // Zero out padding regions. There's no need to apply masks
6431            // because the unmasked parts will be overwritten by fields.
6432            // Write the fields.
6433            self.0.encode(encoder, offset + 0, depth)?;
6434            self.1.encode(encoder, offset + 16, depth)?;
6435            Ok(())
6436        }
6437    }
6438
6439    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RectangleArgs {
6440        #[inline(always)]
6441        fn new_empty() -> Self {
6442            Self { width: fidl::new_empty!(Value, D), height: fidl::new_empty!(Value, D) }
6443        }
6444
6445        #[inline]
6446        unsafe fn decode(
6447            &mut self,
6448            decoder: &mut fidl::encoding::Decoder<'_, D>,
6449            offset: usize,
6450            _depth: fidl::encoding::Depth,
6451        ) -> fidl::Result<()> {
6452            decoder.debug_check_bounds::<Self>(offset);
6453            // Verify that padding bytes are zero.
6454            fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
6455            fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
6456            Ok(())
6457        }
6458    }
6459
6460    impl fidl::encoding::ValueTypeMarker for ReleaseResourceCmd {
6461        type Borrowed<'a> = &'a Self;
6462        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6463            value
6464        }
6465    }
6466
6467    unsafe impl fidl::encoding::TypeMarker for ReleaseResourceCmd {
6468        type Owned = Self;
6469
6470        #[inline(always)]
6471        fn inline_align(_context: fidl::encoding::Context) -> usize {
6472            4
6473        }
6474
6475        #[inline(always)]
6476        fn inline_size(_context: fidl::encoding::Context) -> usize {
6477            4
6478        }
6479        #[inline(always)]
6480        fn encode_is_copy() -> bool {
6481            true
6482        }
6483
6484        #[inline(always)]
6485        fn decode_is_copy() -> bool {
6486            true
6487        }
6488    }
6489
6490    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReleaseResourceCmd, D>
6491        for &ReleaseResourceCmd
6492    {
6493        #[inline]
6494        unsafe fn encode(
6495            self,
6496            encoder: &mut fidl::encoding::Encoder<'_, D>,
6497            offset: usize,
6498            _depth: fidl::encoding::Depth,
6499        ) -> fidl::Result<()> {
6500            encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6501            unsafe {
6502                // Copy the object into the buffer.
6503                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6504                (buf_ptr as *mut ReleaseResourceCmd)
6505                    .write_unaligned((self as *const ReleaseResourceCmd).read());
6506                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6507                // done second because the memcpy will write garbage to these bytes.
6508            }
6509            Ok(())
6510        }
6511    }
6512    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6513        fidl::encoding::Encode<ReleaseResourceCmd, D> for (T0,)
6514    {
6515        #[inline]
6516        unsafe fn encode(
6517            self,
6518            encoder: &mut fidl::encoding::Encoder<'_, D>,
6519            offset: usize,
6520            depth: fidl::encoding::Depth,
6521        ) -> fidl::Result<()> {
6522            encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6523            // Zero out padding regions. There's no need to apply masks
6524            // because the unmasked parts will be overwritten by fields.
6525            // Write the fields.
6526            self.0.encode(encoder, offset + 0, depth)?;
6527            Ok(())
6528        }
6529    }
6530
6531    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReleaseResourceCmd {
6532        #[inline(always)]
6533        fn new_empty() -> Self {
6534            Self { id: fidl::new_empty!(u32, D) }
6535        }
6536
6537        #[inline]
6538        unsafe fn decode(
6539            &mut self,
6540            decoder: &mut fidl::encoding::Decoder<'_, D>,
6541            offset: usize,
6542            _depth: fidl::encoding::Depth,
6543        ) -> fidl::Result<()> {
6544            decoder.debug_check_bounds::<Self>(offset);
6545            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6546            // Verify that padding bytes are zero.
6547            // Copy from the buffer into the object.
6548            unsafe {
6549                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6550            }
6551            Ok(())
6552        }
6553    }
6554
6555    impl fidl::encoding::ValueTypeMarker for RemoveAllLayersCmd {
6556        type Borrowed<'a> = &'a Self;
6557        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6558            value
6559        }
6560    }
6561
6562    unsafe impl fidl::encoding::TypeMarker for RemoveAllLayersCmd {
6563        type Owned = Self;
6564
6565        #[inline(always)]
6566        fn inline_align(_context: fidl::encoding::Context) -> usize {
6567            4
6568        }
6569
6570        #[inline(always)]
6571        fn inline_size(_context: fidl::encoding::Context) -> usize {
6572            4
6573        }
6574        #[inline(always)]
6575        fn encode_is_copy() -> bool {
6576            true
6577        }
6578
6579        #[inline(always)]
6580        fn decode_is_copy() -> bool {
6581            true
6582        }
6583    }
6584
6585    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveAllLayersCmd, D>
6586        for &RemoveAllLayersCmd
6587    {
6588        #[inline]
6589        unsafe fn encode(
6590            self,
6591            encoder: &mut fidl::encoding::Encoder<'_, D>,
6592            offset: usize,
6593            _depth: fidl::encoding::Depth,
6594        ) -> fidl::Result<()> {
6595            encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6596            unsafe {
6597                // Copy the object into the buffer.
6598                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6599                (buf_ptr as *mut RemoveAllLayersCmd)
6600                    .write_unaligned((self as *const RemoveAllLayersCmd).read());
6601                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6602                // done second because the memcpy will write garbage to these bytes.
6603            }
6604            Ok(())
6605        }
6606    }
6607    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6608        fidl::encoding::Encode<RemoveAllLayersCmd, D> for (T0,)
6609    {
6610        #[inline]
6611        unsafe fn encode(
6612            self,
6613            encoder: &mut fidl::encoding::Encoder<'_, D>,
6614            offset: usize,
6615            depth: fidl::encoding::Depth,
6616        ) -> fidl::Result<()> {
6617            encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6618            // Zero out padding regions. There's no need to apply masks
6619            // because the unmasked parts will be overwritten by fields.
6620            // Write the fields.
6621            self.0.encode(encoder, offset + 0, depth)?;
6622            Ok(())
6623        }
6624    }
6625
6626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveAllLayersCmd {
6627        #[inline(always)]
6628        fn new_empty() -> Self {
6629            Self { layer_stack_id: fidl::new_empty!(u32, D) }
6630        }
6631
6632        #[inline]
6633        unsafe fn decode(
6634            &mut self,
6635            decoder: &mut fidl::encoding::Decoder<'_, D>,
6636            offset: usize,
6637            _depth: fidl::encoding::Depth,
6638        ) -> fidl::Result<()> {
6639            decoder.debug_check_bounds::<Self>(offset);
6640            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6641            // Verify that padding bytes are zero.
6642            // Copy from the buffer into the object.
6643            unsafe {
6644                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6645            }
6646            Ok(())
6647        }
6648    }
6649
6650    impl fidl::encoding::ValueTypeMarker for RemoveLayerCmd {
6651        type Borrowed<'a> = &'a Self;
6652        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6653            value
6654        }
6655    }
6656
6657    unsafe impl fidl::encoding::TypeMarker for RemoveLayerCmd {
6658        type Owned = Self;
6659
6660        #[inline(always)]
6661        fn inline_align(_context: fidl::encoding::Context) -> usize {
6662            4
6663        }
6664
6665        #[inline(always)]
6666        fn inline_size(_context: fidl::encoding::Context) -> usize {
6667            8
6668        }
6669        #[inline(always)]
6670        fn encode_is_copy() -> bool {
6671            true
6672        }
6673
6674        #[inline(always)]
6675        fn decode_is_copy() -> bool {
6676            true
6677        }
6678    }
6679
6680    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveLayerCmd, D>
6681        for &RemoveLayerCmd
6682    {
6683        #[inline]
6684        unsafe fn encode(
6685            self,
6686            encoder: &mut fidl::encoding::Encoder<'_, D>,
6687            offset: usize,
6688            _depth: fidl::encoding::Depth,
6689        ) -> fidl::Result<()> {
6690            encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6691            unsafe {
6692                // Copy the object into the buffer.
6693                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6694                (buf_ptr as *mut RemoveLayerCmd)
6695                    .write_unaligned((self as *const RemoveLayerCmd).read());
6696                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6697                // done second because the memcpy will write garbage to these bytes.
6698            }
6699            Ok(())
6700        }
6701    }
6702    unsafe impl<
6703        D: fidl::encoding::ResourceDialect,
6704        T0: fidl::encoding::Encode<u32, D>,
6705        T1: fidl::encoding::Encode<u32, D>,
6706    > fidl::encoding::Encode<RemoveLayerCmd, D> for (T0, T1)
6707    {
6708        #[inline]
6709        unsafe fn encode(
6710            self,
6711            encoder: &mut fidl::encoding::Encoder<'_, D>,
6712            offset: usize,
6713            depth: fidl::encoding::Depth,
6714        ) -> fidl::Result<()> {
6715            encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6716            // Zero out padding regions. There's no need to apply masks
6717            // because the unmasked parts will be overwritten by fields.
6718            // Write the fields.
6719            self.0.encode(encoder, offset + 0, depth)?;
6720            self.1.encode(encoder, offset + 4, depth)?;
6721            Ok(())
6722        }
6723    }
6724
6725    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveLayerCmd {
6726        #[inline(always)]
6727        fn new_empty() -> Self {
6728            Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
6729        }
6730
6731        #[inline]
6732        unsafe fn decode(
6733            &mut self,
6734            decoder: &mut fidl::encoding::Decoder<'_, D>,
6735            offset: usize,
6736            _depth: fidl::encoding::Depth,
6737        ) -> fidl::Result<()> {
6738            decoder.debug_check_bounds::<Self>(offset);
6739            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6740            // Verify that padding bytes are zero.
6741            // Copy from the buffer into the object.
6742            unsafe {
6743                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6744            }
6745            Ok(())
6746        }
6747    }
6748
6749    impl fidl::encoding::ValueTypeMarker for RendererArgs {
6750        type Borrowed<'a> = &'a Self;
6751        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6752            value
6753        }
6754    }
6755
6756    unsafe impl fidl::encoding::TypeMarker for RendererArgs {
6757        type Owned = Self;
6758
6759        #[inline(always)]
6760        fn inline_align(_context: fidl::encoding::Context) -> usize {
6761            4
6762        }
6763
6764        #[inline(always)]
6765        fn inline_size(_context: fidl::encoding::Context) -> usize {
6766            4
6767        }
6768        #[inline(always)]
6769        fn encode_is_copy() -> bool {
6770            true
6771        }
6772
6773        #[inline(always)]
6774        fn decode_is_copy() -> bool {
6775            true
6776        }
6777    }
6778
6779    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererArgs, D>
6780        for &RendererArgs
6781    {
6782        #[inline]
6783        unsafe fn encode(
6784            self,
6785            encoder: &mut fidl::encoding::Encoder<'_, D>,
6786            offset: usize,
6787            _depth: fidl::encoding::Depth,
6788        ) -> fidl::Result<()> {
6789            encoder.debug_check_bounds::<RendererArgs>(offset);
6790            unsafe {
6791                // Copy the object into the buffer.
6792                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6793                (buf_ptr as *mut RendererArgs)
6794                    .write_unaligned((self as *const RendererArgs).read());
6795                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6796                // done second because the memcpy will write garbage to these bytes.
6797            }
6798            Ok(())
6799        }
6800    }
6801    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6802        fidl::encoding::Encode<RendererArgs, D> for (T0,)
6803    {
6804        #[inline]
6805        unsafe fn encode(
6806            self,
6807            encoder: &mut fidl::encoding::Encoder<'_, D>,
6808            offset: usize,
6809            depth: fidl::encoding::Depth,
6810        ) -> fidl::Result<()> {
6811            encoder.debug_check_bounds::<RendererArgs>(offset);
6812            // Zero out padding regions. There's no need to apply masks
6813            // because the unmasked parts will be overwritten by fields.
6814            // Write the fields.
6815            self.0.encode(encoder, offset + 0, depth)?;
6816            Ok(())
6817        }
6818    }
6819
6820    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererArgs {
6821        #[inline(always)]
6822        fn new_empty() -> Self {
6823            Self { dummy: fidl::new_empty!(u32, D) }
6824        }
6825
6826        #[inline]
6827        unsafe fn decode(
6828            &mut self,
6829            decoder: &mut fidl::encoding::Decoder<'_, D>,
6830            offset: usize,
6831            _depth: fidl::encoding::Depth,
6832        ) -> fidl::Result<()> {
6833            decoder.debug_check_bounds::<Self>(offset);
6834            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6835            // Verify that padding bytes are zero.
6836            // Copy from the buffer into the object.
6837            unsafe {
6838                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6839            }
6840            Ok(())
6841        }
6842    }
6843
6844    impl fidl::encoding::ValueTypeMarker for RoundedRectangleArgs {
6845        type Borrowed<'a> = &'a Self;
6846        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6847            value
6848        }
6849    }
6850
6851    unsafe impl fidl::encoding::TypeMarker for RoundedRectangleArgs {
6852        type Owned = Self;
6853
6854        #[inline(always)]
6855        fn inline_align(_context: fidl::encoding::Context) -> usize {
6856            8
6857        }
6858
6859        #[inline(always)]
6860        fn inline_size(_context: fidl::encoding::Context) -> usize {
6861            96
6862        }
6863    }
6864
6865    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RoundedRectangleArgs, D>
6866        for &RoundedRectangleArgs
6867    {
6868        #[inline]
6869        unsafe fn encode(
6870            self,
6871            encoder: &mut fidl::encoding::Encoder<'_, D>,
6872            offset: usize,
6873            _depth: fidl::encoding::Depth,
6874        ) -> fidl::Result<()> {
6875            encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6876            // Delegate to tuple encoding.
6877            fidl::encoding::Encode::<RoundedRectangleArgs, D>::encode(
6878                (
6879                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6880                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6881                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_left_radius),
6882                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_right_radius),
6883                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_right_radius),
6884                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_left_radius),
6885                ),
6886                encoder,
6887                offset,
6888                _depth,
6889            )
6890        }
6891    }
6892    unsafe impl<
6893        D: fidl::encoding::ResourceDialect,
6894        T0: fidl::encoding::Encode<Value, D>,
6895        T1: fidl::encoding::Encode<Value, D>,
6896        T2: fidl::encoding::Encode<Value, D>,
6897        T3: fidl::encoding::Encode<Value, D>,
6898        T4: fidl::encoding::Encode<Value, D>,
6899        T5: fidl::encoding::Encode<Value, D>,
6900    > fidl::encoding::Encode<RoundedRectangleArgs, D> for (T0, T1, T2, T3, T4, T5)
6901    {
6902        #[inline]
6903        unsafe fn encode(
6904            self,
6905            encoder: &mut fidl::encoding::Encoder<'_, D>,
6906            offset: usize,
6907            depth: fidl::encoding::Depth,
6908        ) -> fidl::Result<()> {
6909            encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6910            // Zero out padding regions. There's no need to apply masks
6911            // because the unmasked parts will be overwritten by fields.
6912            // Write the fields.
6913            self.0.encode(encoder, offset + 0, depth)?;
6914            self.1.encode(encoder, offset + 16, depth)?;
6915            self.2.encode(encoder, offset + 32, depth)?;
6916            self.3.encode(encoder, offset + 48, depth)?;
6917            self.4.encode(encoder, offset + 64, depth)?;
6918            self.5.encode(encoder, offset + 80, depth)?;
6919            Ok(())
6920        }
6921    }
6922
6923    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RoundedRectangleArgs {
6924        #[inline(always)]
6925        fn new_empty() -> Self {
6926            Self {
6927                width: fidl::new_empty!(Value, D),
6928                height: fidl::new_empty!(Value, D),
6929                top_left_radius: fidl::new_empty!(Value, D),
6930                top_right_radius: fidl::new_empty!(Value, D),
6931                bottom_right_radius: fidl::new_empty!(Value, D),
6932                bottom_left_radius: fidl::new_empty!(Value, D),
6933            }
6934        }
6935
6936        #[inline]
6937        unsafe fn decode(
6938            &mut self,
6939            decoder: &mut fidl::encoding::Decoder<'_, D>,
6940            offset: usize,
6941            _depth: fidl::encoding::Depth,
6942        ) -> fidl::Result<()> {
6943            decoder.debug_check_bounds::<Self>(offset);
6944            // Verify that padding bytes are zero.
6945            fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
6946            fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
6947            fidl::decode!(Value, D, &mut self.top_left_radius, decoder, offset + 32, _depth)?;
6948            fidl::decode!(Value, D, &mut self.top_right_radius, decoder, offset + 48, _depth)?;
6949            fidl::decode!(Value, D, &mut self.bottom_right_radius, decoder, offset + 64, _depth)?;
6950            fidl::decode!(Value, D, &mut self.bottom_left_radius, decoder, offset + 80, _depth)?;
6951            Ok(())
6952        }
6953    }
6954
6955    impl fidl::encoding::ValueTypeMarker for SceneAddAmbientLightCmd {
6956        type Borrowed<'a> = &'a Self;
6957        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6958            value
6959        }
6960    }
6961
6962    unsafe impl fidl::encoding::TypeMarker for SceneAddAmbientLightCmd {
6963        type Owned = Self;
6964
6965        #[inline(always)]
6966        fn inline_align(_context: fidl::encoding::Context) -> usize {
6967            4
6968        }
6969
6970        #[inline(always)]
6971        fn inline_size(_context: fidl::encoding::Context) -> usize {
6972            8
6973        }
6974        #[inline(always)]
6975        fn encode_is_copy() -> bool {
6976            true
6977        }
6978
6979        #[inline(always)]
6980        fn decode_is_copy() -> bool {
6981            true
6982        }
6983    }
6984
6985    unsafe impl<D: fidl::encoding::ResourceDialect>
6986        fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for &SceneAddAmbientLightCmd
6987    {
6988        #[inline]
6989        unsafe fn encode(
6990            self,
6991            encoder: &mut fidl::encoding::Encoder<'_, D>,
6992            offset: usize,
6993            _depth: fidl::encoding::Depth,
6994        ) -> fidl::Result<()> {
6995            encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
6996            unsafe {
6997                // Copy the object into the buffer.
6998                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6999                (buf_ptr as *mut SceneAddAmbientLightCmd)
7000                    .write_unaligned((self as *const SceneAddAmbientLightCmd).read());
7001                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7002                // done second because the memcpy will write garbage to these bytes.
7003            }
7004            Ok(())
7005        }
7006    }
7007    unsafe impl<
7008        D: fidl::encoding::ResourceDialect,
7009        T0: fidl::encoding::Encode<u32, D>,
7010        T1: fidl::encoding::Encode<u32, D>,
7011    > fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for (T0, T1)
7012    {
7013        #[inline]
7014        unsafe fn encode(
7015            self,
7016            encoder: &mut fidl::encoding::Encoder<'_, D>,
7017            offset: usize,
7018            depth: fidl::encoding::Depth,
7019        ) -> fidl::Result<()> {
7020            encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
7021            // Zero out padding regions. There's no need to apply masks
7022            // because the unmasked parts will be overwritten by fields.
7023            // Write the fields.
7024            self.0.encode(encoder, offset + 0, depth)?;
7025            self.1.encode(encoder, offset + 4, depth)?;
7026            Ok(())
7027        }
7028    }
7029
7030    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7031        for SceneAddAmbientLightCmd
7032    {
7033        #[inline(always)]
7034        fn new_empty() -> Self {
7035            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7036        }
7037
7038        #[inline]
7039        unsafe fn decode(
7040            &mut self,
7041            decoder: &mut fidl::encoding::Decoder<'_, D>,
7042            offset: usize,
7043            _depth: fidl::encoding::Depth,
7044        ) -> fidl::Result<()> {
7045            decoder.debug_check_bounds::<Self>(offset);
7046            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7047            // Verify that padding bytes are zero.
7048            // Copy from the buffer into the object.
7049            unsafe {
7050                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7051            }
7052            Ok(())
7053        }
7054    }
7055
7056    impl fidl::encoding::ValueTypeMarker for SceneAddDirectionalLightCmd {
7057        type Borrowed<'a> = &'a Self;
7058        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7059            value
7060        }
7061    }
7062
7063    unsafe impl fidl::encoding::TypeMarker for SceneAddDirectionalLightCmd {
7064        type Owned = Self;
7065
7066        #[inline(always)]
7067        fn inline_align(_context: fidl::encoding::Context) -> usize {
7068            4
7069        }
7070
7071        #[inline(always)]
7072        fn inline_size(_context: fidl::encoding::Context) -> usize {
7073            8
7074        }
7075        #[inline(always)]
7076        fn encode_is_copy() -> bool {
7077            true
7078        }
7079
7080        #[inline(always)]
7081        fn decode_is_copy() -> bool {
7082            true
7083        }
7084    }
7085
7086    unsafe impl<D: fidl::encoding::ResourceDialect>
7087        fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for &SceneAddDirectionalLightCmd
7088    {
7089        #[inline]
7090        unsafe fn encode(
7091            self,
7092            encoder: &mut fidl::encoding::Encoder<'_, D>,
7093            offset: usize,
7094            _depth: fidl::encoding::Depth,
7095        ) -> fidl::Result<()> {
7096            encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7097            unsafe {
7098                // Copy the object into the buffer.
7099                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7100                (buf_ptr as *mut SceneAddDirectionalLightCmd)
7101                    .write_unaligned((self as *const SceneAddDirectionalLightCmd).read());
7102                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7103                // done second because the memcpy will write garbage to these bytes.
7104            }
7105            Ok(())
7106        }
7107    }
7108    unsafe impl<
7109        D: fidl::encoding::ResourceDialect,
7110        T0: fidl::encoding::Encode<u32, D>,
7111        T1: fidl::encoding::Encode<u32, D>,
7112    > fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for (T0, T1)
7113    {
7114        #[inline]
7115        unsafe fn encode(
7116            self,
7117            encoder: &mut fidl::encoding::Encoder<'_, D>,
7118            offset: usize,
7119            depth: fidl::encoding::Depth,
7120        ) -> fidl::Result<()> {
7121            encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7122            // Zero out padding regions. There's no need to apply masks
7123            // because the unmasked parts will be overwritten by fields.
7124            // Write the fields.
7125            self.0.encode(encoder, offset + 0, depth)?;
7126            self.1.encode(encoder, offset + 4, depth)?;
7127            Ok(())
7128        }
7129    }
7130
7131    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7132        for SceneAddDirectionalLightCmd
7133    {
7134        #[inline(always)]
7135        fn new_empty() -> Self {
7136            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7137        }
7138
7139        #[inline]
7140        unsafe fn decode(
7141            &mut self,
7142            decoder: &mut fidl::encoding::Decoder<'_, D>,
7143            offset: usize,
7144            _depth: fidl::encoding::Depth,
7145        ) -> fidl::Result<()> {
7146            decoder.debug_check_bounds::<Self>(offset);
7147            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7148            // Verify that padding bytes are zero.
7149            // Copy from the buffer into the object.
7150            unsafe {
7151                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7152            }
7153            Ok(())
7154        }
7155    }
7156
7157    impl fidl::encoding::ValueTypeMarker for SceneAddPointLightCmd {
7158        type Borrowed<'a> = &'a Self;
7159        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7160            value
7161        }
7162    }
7163
7164    unsafe impl fidl::encoding::TypeMarker for SceneAddPointLightCmd {
7165        type Owned = Self;
7166
7167        #[inline(always)]
7168        fn inline_align(_context: fidl::encoding::Context) -> usize {
7169            4
7170        }
7171
7172        #[inline(always)]
7173        fn inline_size(_context: fidl::encoding::Context) -> usize {
7174            8
7175        }
7176        #[inline(always)]
7177        fn encode_is_copy() -> bool {
7178            true
7179        }
7180
7181        #[inline(always)]
7182        fn decode_is_copy() -> bool {
7183            true
7184        }
7185    }
7186
7187    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneAddPointLightCmd, D>
7188        for &SceneAddPointLightCmd
7189    {
7190        #[inline]
7191        unsafe fn encode(
7192            self,
7193            encoder: &mut fidl::encoding::Encoder<'_, D>,
7194            offset: usize,
7195            _depth: fidl::encoding::Depth,
7196        ) -> fidl::Result<()> {
7197            encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7198            unsafe {
7199                // Copy the object into the buffer.
7200                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7201                (buf_ptr as *mut SceneAddPointLightCmd)
7202                    .write_unaligned((self as *const SceneAddPointLightCmd).read());
7203                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7204                // done second because the memcpy will write garbage to these bytes.
7205            }
7206            Ok(())
7207        }
7208    }
7209    unsafe impl<
7210        D: fidl::encoding::ResourceDialect,
7211        T0: fidl::encoding::Encode<u32, D>,
7212        T1: fidl::encoding::Encode<u32, D>,
7213    > fidl::encoding::Encode<SceneAddPointLightCmd, D> for (T0, T1)
7214    {
7215        #[inline]
7216        unsafe fn encode(
7217            self,
7218            encoder: &mut fidl::encoding::Encoder<'_, D>,
7219            offset: usize,
7220            depth: fidl::encoding::Depth,
7221        ) -> fidl::Result<()> {
7222            encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7223            // Zero out padding regions. There's no need to apply masks
7224            // because the unmasked parts will be overwritten by fields.
7225            // Write the fields.
7226            self.0.encode(encoder, offset + 0, depth)?;
7227            self.1.encode(encoder, offset + 4, depth)?;
7228            Ok(())
7229        }
7230    }
7231
7232    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneAddPointLightCmd {
7233        #[inline(always)]
7234        fn new_empty() -> Self {
7235            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7236        }
7237
7238        #[inline]
7239        unsafe fn decode(
7240            &mut self,
7241            decoder: &mut fidl::encoding::Decoder<'_, D>,
7242            offset: usize,
7243            _depth: fidl::encoding::Depth,
7244        ) -> fidl::Result<()> {
7245            decoder.debug_check_bounds::<Self>(offset);
7246            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7247            // Verify that padding bytes are zero.
7248            // Copy from the buffer into the object.
7249            unsafe {
7250                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7251            }
7252            Ok(())
7253        }
7254    }
7255
7256    impl fidl::encoding::ValueTypeMarker for SceneArgs {
7257        type Borrowed<'a> = &'a Self;
7258        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7259            value
7260        }
7261    }
7262
7263    unsafe impl fidl::encoding::TypeMarker for SceneArgs {
7264        type Owned = Self;
7265
7266        #[inline(always)]
7267        fn inline_align(_context: fidl::encoding::Context) -> usize {
7268            4
7269        }
7270
7271        #[inline(always)]
7272        fn inline_size(_context: fidl::encoding::Context) -> usize {
7273            4
7274        }
7275        #[inline(always)]
7276        fn encode_is_copy() -> bool {
7277            true
7278        }
7279
7280        #[inline(always)]
7281        fn decode_is_copy() -> bool {
7282            true
7283        }
7284    }
7285
7286    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneArgs, D>
7287        for &SceneArgs
7288    {
7289        #[inline]
7290        unsafe fn encode(
7291            self,
7292            encoder: &mut fidl::encoding::Encoder<'_, D>,
7293            offset: usize,
7294            _depth: fidl::encoding::Depth,
7295        ) -> fidl::Result<()> {
7296            encoder.debug_check_bounds::<SceneArgs>(offset);
7297            unsafe {
7298                // Copy the object into the buffer.
7299                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7300                (buf_ptr as *mut SceneArgs).write_unaligned((self as *const SceneArgs).read());
7301                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7302                // done second because the memcpy will write garbage to these bytes.
7303            }
7304            Ok(())
7305        }
7306    }
7307    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7308        fidl::encoding::Encode<SceneArgs, D> for (T0,)
7309    {
7310        #[inline]
7311        unsafe fn encode(
7312            self,
7313            encoder: &mut fidl::encoding::Encoder<'_, D>,
7314            offset: usize,
7315            depth: fidl::encoding::Depth,
7316        ) -> fidl::Result<()> {
7317            encoder.debug_check_bounds::<SceneArgs>(offset);
7318            // Zero out padding regions. There's no need to apply masks
7319            // because the unmasked parts will be overwritten by fields.
7320            // Write the fields.
7321            self.0.encode(encoder, offset + 0, depth)?;
7322            Ok(())
7323        }
7324    }
7325
7326    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneArgs {
7327        #[inline(always)]
7328        fn new_empty() -> Self {
7329            Self { dummy: fidl::new_empty!(u32, D) }
7330        }
7331
7332        #[inline]
7333        unsafe fn decode(
7334            &mut self,
7335            decoder: &mut fidl::encoding::Decoder<'_, D>,
7336            offset: usize,
7337            _depth: fidl::encoding::Depth,
7338        ) -> fidl::Result<()> {
7339            decoder.debug_check_bounds::<Self>(offset);
7340            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7341            // Verify that padding bytes are zero.
7342            // Copy from the buffer into the object.
7343            unsafe {
7344                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7345            }
7346            Ok(())
7347        }
7348    }
7349
7350    impl fidl::encoding::ValueTypeMarker for SendSizeChangeHintCmdHack {
7351        type Borrowed<'a> = &'a Self;
7352        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7353            value
7354        }
7355    }
7356
7357    unsafe impl fidl::encoding::TypeMarker for SendSizeChangeHintCmdHack {
7358        type Owned = Self;
7359
7360        #[inline(always)]
7361        fn inline_align(_context: fidl::encoding::Context) -> usize {
7362            4
7363        }
7364
7365        #[inline(always)]
7366        fn inline_size(_context: fidl::encoding::Context) -> usize {
7367            12
7368        }
7369    }
7370
7371    unsafe impl<D: fidl::encoding::ResourceDialect>
7372        fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for &SendSizeChangeHintCmdHack
7373    {
7374        #[inline]
7375        unsafe fn encode(
7376            self,
7377            encoder: &mut fidl::encoding::Encoder<'_, D>,
7378            offset: usize,
7379            _depth: fidl::encoding::Depth,
7380        ) -> fidl::Result<()> {
7381            encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7382            // Delegate to tuple encoding.
7383            fidl::encoding::Encode::<SendSizeChangeHintCmdHack, D>::encode(
7384                (
7385                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
7386                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
7387                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
7388                ),
7389                encoder,
7390                offset,
7391                _depth,
7392            )
7393        }
7394    }
7395    unsafe impl<
7396        D: fidl::encoding::ResourceDialect,
7397        T0: fidl::encoding::Encode<u32, D>,
7398        T1: fidl::encoding::Encode<f32, D>,
7399        T2: fidl::encoding::Encode<f32, D>,
7400    > fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for (T0, T1, T2)
7401    {
7402        #[inline]
7403        unsafe fn encode(
7404            self,
7405            encoder: &mut fidl::encoding::Encoder<'_, D>,
7406            offset: usize,
7407            depth: fidl::encoding::Depth,
7408        ) -> fidl::Result<()> {
7409            encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7410            // Zero out padding regions. There's no need to apply masks
7411            // because the unmasked parts will be overwritten by fields.
7412            // Write the fields.
7413            self.0.encode(encoder, offset + 0, depth)?;
7414            self.1.encode(encoder, offset + 4, depth)?;
7415            self.2.encode(encoder, offset + 8, depth)?;
7416            Ok(())
7417        }
7418    }
7419
7420    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7421        for SendSizeChangeHintCmdHack
7422    {
7423        #[inline(always)]
7424        fn new_empty() -> Self {
7425            Self {
7426                node_id: fidl::new_empty!(u32, D),
7427                width_change_factor: fidl::new_empty!(f32, D),
7428                height_change_factor: fidl::new_empty!(f32, D),
7429            }
7430        }
7431
7432        #[inline]
7433        unsafe fn decode(
7434            &mut self,
7435            decoder: &mut fidl::encoding::Decoder<'_, D>,
7436            offset: usize,
7437            _depth: fidl::encoding::Depth,
7438        ) -> fidl::Result<()> {
7439            decoder.debug_check_bounds::<Self>(offset);
7440            // Verify that padding bytes are zero.
7441            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
7442            fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
7443            fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
7444            Ok(())
7445        }
7446    }
7447
7448    impl fidl::encoding::ValueTypeMarker for SetAnchorCmd {
7449        type Borrowed<'a> = &'a Self;
7450        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7451            value
7452        }
7453    }
7454
7455    unsafe impl fidl::encoding::TypeMarker for SetAnchorCmd {
7456        type Owned = Self;
7457
7458        #[inline(always)]
7459        fn inline_align(_context: fidl::encoding::Context) -> usize {
7460            4
7461        }
7462
7463        #[inline(always)]
7464        fn inline_size(_context: fidl::encoding::Context) -> usize {
7465            20
7466        }
7467    }
7468
7469    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetAnchorCmd, D>
7470        for &SetAnchorCmd
7471    {
7472        #[inline]
7473        unsafe fn encode(
7474            self,
7475            encoder: &mut fidl::encoding::Encoder<'_, D>,
7476            offset: usize,
7477            _depth: fidl::encoding::Depth,
7478        ) -> fidl::Result<()> {
7479            encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7480            // Delegate to tuple encoding.
7481            fidl::encoding::Encode::<SetAnchorCmd, D>::encode(
7482                (
7483                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
7484                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
7485                ),
7486                encoder,
7487                offset,
7488                _depth,
7489            )
7490        }
7491    }
7492    unsafe impl<
7493        D: fidl::encoding::ResourceDialect,
7494        T0: fidl::encoding::Encode<u32, D>,
7495        T1: fidl::encoding::Encode<Vector3Value, D>,
7496    > fidl::encoding::Encode<SetAnchorCmd, D> for (T0, T1)
7497    {
7498        #[inline]
7499        unsafe fn encode(
7500            self,
7501            encoder: &mut fidl::encoding::Encoder<'_, D>,
7502            offset: usize,
7503            depth: fidl::encoding::Depth,
7504        ) -> fidl::Result<()> {
7505            encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7506            // Zero out padding regions. There's no need to apply masks
7507            // because the unmasked parts will be overwritten by fields.
7508            // Write the fields.
7509            self.0.encode(encoder, offset + 0, depth)?;
7510            self.1.encode(encoder, offset + 4, depth)?;
7511            Ok(())
7512        }
7513    }
7514
7515    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetAnchorCmd {
7516        #[inline(always)]
7517        fn new_empty() -> Self {
7518            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
7519        }
7520
7521        #[inline]
7522        unsafe fn decode(
7523            &mut self,
7524            decoder: &mut fidl::encoding::Decoder<'_, D>,
7525            offset: usize,
7526            _depth: fidl::encoding::Depth,
7527        ) -> fidl::Result<()> {
7528            decoder.debug_check_bounds::<Self>(offset);
7529            // Verify that padding bytes are zero.
7530            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
7531            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
7532            Ok(())
7533        }
7534    }
7535
7536    impl fidl::encoding::ValueTypeMarker for SetCameraClipSpaceTransformCmd {
7537        type Borrowed<'a> = &'a Self;
7538        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7539            value
7540        }
7541    }
7542
7543    unsafe impl fidl::encoding::TypeMarker for SetCameraClipSpaceTransformCmd {
7544        type Owned = Self;
7545
7546        #[inline(always)]
7547        fn inline_align(_context: fidl::encoding::Context) -> usize {
7548            4
7549        }
7550
7551        #[inline(always)]
7552        fn inline_size(_context: fidl::encoding::Context) -> usize {
7553            16
7554        }
7555    }
7556
7557    unsafe impl<D: fidl::encoding::ResourceDialect>
7558        fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D>
7559        for &SetCameraClipSpaceTransformCmd
7560    {
7561        #[inline]
7562        unsafe fn encode(
7563            self,
7564            encoder: &mut fidl::encoding::Encoder<'_, D>,
7565            offset: usize,
7566            _depth: fidl::encoding::Depth,
7567        ) -> fidl::Result<()> {
7568            encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7569            // Delegate to tuple encoding.
7570            fidl::encoding::Encode::<SetCameraClipSpaceTransformCmd, D>::encode(
7571                (
7572                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7573                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
7574                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
7575                ),
7576                encoder,
7577                offset,
7578                _depth,
7579            )
7580        }
7581    }
7582    unsafe impl<
7583        D: fidl::encoding::ResourceDialect,
7584        T0: fidl::encoding::Encode<u32, D>,
7585        T1: fidl::encoding::Encode<Vec2, D>,
7586        T2: fidl::encoding::Encode<f32, D>,
7587    > fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D> for (T0, T1, T2)
7588    {
7589        #[inline]
7590        unsafe fn encode(
7591            self,
7592            encoder: &mut fidl::encoding::Encoder<'_, D>,
7593            offset: usize,
7594            depth: fidl::encoding::Depth,
7595        ) -> fidl::Result<()> {
7596            encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7597            // Zero out padding regions. There's no need to apply masks
7598            // because the unmasked parts will be overwritten by fields.
7599            // Write the fields.
7600            self.0.encode(encoder, offset + 0, depth)?;
7601            self.1.encode(encoder, offset + 4, depth)?;
7602            self.2.encode(encoder, offset + 12, depth)?;
7603            Ok(())
7604        }
7605    }
7606
7607    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7608        for SetCameraClipSpaceTransformCmd
7609    {
7610        #[inline(always)]
7611        fn new_empty() -> Self {
7612            Self {
7613                camera_id: fidl::new_empty!(u32, D),
7614                translation: fidl::new_empty!(Vec2, D),
7615                scale: fidl::new_empty!(f32, D),
7616            }
7617        }
7618
7619        #[inline]
7620        unsafe fn decode(
7621            &mut self,
7622            decoder: &mut fidl::encoding::Decoder<'_, D>,
7623            offset: usize,
7624            _depth: fidl::encoding::Depth,
7625        ) -> fidl::Result<()> {
7626            decoder.debug_check_bounds::<Self>(offset);
7627            // Verify that padding bytes are zero.
7628            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7629            fidl::decode!(Vec2, D, &mut self.translation, decoder, offset + 4, _depth)?;
7630            fidl::decode!(f32, D, &mut self.scale, decoder, offset + 12, _depth)?;
7631            Ok(())
7632        }
7633    }
7634
7635    impl fidl::encoding::ValueTypeMarker for SetCameraCmd {
7636        type Borrowed<'a> = &'a Self;
7637        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7638            value
7639        }
7640    }
7641
7642    unsafe impl fidl::encoding::TypeMarker for SetCameraCmd {
7643        type Owned = Self;
7644
7645        #[inline(always)]
7646        fn inline_align(_context: fidl::encoding::Context) -> usize {
7647            4
7648        }
7649
7650        #[inline(always)]
7651        fn inline_size(_context: fidl::encoding::Context) -> usize {
7652            8
7653        }
7654        #[inline(always)]
7655        fn encode_is_copy() -> bool {
7656            true
7657        }
7658
7659        #[inline(always)]
7660        fn decode_is_copy() -> bool {
7661            true
7662        }
7663    }
7664
7665    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraCmd, D>
7666        for &SetCameraCmd
7667    {
7668        #[inline]
7669        unsafe fn encode(
7670            self,
7671            encoder: &mut fidl::encoding::Encoder<'_, D>,
7672            offset: usize,
7673            _depth: fidl::encoding::Depth,
7674        ) -> fidl::Result<()> {
7675            encoder.debug_check_bounds::<SetCameraCmd>(offset);
7676            unsafe {
7677                // Copy the object into the buffer.
7678                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7679                (buf_ptr as *mut SetCameraCmd)
7680                    .write_unaligned((self as *const SetCameraCmd).read());
7681                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7682                // done second because the memcpy will write garbage to these bytes.
7683            }
7684            Ok(())
7685        }
7686    }
7687    unsafe impl<
7688        D: fidl::encoding::ResourceDialect,
7689        T0: fidl::encoding::Encode<u32, D>,
7690        T1: fidl::encoding::Encode<u32, D>,
7691    > fidl::encoding::Encode<SetCameraCmd, D> for (T0, T1)
7692    {
7693        #[inline]
7694        unsafe fn encode(
7695            self,
7696            encoder: &mut fidl::encoding::Encoder<'_, D>,
7697            offset: usize,
7698            depth: fidl::encoding::Depth,
7699        ) -> fidl::Result<()> {
7700            encoder.debug_check_bounds::<SetCameraCmd>(offset);
7701            // Zero out padding regions. There's no need to apply masks
7702            // because the unmasked parts will be overwritten by fields.
7703            // Write the fields.
7704            self.0.encode(encoder, offset + 0, depth)?;
7705            self.1.encode(encoder, offset + 4, depth)?;
7706            Ok(())
7707        }
7708    }
7709
7710    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraCmd {
7711        #[inline(always)]
7712        fn new_empty() -> Self {
7713            Self { renderer_id: fidl::new_empty!(u32, D), camera_id: fidl::new_empty!(u32, D) }
7714        }
7715
7716        #[inline]
7717        unsafe fn decode(
7718            &mut self,
7719            decoder: &mut fidl::encoding::Decoder<'_, D>,
7720            offset: usize,
7721            _depth: fidl::encoding::Depth,
7722        ) -> fidl::Result<()> {
7723            decoder.debug_check_bounds::<Self>(offset);
7724            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7725            // Verify that padding bytes are zero.
7726            // Copy from the buffer into the object.
7727            unsafe {
7728                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7729            }
7730            Ok(())
7731        }
7732    }
7733
7734    impl fidl::encoding::ValueTypeMarker for SetCameraPoseBufferCmd {
7735        type Borrowed<'a> = &'a Self;
7736        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7737            value
7738        }
7739    }
7740
7741    unsafe impl fidl::encoding::TypeMarker for SetCameraPoseBufferCmd {
7742        type Owned = Self;
7743
7744        #[inline(always)]
7745        fn inline_align(_context: fidl::encoding::Context) -> usize {
7746            8
7747        }
7748
7749        #[inline(always)]
7750        fn inline_size(_context: fidl::encoding::Context) -> usize {
7751            32
7752        }
7753    }
7754
7755    unsafe impl<D: fidl::encoding::ResourceDialect>
7756        fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for &SetCameraPoseBufferCmd
7757    {
7758        #[inline]
7759        unsafe fn encode(
7760            self,
7761            encoder: &mut fidl::encoding::Encoder<'_, D>,
7762            offset: usize,
7763            _depth: fidl::encoding::Depth,
7764        ) -> fidl::Result<()> {
7765            encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7766            unsafe {
7767                // Copy the object into the buffer.
7768                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7769                (buf_ptr as *mut SetCameraPoseBufferCmd)
7770                    .write_unaligned((self as *const SetCameraPoseBufferCmd).read());
7771                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7772                // done second because the memcpy will write garbage to these bytes.
7773                let padding_ptr = buf_ptr.offset(8) as *mut u64;
7774                let padding_mask = 0xffffffff00000000u64;
7775                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
7776            }
7777            Ok(())
7778        }
7779    }
7780    unsafe impl<
7781        D: fidl::encoding::ResourceDialect,
7782        T0: fidl::encoding::Encode<u32, D>,
7783        T1: fidl::encoding::Encode<u32, D>,
7784        T2: fidl::encoding::Encode<u32, D>,
7785        T3: fidl::encoding::Encode<i64, D>,
7786        T4: fidl::encoding::Encode<u64, D>,
7787    > fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for (T0, T1, T2, T3, T4)
7788    {
7789        #[inline]
7790        unsafe fn encode(
7791            self,
7792            encoder: &mut fidl::encoding::Encoder<'_, D>,
7793            offset: usize,
7794            depth: fidl::encoding::Depth,
7795        ) -> fidl::Result<()> {
7796            encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7797            // Zero out padding regions. There's no need to apply masks
7798            // because the unmasked parts will be overwritten by fields.
7799            unsafe {
7800                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
7801                (ptr as *mut u64).write_unaligned(0);
7802            }
7803            // Write the fields.
7804            self.0.encode(encoder, offset + 0, depth)?;
7805            self.1.encode(encoder, offset + 4, depth)?;
7806            self.2.encode(encoder, offset + 8, depth)?;
7807            self.3.encode(encoder, offset + 16, depth)?;
7808            self.4.encode(encoder, offset + 24, depth)?;
7809            Ok(())
7810        }
7811    }
7812
7813    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7814        for SetCameraPoseBufferCmd
7815    {
7816        #[inline(always)]
7817        fn new_empty() -> Self {
7818            Self {
7819                camera_id: fidl::new_empty!(u32, D),
7820                buffer_id: fidl::new_empty!(u32, D),
7821                num_entries: fidl::new_empty!(u32, D),
7822                base_time: fidl::new_empty!(i64, D),
7823                time_interval: fidl::new_empty!(u64, D),
7824            }
7825        }
7826
7827        #[inline]
7828        unsafe fn decode(
7829            &mut self,
7830            decoder: &mut fidl::encoding::Decoder<'_, D>,
7831            offset: usize,
7832            _depth: fidl::encoding::Depth,
7833        ) -> fidl::Result<()> {
7834            decoder.debug_check_bounds::<Self>(offset);
7835            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7836            // Verify that padding bytes are zero.
7837            let ptr = unsafe { buf_ptr.offset(8) };
7838            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7839            let mask = 0xffffffff00000000u64;
7840            let maskedval = padval & mask;
7841            if maskedval != 0 {
7842                return Err(fidl::Error::NonZeroPadding {
7843                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
7844                });
7845            }
7846            // Copy from the buffer into the object.
7847            unsafe {
7848                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
7849            }
7850            Ok(())
7851        }
7852    }
7853
7854    impl fidl::encoding::ValueTypeMarker for SetCameraProjectionCmd {
7855        type Borrowed<'a> = &'a Self;
7856        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7857            value
7858        }
7859    }
7860
7861    unsafe impl fidl::encoding::TypeMarker for SetCameraProjectionCmd {
7862        type Owned = Self;
7863
7864        #[inline(always)]
7865        fn inline_align(_context: fidl::encoding::Context) -> usize {
7866            4
7867        }
7868
7869        #[inline(always)]
7870        fn inline_size(_context: fidl::encoding::Context) -> usize {
7871            12
7872        }
7873    }
7874
7875    unsafe impl<D: fidl::encoding::ResourceDialect>
7876        fidl::encoding::Encode<SetCameraProjectionCmd, D> for &SetCameraProjectionCmd
7877    {
7878        #[inline]
7879        unsafe fn encode(
7880            self,
7881            encoder: &mut fidl::encoding::Encoder<'_, D>,
7882            offset: usize,
7883            _depth: fidl::encoding::Depth,
7884        ) -> fidl::Result<()> {
7885            encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7886            // Delegate to tuple encoding.
7887            fidl::encoding::Encode::<SetCameraProjectionCmd, D>::encode(
7888                (
7889                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7890                    <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.fovy),
7891                ),
7892                encoder,
7893                offset,
7894                _depth,
7895            )
7896        }
7897    }
7898    unsafe impl<
7899        D: fidl::encoding::ResourceDialect,
7900        T0: fidl::encoding::Encode<u32, D>,
7901        T1: fidl::encoding::Encode<FloatValue, D>,
7902    > fidl::encoding::Encode<SetCameraProjectionCmd, D> for (T0, T1)
7903    {
7904        #[inline]
7905        unsafe fn encode(
7906            self,
7907            encoder: &mut fidl::encoding::Encoder<'_, D>,
7908            offset: usize,
7909            depth: fidl::encoding::Depth,
7910        ) -> fidl::Result<()> {
7911            encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7912            // Zero out padding regions. There's no need to apply masks
7913            // because the unmasked parts will be overwritten by fields.
7914            // Write the fields.
7915            self.0.encode(encoder, offset + 0, depth)?;
7916            self.1.encode(encoder, offset + 4, depth)?;
7917            Ok(())
7918        }
7919    }
7920
7921    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7922        for SetCameraProjectionCmd
7923    {
7924        #[inline(always)]
7925        fn new_empty() -> Self {
7926            Self { camera_id: fidl::new_empty!(u32, D), fovy: fidl::new_empty!(FloatValue, D) }
7927        }
7928
7929        #[inline]
7930        unsafe fn decode(
7931            &mut self,
7932            decoder: &mut fidl::encoding::Decoder<'_, D>,
7933            offset: usize,
7934            _depth: fidl::encoding::Depth,
7935        ) -> fidl::Result<()> {
7936            decoder.debug_check_bounds::<Self>(offset);
7937            // Verify that padding bytes are zero.
7938            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7939            fidl::decode!(FloatValue, D, &mut self.fovy, decoder, offset + 4, _depth)?;
7940            Ok(())
7941        }
7942    }
7943
7944    impl fidl::encoding::ValueTypeMarker for SetCameraTransformCmd {
7945        type Borrowed<'a> = &'a Self;
7946        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7947            value
7948        }
7949    }
7950
7951    unsafe impl fidl::encoding::TypeMarker for SetCameraTransformCmd {
7952        type Owned = Self;
7953
7954        #[inline(always)]
7955        fn inline_align(_context: fidl::encoding::Context) -> usize {
7956            4
7957        }
7958
7959        #[inline(always)]
7960        fn inline_size(_context: fidl::encoding::Context) -> usize {
7961            52
7962        }
7963    }
7964
7965    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraTransformCmd, D>
7966        for &SetCameraTransformCmd
7967    {
7968        #[inline]
7969        unsafe fn encode(
7970            self,
7971            encoder: &mut fidl::encoding::Encoder<'_, D>,
7972            offset: usize,
7973            _depth: fidl::encoding::Depth,
7974        ) -> fidl::Result<()> {
7975            encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
7976            // Delegate to tuple encoding.
7977            fidl::encoding::Encode::<SetCameraTransformCmd, D>::encode(
7978                (
7979                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7980                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_position),
7981                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_look_at),
7982                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_up),
7983                ),
7984                encoder,
7985                offset,
7986                _depth,
7987            )
7988        }
7989    }
7990    unsafe impl<
7991        D: fidl::encoding::ResourceDialect,
7992        T0: fidl::encoding::Encode<u32, D>,
7993        T1: fidl::encoding::Encode<Vector3Value, D>,
7994        T2: fidl::encoding::Encode<Vector3Value, D>,
7995        T3: fidl::encoding::Encode<Vector3Value, D>,
7996    > fidl::encoding::Encode<SetCameraTransformCmd, D> for (T0, T1, T2, T3)
7997    {
7998        #[inline]
7999        unsafe fn encode(
8000            self,
8001            encoder: &mut fidl::encoding::Encoder<'_, D>,
8002            offset: usize,
8003            depth: fidl::encoding::Depth,
8004        ) -> fidl::Result<()> {
8005            encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
8006            // Zero out padding regions. There's no need to apply masks
8007            // because the unmasked parts will be overwritten by fields.
8008            // Write the fields.
8009            self.0.encode(encoder, offset + 0, depth)?;
8010            self.1.encode(encoder, offset + 4, depth)?;
8011            self.2.encode(encoder, offset + 20, depth)?;
8012            self.3.encode(encoder, offset + 36, depth)?;
8013            Ok(())
8014        }
8015    }
8016
8017    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraTransformCmd {
8018        #[inline(always)]
8019        fn new_empty() -> Self {
8020            Self {
8021                camera_id: fidl::new_empty!(u32, D),
8022                eye_position: fidl::new_empty!(Vector3Value, D),
8023                eye_look_at: fidl::new_empty!(Vector3Value, D),
8024                eye_up: fidl::new_empty!(Vector3Value, D),
8025            }
8026        }
8027
8028        #[inline]
8029        unsafe fn decode(
8030            &mut self,
8031            decoder: &mut fidl::encoding::Decoder<'_, D>,
8032            offset: usize,
8033            _depth: fidl::encoding::Depth,
8034        ) -> fidl::Result<()> {
8035            decoder.debug_check_bounds::<Self>(offset);
8036            // Verify that padding bytes are zero.
8037            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
8038            fidl::decode!(Vector3Value, D, &mut self.eye_position, decoder, offset + 4, _depth)?;
8039            fidl::decode!(Vector3Value, D, &mut self.eye_look_at, decoder, offset + 20, _depth)?;
8040            fidl::decode!(Vector3Value, D, &mut self.eye_up, decoder, offset + 36, _depth)?;
8041            Ok(())
8042        }
8043    }
8044
8045    impl fidl::encoding::ValueTypeMarker for SetClipCmd {
8046        type Borrowed<'a> = &'a Self;
8047        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8048            value
8049        }
8050    }
8051
8052    unsafe impl fidl::encoding::TypeMarker for SetClipCmd {
8053        type Owned = Self;
8054
8055        #[inline(always)]
8056        fn inline_align(_context: fidl::encoding::Context) -> usize {
8057            4
8058        }
8059
8060        #[inline(always)]
8061        fn inline_size(_context: fidl::encoding::Context) -> usize {
8062            12
8063        }
8064    }
8065
8066    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipCmd, D>
8067        for &SetClipCmd
8068    {
8069        #[inline]
8070        unsafe fn encode(
8071            self,
8072            encoder: &mut fidl::encoding::Encoder<'_, D>,
8073            offset: usize,
8074            _depth: fidl::encoding::Depth,
8075        ) -> fidl::Result<()> {
8076            encoder.debug_check_bounds::<SetClipCmd>(offset);
8077            // Delegate to tuple encoding.
8078            fidl::encoding::Encode::<SetClipCmd, D>::encode(
8079                (
8080                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8081                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_id),
8082                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_to_self),
8083                ),
8084                encoder,
8085                offset,
8086                _depth,
8087            )
8088        }
8089    }
8090    unsafe impl<
8091        D: fidl::encoding::ResourceDialect,
8092        T0: fidl::encoding::Encode<u32, D>,
8093        T1: fidl::encoding::Encode<u32, D>,
8094        T2: fidl::encoding::Encode<bool, D>,
8095    > fidl::encoding::Encode<SetClipCmd, D> for (T0, T1, T2)
8096    {
8097        #[inline]
8098        unsafe fn encode(
8099            self,
8100            encoder: &mut fidl::encoding::Encoder<'_, D>,
8101            offset: usize,
8102            depth: fidl::encoding::Depth,
8103        ) -> fidl::Result<()> {
8104            encoder.debug_check_bounds::<SetClipCmd>(offset);
8105            // Zero out padding regions. There's no need to apply masks
8106            // because the unmasked parts will be overwritten by fields.
8107            unsafe {
8108                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8109                (ptr as *mut u32).write_unaligned(0);
8110            }
8111            // Write the fields.
8112            self.0.encode(encoder, offset + 0, depth)?;
8113            self.1.encode(encoder, offset + 4, depth)?;
8114            self.2.encode(encoder, offset + 8, depth)?;
8115            Ok(())
8116        }
8117    }
8118
8119    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipCmd {
8120        #[inline(always)]
8121        fn new_empty() -> Self {
8122            Self {
8123                node_id: fidl::new_empty!(u32, D),
8124                clip_id: fidl::new_empty!(u32, D),
8125                clip_to_self: fidl::new_empty!(bool, D),
8126            }
8127        }
8128
8129        #[inline]
8130        unsafe fn decode(
8131            &mut self,
8132            decoder: &mut fidl::encoding::Decoder<'_, D>,
8133            offset: usize,
8134            _depth: fidl::encoding::Depth,
8135        ) -> fidl::Result<()> {
8136            decoder.debug_check_bounds::<Self>(offset);
8137            // Verify that padding bytes are zero.
8138            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8139            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8140            let mask = 0xffffff00u32;
8141            let maskedval = padval & mask;
8142            if maskedval != 0 {
8143                return Err(fidl::Error::NonZeroPadding {
8144                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8145                });
8146            }
8147            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8148            fidl::decode!(u32, D, &mut self.clip_id, decoder, offset + 4, _depth)?;
8149            fidl::decode!(bool, D, &mut self.clip_to_self, decoder, offset + 8, _depth)?;
8150            Ok(())
8151        }
8152    }
8153
8154    impl fidl::encoding::ValueTypeMarker for SetClipPlanesCmd {
8155        type Borrowed<'a> = &'a Self;
8156        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8157            value
8158        }
8159    }
8160
8161    unsafe impl fidl::encoding::TypeMarker for SetClipPlanesCmd {
8162        type Owned = Self;
8163
8164        #[inline(always)]
8165        fn inline_align(_context: fidl::encoding::Context) -> usize {
8166            8
8167        }
8168
8169        #[inline(always)]
8170        fn inline_size(_context: fidl::encoding::Context) -> usize {
8171            24
8172        }
8173    }
8174
8175    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipPlanesCmd, D>
8176        for &SetClipPlanesCmd
8177    {
8178        #[inline]
8179        unsafe fn encode(
8180            self,
8181            encoder: &mut fidl::encoding::Encoder<'_, D>,
8182            offset: usize,
8183            _depth: fidl::encoding::Depth,
8184        ) -> fidl::Result<()> {
8185            encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8186            // Delegate to tuple encoding.
8187            fidl::encoding::Encode::<SetClipPlanesCmd, D>::encode(
8188                (
8189                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8190                    <fidl::encoding::UnboundedVector<Plane3> as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_planes),
8191                ),
8192                encoder, offset, _depth
8193            )
8194        }
8195    }
8196    unsafe impl<
8197        D: fidl::encoding::ResourceDialect,
8198        T0: fidl::encoding::Encode<u32, D>,
8199        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Plane3>, D>,
8200    > fidl::encoding::Encode<SetClipPlanesCmd, D> for (T0, T1)
8201    {
8202        #[inline]
8203        unsafe fn encode(
8204            self,
8205            encoder: &mut fidl::encoding::Encoder<'_, D>,
8206            offset: usize,
8207            depth: fidl::encoding::Depth,
8208        ) -> fidl::Result<()> {
8209            encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8210            // Zero out padding regions. There's no need to apply masks
8211            // because the unmasked parts will be overwritten by fields.
8212            unsafe {
8213                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8214                (ptr as *mut u64).write_unaligned(0);
8215            }
8216            // Write the fields.
8217            self.0.encode(encoder, offset + 0, depth)?;
8218            self.1.encode(encoder, offset + 8, depth)?;
8219            Ok(())
8220        }
8221    }
8222
8223    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipPlanesCmd {
8224        #[inline(always)]
8225        fn new_empty() -> Self {
8226            Self {
8227                node_id: fidl::new_empty!(u32, D),
8228                clip_planes: fidl::new_empty!(fidl::encoding::UnboundedVector<Plane3>, D),
8229            }
8230        }
8231
8232        #[inline]
8233        unsafe fn decode(
8234            &mut self,
8235            decoder: &mut fidl::encoding::Decoder<'_, D>,
8236            offset: usize,
8237            _depth: fidl::encoding::Depth,
8238        ) -> fidl::Result<()> {
8239            decoder.debug_check_bounds::<Self>(offset);
8240            // Verify that padding bytes are zero.
8241            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8242            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8243            let mask = 0xffffffff00000000u64;
8244            let maskedval = padval & mask;
8245            if maskedval != 0 {
8246                return Err(fidl::Error::NonZeroPadding {
8247                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8248                });
8249            }
8250            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8251            fidl::decode!(
8252                fidl::encoding::UnboundedVector<Plane3>,
8253                D,
8254                &mut self.clip_planes,
8255                decoder,
8256                offset + 8,
8257                _depth
8258            )?;
8259            Ok(())
8260        }
8261    }
8262
8263    impl fidl::encoding::ValueTypeMarker for SetColorCmd {
8264        type Borrowed<'a> = &'a Self;
8265        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8266            value
8267        }
8268    }
8269
8270    unsafe impl fidl::encoding::TypeMarker for SetColorCmd {
8271        type Owned = Self;
8272
8273        #[inline(always)]
8274        fn inline_align(_context: fidl::encoding::Context) -> usize {
8275            4
8276        }
8277
8278        #[inline(always)]
8279        fn inline_size(_context: fidl::encoding::Context) -> usize {
8280            12
8281        }
8282        #[inline(always)]
8283        fn encode_is_copy() -> bool {
8284            true
8285        }
8286
8287        #[inline(always)]
8288        fn decode_is_copy() -> bool {
8289            true
8290        }
8291    }
8292
8293    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetColorCmd, D>
8294        for &SetColorCmd
8295    {
8296        #[inline]
8297        unsafe fn encode(
8298            self,
8299            encoder: &mut fidl::encoding::Encoder<'_, D>,
8300            offset: usize,
8301            _depth: fidl::encoding::Depth,
8302        ) -> fidl::Result<()> {
8303            encoder.debug_check_bounds::<SetColorCmd>(offset);
8304            unsafe {
8305                // Copy the object into the buffer.
8306                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8307                (buf_ptr as *mut SetColorCmd).write_unaligned((self as *const SetColorCmd).read());
8308                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8309                // done second because the memcpy will write garbage to these bytes.
8310            }
8311            Ok(())
8312        }
8313    }
8314    unsafe impl<
8315        D: fidl::encoding::ResourceDialect,
8316        T0: fidl::encoding::Encode<u32, D>,
8317        T1: fidl::encoding::Encode<ColorRgbaValue, D>,
8318    > fidl::encoding::Encode<SetColorCmd, D> for (T0, T1)
8319    {
8320        #[inline]
8321        unsafe fn encode(
8322            self,
8323            encoder: &mut fidl::encoding::Encoder<'_, D>,
8324            offset: usize,
8325            depth: fidl::encoding::Depth,
8326        ) -> fidl::Result<()> {
8327            encoder.debug_check_bounds::<SetColorCmd>(offset);
8328            // Zero out padding regions. There's no need to apply masks
8329            // because the unmasked parts will be overwritten by fields.
8330            // Write the fields.
8331            self.0.encode(encoder, offset + 0, depth)?;
8332            self.1.encode(encoder, offset + 4, depth)?;
8333            Ok(())
8334        }
8335    }
8336
8337    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetColorCmd {
8338        #[inline(always)]
8339        fn new_empty() -> Self {
8340            Self {
8341                material_id: fidl::new_empty!(u32, D),
8342                color: fidl::new_empty!(ColorRgbaValue, D),
8343            }
8344        }
8345
8346        #[inline]
8347        unsafe fn decode(
8348            &mut self,
8349            decoder: &mut fidl::encoding::Decoder<'_, D>,
8350            offset: usize,
8351            _depth: fidl::encoding::Depth,
8352        ) -> fidl::Result<()> {
8353            decoder.debug_check_bounds::<Self>(offset);
8354            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8355            // Verify that padding bytes are zero.
8356            // Copy from the buffer into the object.
8357            unsafe {
8358                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
8359            }
8360            Ok(())
8361        }
8362    }
8363
8364    impl fidl::encoding::ValueTypeMarker for SetDisableClippingCmd {
8365        type Borrowed<'a> = &'a Self;
8366        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8367            value
8368        }
8369    }
8370
8371    unsafe impl fidl::encoding::TypeMarker for SetDisableClippingCmd {
8372        type Owned = Self;
8373
8374        #[inline(always)]
8375        fn inline_align(_context: fidl::encoding::Context) -> usize {
8376            4
8377        }
8378
8379        #[inline(always)]
8380        fn inline_size(_context: fidl::encoding::Context) -> usize {
8381            8
8382        }
8383    }
8384
8385    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetDisableClippingCmd, D>
8386        for &SetDisableClippingCmd
8387    {
8388        #[inline]
8389        unsafe fn encode(
8390            self,
8391            encoder: &mut fidl::encoding::Encoder<'_, D>,
8392            offset: usize,
8393            _depth: fidl::encoding::Depth,
8394        ) -> fidl::Result<()> {
8395            encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8396            // Delegate to tuple encoding.
8397            fidl::encoding::Encode::<SetDisableClippingCmd, D>::encode(
8398                (
8399                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
8400                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_clipping),
8401                ),
8402                encoder,
8403                offset,
8404                _depth,
8405            )
8406        }
8407    }
8408    unsafe impl<
8409        D: fidl::encoding::ResourceDialect,
8410        T0: fidl::encoding::Encode<u32, D>,
8411        T1: fidl::encoding::Encode<bool, D>,
8412    > fidl::encoding::Encode<SetDisableClippingCmd, D> for (T0, T1)
8413    {
8414        #[inline]
8415        unsafe fn encode(
8416            self,
8417            encoder: &mut fidl::encoding::Encoder<'_, D>,
8418            offset: usize,
8419            depth: fidl::encoding::Depth,
8420        ) -> fidl::Result<()> {
8421            encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8422            // Zero out padding regions. There's no need to apply masks
8423            // because the unmasked parts will be overwritten by fields.
8424            unsafe {
8425                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8426                (ptr as *mut u32).write_unaligned(0);
8427            }
8428            // Write the fields.
8429            self.0.encode(encoder, offset + 0, depth)?;
8430            self.1.encode(encoder, offset + 4, depth)?;
8431            Ok(())
8432        }
8433    }
8434
8435    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetDisableClippingCmd {
8436        #[inline(always)]
8437        fn new_empty() -> Self {
8438            Self {
8439                renderer_id: fidl::new_empty!(u32, D),
8440                disable_clipping: fidl::new_empty!(bool, D),
8441            }
8442        }
8443
8444        #[inline]
8445        unsafe fn decode(
8446            &mut self,
8447            decoder: &mut fidl::encoding::Decoder<'_, D>,
8448            offset: usize,
8449            _depth: fidl::encoding::Depth,
8450        ) -> fidl::Result<()> {
8451            decoder.debug_check_bounds::<Self>(offset);
8452            // Verify that padding bytes are zero.
8453            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8454            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8455            let mask = 0xffffff00u32;
8456            let maskedval = padval & mask;
8457            if maskedval != 0 {
8458                return Err(fidl::Error::NonZeroPadding {
8459                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8460                });
8461            }
8462            fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
8463            fidl::decode!(bool, D, &mut self.disable_clipping, decoder, offset + 4, _depth)?;
8464            Ok(())
8465        }
8466    }
8467
8468    impl fidl::encoding::ValueTypeMarker for SetDisplayColorConversionCmdHack {
8469        type Borrowed<'a> = &'a Self;
8470        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8471            value
8472        }
8473    }
8474
8475    unsafe impl fidl::encoding::TypeMarker for SetDisplayColorConversionCmdHack {
8476        type Owned = Self;
8477
8478        #[inline(always)]
8479        fn inline_align(_context: fidl::encoding::Context) -> usize {
8480            4
8481        }
8482
8483        #[inline(always)]
8484        fn inline_size(_context: fidl::encoding::Context) -> usize {
8485            64
8486        }
8487    }
8488
8489    unsafe impl<D: fidl::encoding::ResourceDialect>
8490        fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D>
8491        for &SetDisplayColorConversionCmdHack
8492    {
8493        #[inline]
8494        unsafe fn encode(
8495            self,
8496            encoder: &mut fidl::encoding::Encoder<'_, D>,
8497            offset: usize,
8498            _depth: fidl::encoding::Depth,
8499        ) -> fidl::Result<()> {
8500            encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8501            // Delegate to tuple encoding.
8502            fidl::encoding::Encode::<SetDisplayColorConversionCmdHack, D>::encode(
8503                (
8504                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.compositor_id),
8505                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8506                        &self.preoffsets,
8507                    ),
8508                    <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(
8509                        &self.matrix,
8510                    ),
8511                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8512                        &self.postoffsets,
8513                    ),
8514                ),
8515                encoder,
8516                offset,
8517                _depth,
8518            )
8519        }
8520    }
8521    unsafe impl<
8522        D: fidl::encoding::ResourceDialect,
8523        T0: fidl::encoding::Encode<u32, D>,
8524        T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8525        T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
8526        T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8527    > fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D> for (T0, T1, T2, T3)
8528    {
8529        #[inline]
8530        unsafe fn encode(
8531            self,
8532            encoder: &mut fidl::encoding::Encoder<'_, D>,
8533            offset: usize,
8534            depth: fidl::encoding::Depth,
8535        ) -> fidl::Result<()> {
8536            encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8537            // Zero out padding regions. There's no need to apply masks
8538            // because the unmasked parts will be overwritten by fields.
8539            // Write the fields.
8540            self.0.encode(encoder, offset + 0, depth)?;
8541            self.1.encode(encoder, offset + 4, depth)?;
8542            self.2.encode(encoder, offset + 16, depth)?;
8543            self.3.encode(encoder, offset + 52, depth)?;
8544            Ok(())
8545        }
8546    }
8547
8548    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8549        for SetDisplayColorConversionCmdHack
8550    {
8551        #[inline(always)]
8552        fn new_empty() -> Self {
8553            Self {
8554                compositor_id: fidl::new_empty!(u32, D),
8555                preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8556                matrix: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
8557                postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8558            }
8559        }
8560
8561        #[inline]
8562        unsafe fn decode(
8563            &mut self,
8564            decoder: &mut fidl::encoding::Decoder<'_, D>,
8565            offset: usize,
8566            _depth: fidl::encoding::Depth,
8567        ) -> fidl::Result<()> {
8568            decoder.debug_check_bounds::<Self>(offset);
8569            // Verify that padding bytes are zero.
8570            fidl::decode!(u32, D, &mut self.compositor_id, decoder, offset + 0, _depth)?;
8571            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 4, _depth)?;
8572            fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.matrix, decoder, offset + 16, _depth)?;
8573            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 52, _depth)?;
8574            Ok(())
8575        }
8576    }
8577
8578    impl fidl::encoding::ValueTypeMarker for SetDisplayMinimumRgbCmdHack {
8579        type Borrowed<'a> = &'a Self;
8580        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8581            value
8582        }
8583    }
8584
8585    unsafe impl fidl::encoding::TypeMarker for SetDisplayMinimumRgbCmdHack {
8586        type Owned = Self;
8587
8588        #[inline(always)]
8589        fn inline_align(_context: fidl::encoding::Context) -> usize {
8590            1
8591        }
8592
8593        #[inline(always)]
8594        fn inline_size(_context: fidl::encoding::Context) -> usize {
8595            1
8596        }
8597        #[inline(always)]
8598        fn encode_is_copy() -> bool {
8599            true
8600        }
8601
8602        #[inline(always)]
8603        fn decode_is_copy() -> bool {
8604            true
8605        }
8606    }
8607
8608    unsafe impl<D: fidl::encoding::ResourceDialect>
8609        fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for &SetDisplayMinimumRgbCmdHack
8610    {
8611        #[inline]
8612        unsafe fn encode(
8613            self,
8614            encoder: &mut fidl::encoding::Encoder<'_, D>,
8615            offset: usize,
8616            _depth: fidl::encoding::Depth,
8617        ) -> fidl::Result<()> {
8618            encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8619            unsafe {
8620                // Copy the object into the buffer.
8621                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8622                (buf_ptr as *mut SetDisplayMinimumRgbCmdHack)
8623                    .write_unaligned((self as *const SetDisplayMinimumRgbCmdHack).read());
8624                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8625                // done second because the memcpy will write garbage to these bytes.
8626            }
8627            Ok(())
8628        }
8629    }
8630    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
8631        fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for (T0,)
8632    {
8633        #[inline]
8634        unsafe fn encode(
8635            self,
8636            encoder: &mut fidl::encoding::Encoder<'_, D>,
8637            offset: usize,
8638            depth: fidl::encoding::Depth,
8639        ) -> fidl::Result<()> {
8640            encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8641            // Zero out padding regions. There's no need to apply masks
8642            // because the unmasked parts will be overwritten by fields.
8643            // Write the fields.
8644            self.0.encode(encoder, offset + 0, depth)?;
8645            Ok(())
8646        }
8647    }
8648
8649    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8650        for SetDisplayMinimumRgbCmdHack
8651    {
8652        #[inline(always)]
8653        fn new_empty() -> Self {
8654            Self { min_value: fidl::new_empty!(u8, D) }
8655        }
8656
8657        #[inline]
8658        unsafe fn decode(
8659            &mut self,
8660            decoder: &mut fidl::encoding::Decoder<'_, D>,
8661            offset: usize,
8662            _depth: fidl::encoding::Depth,
8663        ) -> fidl::Result<()> {
8664            decoder.debug_check_bounds::<Self>(offset);
8665            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8666            // Verify that padding bytes are zero.
8667            // Copy from the buffer into the object.
8668            unsafe {
8669                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
8670            }
8671            Ok(())
8672        }
8673    }
8674
8675    impl fidl::encoding::ValueTypeMarker for SetDisplayRotationCmdHack {
8676        type Borrowed<'a> = &'a Self;
8677        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8678            value
8679        }
8680    }
8681
8682    unsafe impl fidl::encoding::TypeMarker for SetDisplayRotationCmdHack {
8683        type Owned = Self;
8684
8685        #[inline(always)]
8686        fn inline_align(_context: fidl::encoding::Context) -> usize {
8687            4
8688        }
8689
8690        #[inline(always)]
8691        fn inline_size(_context: fidl::encoding::Context) -> usize {
8692            8
8693        }
8694        #[inline(always)]
8695        fn encode_is_copy() -> bool {
8696            true
8697        }
8698
8699        #[inline(always)]
8700        fn decode_is_copy() -> bool {
8701            true
8702        }
8703    }
8704
8705    unsafe impl<D: fidl::encoding::ResourceDialect>
8706        fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for &SetDisplayRotationCmdHack
8707    {
8708        #[inline]
8709        unsafe fn encode(
8710            self,
8711            encoder: &mut fidl::encoding::Encoder<'_, D>,
8712            offset: usize,
8713            _depth: fidl::encoding::Depth,
8714        ) -> fidl::Result<()> {
8715            encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8716            unsafe {
8717                // Copy the object into the buffer.
8718                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8719                (buf_ptr as *mut SetDisplayRotationCmdHack)
8720                    .write_unaligned((self as *const SetDisplayRotationCmdHack).read());
8721                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8722                // done second because the memcpy will write garbage to these bytes.
8723            }
8724            Ok(())
8725        }
8726    }
8727    unsafe impl<
8728        D: fidl::encoding::ResourceDialect,
8729        T0: fidl::encoding::Encode<u32, D>,
8730        T1: fidl::encoding::Encode<u32, D>,
8731    > fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for (T0, T1)
8732    {
8733        #[inline]
8734        unsafe fn encode(
8735            self,
8736            encoder: &mut fidl::encoding::Encoder<'_, D>,
8737            offset: usize,
8738            depth: fidl::encoding::Depth,
8739        ) -> fidl::Result<()> {
8740            encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8741            // Zero out padding regions. There's no need to apply masks
8742            // because the unmasked parts will be overwritten by fields.
8743            // Write the fields.
8744            self.0.encode(encoder, offset + 0, depth)?;
8745            self.1.encode(encoder, offset + 4, depth)?;
8746            Ok(())
8747        }
8748    }
8749
8750    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8751        for SetDisplayRotationCmdHack
8752    {
8753        #[inline(always)]
8754        fn new_empty() -> Self {
8755            Self {
8756                compositor_id: fidl::new_empty!(u32, D),
8757                rotation_degrees: fidl::new_empty!(u32, D),
8758            }
8759        }
8760
8761        #[inline]
8762        unsafe fn decode(
8763            &mut self,
8764            decoder: &mut fidl::encoding::Decoder<'_, D>,
8765            offset: usize,
8766            _depth: fidl::encoding::Depth,
8767        ) -> fidl::Result<()> {
8768            decoder.debug_check_bounds::<Self>(offset);
8769            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8770            // Verify that padding bytes are zero.
8771            // Copy from the buffer into the object.
8772            unsafe {
8773                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8774            }
8775            Ok(())
8776        }
8777    }
8778
8779    impl fidl::encoding::ValueTypeMarker for SetEnableDebugViewBoundsCmd {
8780        type Borrowed<'a> = &'a Self;
8781        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8782            value
8783        }
8784    }
8785
8786    unsafe impl fidl::encoding::TypeMarker for SetEnableDebugViewBoundsCmd {
8787        type Owned = Self;
8788
8789        #[inline(always)]
8790        fn inline_align(_context: fidl::encoding::Context) -> usize {
8791            4
8792        }
8793
8794        #[inline(always)]
8795        fn inline_size(_context: fidl::encoding::Context) -> usize {
8796            8
8797        }
8798    }
8799
8800    unsafe impl<D: fidl::encoding::ResourceDialect>
8801        fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for &SetEnableDebugViewBoundsCmd
8802    {
8803        #[inline]
8804        unsafe fn encode(
8805            self,
8806            encoder: &mut fidl::encoding::Encoder<'_, D>,
8807            offset: usize,
8808            _depth: fidl::encoding::Depth,
8809        ) -> fidl::Result<()> {
8810            encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8811            // Delegate to tuple encoding.
8812            fidl::encoding::Encode::<SetEnableDebugViewBoundsCmd, D>::encode(
8813                (
8814                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
8815                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable),
8816                ),
8817                encoder,
8818                offset,
8819                _depth,
8820            )
8821        }
8822    }
8823    unsafe impl<
8824        D: fidl::encoding::ResourceDialect,
8825        T0: fidl::encoding::Encode<u32, D>,
8826        T1: fidl::encoding::Encode<bool, D>,
8827    > fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for (T0, T1)
8828    {
8829        #[inline]
8830        unsafe fn encode(
8831            self,
8832            encoder: &mut fidl::encoding::Encoder<'_, D>,
8833            offset: usize,
8834            depth: fidl::encoding::Depth,
8835        ) -> fidl::Result<()> {
8836            encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8837            // Zero out padding regions. There's no need to apply masks
8838            // because the unmasked parts will be overwritten by fields.
8839            unsafe {
8840                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8841                (ptr as *mut u32).write_unaligned(0);
8842            }
8843            // Write the fields.
8844            self.0.encode(encoder, offset + 0, depth)?;
8845            self.1.encode(encoder, offset + 4, depth)?;
8846            Ok(())
8847        }
8848    }
8849
8850    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8851        for SetEnableDebugViewBoundsCmd
8852    {
8853        #[inline(always)]
8854        fn new_empty() -> Self {
8855            Self { view_id: fidl::new_empty!(u32, D), enable: fidl::new_empty!(bool, D) }
8856        }
8857
8858        #[inline]
8859        unsafe fn decode(
8860            &mut self,
8861            decoder: &mut fidl::encoding::Decoder<'_, D>,
8862            offset: usize,
8863            _depth: fidl::encoding::Depth,
8864        ) -> fidl::Result<()> {
8865            decoder.debug_check_bounds::<Self>(offset);
8866            // Verify that padding bytes are zero.
8867            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8868            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8869            let mask = 0xffffff00u32;
8870            let maskedval = padval & mask;
8871            if maskedval != 0 {
8872                return Err(fidl::Error::NonZeroPadding {
8873                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8874                });
8875            }
8876            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
8877            fidl::decode!(bool, D, &mut self.enable, decoder, offset + 4, _depth)?;
8878            Ok(())
8879        }
8880    }
8881
8882    impl fidl::encoding::ValueTypeMarker for SetEventMaskCmd {
8883        type Borrowed<'a> = &'a Self;
8884        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8885            value
8886        }
8887    }
8888
8889    unsafe impl fidl::encoding::TypeMarker for SetEventMaskCmd {
8890        type Owned = Self;
8891
8892        #[inline(always)]
8893        fn inline_align(_context: fidl::encoding::Context) -> usize {
8894            4
8895        }
8896
8897        #[inline(always)]
8898        fn inline_size(_context: fidl::encoding::Context) -> usize {
8899            8
8900        }
8901        #[inline(always)]
8902        fn encode_is_copy() -> bool {
8903            true
8904        }
8905
8906        #[inline(always)]
8907        fn decode_is_copy() -> bool {
8908            true
8909        }
8910    }
8911
8912    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetEventMaskCmd, D>
8913        for &SetEventMaskCmd
8914    {
8915        #[inline]
8916        unsafe fn encode(
8917            self,
8918            encoder: &mut fidl::encoding::Encoder<'_, D>,
8919            offset: usize,
8920            _depth: fidl::encoding::Depth,
8921        ) -> fidl::Result<()> {
8922            encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
8923            unsafe {
8924                // Copy the object into the buffer.
8925                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8926                (buf_ptr as *mut SetEventMaskCmd)
8927                    .write_unaligned((self as *const SetEventMaskCmd).read());
8928                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8929                // done second because the memcpy will write garbage to these bytes.
8930            }
8931            Ok(())
8932        }
8933    }
8934    unsafe impl<
8935        D: fidl::encoding::ResourceDialect,
8936        T0: fidl::encoding::Encode<u32, D>,
8937        T1: fidl::encoding::Encode<u32, D>,
8938    > fidl::encoding::Encode<SetEventMaskCmd, D> for (T0, T1)
8939    {
8940        #[inline]
8941        unsafe fn encode(
8942            self,
8943            encoder: &mut fidl::encoding::Encoder<'_, D>,
8944            offset: usize,
8945            depth: fidl::encoding::Depth,
8946        ) -> fidl::Result<()> {
8947            encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
8948            // Zero out padding regions. There's no need to apply masks
8949            // because the unmasked parts will be overwritten by fields.
8950            // Write the fields.
8951            self.0.encode(encoder, offset + 0, depth)?;
8952            self.1.encode(encoder, offset + 4, depth)?;
8953            Ok(())
8954        }
8955    }
8956
8957    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetEventMaskCmd {
8958        #[inline(always)]
8959        fn new_empty() -> Self {
8960            Self { id: fidl::new_empty!(u32, D), event_mask: fidl::new_empty!(u32, D) }
8961        }
8962
8963        #[inline]
8964        unsafe fn decode(
8965            &mut self,
8966            decoder: &mut fidl::encoding::Decoder<'_, D>,
8967            offset: usize,
8968            _depth: fidl::encoding::Depth,
8969        ) -> fidl::Result<()> {
8970            decoder.debug_check_bounds::<Self>(offset);
8971            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8972            // Verify that padding bytes are zero.
8973            // Copy from the buffer into the object.
8974            unsafe {
8975                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8976            }
8977            Ok(())
8978        }
8979    }
8980
8981    impl fidl::encoding::ValueTypeMarker for SetHitTestBehaviorCmd {
8982        type Borrowed<'a> = &'a Self;
8983        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8984            value
8985        }
8986    }
8987
8988    unsafe impl fidl::encoding::TypeMarker for SetHitTestBehaviorCmd {
8989        type Owned = Self;
8990
8991        #[inline(always)]
8992        fn inline_align(_context: fidl::encoding::Context) -> usize {
8993            4
8994        }
8995
8996        #[inline(always)]
8997        fn inline_size(_context: fidl::encoding::Context) -> usize {
8998            8
8999        }
9000    }
9001
9002    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetHitTestBehaviorCmd, D>
9003        for &SetHitTestBehaviorCmd
9004    {
9005        #[inline]
9006        unsafe fn encode(
9007            self,
9008            encoder: &mut fidl::encoding::Encoder<'_, D>,
9009            offset: usize,
9010            _depth: fidl::encoding::Depth,
9011        ) -> fidl::Result<()> {
9012            encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9013            // Delegate to tuple encoding.
9014            fidl::encoding::Encode::<SetHitTestBehaviorCmd, D>::encode(
9015                (
9016                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9017                    <HitTestBehavior as fidl::encoding::ValueTypeMarker>::borrow(
9018                        &self.hit_test_behavior,
9019                    ),
9020                ),
9021                encoder,
9022                offset,
9023                _depth,
9024            )
9025        }
9026    }
9027    unsafe impl<
9028        D: fidl::encoding::ResourceDialect,
9029        T0: fidl::encoding::Encode<u32, D>,
9030        T1: fidl::encoding::Encode<HitTestBehavior, D>,
9031    > fidl::encoding::Encode<SetHitTestBehaviorCmd, D> for (T0, T1)
9032    {
9033        #[inline]
9034        unsafe fn encode(
9035            self,
9036            encoder: &mut fidl::encoding::Encoder<'_, D>,
9037            offset: usize,
9038            depth: fidl::encoding::Depth,
9039        ) -> fidl::Result<()> {
9040            encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9041            // Zero out padding regions. There's no need to apply masks
9042            // because the unmasked parts will be overwritten by fields.
9043            // Write the fields.
9044            self.0.encode(encoder, offset + 0, depth)?;
9045            self.1.encode(encoder, offset + 4, depth)?;
9046            Ok(())
9047        }
9048    }
9049
9050    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetHitTestBehaviorCmd {
9051        #[inline(always)]
9052        fn new_empty() -> Self {
9053            Self {
9054                node_id: fidl::new_empty!(u32, D),
9055                hit_test_behavior: fidl::new_empty!(HitTestBehavior, D),
9056            }
9057        }
9058
9059        #[inline]
9060        unsafe fn decode(
9061            &mut self,
9062            decoder: &mut fidl::encoding::Decoder<'_, D>,
9063            offset: usize,
9064            _depth: fidl::encoding::Depth,
9065        ) -> fidl::Result<()> {
9066            decoder.debug_check_bounds::<Self>(offset);
9067            // Verify that padding bytes are zero.
9068            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9069            fidl::decode!(
9070                HitTestBehavior,
9071                D,
9072                &mut self.hit_test_behavior,
9073                decoder,
9074                offset + 4,
9075                _depth
9076            )?;
9077            Ok(())
9078        }
9079    }
9080
9081    impl fidl::encoding::ValueTypeMarker for SetImportFocusCmdDeprecated {
9082        type Borrowed<'a> = &'a Self;
9083        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9084            value
9085        }
9086    }
9087
9088    unsafe impl fidl::encoding::TypeMarker for SetImportFocusCmdDeprecated {
9089        type Owned = Self;
9090
9091        #[inline(always)]
9092        fn inline_align(_context: fidl::encoding::Context) -> usize {
9093            1
9094        }
9095
9096        #[inline(always)]
9097        fn inline_size(_context: fidl::encoding::Context) -> usize {
9098            1
9099        }
9100    }
9101
9102    unsafe impl<D: fidl::encoding::ResourceDialect>
9103        fidl::encoding::Encode<SetImportFocusCmdDeprecated, D> for &SetImportFocusCmdDeprecated
9104    {
9105        #[inline]
9106        unsafe fn encode(
9107            self,
9108            encoder: &mut fidl::encoding::Encoder<'_, D>,
9109            offset: usize,
9110            _depth: fidl::encoding::Depth,
9111        ) -> fidl::Result<()> {
9112            encoder.debug_check_bounds::<SetImportFocusCmdDeprecated>(offset);
9113            encoder.write_num(0u8, offset);
9114            Ok(())
9115        }
9116    }
9117
9118    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9119        for SetImportFocusCmdDeprecated
9120    {
9121        #[inline(always)]
9122        fn new_empty() -> Self {
9123            Self
9124        }
9125
9126        #[inline]
9127        unsafe fn decode(
9128            &mut self,
9129            decoder: &mut fidl::encoding::Decoder<'_, D>,
9130            offset: usize,
9131            _depth: fidl::encoding::Depth,
9132        ) -> fidl::Result<()> {
9133            decoder.debug_check_bounds::<Self>(offset);
9134            match decoder.read_num::<u8>(offset) {
9135                0 => Ok(()),
9136                _ => Err(fidl::Error::Invalid),
9137            }
9138        }
9139    }
9140
9141    impl fidl::encoding::ValueTypeMarker for SetLabelCmd {
9142        type Borrowed<'a> = &'a Self;
9143        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9144            value
9145        }
9146    }
9147
9148    unsafe impl fidl::encoding::TypeMarker for SetLabelCmd {
9149        type Owned = Self;
9150
9151        #[inline(always)]
9152        fn inline_align(_context: fidl::encoding::Context) -> usize {
9153            8
9154        }
9155
9156        #[inline(always)]
9157        fn inline_size(_context: fidl::encoding::Context) -> usize {
9158            24
9159        }
9160    }
9161
9162    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLabelCmd, D>
9163        for &SetLabelCmd
9164    {
9165        #[inline]
9166        unsafe fn encode(
9167            self,
9168            encoder: &mut fidl::encoding::Encoder<'_, D>,
9169            offset: usize,
9170            _depth: fidl::encoding::Depth,
9171        ) -> fidl::Result<()> {
9172            encoder.debug_check_bounds::<SetLabelCmd>(offset);
9173            // Delegate to tuple encoding.
9174            fidl::encoding::Encode::<SetLabelCmd, D>::encode(
9175                (
9176                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9177                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9178                        &self.label,
9179                    ),
9180                ),
9181                encoder,
9182                offset,
9183                _depth,
9184            )
9185        }
9186    }
9187    unsafe impl<
9188        D: fidl::encoding::ResourceDialect,
9189        T0: fidl::encoding::Encode<u32, D>,
9190        T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9191    > fidl::encoding::Encode<SetLabelCmd, D> for (T0, T1)
9192    {
9193        #[inline]
9194        unsafe fn encode(
9195            self,
9196            encoder: &mut fidl::encoding::Encoder<'_, D>,
9197            offset: usize,
9198            depth: fidl::encoding::Depth,
9199        ) -> fidl::Result<()> {
9200            encoder.debug_check_bounds::<SetLabelCmd>(offset);
9201            // Zero out padding regions. There's no need to apply masks
9202            // because the unmasked parts will be overwritten by fields.
9203            unsafe {
9204                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9205                (ptr as *mut u64).write_unaligned(0);
9206            }
9207            // Write the fields.
9208            self.0.encode(encoder, offset + 0, depth)?;
9209            self.1.encode(encoder, offset + 8, depth)?;
9210            Ok(())
9211        }
9212    }
9213
9214    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLabelCmd {
9215        #[inline(always)]
9216        fn new_empty() -> Self {
9217            Self {
9218                id: fidl::new_empty!(u32, D),
9219                label: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9220            }
9221        }
9222
9223        #[inline]
9224        unsafe fn decode(
9225            &mut self,
9226            decoder: &mut fidl::encoding::Decoder<'_, D>,
9227            offset: usize,
9228            _depth: fidl::encoding::Depth,
9229        ) -> fidl::Result<()> {
9230            decoder.debug_check_bounds::<Self>(offset);
9231            // Verify that padding bytes are zero.
9232            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9233            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9234            let mask = 0xffffffff00000000u64;
9235            let maskedval = padval & mask;
9236            if maskedval != 0 {
9237                return Err(fidl::Error::NonZeroPadding {
9238                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9239                });
9240            }
9241            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
9242            fidl::decode!(
9243                fidl::encoding::UnboundedString,
9244                D,
9245                &mut self.label,
9246                decoder,
9247                offset + 8,
9248                _depth
9249            )?;
9250            Ok(())
9251        }
9252    }
9253
9254    impl fidl::encoding::ValueTypeMarker for SetLayerStackCmd {
9255        type Borrowed<'a> = &'a Self;
9256        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9257            value
9258        }
9259    }
9260
9261    unsafe impl fidl::encoding::TypeMarker for SetLayerStackCmd {
9262        type Owned = Self;
9263
9264        #[inline(always)]
9265        fn inline_align(_context: fidl::encoding::Context) -> usize {
9266            4
9267        }
9268
9269        #[inline(always)]
9270        fn inline_size(_context: fidl::encoding::Context) -> usize {
9271            8
9272        }
9273        #[inline(always)]
9274        fn encode_is_copy() -> bool {
9275            true
9276        }
9277
9278        #[inline(always)]
9279        fn decode_is_copy() -> bool {
9280            true
9281        }
9282    }
9283
9284    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLayerStackCmd, D>
9285        for &SetLayerStackCmd
9286    {
9287        #[inline]
9288        unsafe fn encode(
9289            self,
9290            encoder: &mut fidl::encoding::Encoder<'_, D>,
9291            offset: usize,
9292            _depth: fidl::encoding::Depth,
9293        ) -> fidl::Result<()> {
9294            encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9295            unsafe {
9296                // Copy the object into the buffer.
9297                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9298                (buf_ptr as *mut SetLayerStackCmd)
9299                    .write_unaligned((self as *const SetLayerStackCmd).read());
9300                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9301                // done second because the memcpy will write garbage to these bytes.
9302            }
9303            Ok(())
9304        }
9305    }
9306    unsafe impl<
9307        D: fidl::encoding::ResourceDialect,
9308        T0: fidl::encoding::Encode<u32, D>,
9309        T1: fidl::encoding::Encode<u32, D>,
9310    > fidl::encoding::Encode<SetLayerStackCmd, D> for (T0, T1)
9311    {
9312        #[inline]
9313        unsafe fn encode(
9314            self,
9315            encoder: &mut fidl::encoding::Encoder<'_, D>,
9316            offset: usize,
9317            depth: fidl::encoding::Depth,
9318        ) -> fidl::Result<()> {
9319            encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9320            // Zero out padding regions. There's no need to apply masks
9321            // because the unmasked parts will be overwritten by fields.
9322            // Write the fields.
9323            self.0.encode(encoder, offset + 0, depth)?;
9324            self.1.encode(encoder, offset + 4, depth)?;
9325            Ok(())
9326        }
9327    }
9328
9329    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLayerStackCmd {
9330        #[inline(always)]
9331        fn new_empty() -> Self {
9332            Self {
9333                compositor_id: fidl::new_empty!(u32, D),
9334                layer_stack_id: fidl::new_empty!(u32, D),
9335            }
9336        }
9337
9338        #[inline]
9339        unsafe fn decode(
9340            &mut self,
9341            decoder: &mut fidl::encoding::Decoder<'_, D>,
9342            offset: usize,
9343            _depth: fidl::encoding::Depth,
9344        ) -> fidl::Result<()> {
9345            decoder.debug_check_bounds::<Self>(offset);
9346            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9347            // Verify that padding bytes are zero.
9348            // Copy from the buffer into the object.
9349            unsafe {
9350                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9351            }
9352            Ok(())
9353        }
9354    }
9355
9356    impl fidl::encoding::ValueTypeMarker for SetLightColorCmd {
9357        type Borrowed<'a> = &'a Self;
9358        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9359            value
9360        }
9361    }
9362
9363    unsafe impl fidl::encoding::TypeMarker for SetLightColorCmd {
9364        type Owned = Self;
9365
9366        #[inline(always)]
9367        fn inline_align(_context: fidl::encoding::Context) -> usize {
9368            4
9369        }
9370
9371        #[inline(always)]
9372        fn inline_size(_context: fidl::encoding::Context) -> usize {
9373            20
9374        }
9375    }
9376
9377    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightColorCmd, D>
9378        for &SetLightColorCmd
9379    {
9380        #[inline]
9381        unsafe fn encode(
9382            self,
9383            encoder: &mut fidl::encoding::Encoder<'_, D>,
9384            offset: usize,
9385            _depth: fidl::encoding::Depth,
9386        ) -> fidl::Result<()> {
9387            encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9388            // Delegate to tuple encoding.
9389            fidl::encoding::Encode::<SetLightColorCmd, D>::encode(
9390                (
9391                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9392                    <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
9393                ),
9394                encoder,
9395                offset,
9396                _depth,
9397            )
9398        }
9399    }
9400    unsafe impl<
9401        D: fidl::encoding::ResourceDialect,
9402        T0: fidl::encoding::Encode<u32, D>,
9403        T1: fidl::encoding::Encode<ColorRgbValue, D>,
9404    > fidl::encoding::Encode<SetLightColorCmd, D> for (T0, T1)
9405    {
9406        #[inline]
9407        unsafe fn encode(
9408            self,
9409            encoder: &mut fidl::encoding::Encoder<'_, D>,
9410            offset: usize,
9411            depth: fidl::encoding::Depth,
9412        ) -> fidl::Result<()> {
9413            encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9414            // Zero out padding regions. There's no need to apply masks
9415            // because the unmasked parts will be overwritten by fields.
9416            // Write the fields.
9417            self.0.encode(encoder, offset + 0, depth)?;
9418            self.1.encode(encoder, offset + 4, depth)?;
9419            Ok(())
9420        }
9421    }
9422
9423    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightColorCmd {
9424        #[inline(always)]
9425        fn new_empty() -> Self {
9426            Self { light_id: fidl::new_empty!(u32, D), color: fidl::new_empty!(ColorRgbValue, D) }
9427        }
9428
9429        #[inline]
9430        unsafe fn decode(
9431            &mut self,
9432            decoder: &mut fidl::encoding::Decoder<'_, D>,
9433            offset: usize,
9434            _depth: fidl::encoding::Depth,
9435        ) -> fidl::Result<()> {
9436            decoder.debug_check_bounds::<Self>(offset);
9437            // Verify that padding bytes are zero.
9438            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9439            fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
9440            Ok(())
9441        }
9442    }
9443
9444    impl fidl::encoding::ValueTypeMarker for SetLightDirectionCmd {
9445        type Borrowed<'a> = &'a Self;
9446        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9447            value
9448        }
9449    }
9450
9451    unsafe impl fidl::encoding::TypeMarker for SetLightDirectionCmd {
9452        type Owned = Self;
9453
9454        #[inline(always)]
9455        fn inline_align(_context: fidl::encoding::Context) -> usize {
9456            4
9457        }
9458
9459        #[inline(always)]
9460        fn inline_size(_context: fidl::encoding::Context) -> usize {
9461            20
9462        }
9463    }
9464
9465    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightDirectionCmd, D>
9466        for &SetLightDirectionCmd
9467    {
9468        #[inline]
9469        unsafe fn encode(
9470            self,
9471            encoder: &mut fidl::encoding::Encoder<'_, D>,
9472            offset: usize,
9473            _depth: fidl::encoding::Depth,
9474        ) -> fidl::Result<()> {
9475            encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9476            // Delegate to tuple encoding.
9477            fidl::encoding::Encode::<SetLightDirectionCmd, D>::encode(
9478                (
9479                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9480                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.direction),
9481                ),
9482                encoder,
9483                offset,
9484                _depth,
9485            )
9486        }
9487    }
9488    unsafe impl<
9489        D: fidl::encoding::ResourceDialect,
9490        T0: fidl::encoding::Encode<u32, D>,
9491        T1: fidl::encoding::Encode<Vector3Value, D>,
9492    > fidl::encoding::Encode<SetLightDirectionCmd, D> for (T0, T1)
9493    {
9494        #[inline]
9495        unsafe fn encode(
9496            self,
9497            encoder: &mut fidl::encoding::Encoder<'_, D>,
9498            offset: usize,
9499            depth: fidl::encoding::Depth,
9500        ) -> fidl::Result<()> {
9501            encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9502            // Zero out padding regions. There's no need to apply masks
9503            // because the unmasked parts will be overwritten by fields.
9504            // Write the fields.
9505            self.0.encode(encoder, offset + 0, depth)?;
9506            self.1.encode(encoder, offset + 4, depth)?;
9507            Ok(())
9508        }
9509    }
9510
9511    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightDirectionCmd {
9512        #[inline(always)]
9513        fn new_empty() -> Self {
9514            Self {
9515                light_id: fidl::new_empty!(u32, D),
9516                direction: fidl::new_empty!(Vector3Value, D),
9517            }
9518        }
9519
9520        #[inline]
9521        unsafe fn decode(
9522            &mut self,
9523            decoder: &mut fidl::encoding::Decoder<'_, D>,
9524            offset: usize,
9525            _depth: fidl::encoding::Depth,
9526        ) -> fidl::Result<()> {
9527            decoder.debug_check_bounds::<Self>(offset);
9528            // Verify that padding bytes are zero.
9529            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9530            fidl::decode!(Vector3Value, D, &mut self.direction, decoder, offset + 4, _depth)?;
9531            Ok(())
9532        }
9533    }
9534
9535    impl fidl::encoding::ValueTypeMarker for SetMaterialCmd {
9536        type Borrowed<'a> = &'a Self;
9537        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9538            value
9539        }
9540    }
9541
9542    unsafe impl fidl::encoding::TypeMarker for SetMaterialCmd {
9543        type Owned = Self;
9544
9545        #[inline(always)]
9546        fn inline_align(_context: fidl::encoding::Context) -> usize {
9547            4
9548        }
9549
9550        #[inline(always)]
9551        fn inline_size(_context: fidl::encoding::Context) -> usize {
9552            8
9553        }
9554        #[inline(always)]
9555        fn encode_is_copy() -> bool {
9556            true
9557        }
9558
9559        #[inline(always)]
9560        fn decode_is_copy() -> bool {
9561            true
9562        }
9563    }
9564
9565    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetMaterialCmd, D>
9566        for &SetMaterialCmd
9567    {
9568        #[inline]
9569        unsafe fn encode(
9570            self,
9571            encoder: &mut fidl::encoding::Encoder<'_, D>,
9572            offset: usize,
9573            _depth: fidl::encoding::Depth,
9574        ) -> fidl::Result<()> {
9575            encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9576            unsafe {
9577                // Copy the object into the buffer.
9578                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9579                (buf_ptr as *mut SetMaterialCmd)
9580                    .write_unaligned((self as *const SetMaterialCmd).read());
9581                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9582                // done second because the memcpy will write garbage to these bytes.
9583            }
9584            Ok(())
9585        }
9586    }
9587    unsafe impl<
9588        D: fidl::encoding::ResourceDialect,
9589        T0: fidl::encoding::Encode<u32, D>,
9590        T1: fidl::encoding::Encode<u32, D>,
9591    > fidl::encoding::Encode<SetMaterialCmd, D> for (T0, T1)
9592    {
9593        #[inline]
9594        unsafe fn encode(
9595            self,
9596            encoder: &mut fidl::encoding::Encoder<'_, D>,
9597            offset: usize,
9598            depth: fidl::encoding::Depth,
9599        ) -> fidl::Result<()> {
9600            encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9601            // Zero out padding regions. There's no need to apply masks
9602            // because the unmasked parts will be overwritten by fields.
9603            // Write the fields.
9604            self.0.encode(encoder, offset + 0, depth)?;
9605            self.1.encode(encoder, offset + 4, depth)?;
9606            Ok(())
9607        }
9608    }
9609
9610    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetMaterialCmd {
9611        #[inline(always)]
9612        fn new_empty() -> Self {
9613            Self { node_id: fidl::new_empty!(u32, D), material_id: fidl::new_empty!(u32, D) }
9614        }
9615
9616        #[inline]
9617        unsafe fn decode(
9618            &mut self,
9619            decoder: &mut fidl::encoding::Decoder<'_, D>,
9620            offset: usize,
9621            _depth: fidl::encoding::Depth,
9622        ) -> fidl::Result<()> {
9623            decoder.debug_check_bounds::<Self>(offset);
9624            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9625            // Verify that padding bytes are zero.
9626            // Copy from the buffer into the object.
9627            unsafe {
9628                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9629            }
9630            Ok(())
9631        }
9632    }
9633
9634    impl fidl::encoding::ValueTypeMarker for SetOpacityCmd {
9635        type Borrowed<'a> = &'a Self;
9636        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9637            value
9638        }
9639    }
9640
9641    unsafe impl fidl::encoding::TypeMarker for SetOpacityCmd {
9642        type Owned = Self;
9643
9644        #[inline(always)]
9645        fn inline_align(_context: fidl::encoding::Context) -> usize {
9646            4
9647        }
9648
9649        #[inline(always)]
9650        fn inline_size(_context: fidl::encoding::Context) -> usize {
9651            8
9652        }
9653    }
9654
9655    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetOpacityCmd, D>
9656        for &SetOpacityCmd
9657    {
9658        #[inline]
9659        unsafe fn encode(
9660            self,
9661            encoder: &mut fidl::encoding::Encoder<'_, D>,
9662            offset: usize,
9663            _depth: fidl::encoding::Depth,
9664        ) -> fidl::Result<()> {
9665            encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9666            // Delegate to tuple encoding.
9667            fidl::encoding::Encode::<SetOpacityCmd, D>::encode(
9668                (
9669                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9670                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.opacity),
9671                ),
9672                encoder,
9673                offset,
9674                _depth,
9675            )
9676        }
9677    }
9678    unsafe impl<
9679        D: fidl::encoding::ResourceDialect,
9680        T0: fidl::encoding::Encode<u32, D>,
9681        T1: fidl::encoding::Encode<f32, D>,
9682    > fidl::encoding::Encode<SetOpacityCmd, D> for (T0, T1)
9683    {
9684        #[inline]
9685        unsafe fn encode(
9686            self,
9687            encoder: &mut fidl::encoding::Encoder<'_, D>,
9688            offset: usize,
9689            depth: fidl::encoding::Depth,
9690        ) -> fidl::Result<()> {
9691            encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9692            // Zero out padding regions. There's no need to apply masks
9693            // because the unmasked parts will be overwritten by fields.
9694            // Write the fields.
9695            self.0.encode(encoder, offset + 0, depth)?;
9696            self.1.encode(encoder, offset + 4, depth)?;
9697            Ok(())
9698        }
9699    }
9700
9701    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetOpacityCmd {
9702        #[inline(always)]
9703        fn new_empty() -> Self {
9704            Self { node_id: fidl::new_empty!(u32, D), opacity: fidl::new_empty!(f32, D) }
9705        }
9706
9707        #[inline]
9708        unsafe fn decode(
9709            &mut self,
9710            decoder: &mut fidl::encoding::Decoder<'_, D>,
9711            offset: usize,
9712            _depth: fidl::encoding::Depth,
9713        ) -> fidl::Result<()> {
9714            decoder.debug_check_bounds::<Self>(offset);
9715            // Verify that padding bytes are zero.
9716            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9717            fidl::decode!(f32, D, &mut self.opacity, decoder, offset + 4, _depth)?;
9718            Ok(())
9719        }
9720    }
9721
9722    impl fidl::encoding::ValueTypeMarker for SetPointLightFalloffCmd {
9723        type Borrowed<'a> = &'a Self;
9724        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9725            value
9726        }
9727    }
9728
9729    unsafe impl fidl::encoding::TypeMarker for SetPointLightFalloffCmd {
9730        type Owned = Self;
9731
9732        #[inline(always)]
9733        fn inline_align(_context: fidl::encoding::Context) -> usize {
9734            4
9735        }
9736
9737        #[inline(always)]
9738        fn inline_size(_context: fidl::encoding::Context) -> usize {
9739            12
9740        }
9741    }
9742
9743    unsafe impl<D: fidl::encoding::ResourceDialect>
9744        fidl::encoding::Encode<SetPointLightFalloffCmd, D> for &SetPointLightFalloffCmd
9745    {
9746        #[inline]
9747        unsafe fn encode(
9748            self,
9749            encoder: &mut fidl::encoding::Encoder<'_, D>,
9750            offset: usize,
9751            _depth: fidl::encoding::Depth,
9752        ) -> fidl::Result<()> {
9753            encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9754            // Delegate to tuple encoding.
9755            fidl::encoding::Encode::<SetPointLightFalloffCmd, D>::encode(
9756                (
9757                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9758                    <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.falloff),
9759                ),
9760                encoder,
9761                offset,
9762                _depth,
9763            )
9764        }
9765    }
9766    unsafe impl<
9767        D: fidl::encoding::ResourceDialect,
9768        T0: fidl::encoding::Encode<u32, D>,
9769        T1: fidl::encoding::Encode<FloatValue, D>,
9770    > fidl::encoding::Encode<SetPointLightFalloffCmd, D> for (T0, T1)
9771    {
9772        #[inline]
9773        unsafe fn encode(
9774            self,
9775            encoder: &mut fidl::encoding::Encoder<'_, D>,
9776            offset: usize,
9777            depth: fidl::encoding::Depth,
9778        ) -> fidl::Result<()> {
9779            encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9780            // Zero out padding regions. There's no need to apply masks
9781            // because the unmasked parts will be overwritten by fields.
9782            // Write the fields.
9783            self.0.encode(encoder, offset + 0, depth)?;
9784            self.1.encode(encoder, offset + 4, depth)?;
9785            Ok(())
9786        }
9787    }
9788
9789    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9790        for SetPointLightFalloffCmd
9791    {
9792        #[inline(always)]
9793        fn new_empty() -> Self {
9794            Self { light_id: fidl::new_empty!(u32, D), falloff: fidl::new_empty!(FloatValue, D) }
9795        }
9796
9797        #[inline]
9798        unsafe fn decode(
9799            &mut self,
9800            decoder: &mut fidl::encoding::Decoder<'_, D>,
9801            offset: usize,
9802            _depth: fidl::encoding::Depth,
9803        ) -> fidl::Result<()> {
9804            decoder.debug_check_bounds::<Self>(offset);
9805            // Verify that padding bytes are zero.
9806            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9807            fidl::decode!(FloatValue, D, &mut self.falloff, decoder, offset + 4, _depth)?;
9808            Ok(())
9809        }
9810    }
9811
9812    impl fidl::encoding::ValueTypeMarker for SetPointLightPositionCmd {
9813        type Borrowed<'a> = &'a Self;
9814        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9815            value
9816        }
9817    }
9818
9819    unsafe impl fidl::encoding::TypeMarker for SetPointLightPositionCmd {
9820        type Owned = Self;
9821
9822        #[inline(always)]
9823        fn inline_align(_context: fidl::encoding::Context) -> usize {
9824            4
9825        }
9826
9827        #[inline(always)]
9828        fn inline_size(_context: fidl::encoding::Context) -> usize {
9829            20
9830        }
9831    }
9832
9833    unsafe impl<D: fidl::encoding::ResourceDialect>
9834        fidl::encoding::Encode<SetPointLightPositionCmd, D> for &SetPointLightPositionCmd
9835    {
9836        #[inline]
9837        unsafe fn encode(
9838            self,
9839            encoder: &mut fidl::encoding::Encoder<'_, D>,
9840            offset: usize,
9841            _depth: fidl::encoding::Depth,
9842        ) -> fidl::Result<()> {
9843            encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9844            // Delegate to tuple encoding.
9845            fidl::encoding::Encode::<SetPointLightPositionCmd, D>::encode(
9846                (
9847                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9848                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.position),
9849                ),
9850                encoder,
9851                offset,
9852                _depth,
9853            )
9854        }
9855    }
9856    unsafe impl<
9857        D: fidl::encoding::ResourceDialect,
9858        T0: fidl::encoding::Encode<u32, D>,
9859        T1: fidl::encoding::Encode<Vector3Value, D>,
9860    > fidl::encoding::Encode<SetPointLightPositionCmd, D> for (T0, T1)
9861    {
9862        #[inline]
9863        unsafe fn encode(
9864            self,
9865            encoder: &mut fidl::encoding::Encoder<'_, D>,
9866            offset: usize,
9867            depth: fidl::encoding::Depth,
9868        ) -> fidl::Result<()> {
9869            encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9870            // Zero out padding regions. There's no need to apply masks
9871            // because the unmasked parts will be overwritten by fields.
9872            // Write the fields.
9873            self.0.encode(encoder, offset + 0, depth)?;
9874            self.1.encode(encoder, offset + 4, depth)?;
9875            Ok(())
9876        }
9877    }
9878
9879    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9880        for SetPointLightPositionCmd
9881    {
9882        #[inline(always)]
9883        fn new_empty() -> Self {
9884            Self { light_id: fidl::new_empty!(u32, D), position: fidl::new_empty!(Vector3Value, D) }
9885        }
9886
9887        #[inline]
9888        unsafe fn decode(
9889            &mut self,
9890            decoder: &mut fidl::encoding::Decoder<'_, D>,
9891            offset: usize,
9892            _depth: fidl::encoding::Depth,
9893        ) -> fidl::Result<()> {
9894            decoder.debug_check_bounds::<Self>(offset);
9895            // Verify that padding bytes are zero.
9896            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9897            fidl::decode!(Vector3Value, D, &mut self.position, decoder, offset + 4, _depth)?;
9898            Ok(())
9899        }
9900    }
9901
9902    impl fidl::encoding::ValueTypeMarker for SetRendererCmd {
9903        type Borrowed<'a> = &'a Self;
9904        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9905            value
9906        }
9907    }
9908
9909    unsafe impl fidl::encoding::TypeMarker for SetRendererCmd {
9910        type Owned = Self;
9911
9912        #[inline(always)]
9913        fn inline_align(_context: fidl::encoding::Context) -> usize {
9914            4
9915        }
9916
9917        #[inline(always)]
9918        fn inline_size(_context: fidl::encoding::Context) -> usize {
9919            8
9920        }
9921        #[inline(always)]
9922        fn encode_is_copy() -> bool {
9923            true
9924        }
9925
9926        #[inline(always)]
9927        fn decode_is_copy() -> bool {
9928            true
9929        }
9930    }
9931
9932    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererCmd, D>
9933        for &SetRendererCmd
9934    {
9935        #[inline]
9936        unsafe fn encode(
9937            self,
9938            encoder: &mut fidl::encoding::Encoder<'_, D>,
9939            offset: usize,
9940            _depth: fidl::encoding::Depth,
9941        ) -> fidl::Result<()> {
9942            encoder.debug_check_bounds::<SetRendererCmd>(offset);
9943            unsafe {
9944                // Copy the object into the buffer.
9945                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9946                (buf_ptr as *mut SetRendererCmd)
9947                    .write_unaligned((self as *const SetRendererCmd).read());
9948                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9949                // done second because the memcpy will write garbage to these bytes.
9950            }
9951            Ok(())
9952        }
9953    }
9954    unsafe impl<
9955        D: fidl::encoding::ResourceDialect,
9956        T0: fidl::encoding::Encode<u32, D>,
9957        T1: fidl::encoding::Encode<u32, D>,
9958    > fidl::encoding::Encode<SetRendererCmd, D> for (T0, T1)
9959    {
9960        #[inline]
9961        unsafe fn encode(
9962            self,
9963            encoder: &mut fidl::encoding::Encoder<'_, D>,
9964            offset: usize,
9965            depth: fidl::encoding::Depth,
9966        ) -> fidl::Result<()> {
9967            encoder.debug_check_bounds::<SetRendererCmd>(offset);
9968            // Zero out padding regions. There's no need to apply masks
9969            // because the unmasked parts will be overwritten by fields.
9970            // Write the fields.
9971            self.0.encode(encoder, offset + 0, depth)?;
9972            self.1.encode(encoder, offset + 4, depth)?;
9973            Ok(())
9974        }
9975    }
9976
9977    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererCmd {
9978        #[inline(always)]
9979        fn new_empty() -> Self {
9980            Self { layer_id: fidl::new_empty!(u32, D), renderer_id: fidl::new_empty!(u32, D) }
9981        }
9982
9983        #[inline]
9984        unsafe fn decode(
9985            &mut self,
9986            decoder: &mut fidl::encoding::Decoder<'_, D>,
9987            offset: usize,
9988            _depth: fidl::encoding::Depth,
9989        ) -> fidl::Result<()> {
9990            decoder.debug_check_bounds::<Self>(offset);
9991            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9992            // Verify that padding bytes are zero.
9993            // Copy from the buffer into the object.
9994            unsafe {
9995                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9996            }
9997            Ok(())
9998        }
9999    }
10000
10001    impl fidl::encoding::ValueTypeMarker for SetRendererParamCmd {
10002        type Borrowed<'a> = &'a Self;
10003        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10004            value
10005        }
10006    }
10007
10008    unsafe impl fidl::encoding::TypeMarker for SetRendererParamCmd {
10009        type Owned = Self;
10010
10011        #[inline(always)]
10012        fn inline_align(_context: fidl::encoding::Context) -> usize {
10013            8
10014        }
10015
10016        #[inline(always)]
10017        fn inline_size(_context: fidl::encoding::Context) -> usize {
10018            24
10019        }
10020    }
10021
10022    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererParamCmd, D>
10023        for &SetRendererParamCmd
10024    {
10025        #[inline]
10026        unsafe fn encode(
10027            self,
10028            encoder: &mut fidl::encoding::Encoder<'_, D>,
10029            offset: usize,
10030            _depth: fidl::encoding::Depth,
10031        ) -> fidl::Result<()> {
10032            encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10033            // Delegate to tuple encoding.
10034            fidl::encoding::Encode::<SetRendererParamCmd, D>::encode(
10035                (
10036                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
10037                    <RendererParam as fidl::encoding::ValueTypeMarker>::borrow(&self.param),
10038                ),
10039                encoder,
10040                offset,
10041                _depth,
10042            )
10043        }
10044    }
10045    unsafe impl<
10046        D: fidl::encoding::ResourceDialect,
10047        T0: fidl::encoding::Encode<u32, D>,
10048        T1: fidl::encoding::Encode<RendererParam, D>,
10049    > fidl::encoding::Encode<SetRendererParamCmd, D> for (T0, T1)
10050    {
10051        #[inline]
10052        unsafe fn encode(
10053            self,
10054            encoder: &mut fidl::encoding::Encoder<'_, D>,
10055            offset: usize,
10056            depth: fidl::encoding::Depth,
10057        ) -> fidl::Result<()> {
10058            encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10059            // Zero out padding regions. There's no need to apply masks
10060            // because the unmasked parts will be overwritten by fields.
10061            unsafe {
10062                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10063                (ptr as *mut u64).write_unaligned(0);
10064            }
10065            // Write the fields.
10066            self.0.encode(encoder, offset + 0, depth)?;
10067            self.1.encode(encoder, offset + 8, depth)?;
10068            Ok(())
10069        }
10070    }
10071
10072    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererParamCmd {
10073        #[inline(always)]
10074        fn new_empty() -> Self {
10075            Self {
10076                renderer_id: fidl::new_empty!(u32, D),
10077                param: fidl::new_empty!(RendererParam, D),
10078            }
10079        }
10080
10081        #[inline]
10082        unsafe fn decode(
10083            &mut self,
10084            decoder: &mut fidl::encoding::Decoder<'_, D>,
10085            offset: usize,
10086            _depth: fidl::encoding::Depth,
10087        ) -> fidl::Result<()> {
10088            decoder.debug_check_bounds::<Self>(offset);
10089            // Verify that padding bytes are zero.
10090            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10091            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10092            let mask = 0xffffffff00000000u64;
10093            let maskedval = padval & mask;
10094            if maskedval != 0 {
10095                return Err(fidl::Error::NonZeroPadding {
10096                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10097                });
10098            }
10099            fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
10100            fidl::decode!(RendererParam, D, &mut self.param, decoder, offset + 8, _depth)?;
10101            Ok(())
10102        }
10103    }
10104
10105    impl fidl::encoding::ValueTypeMarker for SetRotationCmd {
10106        type Borrowed<'a> = &'a Self;
10107        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10108            value
10109        }
10110    }
10111
10112    unsafe impl fidl::encoding::TypeMarker for SetRotationCmd {
10113        type Owned = Self;
10114
10115        #[inline(always)]
10116        fn inline_align(_context: fidl::encoding::Context) -> usize {
10117            4
10118        }
10119
10120        #[inline(always)]
10121        fn inline_size(_context: fidl::encoding::Context) -> usize {
10122            24
10123        }
10124    }
10125
10126    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRotationCmd, D>
10127        for &SetRotationCmd
10128    {
10129        #[inline]
10130        unsafe fn encode(
10131            self,
10132            encoder: &mut fidl::encoding::Encoder<'_, D>,
10133            offset: usize,
10134            _depth: fidl::encoding::Depth,
10135        ) -> fidl::Result<()> {
10136            encoder.debug_check_bounds::<SetRotationCmd>(offset);
10137            // Delegate to tuple encoding.
10138            fidl::encoding::Encode::<SetRotationCmd, D>::encode(
10139                (
10140                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10141                    <QuaternionValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10142                ),
10143                encoder,
10144                offset,
10145                _depth,
10146            )
10147        }
10148    }
10149    unsafe impl<
10150        D: fidl::encoding::ResourceDialect,
10151        T0: fidl::encoding::Encode<u32, D>,
10152        T1: fidl::encoding::Encode<QuaternionValue, D>,
10153    > fidl::encoding::Encode<SetRotationCmd, D> for (T0, T1)
10154    {
10155        #[inline]
10156        unsafe fn encode(
10157            self,
10158            encoder: &mut fidl::encoding::Encoder<'_, D>,
10159            offset: usize,
10160            depth: fidl::encoding::Depth,
10161        ) -> fidl::Result<()> {
10162            encoder.debug_check_bounds::<SetRotationCmd>(offset);
10163            // Zero out padding regions. There's no need to apply masks
10164            // because the unmasked parts will be overwritten by fields.
10165            // Write the fields.
10166            self.0.encode(encoder, offset + 0, depth)?;
10167            self.1.encode(encoder, offset + 4, depth)?;
10168            Ok(())
10169        }
10170    }
10171
10172    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRotationCmd {
10173        #[inline(always)]
10174        fn new_empty() -> Self {
10175            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(QuaternionValue, D) }
10176        }
10177
10178        #[inline]
10179        unsafe fn decode(
10180            &mut self,
10181            decoder: &mut fidl::encoding::Decoder<'_, D>,
10182            offset: usize,
10183            _depth: fidl::encoding::Depth,
10184        ) -> fidl::Result<()> {
10185            decoder.debug_check_bounds::<Self>(offset);
10186            // Verify that padding bytes are zero.
10187            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10188            fidl::decode!(QuaternionValue, D, &mut self.value, decoder, offset + 4, _depth)?;
10189            Ok(())
10190        }
10191    }
10192
10193    impl fidl::encoding::ValueTypeMarker for SetScaleCmd {
10194        type Borrowed<'a> = &'a Self;
10195        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10196            value
10197        }
10198    }
10199
10200    unsafe impl fidl::encoding::TypeMarker for SetScaleCmd {
10201        type Owned = Self;
10202
10203        #[inline(always)]
10204        fn inline_align(_context: fidl::encoding::Context) -> usize {
10205            4
10206        }
10207
10208        #[inline(always)]
10209        fn inline_size(_context: fidl::encoding::Context) -> usize {
10210            20
10211        }
10212    }
10213
10214    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetScaleCmd, D>
10215        for &SetScaleCmd
10216    {
10217        #[inline]
10218        unsafe fn encode(
10219            self,
10220            encoder: &mut fidl::encoding::Encoder<'_, D>,
10221            offset: usize,
10222            _depth: fidl::encoding::Depth,
10223        ) -> fidl::Result<()> {
10224            encoder.debug_check_bounds::<SetScaleCmd>(offset);
10225            // Delegate to tuple encoding.
10226            fidl::encoding::Encode::<SetScaleCmd, D>::encode(
10227                (
10228                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10229                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10230                ),
10231                encoder,
10232                offset,
10233                _depth,
10234            )
10235        }
10236    }
10237    unsafe impl<
10238        D: fidl::encoding::ResourceDialect,
10239        T0: fidl::encoding::Encode<u32, D>,
10240        T1: fidl::encoding::Encode<Vector3Value, D>,
10241    > fidl::encoding::Encode<SetScaleCmd, D> for (T0, T1)
10242    {
10243        #[inline]
10244        unsafe fn encode(
10245            self,
10246            encoder: &mut fidl::encoding::Encoder<'_, D>,
10247            offset: usize,
10248            depth: fidl::encoding::Depth,
10249        ) -> fidl::Result<()> {
10250            encoder.debug_check_bounds::<SetScaleCmd>(offset);
10251            // Zero out padding regions. There's no need to apply masks
10252            // because the unmasked parts will be overwritten by fields.
10253            // Write the fields.
10254            self.0.encode(encoder, offset + 0, depth)?;
10255            self.1.encode(encoder, offset + 4, depth)?;
10256            Ok(())
10257        }
10258    }
10259
10260    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetScaleCmd {
10261        #[inline(always)]
10262        fn new_empty() -> Self {
10263            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
10264        }
10265
10266        #[inline]
10267        unsafe fn decode(
10268            &mut self,
10269            decoder: &mut fidl::encoding::Decoder<'_, D>,
10270            offset: usize,
10271            _depth: fidl::encoding::Depth,
10272        ) -> fidl::Result<()> {
10273            decoder.debug_check_bounds::<Self>(offset);
10274            // Verify that padding bytes are zero.
10275            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10276            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10277            Ok(())
10278        }
10279    }
10280
10281    impl fidl::encoding::ValueTypeMarker for SetSemanticVisibilityCmd {
10282        type Borrowed<'a> = &'a Self;
10283        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10284            value
10285        }
10286    }
10287
10288    unsafe impl fidl::encoding::TypeMarker for SetSemanticVisibilityCmd {
10289        type Owned = Self;
10290
10291        #[inline(always)]
10292        fn inline_align(_context: fidl::encoding::Context) -> usize {
10293            4
10294        }
10295
10296        #[inline(always)]
10297        fn inline_size(_context: fidl::encoding::Context) -> usize {
10298            8
10299        }
10300    }
10301
10302    unsafe impl<D: fidl::encoding::ResourceDialect>
10303        fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for &SetSemanticVisibilityCmd
10304    {
10305        #[inline]
10306        unsafe fn encode(
10307            self,
10308            encoder: &mut fidl::encoding::Encoder<'_, D>,
10309            offset: usize,
10310            _depth: fidl::encoding::Depth,
10311        ) -> fidl::Result<()> {
10312            encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10313            // Delegate to tuple encoding.
10314            fidl::encoding::Encode::<SetSemanticVisibilityCmd, D>::encode(
10315                (
10316                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
10317                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.visible),
10318                ),
10319                encoder,
10320                offset,
10321                _depth,
10322            )
10323        }
10324    }
10325    unsafe impl<
10326        D: fidl::encoding::ResourceDialect,
10327        T0: fidl::encoding::Encode<u32, D>,
10328        T1: fidl::encoding::Encode<bool, D>,
10329    > fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for (T0, T1)
10330    {
10331        #[inline]
10332        unsafe fn encode(
10333            self,
10334            encoder: &mut fidl::encoding::Encoder<'_, D>,
10335            offset: usize,
10336            depth: fidl::encoding::Depth,
10337        ) -> fidl::Result<()> {
10338            encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10339            // Zero out padding regions. There's no need to apply masks
10340            // because the unmasked parts will be overwritten by fields.
10341            unsafe {
10342                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
10343                (ptr as *mut u32).write_unaligned(0);
10344            }
10345            // Write the fields.
10346            self.0.encode(encoder, offset + 0, depth)?;
10347            self.1.encode(encoder, offset + 4, depth)?;
10348            Ok(())
10349        }
10350    }
10351
10352    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10353        for SetSemanticVisibilityCmd
10354    {
10355        #[inline(always)]
10356        fn new_empty() -> Self {
10357            Self { node_id: fidl::new_empty!(u32, D), visible: fidl::new_empty!(bool, D) }
10358        }
10359
10360        #[inline]
10361        unsafe fn decode(
10362            &mut self,
10363            decoder: &mut fidl::encoding::Decoder<'_, D>,
10364            offset: usize,
10365            _depth: fidl::encoding::Depth,
10366        ) -> fidl::Result<()> {
10367            decoder.debug_check_bounds::<Self>(offset);
10368            // Verify that padding bytes are zero.
10369            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
10370            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10371            let mask = 0xffffff00u32;
10372            let maskedval = padval & mask;
10373            if maskedval != 0 {
10374                return Err(fidl::Error::NonZeroPadding {
10375                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
10376                });
10377            }
10378            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
10379            fidl::decode!(bool, D, &mut self.visible, decoder, offset + 4, _depth)?;
10380            Ok(())
10381        }
10382    }
10383
10384    impl fidl::encoding::ValueTypeMarker for SetShapeCmd {
10385        type Borrowed<'a> = &'a Self;
10386        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10387            value
10388        }
10389    }
10390
10391    unsafe impl fidl::encoding::TypeMarker for SetShapeCmd {
10392        type Owned = Self;
10393
10394        #[inline(always)]
10395        fn inline_align(_context: fidl::encoding::Context) -> usize {
10396            4
10397        }
10398
10399        #[inline(always)]
10400        fn inline_size(_context: fidl::encoding::Context) -> usize {
10401            8
10402        }
10403        #[inline(always)]
10404        fn encode_is_copy() -> bool {
10405            true
10406        }
10407
10408        #[inline(always)]
10409        fn decode_is_copy() -> bool {
10410            true
10411        }
10412    }
10413
10414    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetShapeCmd, D>
10415        for &SetShapeCmd
10416    {
10417        #[inline]
10418        unsafe fn encode(
10419            self,
10420            encoder: &mut fidl::encoding::Encoder<'_, D>,
10421            offset: usize,
10422            _depth: fidl::encoding::Depth,
10423        ) -> fidl::Result<()> {
10424            encoder.debug_check_bounds::<SetShapeCmd>(offset);
10425            unsafe {
10426                // Copy the object into the buffer.
10427                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10428                (buf_ptr as *mut SetShapeCmd).write_unaligned((self as *const SetShapeCmd).read());
10429                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10430                // done second because the memcpy will write garbage to these bytes.
10431            }
10432            Ok(())
10433        }
10434    }
10435    unsafe impl<
10436        D: fidl::encoding::ResourceDialect,
10437        T0: fidl::encoding::Encode<u32, D>,
10438        T1: fidl::encoding::Encode<u32, D>,
10439    > fidl::encoding::Encode<SetShapeCmd, D> for (T0, T1)
10440    {
10441        #[inline]
10442        unsafe fn encode(
10443            self,
10444            encoder: &mut fidl::encoding::Encoder<'_, D>,
10445            offset: usize,
10446            depth: fidl::encoding::Depth,
10447        ) -> fidl::Result<()> {
10448            encoder.debug_check_bounds::<SetShapeCmd>(offset);
10449            // Zero out padding regions. There's no need to apply masks
10450            // because the unmasked parts will be overwritten by fields.
10451            // Write the fields.
10452            self.0.encode(encoder, offset + 0, depth)?;
10453            self.1.encode(encoder, offset + 4, depth)?;
10454            Ok(())
10455        }
10456    }
10457
10458    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetShapeCmd {
10459        #[inline(always)]
10460        fn new_empty() -> Self {
10461            Self { node_id: fidl::new_empty!(u32, D), shape_id: fidl::new_empty!(u32, D) }
10462        }
10463
10464        #[inline]
10465        unsafe fn decode(
10466            &mut self,
10467            decoder: &mut fidl::encoding::Decoder<'_, D>,
10468            offset: usize,
10469            _depth: fidl::encoding::Depth,
10470        ) -> fidl::Result<()> {
10471            decoder.debug_check_bounds::<Self>(offset);
10472            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10473            // Verify that padding bytes are zero.
10474            // Copy from the buffer into the object.
10475            unsafe {
10476                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10477            }
10478            Ok(())
10479        }
10480    }
10481
10482    impl fidl::encoding::ValueTypeMarker for SetSizeCmd {
10483        type Borrowed<'a> = &'a Self;
10484        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10485            value
10486        }
10487    }
10488
10489    unsafe impl fidl::encoding::TypeMarker for SetSizeCmd {
10490        type Owned = Self;
10491
10492        #[inline(always)]
10493        fn inline_align(_context: fidl::encoding::Context) -> usize {
10494            4
10495        }
10496
10497        #[inline(always)]
10498        fn inline_size(_context: fidl::encoding::Context) -> usize {
10499            16
10500        }
10501    }
10502
10503    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetSizeCmd, D>
10504        for &SetSizeCmd
10505    {
10506        #[inline]
10507        unsafe fn encode(
10508            self,
10509            encoder: &mut fidl::encoding::Encoder<'_, D>,
10510            offset: usize,
10511            _depth: fidl::encoding::Depth,
10512        ) -> fidl::Result<()> {
10513            encoder.debug_check_bounds::<SetSizeCmd>(offset);
10514            // Delegate to tuple encoding.
10515            fidl::encoding::Encode::<SetSizeCmd, D>::encode(
10516                (
10517                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10518                    <Vector2Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10519                ),
10520                encoder,
10521                offset,
10522                _depth,
10523            )
10524        }
10525    }
10526    unsafe impl<
10527        D: fidl::encoding::ResourceDialect,
10528        T0: fidl::encoding::Encode<u32, D>,
10529        T1: fidl::encoding::Encode<Vector2Value, D>,
10530    > fidl::encoding::Encode<SetSizeCmd, D> for (T0, T1)
10531    {
10532        #[inline]
10533        unsafe fn encode(
10534            self,
10535            encoder: &mut fidl::encoding::Encoder<'_, D>,
10536            offset: usize,
10537            depth: fidl::encoding::Depth,
10538        ) -> fidl::Result<()> {
10539            encoder.debug_check_bounds::<SetSizeCmd>(offset);
10540            // Zero out padding regions. There's no need to apply masks
10541            // because the unmasked parts will be overwritten by fields.
10542            // Write the fields.
10543            self.0.encode(encoder, offset + 0, depth)?;
10544            self.1.encode(encoder, offset + 4, depth)?;
10545            Ok(())
10546        }
10547    }
10548
10549    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetSizeCmd {
10550        #[inline(always)]
10551        fn new_empty() -> Self {
10552            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector2Value, D) }
10553        }
10554
10555        #[inline]
10556        unsafe fn decode(
10557            &mut self,
10558            decoder: &mut fidl::encoding::Decoder<'_, D>,
10559            offset: usize,
10560            _depth: fidl::encoding::Depth,
10561        ) -> fidl::Result<()> {
10562            decoder.debug_check_bounds::<Self>(offset);
10563            // Verify that padding bytes are zero.
10564            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10565            fidl::decode!(Vector2Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10566            Ok(())
10567        }
10568    }
10569
10570    impl fidl::encoding::ValueTypeMarker for SetStereoCameraProjectionCmd {
10571        type Borrowed<'a> = &'a Self;
10572        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10573            value
10574        }
10575    }
10576
10577    unsafe impl fidl::encoding::TypeMarker for SetStereoCameraProjectionCmd {
10578        type Owned = Self;
10579
10580        #[inline(always)]
10581        fn inline_align(_context: fidl::encoding::Context) -> usize {
10582            4
10583        }
10584
10585        #[inline(always)]
10586        fn inline_size(_context: fidl::encoding::Context) -> usize {
10587            140
10588        }
10589    }
10590
10591    unsafe impl<D: fidl::encoding::ResourceDialect>
10592        fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for &SetStereoCameraProjectionCmd
10593    {
10594        #[inline]
10595        unsafe fn encode(
10596            self,
10597            encoder: &mut fidl::encoding::Encoder<'_, D>,
10598            offset: usize,
10599            _depth: fidl::encoding::Depth,
10600        ) -> fidl::Result<()> {
10601            encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10602            // Delegate to tuple encoding.
10603            fidl::encoding::Encode::<SetStereoCameraProjectionCmd, D>::encode(
10604                (
10605                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
10606                    <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10607                        &self.left_projection,
10608                    ),
10609                    <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10610                        &self.right_projection,
10611                    ),
10612                ),
10613                encoder,
10614                offset,
10615                _depth,
10616            )
10617        }
10618    }
10619    unsafe impl<
10620        D: fidl::encoding::ResourceDialect,
10621        T0: fidl::encoding::Encode<u32, D>,
10622        T1: fidl::encoding::Encode<Matrix4Value, D>,
10623        T2: fidl::encoding::Encode<Matrix4Value, D>,
10624    > fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for (T0, T1, T2)
10625    {
10626        #[inline]
10627        unsafe fn encode(
10628            self,
10629            encoder: &mut fidl::encoding::Encoder<'_, D>,
10630            offset: usize,
10631            depth: fidl::encoding::Depth,
10632        ) -> fidl::Result<()> {
10633            encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10634            // Zero out padding regions. There's no need to apply masks
10635            // because the unmasked parts will be overwritten by fields.
10636            // Write the fields.
10637            self.0.encode(encoder, offset + 0, depth)?;
10638            self.1.encode(encoder, offset + 4, depth)?;
10639            self.2.encode(encoder, offset + 72, depth)?;
10640            Ok(())
10641        }
10642    }
10643
10644    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10645        for SetStereoCameraProjectionCmd
10646    {
10647        #[inline(always)]
10648        fn new_empty() -> Self {
10649            Self {
10650                camera_id: fidl::new_empty!(u32, D),
10651                left_projection: fidl::new_empty!(Matrix4Value, D),
10652                right_projection: fidl::new_empty!(Matrix4Value, D),
10653            }
10654        }
10655
10656        #[inline]
10657        unsafe fn decode(
10658            &mut self,
10659            decoder: &mut fidl::encoding::Decoder<'_, D>,
10660            offset: usize,
10661            _depth: fidl::encoding::Depth,
10662        ) -> fidl::Result<()> {
10663            decoder.debug_check_bounds::<Self>(offset);
10664            // Verify that padding bytes are zero.
10665            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
10666            fidl::decode!(Matrix4Value, D, &mut self.left_projection, decoder, offset + 4, _depth)?;
10667            fidl::decode!(
10668                Matrix4Value,
10669                D,
10670                &mut self.right_projection,
10671                decoder,
10672                offset + 72,
10673                _depth
10674            )?;
10675            Ok(())
10676        }
10677    }
10678
10679    impl fidl::encoding::ValueTypeMarker for SetTagCmd {
10680        type Borrowed<'a> = &'a Self;
10681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10682            value
10683        }
10684    }
10685
10686    unsafe impl fidl::encoding::TypeMarker for SetTagCmd {
10687        type Owned = Self;
10688
10689        #[inline(always)]
10690        fn inline_align(_context: fidl::encoding::Context) -> usize {
10691            4
10692        }
10693
10694        #[inline(always)]
10695        fn inline_size(_context: fidl::encoding::Context) -> usize {
10696            8
10697        }
10698        #[inline(always)]
10699        fn encode_is_copy() -> bool {
10700            true
10701        }
10702
10703        #[inline(always)]
10704        fn decode_is_copy() -> bool {
10705            true
10706        }
10707    }
10708
10709    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTagCmd, D>
10710        for &SetTagCmd
10711    {
10712        #[inline]
10713        unsafe fn encode(
10714            self,
10715            encoder: &mut fidl::encoding::Encoder<'_, D>,
10716            offset: usize,
10717            _depth: fidl::encoding::Depth,
10718        ) -> fidl::Result<()> {
10719            encoder.debug_check_bounds::<SetTagCmd>(offset);
10720            unsafe {
10721                // Copy the object into the buffer.
10722                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10723                (buf_ptr as *mut SetTagCmd).write_unaligned((self as *const SetTagCmd).read());
10724                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10725                // done second because the memcpy will write garbage to these bytes.
10726            }
10727            Ok(())
10728        }
10729    }
10730    unsafe impl<
10731        D: fidl::encoding::ResourceDialect,
10732        T0: fidl::encoding::Encode<u32, D>,
10733        T1: fidl::encoding::Encode<u32, D>,
10734    > fidl::encoding::Encode<SetTagCmd, D> for (T0, T1)
10735    {
10736        #[inline]
10737        unsafe fn encode(
10738            self,
10739            encoder: &mut fidl::encoding::Encoder<'_, D>,
10740            offset: usize,
10741            depth: fidl::encoding::Depth,
10742        ) -> fidl::Result<()> {
10743            encoder.debug_check_bounds::<SetTagCmd>(offset);
10744            // Zero out padding regions. There's no need to apply masks
10745            // because the unmasked parts will be overwritten by fields.
10746            // Write the fields.
10747            self.0.encode(encoder, offset + 0, depth)?;
10748            self.1.encode(encoder, offset + 4, depth)?;
10749            Ok(())
10750        }
10751    }
10752
10753    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTagCmd {
10754        #[inline(always)]
10755        fn new_empty() -> Self {
10756            Self { node_id: fidl::new_empty!(u32, D), tag_value: fidl::new_empty!(u32, D) }
10757        }
10758
10759        #[inline]
10760        unsafe fn decode(
10761            &mut self,
10762            decoder: &mut fidl::encoding::Decoder<'_, D>,
10763            offset: usize,
10764            _depth: fidl::encoding::Depth,
10765        ) -> fidl::Result<()> {
10766            decoder.debug_check_bounds::<Self>(offset);
10767            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10768            // Verify that padding bytes are zero.
10769            // Copy from the buffer into the object.
10770            unsafe {
10771                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10772            }
10773            Ok(())
10774        }
10775    }
10776
10777    impl fidl::encoding::ValueTypeMarker for SetTextureCmd {
10778        type Borrowed<'a> = &'a Self;
10779        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10780            value
10781        }
10782    }
10783
10784    unsafe impl fidl::encoding::TypeMarker for SetTextureCmd {
10785        type Owned = Self;
10786
10787        #[inline(always)]
10788        fn inline_align(_context: fidl::encoding::Context) -> usize {
10789            4
10790        }
10791
10792        #[inline(always)]
10793        fn inline_size(_context: fidl::encoding::Context) -> usize {
10794            8
10795        }
10796        #[inline(always)]
10797        fn encode_is_copy() -> bool {
10798            true
10799        }
10800
10801        #[inline(always)]
10802        fn decode_is_copy() -> bool {
10803            true
10804        }
10805    }
10806
10807    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTextureCmd, D>
10808        for &SetTextureCmd
10809    {
10810        #[inline]
10811        unsafe fn encode(
10812            self,
10813            encoder: &mut fidl::encoding::Encoder<'_, D>,
10814            offset: usize,
10815            _depth: fidl::encoding::Depth,
10816        ) -> fidl::Result<()> {
10817            encoder.debug_check_bounds::<SetTextureCmd>(offset);
10818            unsafe {
10819                // Copy the object into the buffer.
10820                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10821                (buf_ptr as *mut SetTextureCmd)
10822                    .write_unaligned((self as *const SetTextureCmd).read());
10823                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10824                // done second because the memcpy will write garbage to these bytes.
10825            }
10826            Ok(())
10827        }
10828    }
10829    unsafe impl<
10830        D: fidl::encoding::ResourceDialect,
10831        T0: fidl::encoding::Encode<u32, D>,
10832        T1: fidl::encoding::Encode<u32, D>,
10833    > fidl::encoding::Encode<SetTextureCmd, D> for (T0, T1)
10834    {
10835        #[inline]
10836        unsafe fn encode(
10837            self,
10838            encoder: &mut fidl::encoding::Encoder<'_, D>,
10839            offset: usize,
10840            depth: fidl::encoding::Depth,
10841        ) -> fidl::Result<()> {
10842            encoder.debug_check_bounds::<SetTextureCmd>(offset);
10843            // Zero out padding regions. There's no need to apply masks
10844            // because the unmasked parts will be overwritten by fields.
10845            // Write the fields.
10846            self.0.encode(encoder, offset + 0, depth)?;
10847            self.1.encode(encoder, offset + 4, depth)?;
10848            Ok(())
10849        }
10850    }
10851
10852    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTextureCmd {
10853        #[inline(always)]
10854        fn new_empty() -> Self {
10855            Self { material_id: fidl::new_empty!(u32, D), texture_id: fidl::new_empty!(u32, D) }
10856        }
10857
10858        #[inline]
10859        unsafe fn decode(
10860            &mut self,
10861            decoder: &mut fidl::encoding::Decoder<'_, D>,
10862            offset: usize,
10863            _depth: fidl::encoding::Depth,
10864        ) -> fidl::Result<()> {
10865            decoder.debug_check_bounds::<Self>(offset);
10866            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10867            // Verify that padding bytes are zero.
10868            // Copy from the buffer into the object.
10869            unsafe {
10870                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10871            }
10872            Ok(())
10873        }
10874    }
10875
10876    impl fidl::encoding::ValueTypeMarker for SetTranslationCmd {
10877        type Borrowed<'a> = &'a Self;
10878        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10879            value
10880        }
10881    }
10882
10883    unsafe impl fidl::encoding::TypeMarker for SetTranslationCmd {
10884        type Owned = Self;
10885
10886        #[inline(always)]
10887        fn inline_align(_context: fidl::encoding::Context) -> usize {
10888            4
10889        }
10890
10891        #[inline(always)]
10892        fn inline_size(_context: fidl::encoding::Context) -> usize {
10893            20
10894        }
10895    }
10896
10897    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTranslationCmd, D>
10898        for &SetTranslationCmd
10899    {
10900        #[inline]
10901        unsafe fn encode(
10902            self,
10903            encoder: &mut fidl::encoding::Encoder<'_, D>,
10904            offset: usize,
10905            _depth: fidl::encoding::Depth,
10906        ) -> fidl::Result<()> {
10907            encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10908            // Delegate to tuple encoding.
10909            fidl::encoding::Encode::<SetTranslationCmd, D>::encode(
10910                (
10911                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10912                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10913                ),
10914                encoder,
10915                offset,
10916                _depth,
10917            )
10918        }
10919    }
10920    unsafe impl<
10921        D: fidl::encoding::ResourceDialect,
10922        T0: fidl::encoding::Encode<u32, D>,
10923        T1: fidl::encoding::Encode<Vector3Value, D>,
10924    > fidl::encoding::Encode<SetTranslationCmd, D> for (T0, T1)
10925    {
10926        #[inline]
10927        unsafe fn encode(
10928            self,
10929            encoder: &mut fidl::encoding::Encoder<'_, D>,
10930            offset: usize,
10931            depth: fidl::encoding::Depth,
10932        ) -> fidl::Result<()> {
10933            encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10934            // Zero out padding regions. There's no need to apply masks
10935            // because the unmasked parts will be overwritten by fields.
10936            // Write the fields.
10937            self.0.encode(encoder, offset + 0, depth)?;
10938            self.1.encode(encoder, offset + 4, depth)?;
10939            Ok(())
10940        }
10941    }
10942
10943    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTranslationCmd {
10944        #[inline(always)]
10945        fn new_empty() -> Self {
10946            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
10947        }
10948
10949        #[inline]
10950        unsafe fn decode(
10951            &mut self,
10952            decoder: &mut fidl::encoding::Decoder<'_, D>,
10953            offset: usize,
10954            _depth: fidl::encoding::Depth,
10955        ) -> fidl::Result<()> {
10956            decoder.debug_check_bounds::<Self>(offset);
10957            // Verify that padding bytes are zero.
10958            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10959            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10960            Ok(())
10961        }
10962    }
10963
10964    impl fidl::encoding::ValueTypeMarker for SetViewHolderBoundsColorCmd {
10965        type Borrowed<'a> = &'a Self;
10966        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10967            value
10968        }
10969    }
10970
10971    unsafe impl fidl::encoding::TypeMarker for SetViewHolderBoundsColorCmd {
10972        type Owned = Self;
10973
10974        #[inline(always)]
10975        fn inline_align(_context: fidl::encoding::Context) -> usize {
10976            4
10977        }
10978
10979        #[inline(always)]
10980        fn inline_size(_context: fidl::encoding::Context) -> usize {
10981            20
10982        }
10983    }
10984
10985    unsafe impl<D: fidl::encoding::ResourceDialect>
10986        fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for &SetViewHolderBoundsColorCmd
10987    {
10988        #[inline]
10989        unsafe fn encode(
10990            self,
10991            encoder: &mut fidl::encoding::Encoder<'_, D>,
10992            offset: usize,
10993            _depth: fidl::encoding::Depth,
10994        ) -> fidl::Result<()> {
10995            encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
10996            // Delegate to tuple encoding.
10997            fidl::encoding::Encode::<SetViewHolderBoundsColorCmd, D>::encode(
10998                (
10999                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
11000                    <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
11001                ),
11002                encoder,
11003                offset,
11004                _depth,
11005            )
11006        }
11007    }
11008    unsafe impl<
11009        D: fidl::encoding::ResourceDialect,
11010        T0: fidl::encoding::Encode<u32, D>,
11011        T1: fidl::encoding::Encode<ColorRgbValue, D>,
11012    > fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for (T0, T1)
11013    {
11014        #[inline]
11015        unsafe fn encode(
11016            self,
11017            encoder: &mut fidl::encoding::Encoder<'_, D>,
11018            offset: usize,
11019            depth: fidl::encoding::Depth,
11020        ) -> fidl::Result<()> {
11021            encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
11022            // Zero out padding regions. There's no need to apply masks
11023            // because the unmasked parts will be overwritten by fields.
11024            // Write the fields.
11025            self.0.encode(encoder, offset + 0, depth)?;
11026            self.1.encode(encoder, offset + 4, depth)?;
11027            Ok(())
11028        }
11029    }
11030
11031    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11032        for SetViewHolderBoundsColorCmd
11033    {
11034        #[inline(always)]
11035        fn new_empty() -> Self {
11036            Self {
11037                view_holder_id: fidl::new_empty!(u32, D),
11038                color: fidl::new_empty!(ColorRgbValue, D),
11039            }
11040        }
11041
11042        #[inline]
11043        unsafe fn decode(
11044            &mut self,
11045            decoder: &mut fidl::encoding::Decoder<'_, D>,
11046            offset: usize,
11047            _depth: fidl::encoding::Depth,
11048        ) -> fidl::Result<()> {
11049            decoder.debug_check_bounds::<Self>(offset);
11050            // Verify that padding bytes are zero.
11051            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11052            fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
11053            Ok(())
11054        }
11055    }
11056
11057    impl fidl::encoding::ValueTypeMarker for SetViewPropertiesCmd {
11058        type Borrowed<'a> = &'a Self;
11059        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11060            value
11061        }
11062    }
11063
11064    unsafe impl fidl::encoding::TypeMarker for SetViewPropertiesCmd {
11065        type Owned = Self;
11066
11067        #[inline(always)]
11068        fn inline_align(_context: fidl::encoding::Context) -> usize {
11069            4
11070        }
11071
11072        #[inline(always)]
11073        fn inline_size(_context: fidl::encoding::Context) -> usize {
11074            56
11075        }
11076    }
11077
11078    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetViewPropertiesCmd, D>
11079        for &SetViewPropertiesCmd
11080    {
11081        #[inline]
11082        unsafe fn encode(
11083            self,
11084            encoder: &mut fidl::encoding::Encoder<'_, D>,
11085            offset: usize,
11086            _depth: fidl::encoding::Depth,
11087        ) -> fidl::Result<()> {
11088            encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11089            // Delegate to tuple encoding.
11090            fidl::encoding::Encode::<SetViewPropertiesCmd, D>::encode(
11091                (
11092                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
11093                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11094                ),
11095                encoder,
11096                offset,
11097                _depth,
11098            )
11099        }
11100    }
11101    unsafe impl<
11102        D: fidl::encoding::ResourceDialect,
11103        T0: fidl::encoding::Encode<u32, D>,
11104        T1: fidl::encoding::Encode<ViewProperties, D>,
11105    > fidl::encoding::Encode<SetViewPropertiesCmd, D> for (T0, T1)
11106    {
11107        #[inline]
11108        unsafe fn encode(
11109            self,
11110            encoder: &mut fidl::encoding::Encoder<'_, D>,
11111            offset: usize,
11112            depth: fidl::encoding::Depth,
11113        ) -> fidl::Result<()> {
11114            encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11115            // Zero out padding regions. There's no need to apply masks
11116            // because the unmasked parts will be overwritten by fields.
11117            // Write the fields.
11118            self.0.encode(encoder, offset + 0, depth)?;
11119            self.1.encode(encoder, offset + 4, depth)?;
11120            Ok(())
11121        }
11122    }
11123
11124    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetViewPropertiesCmd {
11125        #[inline(always)]
11126        fn new_empty() -> Self {
11127            Self {
11128                view_holder_id: fidl::new_empty!(u32, D),
11129                properties: fidl::new_empty!(ViewProperties, D),
11130            }
11131        }
11132
11133        #[inline]
11134        unsafe fn decode(
11135            &mut self,
11136            decoder: &mut fidl::encoding::Decoder<'_, D>,
11137            offset: usize,
11138            _depth: fidl::encoding::Depth,
11139        ) -> fidl::Result<()> {
11140            decoder.debug_check_bounds::<Self>(offset);
11141            // Verify that padding bytes are zero.
11142            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11143            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11144            Ok(())
11145        }
11146    }
11147
11148    impl fidl::encoding::ValueTypeMarker for ShapeNodeArgs {
11149        type Borrowed<'a> = &'a Self;
11150        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11151            value
11152        }
11153    }
11154
11155    unsafe impl fidl::encoding::TypeMarker for ShapeNodeArgs {
11156        type Owned = Self;
11157
11158        #[inline(always)]
11159        fn inline_align(_context: fidl::encoding::Context) -> usize {
11160            4
11161        }
11162
11163        #[inline(always)]
11164        fn inline_size(_context: fidl::encoding::Context) -> usize {
11165            4
11166        }
11167        #[inline(always)]
11168        fn encode_is_copy() -> bool {
11169            true
11170        }
11171
11172        #[inline(always)]
11173        fn decode_is_copy() -> bool {
11174            true
11175        }
11176    }
11177
11178    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ShapeNodeArgs, D>
11179        for &ShapeNodeArgs
11180    {
11181        #[inline]
11182        unsafe fn encode(
11183            self,
11184            encoder: &mut fidl::encoding::Encoder<'_, D>,
11185            offset: usize,
11186            _depth: fidl::encoding::Depth,
11187        ) -> fidl::Result<()> {
11188            encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11189            unsafe {
11190                // Copy the object into the buffer.
11191                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11192                (buf_ptr as *mut ShapeNodeArgs)
11193                    .write_unaligned((self as *const ShapeNodeArgs).read());
11194                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11195                // done second because the memcpy will write garbage to these bytes.
11196            }
11197            Ok(())
11198        }
11199    }
11200    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11201        fidl::encoding::Encode<ShapeNodeArgs, D> for (T0,)
11202    {
11203        #[inline]
11204        unsafe fn encode(
11205            self,
11206            encoder: &mut fidl::encoding::Encoder<'_, D>,
11207            offset: usize,
11208            depth: fidl::encoding::Depth,
11209        ) -> fidl::Result<()> {
11210            encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11211            // Zero out padding regions. There's no need to apply masks
11212            // because the unmasked parts will be overwritten by fields.
11213            // Write the fields.
11214            self.0.encode(encoder, offset + 0, depth)?;
11215            Ok(())
11216        }
11217    }
11218
11219    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShapeNodeArgs {
11220        #[inline(always)]
11221        fn new_empty() -> Self {
11222            Self { unused: fidl::new_empty!(u32, D) }
11223        }
11224
11225        #[inline]
11226        unsafe fn decode(
11227            &mut self,
11228            decoder: &mut fidl::encoding::Decoder<'_, D>,
11229            offset: usize,
11230            _depth: fidl::encoding::Depth,
11231        ) -> fidl::Result<()> {
11232            decoder.debug_check_bounds::<Self>(offset);
11233            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11234            // Verify that padding bytes are zero.
11235            // Copy from the buffer into the object.
11236            unsafe {
11237                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11238            }
11239            Ok(())
11240        }
11241    }
11242
11243    impl fidl::encoding::ValueTypeMarker for SizeChangeHintEvent {
11244        type Borrowed<'a> = &'a Self;
11245        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11246            value
11247        }
11248    }
11249
11250    unsafe impl fidl::encoding::TypeMarker for SizeChangeHintEvent {
11251        type Owned = Self;
11252
11253        #[inline(always)]
11254        fn inline_align(_context: fidl::encoding::Context) -> usize {
11255            4
11256        }
11257
11258        #[inline(always)]
11259        fn inline_size(_context: fidl::encoding::Context) -> usize {
11260            12
11261        }
11262    }
11263
11264    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SizeChangeHintEvent, D>
11265        for &SizeChangeHintEvent
11266    {
11267        #[inline]
11268        unsafe fn encode(
11269            self,
11270            encoder: &mut fidl::encoding::Encoder<'_, D>,
11271            offset: usize,
11272            _depth: fidl::encoding::Depth,
11273        ) -> fidl::Result<()> {
11274            encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11275            // Delegate to tuple encoding.
11276            fidl::encoding::Encode::<SizeChangeHintEvent, D>::encode(
11277                (
11278                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
11279                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
11280                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
11281                ),
11282                encoder,
11283                offset,
11284                _depth,
11285            )
11286        }
11287    }
11288    unsafe impl<
11289        D: fidl::encoding::ResourceDialect,
11290        T0: fidl::encoding::Encode<u32, D>,
11291        T1: fidl::encoding::Encode<f32, D>,
11292        T2: fidl::encoding::Encode<f32, D>,
11293    > fidl::encoding::Encode<SizeChangeHintEvent, D> for (T0, T1, T2)
11294    {
11295        #[inline]
11296        unsafe fn encode(
11297            self,
11298            encoder: &mut fidl::encoding::Encoder<'_, D>,
11299            offset: usize,
11300            depth: fidl::encoding::Depth,
11301        ) -> fidl::Result<()> {
11302            encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11303            // Zero out padding regions. There's no need to apply masks
11304            // because the unmasked parts will be overwritten by fields.
11305            // Write the fields.
11306            self.0.encode(encoder, offset + 0, depth)?;
11307            self.1.encode(encoder, offset + 4, depth)?;
11308            self.2.encode(encoder, offset + 8, depth)?;
11309            Ok(())
11310        }
11311    }
11312
11313    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SizeChangeHintEvent {
11314        #[inline(always)]
11315        fn new_empty() -> Self {
11316            Self {
11317                node_id: fidl::new_empty!(u32, D),
11318                width_change_factor: fidl::new_empty!(f32, D),
11319                height_change_factor: fidl::new_empty!(f32, D),
11320            }
11321        }
11322
11323        #[inline]
11324        unsafe fn decode(
11325            &mut self,
11326            decoder: &mut fidl::encoding::Decoder<'_, D>,
11327            offset: usize,
11328            _depth: fidl::encoding::Depth,
11329        ) -> fidl::Result<()> {
11330            decoder.debug_check_bounds::<Self>(offset);
11331            // Verify that padding bytes are zero.
11332            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
11333            fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
11334            fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
11335            Ok(())
11336        }
11337    }
11338
11339    impl fidl::encoding::ValueTypeMarker for StereoCameraArgs {
11340        type Borrowed<'a> = &'a Self;
11341        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11342            value
11343        }
11344    }
11345
11346    unsafe impl fidl::encoding::TypeMarker for StereoCameraArgs {
11347        type Owned = Self;
11348
11349        #[inline(always)]
11350        fn inline_align(_context: fidl::encoding::Context) -> usize {
11351            4
11352        }
11353
11354        #[inline(always)]
11355        fn inline_size(_context: fidl::encoding::Context) -> usize {
11356            4
11357        }
11358        #[inline(always)]
11359        fn encode_is_copy() -> bool {
11360            true
11361        }
11362
11363        #[inline(always)]
11364        fn decode_is_copy() -> bool {
11365            true
11366        }
11367    }
11368
11369    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StereoCameraArgs, D>
11370        for &StereoCameraArgs
11371    {
11372        #[inline]
11373        unsafe fn encode(
11374            self,
11375            encoder: &mut fidl::encoding::Encoder<'_, D>,
11376            offset: usize,
11377            _depth: fidl::encoding::Depth,
11378        ) -> fidl::Result<()> {
11379            encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11380            unsafe {
11381                // Copy the object into the buffer.
11382                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11383                (buf_ptr as *mut StereoCameraArgs)
11384                    .write_unaligned((self as *const StereoCameraArgs).read());
11385                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11386                // done second because the memcpy will write garbage to these bytes.
11387            }
11388            Ok(())
11389        }
11390    }
11391    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11392        fidl::encoding::Encode<StereoCameraArgs, D> for (T0,)
11393    {
11394        #[inline]
11395        unsafe fn encode(
11396            self,
11397            encoder: &mut fidl::encoding::Encoder<'_, D>,
11398            offset: usize,
11399            depth: fidl::encoding::Depth,
11400        ) -> fidl::Result<()> {
11401            encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11402            // Zero out padding regions. There's no need to apply masks
11403            // because the unmasked parts will be overwritten by fields.
11404            // Write the fields.
11405            self.0.encode(encoder, offset + 0, depth)?;
11406            Ok(())
11407        }
11408    }
11409
11410    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StereoCameraArgs {
11411        #[inline(always)]
11412        fn new_empty() -> Self {
11413            Self { scene_id: fidl::new_empty!(u32, D) }
11414        }
11415
11416        #[inline]
11417        unsafe fn decode(
11418            &mut self,
11419            decoder: &mut fidl::encoding::Decoder<'_, D>,
11420            offset: usize,
11421            _depth: fidl::encoding::Depth,
11422        ) -> fidl::Result<()> {
11423            decoder.debug_check_bounds::<Self>(offset);
11424            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11425            // Verify that padding bytes are zero.
11426            // Copy from the buffer into the object.
11427            unsafe {
11428                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11429            }
11430            Ok(())
11431        }
11432    }
11433
11434    impl fidl::encoding::ValueTypeMarker for VariableArgs {
11435        type Borrowed<'a> = &'a Self;
11436        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11437            value
11438        }
11439    }
11440
11441    unsafe impl fidl::encoding::TypeMarker for VariableArgs {
11442        type Owned = Self;
11443
11444        #[inline(always)]
11445        fn inline_align(_context: fidl::encoding::Context) -> usize {
11446            8
11447        }
11448
11449        #[inline(always)]
11450        fn inline_size(_context: fidl::encoding::Context) -> usize {
11451            24
11452        }
11453    }
11454
11455    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VariableArgs, D>
11456        for &VariableArgs
11457    {
11458        #[inline]
11459        unsafe fn encode(
11460            self,
11461            encoder: &mut fidl::encoding::Encoder<'_, D>,
11462            offset: usize,
11463            _depth: fidl::encoding::Depth,
11464        ) -> fidl::Result<()> {
11465            encoder.debug_check_bounds::<VariableArgs>(offset);
11466            // Delegate to tuple encoding.
11467            fidl::encoding::Encode::<VariableArgs, D>::encode(
11468                (
11469                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
11470                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.initial_value),
11471                ),
11472                encoder,
11473                offset,
11474                _depth,
11475            )
11476        }
11477    }
11478    unsafe impl<
11479        D: fidl::encoding::ResourceDialect,
11480        T0: fidl::encoding::Encode<ValueType, D>,
11481        T1: fidl::encoding::Encode<Value, D>,
11482    > fidl::encoding::Encode<VariableArgs, D> for (T0, T1)
11483    {
11484        #[inline]
11485        unsafe fn encode(
11486            self,
11487            encoder: &mut fidl::encoding::Encoder<'_, D>,
11488            offset: usize,
11489            depth: fidl::encoding::Depth,
11490        ) -> fidl::Result<()> {
11491            encoder.debug_check_bounds::<VariableArgs>(offset);
11492            // Zero out padding regions. There's no need to apply masks
11493            // because the unmasked parts will be overwritten by fields.
11494            unsafe {
11495                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11496                (ptr as *mut u64).write_unaligned(0);
11497            }
11498            // Write the fields.
11499            self.0.encode(encoder, offset + 0, depth)?;
11500            self.1.encode(encoder, offset + 8, depth)?;
11501            Ok(())
11502        }
11503    }
11504
11505    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VariableArgs {
11506        #[inline(always)]
11507        fn new_empty() -> Self {
11508            Self {
11509                type_: fidl::new_empty!(ValueType, D),
11510                initial_value: fidl::new_empty!(Value, D),
11511            }
11512        }
11513
11514        #[inline]
11515        unsafe fn decode(
11516            &mut self,
11517            decoder: &mut fidl::encoding::Decoder<'_, D>,
11518            offset: usize,
11519            _depth: fidl::encoding::Depth,
11520        ) -> fidl::Result<()> {
11521            decoder.debug_check_bounds::<Self>(offset);
11522            // Verify that padding bytes are zero.
11523            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11524            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11525            let mask = 0xffffffff00000000u64;
11526            let maskedval = padval & mask;
11527            if maskedval != 0 {
11528                return Err(fidl::Error::NonZeroPadding {
11529                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11530                });
11531            }
11532            fidl::decode!(ValueType, D, &mut self.type_, decoder, offset + 0, _depth)?;
11533            fidl::decode!(Value, D, &mut self.initial_value, decoder, offset + 8, _depth)?;
11534            Ok(())
11535        }
11536    }
11537
11538    impl fidl::encoding::ValueTypeMarker for Vector2Value {
11539        type Borrowed<'a> = &'a Self;
11540        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11541            value
11542        }
11543    }
11544
11545    unsafe impl fidl::encoding::TypeMarker for Vector2Value {
11546        type Owned = Self;
11547
11548        #[inline(always)]
11549        fn inline_align(_context: fidl::encoding::Context) -> usize {
11550            4
11551        }
11552
11553        #[inline(always)]
11554        fn inline_size(_context: fidl::encoding::Context) -> usize {
11555            12
11556        }
11557    }
11558
11559    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector2Value, D>
11560        for &Vector2Value
11561    {
11562        #[inline]
11563        unsafe fn encode(
11564            self,
11565            encoder: &mut fidl::encoding::Encoder<'_, D>,
11566            offset: usize,
11567            _depth: fidl::encoding::Depth,
11568        ) -> fidl::Result<()> {
11569            encoder.debug_check_bounds::<Vector2Value>(offset);
11570            // Delegate to tuple encoding.
11571            fidl::encoding::Encode::<Vector2Value, D>::encode(
11572                (
11573                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11574                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11575                ),
11576                encoder,
11577                offset,
11578                _depth,
11579            )
11580        }
11581    }
11582    unsafe impl<
11583        D: fidl::encoding::ResourceDialect,
11584        T0: fidl::encoding::Encode<Vec2, D>,
11585        T1: fidl::encoding::Encode<u32, D>,
11586    > fidl::encoding::Encode<Vector2Value, D> for (T0, T1)
11587    {
11588        #[inline]
11589        unsafe fn encode(
11590            self,
11591            encoder: &mut fidl::encoding::Encoder<'_, D>,
11592            offset: usize,
11593            depth: fidl::encoding::Depth,
11594        ) -> fidl::Result<()> {
11595            encoder.debug_check_bounds::<Vector2Value>(offset);
11596            // Zero out padding regions. There's no need to apply masks
11597            // because the unmasked parts will be overwritten by fields.
11598            // Write the fields.
11599            self.0.encode(encoder, offset + 0, depth)?;
11600            self.1.encode(encoder, offset + 8, depth)?;
11601            Ok(())
11602        }
11603    }
11604
11605    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector2Value {
11606        #[inline(always)]
11607        fn new_empty() -> Self {
11608            Self { value: fidl::new_empty!(Vec2, D), variable_id: fidl::new_empty!(u32, D) }
11609        }
11610
11611        #[inline]
11612        unsafe fn decode(
11613            &mut self,
11614            decoder: &mut fidl::encoding::Decoder<'_, D>,
11615            offset: usize,
11616            _depth: fidl::encoding::Depth,
11617        ) -> fidl::Result<()> {
11618            decoder.debug_check_bounds::<Self>(offset);
11619            // Verify that padding bytes are zero.
11620            fidl::decode!(Vec2, D, &mut self.value, decoder, offset + 0, _depth)?;
11621            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 8, _depth)?;
11622            Ok(())
11623        }
11624    }
11625
11626    impl fidl::encoding::ValueTypeMarker for Vector3Value {
11627        type Borrowed<'a> = &'a Self;
11628        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11629            value
11630        }
11631    }
11632
11633    unsafe impl fidl::encoding::TypeMarker for Vector3Value {
11634        type Owned = Self;
11635
11636        #[inline(always)]
11637        fn inline_align(_context: fidl::encoding::Context) -> usize {
11638            4
11639        }
11640
11641        #[inline(always)]
11642        fn inline_size(_context: fidl::encoding::Context) -> usize {
11643            16
11644        }
11645    }
11646
11647    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector3Value, D>
11648        for &Vector3Value
11649    {
11650        #[inline]
11651        unsafe fn encode(
11652            self,
11653            encoder: &mut fidl::encoding::Encoder<'_, D>,
11654            offset: usize,
11655            _depth: fidl::encoding::Depth,
11656        ) -> fidl::Result<()> {
11657            encoder.debug_check_bounds::<Vector3Value>(offset);
11658            // Delegate to tuple encoding.
11659            fidl::encoding::Encode::<Vector3Value, D>::encode(
11660                (
11661                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11662                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11663                ),
11664                encoder,
11665                offset,
11666                _depth,
11667            )
11668        }
11669    }
11670    unsafe impl<
11671        D: fidl::encoding::ResourceDialect,
11672        T0: fidl::encoding::Encode<Vec3, D>,
11673        T1: fidl::encoding::Encode<u32, D>,
11674    > fidl::encoding::Encode<Vector3Value, D> for (T0, T1)
11675    {
11676        #[inline]
11677        unsafe fn encode(
11678            self,
11679            encoder: &mut fidl::encoding::Encoder<'_, D>,
11680            offset: usize,
11681            depth: fidl::encoding::Depth,
11682        ) -> fidl::Result<()> {
11683            encoder.debug_check_bounds::<Vector3Value>(offset);
11684            // Zero out padding regions. There's no need to apply masks
11685            // because the unmasked parts will be overwritten by fields.
11686            // Write the fields.
11687            self.0.encode(encoder, offset + 0, depth)?;
11688            self.1.encode(encoder, offset + 12, depth)?;
11689            Ok(())
11690        }
11691    }
11692
11693    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector3Value {
11694        #[inline(always)]
11695        fn new_empty() -> Self {
11696            Self { value: fidl::new_empty!(Vec3, D), variable_id: fidl::new_empty!(u32, D) }
11697        }
11698
11699        #[inline]
11700        unsafe fn decode(
11701            &mut self,
11702            decoder: &mut fidl::encoding::Decoder<'_, D>,
11703            offset: usize,
11704            _depth: fidl::encoding::Depth,
11705        ) -> fidl::Result<()> {
11706            decoder.debug_check_bounds::<Self>(offset);
11707            // Verify that padding bytes are zero.
11708            fidl::decode!(Vec3, D, &mut self.value, decoder, offset + 0, _depth)?;
11709            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
11710            Ok(())
11711        }
11712    }
11713
11714    impl fidl::encoding::ValueTypeMarker for Vector4Value {
11715        type Borrowed<'a> = &'a Self;
11716        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11717            value
11718        }
11719    }
11720
11721    unsafe impl fidl::encoding::TypeMarker for Vector4Value {
11722        type Owned = Self;
11723
11724        #[inline(always)]
11725        fn inline_align(_context: fidl::encoding::Context) -> usize {
11726            4
11727        }
11728
11729        #[inline(always)]
11730        fn inline_size(_context: fidl::encoding::Context) -> usize {
11731            20
11732        }
11733    }
11734
11735    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector4Value, D>
11736        for &Vector4Value
11737    {
11738        #[inline]
11739        unsafe fn encode(
11740            self,
11741            encoder: &mut fidl::encoding::Encoder<'_, D>,
11742            offset: usize,
11743            _depth: fidl::encoding::Depth,
11744        ) -> fidl::Result<()> {
11745            encoder.debug_check_bounds::<Vector4Value>(offset);
11746            // Delegate to tuple encoding.
11747            fidl::encoding::Encode::<Vector4Value, D>::encode(
11748                (
11749                    <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11750                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11751                ),
11752                encoder,
11753                offset,
11754                _depth,
11755            )
11756        }
11757    }
11758    unsafe impl<
11759        D: fidl::encoding::ResourceDialect,
11760        T0: fidl::encoding::Encode<Vec4, D>,
11761        T1: fidl::encoding::Encode<u32, D>,
11762    > fidl::encoding::Encode<Vector4Value, D> for (T0, T1)
11763    {
11764        #[inline]
11765        unsafe fn encode(
11766            self,
11767            encoder: &mut fidl::encoding::Encoder<'_, D>,
11768            offset: usize,
11769            depth: fidl::encoding::Depth,
11770        ) -> fidl::Result<()> {
11771            encoder.debug_check_bounds::<Vector4Value>(offset);
11772            // Zero out padding regions. There's no need to apply masks
11773            // because the unmasked parts will be overwritten by fields.
11774            // Write the fields.
11775            self.0.encode(encoder, offset + 0, depth)?;
11776            self.1.encode(encoder, offset + 16, depth)?;
11777            Ok(())
11778        }
11779    }
11780
11781    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector4Value {
11782        #[inline(always)]
11783        fn new_empty() -> Self {
11784            Self { value: fidl::new_empty!(Vec4, D), variable_id: fidl::new_empty!(u32, D) }
11785        }
11786
11787        #[inline]
11788        unsafe fn decode(
11789            &mut self,
11790            decoder: &mut fidl::encoding::Decoder<'_, D>,
11791            offset: usize,
11792            _depth: fidl::encoding::Depth,
11793        ) -> fidl::Result<()> {
11794            decoder.debug_check_bounds::<Self>(offset);
11795            // Verify that padding bytes are zero.
11796            fidl::decode!(Vec4, D, &mut self.value, decoder, offset + 0, _depth)?;
11797            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
11798            Ok(())
11799        }
11800    }
11801
11802    impl fidl::encoding::ValueTypeMarker for ViewAttachedToSceneEvent {
11803        type Borrowed<'a> = &'a Self;
11804        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11805            value
11806        }
11807    }
11808
11809    unsafe impl fidl::encoding::TypeMarker for ViewAttachedToSceneEvent {
11810        type Owned = Self;
11811
11812        #[inline(always)]
11813        fn inline_align(_context: fidl::encoding::Context) -> usize {
11814            4
11815        }
11816
11817        #[inline(always)]
11818        fn inline_size(_context: fidl::encoding::Context) -> usize {
11819            56
11820        }
11821    }
11822
11823    unsafe impl<D: fidl::encoding::ResourceDialect>
11824        fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for &ViewAttachedToSceneEvent
11825    {
11826        #[inline]
11827        unsafe fn encode(
11828            self,
11829            encoder: &mut fidl::encoding::Encoder<'_, D>,
11830            offset: usize,
11831            _depth: fidl::encoding::Depth,
11832        ) -> fidl::Result<()> {
11833            encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11834            // Delegate to tuple encoding.
11835            fidl::encoding::Encode::<ViewAttachedToSceneEvent, D>::encode(
11836                (
11837                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
11838                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11839                ),
11840                encoder,
11841                offset,
11842                _depth,
11843            )
11844        }
11845    }
11846    unsafe impl<
11847        D: fidl::encoding::ResourceDialect,
11848        T0: fidl::encoding::Encode<u32, D>,
11849        T1: fidl::encoding::Encode<ViewProperties, D>,
11850    > fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for (T0, T1)
11851    {
11852        #[inline]
11853        unsafe fn encode(
11854            self,
11855            encoder: &mut fidl::encoding::Encoder<'_, D>,
11856            offset: usize,
11857            depth: fidl::encoding::Depth,
11858        ) -> fidl::Result<()> {
11859            encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11860            // Zero out padding regions. There's no need to apply masks
11861            // because the unmasked parts will be overwritten by fields.
11862            // Write the fields.
11863            self.0.encode(encoder, offset + 0, depth)?;
11864            self.1.encode(encoder, offset + 4, depth)?;
11865            Ok(())
11866        }
11867    }
11868
11869    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11870        for ViewAttachedToSceneEvent
11871    {
11872        #[inline(always)]
11873        fn new_empty() -> Self {
11874            Self {
11875                view_id: fidl::new_empty!(u32, D),
11876                properties: fidl::new_empty!(ViewProperties, D),
11877            }
11878        }
11879
11880        #[inline]
11881        unsafe fn decode(
11882            &mut self,
11883            decoder: &mut fidl::encoding::Decoder<'_, D>,
11884            offset: usize,
11885            _depth: fidl::encoding::Depth,
11886        ) -> fidl::Result<()> {
11887            decoder.debug_check_bounds::<Self>(offset);
11888            // Verify that padding bytes are zero.
11889            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
11890            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11891            Ok(())
11892        }
11893    }
11894
11895    impl fidl::encoding::ValueTypeMarker for ViewConnectedEvent {
11896        type Borrowed<'a> = &'a Self;
11897        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11898            value
11899        }
11900    }
11901
11902    unsafe impl fidl::encoding::TypeMarker for ViewConnectedEvent {
11903        type Owned = Self;
11904
11905        #[inline(always)]
11906        fn inline_align(_context: fidl::encoding::Context) -> usize {
11907            4
11908        }
11909
11910        #[inline(always)]
11911        fn inline_size(_context: fidl::encoding::Context) -> usize {
11912            4
11913        }
11914        #[inline(always)]
11915        fn encode_is_copy() -> bool {
11916            true
11917        }
11918
11919        #[inline(always)]
11920        fn decode_is_copy() -> bool {
11921            true
11922        }
11923    }
11924
11925    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewConnectedEvent, D>
11926        for &ViewConnectedEvent
11927    {
11928        #[inline]
11929        unsafe fn encode(
11930            self,
11931            encoder: &mut fidl::encoding::Encoder<'_, D>,
11932            offset: usize,
11933            _depth: fidl::encoding::Depth,
11934        ) -> fidl::Result<()> {
11935            encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
11936            unsafe {
11937                // Copy the object into the buffer.
11938                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11939                (buf_ptr as *mut ViewConnectedEvent)
11940                    .write_unaligned((self as *const ViewConnectedEvent).read());
11941                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11942                // done second because the memcpy will write garbage to these bytes.
11943            }
11944            Ok(())
11945        }
11946    }
11947    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11948        fidl::encoding::Encode<ViewConnectedEvent, D> for (T0,)
11949    {
11950        #[inline]
11951        unsafe fn encode(
11952            self,
11953            encoder: &mut fidl::encoding::Encoder<'_, D>,
11954            offset: usize,
11955            depth: fidl::encoding::Depth,
11956        ) -> fidl::Result<()> {
11957            encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
11958            // Zero out padding regions. There's no need to apply masks
11959            // because the unmasked parts will be overwritten by fields.
11960            // Write the fields.
11961            self.0.encode(encoder, offset + 0, depth)?;
11962            Ok(())
11963        }
11964    }
11965
11966    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewConnectedEvent {
11967        #[inline(always)]
11968        fn new_empty() -> Self {
11969            Self { view_holder_id: fidl::new_empty!(u32, D) }
11970        }
11971
11972        #[inline]
11973        unsafe fn decode(
11974            &mut self,
11975            decoder: &mut fidl::encoding::Decoder<'_, D>,
11976            offset: usize,
11977            _depth: fidl::encoding::Depth,
11978        ) -> fidl::Result<()> {
11979            decoder.debug_check_bounds::<Self>(offset);
11980            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11981            // Verify that padding bytes are zero.
11982            // Copy from the buffer into the object.
11983            unsafe {
11984                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11985            }
11986            Ok(())
11987        }
11988    }
11989
11990    impl fidl::encoding::ValueTypeMarker for ViewDetachedFromSceneEvent {
11991        type Borrowed<'a> = &'a Self;
11992        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11993            value
11994        }
11995    }
11996
11997    unsafe impl fidl::encoding::TypeMarker for ViewDetachedFromSceneEvent {
11998        type Owned = Self;
11999
12000        #[inline(always)]
12001        fn inline_align(_context: fidl::encoding::Context) -> usize {
12002            4
12003        }
12004
12005        #[inline(always)]
12006        fn inline_size(_context: fidl::encoding::Context) -> usize {
12007            4
12008        }
12009        #[inline(always)]
12010        fn encode_is_copy() -> bool {
12011            true
12012        }
12013
12014        #[inline(always)]
12015        fn decode_is_copy() -> bool {
12016            true
12017        }
12018    }
12019
12020    unsafe impl<D: fidl::encoding::ResourceDialect>
12021        fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for &ViewDetachedFromSceneEvent
12022    {
12023        #[inline]
12024        unsafe fn encode(
12025            self,
12026            encoder: &mut fidl::encoding::Encoder<'_, D>,
12027            offset: usize,
12028            _depth: fidl::encoding::Depth,
12029        ) -> fidl::Result<()> {
12030            encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12031            unsafe {
12032                // Copy the object into the buffer.
12033                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12034                (buf_ptr as *mut ViewDetachedFromSceneEvent)
12035                    .write_unaligned((self as *const ViewDetachedFromSceneEvent).read());
12036                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12037                // done second because the memcpy will write garbage to these bytes.
12038            }
12039            Ok(())
12040        }
12041    }
12042    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12043        fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for (T0,)
12044    {
12045        #[inline]
12046        unsafe fn encode(
12047            self,
12048            encoder: &mut fidl::encoding::Encoder<'_, D>,
12049            offset: usize,
12050            depth: fidl::encoding::Depth,
12051        ) -> fidl::Result<()> {
12052            encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12053            // Zero out padding regions. There's no need to apply masks
12054            // because the unmasked parts will be overwritten by fields.
12055            // Write the fields.
12056            self.0.encode(encoder, offset + 0, depth)?;
12057            Ok(())
12058        }
12059    }
12060
12061    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12062        for ViewDetachedFromSceneEvent
12063    {
12064        #[inline(always)]
12065        fn new_empty() -> Self {
12066            Self { view_id: fidl::new_empty!(u32, D) }
12067        }
12068
12069        #[inline]
12070        unsafe fn decode(
12071            &mut self,
12072            decoder: &mut fidl::encoding::Decoder<'_, D>,
12073            offset: usize,
12074            _depth: fidl::encoding::Depth,
12075        ) -> fidl::Result<()> {
12076            decoder.debug_check_bounds::<Self>(offset);
12077            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12078            // Verify that padding bytes are zero.
12079            // Copy from the buffer into the object.
12080            unsafe {
12081                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12082            }
12083            Ok(())
12084        }
12085    }
12086
12087    impl fidl::encoding::ValueTypeMarker for ViewDisconnectedEvent {
12088        type Borrowed<'a> = &'a Self;
12089        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12090            value
12091        }
12092    }
12093
12094    unsafe impl fidl::encoding::TypeMarker for ViewDisconnectedEvent {
12095        type Owned = Self;
12096
12097        #[inline(always)]
12098        fn inline_align(_context: fidl::encoding::Context) -> usize {
12099            4
12100        }
12101
12102        #[inline(always)]
12103        fn inline_size(_context: fidl::encoding::Context) -> usize {
12104            4
12105        }
12106        #[inline(always)]
12107        fn encode_is_copy() -> bool {
12108            true
12109        }
12110
12111        #[inline(always)]
12112        fn decode_is_copy() -> bool {
12113            true
12114        }
12115    }
12116
12117    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewDisconnectedEvent, D>
12118        for &ViewDisconnectedEvent
12119    {
12120        #[inline]
12121        unsafe fn encode(
12122            self,
12123            encoder: &mut fidl::encoding::Encoder<'_, D>,
12124            offset: usize,
12125            _depth: fidl::encoding::Depth,
12126        ) -> fidl::Result<()> {
12127            encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12128            unsafe {
12129                // Copy the object into the buffer.
12130                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12131                (buf_ptr as *mut ViewDisconnectedEvent)
12132                    .write_unaligned((self as *const ViewDisconnectedEvent).read());
12133                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12134                // done second because the memcpy will write garbage to these bytes.
12135            }
12136            Ok(())
12137        }
12138    }
12139    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12140        fidl::encoding::Encode<ViewDisconnectedEvent, D> for (T0,)
12141    {
12142        #[inline]
12143        unsafe fn encode(
12144            self,
12145            encoder: &mut fidl::encoding::Encoder<'_, D>,
12146            offset: usize,
12147            depth: fidl::encoding::Depth,
12148        ) -> fidl::Result<()> {
12149            encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12150            // Zero out padding regions. There's no need to apply masks
12151            // because the unmasked parts will be overwritten by fields.
12152            // Write the fields.
12153            self.0.encode(encoder, offset + 0, depth)?;
12154            Ok(())
12155        }
12156    }
12157
12158    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewDisconnectedEvent {
12159        #[inline(always)]
12160        fn new_empty() -> Self {
12161            Self { view_holder_id: fidl::new_empty!(u32, D) }
12162        }
12163
12164        #[inline]
12165        unsafe fn decode(
12166            &mut self,
12167            decoder: &mut fidl::encoding::Decoder<'_, D>,
12168            offset: usize,
12169            _depth: fidl::encoding::Depth,
12170        ) -> fidl::Result<()> {
12171            decoder.debug_check_bounds::<Self>(offset);
12172            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12173            // Verify that padding bytes are zero.
12174            // Copy from the buffer into the object.
12175            unsafe {
12176                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12177            }
12178            Ok(())
12179        }
12180    }
12181
12182    impl fidl::encoding::ValueTypeMarker for ViewHolderConnectedEvent {
12183        type Borrowed<'a> = &'a Self;
12184        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12185            value
12186        }
12187    }
12188
12189    unsafe impl fidl::encoding::TypeMarker for ViewHolderConnectedEvent {
12190        type Owned = Self;
12191
12192        #[inline(always)]
12193        fn inline_align(_context: fidl::encoding::Context) -> usize {
12194            4
12195        }
12196
12197        #[inline(always)]
12198        fn inline_size(_context: fidl::encoding::Context) -> usize {
12199            4
12200        }
12201        #[inline(always)]
12202        fn encode_is_copy() -> bool {
12203            true
12204        }
12205
12206        #[inline(always)]
12207        fn decode_is_copy() -> bool {
12208            true
12209        }
12210    }
12211
12212    unsafe impl<D: fidl::encoding::ResourceDialect>
12213        fidl::encoding::Encode<ViewHolderConnectedEvent, D> for &ViewHolderConnectedEvent
12214    {
12215        #[inline]
12216        unsafe fn encode(
12217            self,
12218            encoder: &mut fidl::encoding::Encoder<'_, D>,
12219            offset: usize,
12220            _depth: fidl::encoding::Depth,
12221        ) -> fidl::Result<()> {
12222            encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12223            unsafe {
12224                // Copy the object into the buffer.
12225                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12226                (buf_ptr as *mut ViewHolderConnectedEvent)
12227                    .write_unaligned((self as *const ViewHolderConnectedEvent).read());
12228                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12229                // done second because the memcpy will write garbage to these bytes.
12230            }
12231            Ok(())
12232        }
12233    }
12234    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12235        fidl::encoding::Encode<ViewHolderConnectedEvent, D> for (T0,)
12236    {
12237        #[inline]
12238        unsafe fn encode(
12239            self,
12240            encoder: &mut fidl::encoding::Encoder<'_, D>,
12241            offset: usize,
12242            depth: fidl::encoding::Depth,
12243        ) -> fidl::Result<()> {
12244            encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12245            // Zero out padding regions. There's no need to apply masks
12246            // because the unmasked parts will be overwritten by fields.
12247            // Write the fields.
12248            self.0.encode(encoder, offset + 0, depth)?;
12249            Ok(())
12250        }
12251    }
12252
12253    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12254        for ViewHolderConnectedEvent
12255    {
12256        #[inline(always)]
12257        fn new_empty() -> Self {
12258            Self { view_id: fidl::new_empty!(u32, D) }
12259        }
12260
12261        #[inline]
12262        unsafe fn decode(
12263            &mut self,
12264            decoder: &mut fidl::encoding::Decoder<'_, D>,
12265            offset: usize,
12266            _depth: fidl::encoding::Depth,
12267        ) -> fidl::Result<()> {
12268            decoder.debug_check_bounds::<Self>(offset);
12269            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12270            // Verify that padding bytes are zero.
12271            // Copy from the buffer into the object.
12272            unsafe {
12273                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12274            }
12275            Ok(())
12276        }
12277    }
12278
12279    impl fidl::encoding::ValueTypeMarker for ViewHolderDisconnectedEvent {
12280        type Borrowed<'a> = &'a Self;
12281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12282            value
12283        }
12284    }
12285
12286    unsafe impl fidl::encoding::TypeMarker for ViewHolderDisconnectedEvent {
12287        type Owned = Self;
12288
12289        #[inline(always)]
12290        fn inline_align(_context: fidl::encoding::Context) -> usize {
12291            4
12292        }
12293
12294        #[inline(always)]
12295        fn inline_size(_context: fidl::encoding::Context) -> usize {
12296            4
12297        }
12298        #[inline(always)]
12299        fn encode_is_copy() -> bool {
12300            true
12301        }
12302
12303        #[inline(always)]
12304        fn decode_is_copy() -> bool {
12305            true
12306        }
12307    }
12308
12309    unsafe impl<D: fidl::encoding::ResourceDialect>
12310        fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for &ViewHolderDisconnectedEvent
12311    {
12312        #[inline]
12313        unsafe fn encode(
12314            self,
12315            encoder: &mut fidl::encoding::Encoder<'_, D>,
12316            offset: usize,
12317            _depth: fidl::encoding::Depth,
12318        ) -> fidl::Result<()> {
12319            encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12320            unsafe {
12321                // Copy the object into the buffer.
12322                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12323                (buf_ptr as *mut ViewHolderDisconnectedEvent)
12324                    .write_unaligned((self as *const ViewHolderDisconnectedEvent).read());
12325                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12326                // done second because the memcpy will write garbage to these bytes.
12327            }
12328            Ok(())
12329        }
12330    }
12331    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12332        fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for (T0,)
12333    {
12334        #[inline]
12335        unsafe fn encode(
12336            self,
12337            encoder: &mut fidl::encoding::Encoder<'_, D>,
12338            offset: usize,
12339            depth: fidl::encoding::Depth,
12340        ) -> fidl::Result<()> {
12341            encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12342            // Zero out padding regions. There's no need to apply masks
12343            // because the unmasked parts will be overwritten by fields.
12344            // Write the fields.
12345            self.0.encode(encoder, offset + 0, depth)?;
12346            Ok(())
12347        }
12348    }
12349
12350    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12351        for ViewHolderDisconnectedEvent
12352    {
12353        #[inline(always)]
12354        fn new_empty() -> Self {
12355            Self { view_id: fidl::new_empty!(u32, D) }
12356        }
12357
12358        #[inline]
12359        unsafe fn decode(
12360            &mut self,
12361            decoder: &mut fidl::encoding::Decoder<'_, D>,
12362            offset: usize,
12363            _depth: fidl::encoding::Depth,
12364        ) -> fidl::Result<()> {
12365            decoder.debug_check_bounds::<Self>(offset);
12366            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12367            // Verify that padding bytes are zero.
12368            // Copy from the buffer into the object.
12369            unsafe {
12370                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12371            }
12372            Ok(())
12373        }
12374    }
12375
12376    impl fidl::encoding::ValueTypeMarker for ViewProperties {
12377        type Borrowed<'a> = &'a Self;
12378        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12379            value
12380        }
12381    }
12382
12383    unsafe impl fidl::encoding::TypeMarker for ViewProperties {
12384        type Owned = Self;
12385
12386        #[inline(always)]
12387        fn inline_align(_context: fidl::encoding::Context) -> usize {
12388            4
12389        }
12390
12391        #[inline(always)]
12392        fn inline_size(_context: fidl::encoding::Context) -> usize {
12393            52
12394        }
12395    }
12396
12397    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewProperties, D>
12398        for &ViewProperties
12399    {
12400        #[inline]
12401        unsafe fn encode(
12402            self,
12403            encoder: &mut fidl::encoding::Encoder<'_, D>,
12404            offset: usize,
12405            _depth: fidl::encoding::Depth,
12406        ) -> fidl::Result<()> {
12407            encoder.debug_check_bounds::<ViewProperties>(offset);
12408            // Delegate to tuple encoding.
12409            fidl::encoding::Encode::<ViewProperties, D>::encode(
12410                (
12411                    <BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
12412                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_min),
12413                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_max),
12414                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.focus_change),
12415                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.downward_input),
12416                ),
12417                encoder,
12418                offset,
12419                _depth,
12420            )
12421        }
12422    }
12423    unsafe impl<
12424        D: fidl::encoding::ResourceDialect,
12425        T0: fidl::encoding::Encode<BoundingBox, D>,
12426        T1: fidl::encoding::Encode<Vec3, D>,
12427        T2: fidl::encoding::Encode<Vec3, D>,
12428        T3: fidl::encoding::Encode<bool, D>,
12429        T4: fidl::encoding::Encode<bool, D>,
12430    > fidl::encoding::Encode<ViewProperties, D> for (T0, T1, T2, T3, T4)
12431    {
12432        #[inline]
12433        unsafe fn encode(
12434            self,
12435            encoder: &mut fidl::encoding::Encoder<'_, D>,
12436            offset: usize,
12437            depth: fidl::encoding::Depth,
12438        ) -> fidl::Result<()> {
12439            encoder.debug_check_bounds::<ViewProperties>(offset);
12440            // Zero out padding regions. There's no need to apply masks
12441            // because the unmasked parts will be overwritten by fields.
12442            unsafe {
12443                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
12444                (ptr as *mut u32).write_unaligned(0);
12445            }
12446            // Write the fields.
12447            self.0.encode(encoder, offset + 0, depth)?;
12448            self.1.encode(encoder, offset + 24, depth)?;
12449            self.2.encode(encoder, offset + 36, depth)?;
12450            self.3.encode(encoder, offset + 48, depth)?;
12451            self.4.encode(encoder, offset + 49, depth)?;
12452            Ok(())
12453        }
12454    }
12455
12456    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewProperties {
12457        #[inline(always)]
12458        fn new_empty() -> Self {
12459            Self {
12460                bounding_box: fidl::new_empty!(BoundingBox, D),
12461                inset_from_min: fidl::new_empty!(Vec3, D),
12462                inset_from_max: fidl::new_empty!(Vec3, D),
12463                focus_change: fidl::new_empty!(bool, D),
12464                downward_input: fidl::new_empty!(bool, D),
12465            }
12466        }
12467
12468        #[inline]
12469        unsafe fn decode(
12470            &mut self,
12471            decoder: &mut fidl::encoding::Decoder<'_, D>,
12472            offset: usize,
12473            _depth: fidl::encoding::Depth,
12474        ) -> fidl::Result<()> {
12475            decoder.debug_check_bounds::<Self>(offset);
12476            // Verify that padding bytes are zero.
12477            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
12478            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12479            let mask = 0xffff0000u32;
12480            let maskedval = padval & mask;
12481            if maskedval != 0 {
12482                return Err(fidl::Error::NonZeroPadding {
12483                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
12484                });
12485            }
12486            fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 0, _depth)?;
12487            fidl::decode!(Vec3, D, &mut self.inset_from_min, decoder, offset + 24, _depth)?;
12488            fidl::decode!(Vec3, D, &mut self.inset_from_max, decoder, offset + 36, _depth)?;
12489            fidl::decode!(bool, D, &mut self.focus_change, decoder, offset + 48, _depth)?;
12490            fidl::decode!(bool, D, &mut self.downward_input, decoder, offset + 49, _depth)?;
12491            Ok(())
12492        }
12493    }
12494
12495    impl fidl::encoding::ValueTypeMarker for ViewPropertiesChangedEvent {
12496        type Borrowed<'a> = &'a Self;
12497        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12498            value
12499        }
12500    }
12501
12502    unsafe impl fidl::encoding::TypeMarker for ViewPropertiesChangedEvent {
12503        type Owned = Self;
12504
12505        #[inline(always)]
12506        fn inline_align(_context: fidl::encoding::Context) -> usize {
12507            4
12508        }
12509
12510        #[inline(always)]
12511        fn inline_size(_context: fidl::encoding::Context) -> usize {
12512            56
12513        }
12514    }
12515
12516    unsafe impl<D: fidl::encoding::ResourceDialect>
12517        fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for &ViewPropertiesChangedEvent
12518    {
12519        #[inline]
12520        unsafe fn encode(
12521            self,
12522            encoder: &mut fidl::encoding::Encoder<'_, D>,
12523            offset: usize,
12524            _depth: fidl::encoding::Depth,
12525        ) -> fidl::Result<()> {
12526            encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12527            // Delegate to tuple encoding.
12528            fidl::encoding::Encode::<ViewPropertiesChangedEvent, D>::encode(
12529                (
12530                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
12531                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
12532                ),
12533                encoder,
12534                offset,
12535                _depth,
12536            )
12537        }
12538    }
12539    unsafe impl<
12540        D: fidl::encoding::ResourceDialect,
12541        T0: fidl::encoding::Encode<u32, D>,
12542        T1: fidl::encoding::Encode<ViewProperties, D>,
12543    > fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for (T0, T1)
12544    {
12545        #[inline]
12546        unsafe fn encode(
12547            self,
12548            encoder: &mut fidl::encoding::Encoder<'_, D>,
12549            offset: usize,
12550            depth: fidl::encoding::Depth,
12551        ) -> fidl::Result<()> {
12552            encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12553            // Zero out padding regions. There's no need to apply masks
12554            // because the unmasked parts will be overwritten by fields.
12555            // Write the fields.
12556            self.0.encode(encoder, offset + 0, depth)?;
12557            self.1.encode(encoder, offset + 4, depth)?;
12558            Ok(())
12559        }
12560    }
12561
12562    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12563        for ViewPropertiesChangedEvent
12564    {
12565        #[inline(always)]
12566        fn new_empty() -> Self {
12567            Self {
12568                view_id: fidl::new_empty!(u32, D),
12569                properties: fidl::new_empty!(ViewProperties, D),
12570            }
12571        }
12572
12573        #[inline]
12574        unsafe fn decode(
12575            &mut self,
12576            decoder: &mut fidl::encoding::Decoder<'_, D>,
12577            offset: usize,
12578            _depth: fidl::encoding::Depth,
12579        ) -> fidl::Result<()> {
12580            decoder.debug_check_bounds::<Self>(offset);
12581            // Verify that padding bytes are zero.
12582            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
12583            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
12584            Ok(())
12585        }
12586    }
12587
12588    impl fidl::encoding::ValueTypeMarker for ViewState {
12589        type Borrowed<'a> = &'a Self;
12590        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12591            value
12592        }
12593    }
12594
12595    unsafe impl fidl::encoding::TypeMarker for ViewState {
12596        type Owned = Self;
12597
12598        #[inline(always)]
12599        fn inline_align(_context: fidl::encoding::Context) -> usize {
12600            1
12601        }
12602
12603        #[inline(always)]
12604        fn inline_size(_context: fidl::encoding::Context) -> usize {
12605            1
12606        }
12607    }
12608
12609    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewState, D>
12610        for &ViewState
12611    {
12612        #[inline]
12613        unsafe fn encode(
12614            self,
12615            encoder: &mut fidl::encoding::Encoder<'_, D>,
12616            offset: usize,
12617            _depth: fidl::encoding::Depth,
12618        ) -> fidl::Result<()> {
12619            encoder.debug_check_bounds::<ViewState>(offset);
12620            // Delegate to tuple encoding.
12621            fidl::encoding::Encode::<ViewState, D>::encode(
12622                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_rendering),),
12623                encoder,
12624                offset,
12625                _depth,
12626            )
12627        }
12628    }
12629    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12630        fidl::encoding::Encode<ViewState, D> for (T0,)
12631    {
12632        #[inline]
12633        unsafe fn encode(
12634            self,
12635            encoder: &mut fidl::encoding::Encoder<'_, D>,
12636            offset: usize,
12637            depth: fidl::encoding::Depth,
12638        ) -> fidl::Result<()> {
12639            encoder.debug_check_bounds::<ViewState>(offset);
12640            // Zero out padding regions. There's no need to apply masks
12641            // because the unmasked parts will be overwritten by fields.
12642            // Write the fields.
12643            self.0.encode(encoder, offset + 0, depth)?;
12644            Ok(())
12645        }
12646    }
12647
12648    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewState {
12649        #[inline(always)]
12650        fn new_empty() -> Self {
12651            Self { is_rendering: fidl::new_empty!(bool, D) }
12652        }
12653
12654        #[inline]
12655        unsafe fn decode(
12656            &mut self,
12657            decoder: &mut fidl::encoding::Decoder<'_, D>,
12658            offset: usize,
12659            _depth: fidl::encoding::Depth,
12660        ) -> fidl::Result<()> {
12661            decoder.debug_check_bounds::<Self>(offset);
12662            // Verify that padding bytes are zero.
12663            fidl::decode!(bool, D, &mut self.is_rendering, decoder, offset + 0, _depth)?;
12664            Ok(())
12665        }
12666    }
12667
12668    impl fidl::encoding::ValueTypeMarker for ViewStateChangedEvent {
12669        type Borrowed<'a> = &'a Self;
12670        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12671            value
12672        }
12673    }
12674
12675    unsafe impl fidl::encoding::TypeMarker for ViewStateChangedEvent {
12676        type Owned = Self;
12677
12678        #[inline(always)]
12679        fn inline_align(_context: fidl::encoding::Context) -> usize {
12680            4
12681        }
12682
12683        #[inline(always)]
12684        fn inline_size(_context: fidl::encoding::Context) -> usize {
12685            8
12686        }
12687    }
12688
12689    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewStateChangedEvent, D>
12690        for &ViewStateChangedEvent
12691    {
12692        #[inline]
12693        unsafe fn encode(
12694            self,
12695            encoder: &mut fidl::encoding::Encoder<'_, D>,
12696            offset: usize,
12697            _depth: fidl::encoding::Depth,
12698        ) -> fidl::Result<()> {
12699            encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12700            // Delegate to tuple encoding.
12701            fidl::encoding::Encode::<ViewStateChangedEvent, D>::encode(
12702                (
12703                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
12704                    <ViewState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
12705                ),
12706                encoder,
12707                offset,
12708                _depth,
12709            )
12710        }
12711    }
12712    unsafe impl<
12713        D: fidl::encoding::ResourceDialect,
12714        T0: fidl::encoding::Encode<u32, D>,
12715        T1: fidl::encoding::Encode<ViewState, D>,
12716    > fidl::encoding::Encode<ViewStateChangedEvent, D> for (T0, T1)
12717    {
12718        #[inline]
12719        unsafe fn encode(
12720            self,
12721            encoder: &mut fidl::encoding::Encoder<'_, D>,
12722            offset: usize,
12723            depth: fidl::encoding::Depth,
12724        ) -> fidl::Result<()> {
12725            encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12726            // Zero out padding regions. There's no need to apply masks
12727            // because the unmasked parts will be overwritten by fields.
12728            unsafe {
12729                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
12730                (ptr as *mut u32).write_unaligned(0);
12731            }
12732            // Write the fields.
12733            self.0.encode(encoder, offset + 0, depth)?;
12734            self.1.encode(encoder, offset + 4, depth)?;
12735            Ok(())
12736        }
12737    }
12738
12739    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewStateChangedEvent {
12740        #[inline(always)]
12741        fn new_empty() -> Self {
12742            Self { view_holder_id: fidl::new_empty!(u32, D), state: fidl::new_empty!(ViewState, D) }
12743        }
12744
12745        #[inline]
12746        unsafe fn decode(
12747            &mut self,
12748            decoder: &mut fidl::encoding::Decoder<'_, D>,
12749            offset: usize,
12750            _depth: fidl::encoding::Depth,
12751        ) -> fidl::Result<()> {
12752            decoder.debug_check_bounds::<Self>(offset);
12753            // Verify that padding bytes are zero.
12754            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
12755            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12756            let mask = 0xffffff00u32;
12757            let maskedval = padval & mask;
12758            if maskedval != 0 {
12759                return Err(fidl::Error::NonZeroPadding {
12760                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
12761                });
12762            }
12763            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
12764            fidl::decode!(ViewState, D, &mut self.state, decoder, offset + 4, _depth)?;
12765            Ok(())
12766        }
12767    }
12768
12769    impl fidl::encoding::ValueTypeMarker for Mat4 {
12770        type Borrowed<'a> = &'a Self;
12771        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12772            value
12773        }
12774    }
12775
12776    unsafe impl fidl::encoding::TypeMarker for Mat4 {
12777        type Owned = Self;
12778
12779        #[inline(always)]
12780        fn inline_align(_context: fidl::encoding::Context) -> usize {
12781            4
12782        }
12783
12784        #[inline(always)]
12785        fn inline_size(_context: fidl::encoding::Context) -> usize {
12786            64
12787        }
12788    }
12789
12790    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Mat4, D> for &Mat4 {
12791        #[inline]
12792        unsafe fn encode(
12793            self,
12794            encoder: &mut fidl::encoding::Encoder<'_, D>,
12795            offset: usize,
12796            _depth: fidl::encoding::Depth,
12797        ) -> fidl::Result<()> {
12798            encoder.debug_check_bounds::<Mat4>(offset);
12799            // Delegate to tuple encoding.
12800            fidl::encoding::Encode::<Mat4, D>::encode(
12801                (<fidl::encoding::Array<f32, 16> as fidl::encoding::ValueTypeMarker>::borrow(
12802                    &self.matrix,
12803                ),),
12804                encoder,
12805                offset,
12806                _depth,
12807            )
12808        }
12809    }
12810    unsafe impl<
12811        D: fidl::encoding::ResourceDialect,
12812        T0: fidl::encoding::Encode<fidl::encoding::Array<f32, 16>, D>,
12813    > fidl::encoding::Encode<Mat4, D> for (T0,)
12814    {
12815        #[inline]
12816        unsafe fn encode(
12817            self,
12818            encoder: &mut fidl::encoding::Encoder<'_, D>,
12819            offset: usize,
12820            depth: fidl::encoding::Depth,
12821        ) -> fidl::Result<()> {
12822            encoder.debug_check_bounds::<Mat4>(offset);
12823            // Zero out padding regions. There's no need to apply masks
12824            // because the unmasked parts will be overwritten by fields.
12825            // Write the fields.
12826            self.0.encode(encoder, offset + 0, depth)?;
12827            Ok(())
12828        }
12829    }
12830
12831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Mat4 {
12832        #[inline(always)]
12833        fn new_empty() -> Self {
12834            Self { matrix: fidl::new_empty!(fidl::encoding::Array<f32, 16>, D) }
12835        }
12836
12837        #[inline]
12838        unsafe fn decode(
12839            &mut self,
12840            decoder: &mut fidl::encoding::Decoder<'_, D>,
12841            offset: usize,
12842            _depth: fidl::encoding::Depth,
12843        ) -> fidl::Result<()> {
12844            decoder.debug_check_bounds::<Self>(offset);
12845            // Verify that padding bytes are zero.
12846            fidl::decode!(fidl::encoding::Array<f32, 16>, D, &mut self.matrix, decoder, offset + 0, _depth)?;
12847            Ok(())
12848        }
12849    }
12850
12851    impl fidl::encoding::ValueTypeMarker for Vec2 {
12852        type Borrowed<'a> = &'a Self;
12853        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12854            value
12855        }
12856    }
12857
12858    unsafe impl fidl::encoding::TypeMarker for Vec2 {
12859        type Owned = Self;
12860
12861        #[inline(always)]
12862        fn inline_align(_context: fidl::encoding::Context) -> usize {
12863            4
12864        }
12865
12866        #[inline(always)]
12867        fn inline_size(_context: fidl::encoding::Context) -> usize {
12868            8
12869        }
12870    }
12871
12872    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec2, D> for &Vec2 {
12873        #[inline]
12874        unsafe fn encode(
12875            self,
12876            encoder: &mut fidl::encoding::Encoder<'_, D>,
12877            offset: usize,
12878            _depth: fidl::encoding::Depth,
12879        ) -> fidl::Result<()> {
12880            encoder.debug_check_bounds::<Vec2>(offset);
12881            // Delegate to tuple encoding.
12882            fidl::encoding::Encode::<Vec2, D>::encode(
12883                (
12884                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
12885                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
12886                ),
12887                encoder,
12888                offset,
12889                _depth,
12890            )
12891        }
12892    }
12893    unsafe impl<
12894        D: fidl::encoding::ResourceDialect,
12895        T0: fidl::encoding::Encode<f32, D>,
12896        T1: fidl::encoding::Encode<f32, D>,
12897    > fidl::encoding::Encode<Vec2, D> for (T0, T1)
12898    {
12899        #[inline]
12900        unsafe fn encode(
12901            self,
12902            encoder: &mut fidl::encoding::Encoder<'_, D>,
12903            offset: usize,
12904            depth: fidl::encoding::Depth,
12905        ) -> fidl::Result<()> {
12906            encoder.debug_check_bounds::<Vec2>(offset);
12907            // Zero out padding regions. There's no need to apply masks
12908            // because the unmasked parts will be overwritten by fields.
12909            // Write the fields.
12910            self.0.encode(encoder, offset + 0, depth)?;
12911            self.1.encode(encoder, offset + 4, depth)?;
12912            Ok(())
12913        }
12914    }
12915
12916    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec2 {
12917        #[inline(always)]
12918        fn new_empty() -> Self {
12919            Self { x: fidl::new_empty!(f32, D), y: fidl::new_empty!(f32, D) }
12920        }
12921
12922        #[inline]
12923        unsafe fn decode(
12924            &mut self,
12925            decoder: &mut fidl::encoding::Decoder<'_, D>,
12926            offset: usize,
12927            _depth: fidl::encoding::Depth,
12928        ) -> fidl::Result<()> {
12929            decoder.debug_check_bounds::<Self>(offset);
12930            // Verify that padding bytes are zero.
12931            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
12932            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
12933            Ok(())
12934        }
12935    }
12936
12937    impl fidl::encoding::ValueTypeMarker for Vec3 {
12938        type Borrowed<'a> = &'a Self;
12939        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12940            value
12941        }
12942    }
12943
12944    unsafe impl fidl::encoding::TypeMarker for Vec3 {
12945        type Owned = Self;
12946
12947        #[inline(always)]
12948        fn inline_align(_context: fidl::encoding::Context) -> usize {
12949            4
12950        }
12951
12952        #[inline(always)]
12953        fn inline_size(_context: fidl::encoding::Context) -> usize {
12954            12
12955        }
12956    }
12957
12958    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec3, D> for &Vec3 {
12959        #[inline]
12960        unsafe fn encode(
12961            self,
12962            encoder: &mut fidl::encoding::Encoder<'_, D>,
12963            offset: usize,
12964            _depth: fidl::encoding::Depth,
12965        ) -> fidl::Result<()> {
12966            encoder.debug_check_bounds::<Vec3>(offset);
12967            // Delegate to tuple encoding.
12968            fidl::encoding::Encode::<Vec3, D>::encode(
12969                (
12970                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
12971                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
12972                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
12973                ),
12974                encoder,
12975                offset,
12976                _depth,
12977            )
12978        }
12979    }
12980    unsafe impl<
12981        D: fidl::encoding::ResourceDialect,
12982        T0: fidl::encoding::Encode<f32, D>,
12983        T1: fidl::encoding::Encode<f32, D>,
12984        T2: fidl::encoding::Encode<f32, D>,
12985    > fidl::encoding::Encode<Vec3, D> for (T0, T1, T2)
12986    {
12987        #[inline]
12988        unsafe fn encode(
12989            self,
12990            encoder: &mut fidl::encoding::Encoder<'_, D>,
12991            offset: usize,
12992            depth: fidl::encoding::Depth,
12993        ) -> fidl::Result<()> {
12994            encoder.debug_check_bounds::<Vec3>(offset);
12995            // Zero out padding regions. There's no need to apply masks
12996            // because the unmasked parts will be overwritten by fields.
12997            // Write the fields.
12998            self.0.encode(encoder, offset + 0, depth)?;
12999            self.1.encode(encoder, offset + 4, depth)?;
13000            self.2.encode(encoder, offset + 8, depth)?;
13001            Ok(())
13002        }
13003    }
13004
13005    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec3 {
13006        #[inline(always)]
13007        fn new_empty() -> Self {
13008            Self {
13009                x: fidl::new_empty!(f32, D),
13010                y: fidl::new_empty!(f32, D),
13011                z: fidl::new_empty!(f32, D),
13012            }
13013        }
13014
13015        #[inline]
13016        unsafe fn decode(
13017            &mut self,
13018            decoder: &mut fidl::encoding::Decoder<'_, D>,
13019            offset: usize,
13020            _depth: fidl::encoding::Depth,
13021        ) -> fidl::Result<()> {
13022            decoder.debug_check_bounds::<Self>(offset);
13023            // Verify that padding bytes are zero.
13024            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13025            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13026            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13027            Ok(())
13028        }
13029    }
13030
13031    impl fidl::encoding::ValueTypeMarker for Vec4 {
13032        type Borrowed<'a> = &'a Self;
13033        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13034            value
13035        }
13036    }
13037
13038    unsafe impl fidl::encoding::TypeMarker for Vec4 {
13039        type Owned = Self;
13040
13041        #[inline(always)]
13042        fn inline_align(_context: fidl::encoding::Context) -> usize {
13043            4
13044        }
13045
13046        #[inline(always)]
13047        fn inline_size(_context: fidl::encoding::Context) -> usize {
13048            16
13049        }
13050    }
13051
13052    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec4, D> for &Vec4 {
13053        #[inline]
13054        unsafe fn encode(
13055            self,
13056            encoder: &mut fidl::encoding::Encoder<'_, D>,
13057            offset: usize,
13058            _depth: fidl::encoding::Depth,
13059        ) -> fidl::Result<()> {
13060            encoder.debug_check_bounds::<Vec4>(offset);
13061            // Delegate to tuple encoding.
13062            fidl::encoding::Encode::<Vec4, D>::encode(
13063                (
13064                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
13065                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
13066                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
13067                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
13068                ),
13069                encoder,
13070                offset,
13071                _depth,
13072            )
13073        }
13074    }
13075    unsafe impl<
13076        D: fidl::encoding::ResourceDialect,
13077        T0: fidl::encoding::Encode<f32, D>,
13078        T1: fidl::encoding::Encode<f32, D>,
13079        T2: fidl::encoding::Encode<f32, D>,
13080        T3: fidl::encoding::Encode<f32, D>,
13081    > fidl::encoding::Encode<Vec4, D> for (T0, T1, T2, T3)
13082    {
13083        #[inline]
13084        unsafe fn encode(
13085            self,
13086            encoder: &mut fidl::encoding::Encoder<'_, D>,
13087            offset: usize,
13088            depth: fidl::encoding::Depth,
13089        ) -> fidl::Result<()> {
13090            encoder.debug_check_bounds::<Vec4>(offset);
13091            // Zero out padding regions. There's no need to apply masks
13092            // because the unmasked parts will be overwritten by fields.
13093            // Write the fields.
13094            self.0.encode(encoder, offset + 0, depth)?;
13095            self.1.encode(encoder, offset + 4, depth)?;
13096            self.2.encode(encoder, offset + 8, depth)?;
13097            self.3.encode(encoder, offset + 12, depth)?;
13098            Ok(())
13099        }
13100    }
13101
13102    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec4 {
13103        #[inline(always)]
13104        fn new_empty() -> Self {
13105            Self {
13106                x: fidl::new_empty!(f32, D),
13107                y: fidl::new_empty!(f32, D),
13108                z: fidl::new_empty!(f32, D),
13109                w: fidl::new_empty!(f32, D),
13110            }
13111        }
13112
13113        #[inline]
13114        unsafe fn decode(
13115            &mut self,
13116            decoder: &mut fidl::encoding::Decoder<'_, D>,
13117            offset: usize,
13118            _depth: fidl::encoding::Depth,
13119        ) -> fidl::Result<()> {
13120            decoder.debug_check_bounds::<Self>(offset);
13121            // Verify that padding bytes are zero.
13122            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13123            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13124            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13125            fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
13126            Ok(())
13127        }
13128    }
13129
13130    impl fidl::encoding::ValueTypeMarker for Event {
13131        type Borrowed<'a> = &'a Self;
13132        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13133            value
13134        }
13135    }
13136
13137    unsafe impl fidl::encoding::TypeMarker for Event {
13138        type Owned = Self;
13139
13140        #[inline(always)]
13141        fn inline_align(_context: fidl::encoding::Context) -> usize {
13142            8
13143        }
13144
13145        #[inline(always)]
13146        fn inline_size(_context: fidl::encoding::Context) -> usize {
13147            16
13148        }
13149    }
13150
13151    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Event, D> for &Event {
13152        #[inline]
13153        unsafe fn encode(
13154            self,
13155            encoder: &mut fidl::encoding::Encoder<'_, D>,
13156            offset: usize,
13157            _depth: fidl::encoding::Depth,
13158        ) -> fidl::Result<()> {
13159            encoder.debug_check_bounds::<Event>(offset);
13160            encoder.write_num::<u64>(self.ordinal(), offset);
13161            match self {
13162                Event::Metrics(ref val) => fidl::encoding::encode_in_envelope::<MetricsEvent, D>(
13163                    <MetricsEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13164                    encoder,
13165                    offset + 8,
13166                    _depth,
13167                ),
13168                Event::SizeChangeHint(ref val) => {
13169                    fidl::encoding::encode_in_envelope::<SizeChangeHintEvent, D>(
13170                        <SizeChangeHintEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13171                        encoder,
13172                        offset + 8,
13173                        _depth,
13174                    )
13175                }
13176                Event::ImportUnbound(ref val) => {
13177                    fidl::encoding::encode_in_envelope::<ImportUnboundEvent, D>(
13178                        <ImportUnboundEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13179                        encoder,
13180                        offset + 8,
13181                        _depth,
13182                    )
13183                }
13184                Event::ViewConnected(ref val) => {
13185                    fidl::encoding::encode_in_envelope::<ViewConnectedEvent, D>(
13186                        <ViewConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13187                        encoder,
13188                        offset + 8,
13189                        _depth,
13190                    )
13191                }
13192                Event::ViewDisconnected(ref val) => {
13193                    fidl::encoding::encode_in_envelope::<ViewDisconnectedEvent, D>(
13194                        <ViewDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13195                        encoder,
13196                        offset + 8,
13197                        _depth,
13198                    )
13199                }
13200                Event::ViewHolderDisconnected(ref val) => fidl::encoding::encode_in_envelope::<
13201                    ViewHolderDisconnectedEvent,
13202                    D,
13203                >(
13204                    <ViewHolderDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13205                    encoder,
13206                    offset + 8,
13207                    _depth,
13208                ),
13209                Event::ViewAttachedToScene(ref val) => {
13210                    fidl::encoding::encode_in_envelope::<ViewAttachedToSceneEvent, D>(
13211                        <ViewAttachedToSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13212                        encoder,
13213                        offset + 8,
13214                        _depth,
13215                    )
13216                }
13217                Event::ViewDetachedFromScene(ref val) => fidl::encoding::encode_in_envelope::<
13218                    ViewDetachedFromSceneEvent,
13219                    D,
13220                >(
13221                    <ViewDetachedFromSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13222                    encoder,
13223                    offset + 8,
13224                    _depth,
13225                ),
13226                Event::ViewPropertiesChanged(ref val) => fidl::encoding::encode_in_envelope::<
13227                    ViewPropertiesChangedEvent,
13228                    D,
13229                >(
13230                    <ViewPropertiesChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13231                    encoder,
13232                    offset + 8,
13233                    _depth,
13234                ),
13235                Event::ViewStateChanged(ref val) => {
13236                    fidl::encoding::encode_in_envelope::<ViewStateChangedEvent, D>(
13237                        <ViewStateChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13238                        encoder,
13239                        offset + 8,
13240                        _depth,
13241                    )
13242                }
13243                Event::ViewHolderConnected(ref val) => {
13244                    fidl::encoding::encode_in_envelope::<ViewHolderConnectedEvent, D>(
13245                        <ViewHolderConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13246                        encoder,
13247                        offset + 8,
13248                        _depth,
13249                    )
13250                }
13251            }
13252        }
13253    }
13254
13255    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Event {
13256        #[inline(always)]
13257        fn new_empty() -> Self {
13258            Self::Metrics(fidl::new_empty!(MetricsEvent, D))
13259        }
13260
13261        #[inline]
13262        unsafe fn decode(
13263            &mut self,
13264            decoder: &mut fidl::encoding::Decoder<'_, D>,
13265            offset: usize,
13266            mut depth: fidl::encoding::Depth,
13267        ) -> fidl::Result<()> {
13268            decoder.debug_check_bounds::<Self>(offset);
13269            #[allow(unused_variables)]
13270            let next_out_of_line = decoder.next_out_of_line();
13271            let handles_before = decoder.remaining_handles();
13272            let (ordinal, inlined, num_bytes, num_handles) =
13273                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13274
13275            let member_inline_size = match ordinal {
13276                1 => <MetricsEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13277                2 => <SizeChangeHintEvent as fidl::encoding::TypeMarker>::inline_size(
13278                    decoder.context,
13279                ),
13280                3 => {
13281                    <ImportUnboundEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13282                }
13283                4 => {
13284                    <ViewConnectedEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13285                }
13286                5 => <ViewDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13287                    decoder.context,
13288                ),
13289                6 => <ViewHolderDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13290                    decoder.context,
13291                ),
13292                7 => <ViewAttachedToSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13293                    decoder.context,
13294                ),
13295                8 => <ViewDetachedFromSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13296                    decoder.context,
13297                ),
13298                9 => <ViewPropertiesChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13299                    decoder.context,
13300                ),
13301                10 => <ViewStateChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13302                    decoder.context,
13303                ),
13304                11 => <ViewHolderConnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13305                    decoder.context,
13306                ),
13307                _ => return Err(fidl::Error::UnknownUnionTag),
13308            };
13309
13310            if inlined != (member_inline_size <= 4) {
13311                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13312            }
13313            let _inner_offset;
13314            if inlined {
13315                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13316                _inner_offset = offset + 8;
13317            } else {
13318                depth.increment()?;
13319                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13320            }
13321            match ordinal {
13322                1 => {
13323                    #[allow(irrefutable_let_patterns)]
13324                    if let Event::Metrics(_) = self {
13325                        // Do nothing, read the value into the object
13326                    } else {
13327                        // Initialize `self` to the right variant
13328                        *self = Event::Metrics(fidl::new_empty!(MetricsEvent, D));
13329                    }
13330                    #[allow(irrefutable_let_patterns)]
13331                    if let Event::Metrics(ref mut val) = self {
13332                        fidl::decode!(MetricsEvent, D, val, decoder, _inner_offset, depth)?;
13333                    } else {
13334                        unreachable!()
13335                    }
13336                }
13337                2 => {
13338                    #[allow(irrefutable_let_patterns)]
13339                    if let Event::SizeChangeHint(_) = self {
13340                        // Do nothing, read the value into the object
13341                    } else {
13342                        // Initialize `self` to the right variant
13343                        *self = Event::SizeChangeHint(fidl::new_empty!(SizeChangeHintEvent, D));
13344                    }
13345                    #[allow(irrefutable_let_patterns)]
13346                    if let Event::SizeChangeHint(ref mut val) = self {
13347                        fidl::decode!(SizeChangeHintEvent, D, val, decoder, _inner_offset, depth)?;
13348                    } else {
13349                        unreachable!()
13350                    }
13351                }
13352                3 => {
13353                    #[allow(irrefutable_let_patterns)]
13354                    if let Event::ImportUnbound(_) = self {
13355                        // Do nothing, read the value into the object
13356                    } else {
13357                        // Initialize `self` to the right variant
13358                        *self = Event::ImportUnbound(fidl::new_empty!(ImportUnboundEvent, D));
13359                    }
13360                    #[allow(irrefutable_let_patterns)]
13361                    if let Event::ImportUnbound(ref mut val) = self {
13362                        fidl::decode!(ImportUnboundEvent, D, val, decoder, _inner_offset, depth)?;
13363                    } else {
13364                        unreachable!()
13365                    }
13366                }
13367                4 => {
13368                    #[allow(irrefutable_let_patterns)]
13369                    if let Event::ViewConnected(_) = self {
13370                        // Do nothing, read the value into the object
13371                    } else {
13372                        // Initialize `self` to the right variant
13373                        *self = Event::ViewConnected(fidl::new_empty!(ViewConnectedEvent, D));
13374                    }
13375                    #[allow(irrefutable_let_patterns)]
13376                    if let Event::ViewConnected(ref mut val) = self {
13377                        fidl::decode!(ViewConnectedEvent, D, val, decoder, _inner_offset, depth)?;
13378                    } else {
13379                        unreachable!()
13380                    }
13381                }
13382                5 => {
13383                    #[allow(irrefutable_let_patterns)]
13384                    if let Event::ViewDisconnected(_) = self {
13385                        // Do nothing, read the value into the object
13386                    } else {
13387                        // Initialize `self` to the right variant
13388                        *self = Event::ViewDisconnected(fidl::new_empty!(ViewDisconnectedEvent, D));
13389                    }
13390                    #[allow(irrefutable_let_patterns)]
13391                    if let Event::ViewDisconnected(ref mut val) = self {
13392                        fidl::decode!(
13393                            ViewDisconnectedEvent,
13394                            D,
13395                            val,
13396                            decoder,
13397                            _inner_offset,
13398                            depth
13399                        )?;
13400                    } else {
13401                        unreachable!()
13402                    }
13403                }
13404                6 => {
13405                    #[allow(irrefutable_let_patterns)]
13406                    if let Event::ViewHolderDisconnected(_) = self {
13407                        // Do nothing, read the value into the object
13408                    } else {
13409                        // Initialize `self` to the right variant
13410                        *self = Event::ViewHolderDisconnected(fidl::new_empty!(
13411                            ViewHolderDisconnectedEvent,
13412                            D
13413                        ));
13414                    }
13415                    #[allow(irrefutable_let_patterns)]
13416                    if let Event::ViewHolderDisconnected(ref mut val) = self {
13417                        fidl::decode!(
13418                            ViewHolderDisconnectedEvent,
13419                            D,
13420                            val,
13421                            decoder,
13422                            _inner_offset,
13423                            depth
13424                        )?;
13425                    } else {
13426                        unreachable!()
13427                    }
13428                }
13429                7 => {
13430                    #[allow(irrefutable_let_patterns)]
13431                    if let Event::ViewAttachedToScene(_) = self {
13432                        // Do nothing, read the value into the object
13433                    } else {
13434                        // Initialize `self` to the right variant
13435                        *self = Event::ViewAttachedToScene(fidl::new_empty!(
13436                            ViewAttachedToSceneEvent,
13437                            D
13438                        ));
13439                    }
13440                    #[allow(irrefutable_let_patterns)]
13441                    if let Event::ViewAttachedToScene(ref mut val) = self {
13442                        fidl::decode!(
13443                            ViewAttachedToSceneEvent,
13444                            D,
13445                            val,
13446                            decoder,
13447                            _inner_offset,
13448                            depth
13449                        )?;
13450                    } else {
13451                        unreachable!()
13452                    }
13453                }
13454                8 => {
13455                    #[allow(irrefutable_let_patterns)]
13456                    if let Event::ViewDetachedFromScene(_) = self {
13457                        // Do nothing, read the value into the object
13458                    } else {
13459                        // Initialize `self` to the right variant
13460                        *self = Event::ViewDetachedFromScene(fidl::new_empty!(
13461                            ViewDetachedFromSceneEvent,
13462                            D
13463                        ));
13464                    }
13465                    #[allow(irrefutable_let_patterns)]
13466                    if let Event::ViewDetachedFromScene(ref mut val) = self {
13467                        fidl::decode!(
13468                            ViewDetachedFromSceneEvent,
13469                            D,
13470                            val,
13471                            decoder,
13472                            _inner_offset,
13473                            depth
13474                        )?;
13475                    } else {
13476                        unreachable!()
13477                    }
13478                }
13479                9 => {
13480                    #[allow(irrefutable_let_patterns)]
13481                    if let Event::ViewPropertiesChanged(_) = self {
13482                        // Do nothing, read the value into the object
13483                    } else {
13484                        // Initialize `self` to the right variant
13485                        *self = Event::ViewPropertiesChanged(fidl::new_empty!(
13486                            ViewPropertiesChangedEvent,
13487                            D
13488                        ));
13489                    }
13490                    #[allow(irrefutable_let_patterns)]
13491                    if let Event::ViewPropertiesChanged(ref mut val) = self {
13492                        fidl::decode!(
13493                            ViewPropertiesChangedEvent,
13494                            D,
13495                            val,
13496                            decoder,
13497                            _inner_offset,
13498                            depth
13499                        )?;
13500                    } else {
13501                        unreachable!()
13502                    }
13503                }
13504                10 => {
13505                    #[allow(irrefutable_let_patterns)]
13506                    if let Event::ViewStateChanged(_) = self {
13507                        // Do nothing, read the value into the object
13508                    } else {
13509                        // Initialize `self` to the right variant
13510                        *self = Event::ViewStateChanged(fidl::new_empty!(ViewStateChangedEvent, D));
13511                    }
13512                    #[allow(irrefutable_let_patterns)]
13513                    if let Event::ViewStateChanged(ref mut val) = self {
13514                        fidl::decode!(
13515                            ViewStateChangedEvent,
13516                            D,
13517                            val,
13518                            decoder,
13519                            _inner_offset,
13520                            depth
13521                        )?;
13522                    } else {
13523                        unreachable!()
13524                    }
13525                }
13526                11 => {
13527                    #[allow(irrefutable_let_patterns)]
13528                    if let Event::ViewHolderConnected(_) = self {
13529                        // Do nothing, read the value into the object
13530                    } else {
13531                        // Initialize `self` to the right variant
13532                        *self = Event::ViewHolderConnected(fidl::new_empty!(
13533                            ViewHolderConnectedEvent,
13534                            D
13535                        ));
13536                    }
13537                    #[allow(irrefutable_let_patterns)]
13538                    if let Event::ViewHolderConnected(ref mut val) = self {
13539                        fidl::decode!(
13540                            ViewHolderConnectedEvent,
13541                            D,
13542                            val,
13543                            decoder,
13544                            _inner_offset,
13545                            depth
13546                        )?;
13547                    } else {
13548                        unreachable!()
13549                    }
13550                }
13551                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13552            }
13553            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13554                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13555            }
13556            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13557                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13558            }
13559            Ok(())
13560        }
13561    }
13562
13563    impl fidl::encoding::ValueTypeMarker for RendererParam {
13564        type Borrowed<'a> = &'a Self;
13565        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13566            value
13567        }
13568    }
13569
13570    unsafe impl fidl::encoding::TypeMarker for RendererParam {
13571        type Owned = Self;
13572
13573        #[inline(always)]
13574        fn inline_align(_context: fidl::encoding::Context) -> usize {
13575            8
13576        }
13577
13578        #[inline(always)]
13579        fn inline_size(_context: fidl::encoding::Context) -> usize {
13580            16
13581        }
13582    }
13583
13584    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererParam, D>
13585        for &RendererParam
13586    {
13587        #[inline]
13588        unsafe fn encode(
13589            self,
13590            encoder: &mut fidl::encoding::Encoder<'_, D>,
13591            offset: usize,
13592            _depth: fidl::encoding::Depth,
13593        ) -> fidl::Result<()> {
13594            encoder.debug_check_bounds::<RendererParam>(offset);
13595            encoder.write_num::<u64>(self.ordinal(), offset);
13596            match self {
13597                RendererParam::ShadowTechnique(ref val) => {
13598                    fidl::encoding::encode_in_envelope::<ShadowTechnique, D>(
13599                        <ShadowTechnique as fidl::encoding::ValueTypeMarker>::borrow(val),
13600                        encoder,
13601                        offset + 8,
13602                        _depth,
13603                    )
13604                }
13605                RendererParam::Reserved(ref val) => {
13606                    fidl::encoding::encode_in_envelope::<RenderFrequency, D>(
13607                        <RenderFrequency as fidl::encoding::ValueTypeMarker>::borrow(val),
13608                        encoder,
13609                        offset + 8,
13610                        _depth,
13611                    )
13612                }
13613                RendererParam::EnableDebugging(ref val) => {
13614                    fidl::encoding::encode_in_envelope::<bool, D>(
13615                        <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
13616                        encoder,
13617                        offset + 8,
13618                        _depth,
13619                    )
13620                }
13621            }
13622        }
13623    }
13624
13625    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererParam {
13626        #[inline(always)]
13627        fn new_empty() -> Self {
13628            Self::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D))
13629        }
13630
13631        #[inline]
13632        unsafe fn decode(
13633            &mut self,
13634            decoder: &mut fidl::encoding::Decoder<'_, D>,
13635            offset: usize,
13636            mut depth: fidl::encoding::Depth,
13637        ) -> fidl::Result<()> {
13638            decoder.debug_check_bounds::<Self>(offset);
13639            #[allow(unused_variables)]
13640            let next_out_of_line = decoder.next_out_of_line();
13641            let handles_before = decoder.remaining_handles();
13642            let (ordinal, inlined, num_bytes, num_handles) =
13643                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13644
13645            let member_inline_size = match ordinal {
13646                1 => <ShadowTechnique as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13647                2 => <RenderFrequency as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13648                3 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13649                _ => return Err(fidl::Error::UnknownUnionTag),
13650            };
13651
13652            if inlined != (member_inline_size <= 4) {
13653                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13654            }
13655            let _inner_offset;
13656            if inlined {
13657                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13658                _inner_offset = offset + 8;
13659            } else {
13660                depth.increment()?;
13661                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13662            }
13663            match ordinal {
13664                1 => {
13665                    #[allow(irrefutable_let_patterns)]
13666                    if let RendererParam::ShadowTechnique(_) = self {
13667                        // Do nothing, read the value into the object
13668                    } else {
13669                        // Initialize `self` to the right variant
13670                        *self =
13671                            RendererParam::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D));
13672                    }
13673                    #[allow(irrefutable_let_patterns)]
13674                    if let RendererParam::ShadowTechnique(ref mut val) = self {
13675                        fidl::decode!(ShadowTechnique, D, val, decoder, _inner_offset, depth)?;
13676                    } else {
13677                        unreachable!()
13678                    }
13679                }
13680                2 => {
13681                    #[allow(irrefutable_let_patterns)]
13682                    if let RendererParam::Reserved(_) = self {
13683                        // Do nothing, read the value into the object
13684                    } else {
13685                        // Initialize `self` to the right variant
13686                        *self = RendererParam::Reserved(fidl::new_empty!(RenderFrequency, D));
13687                    }
13688                    #[allow(irrefutable_let_patterns)]
13689                    if let RendererParam::Reserved(ref mut val) = self {
13690                        fidl::decode!(RenderFrequency, D, val, decoder, _inner_offset, depth)?;
13691                    } else {
13692                        unreachable!()
13693                    }
13694                }
13695                3 => {
13696                    #[allow(irrefutable_let_patterns)]
13697                    if let RendererParam::EnableDebugging(_) = self {
13698                        // Do nothing, read the value into the object
13699                    } else {
13700                        // Initialize `self` to the right variant
13701                        *self = RendererParam::EnableDebugging(fidl::new_empty!(bool, D));
13702                    }
13703                    #[allow(irrefutable_let_patterns)]
13704                    if let RendererParam::EnableDebugging(ref mut val) = self {
13705                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
13706                    } else {
13707                        unreachable!()
13708                    }
13709                }
13710                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13711            }
13712            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13713                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13714            }
13715            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13716                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13717            }
13718            Ok(())
13719        }
13720    }
13721
13722    impl fidl::encoding::ValueTypeMarker for Value {
13723        type Borrowed<'a> = &'a Self;
13724        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13725            value
13726        }
13727    }
13728
13729    unsafe impl fidl::encoding::TypeMarker for Value {
13730        type Owned = Self;
13731
13732        #[inline(always)]
13733        fn inline_align(_context: fidl::encoding::Context) -> usize {
13734            8
13735        }
13736
13737        #[inline(always)]
13738        fn inline_size(_context: fidl::encoding::Context) -> usize {
13739            16
13740        }
13741    }
13742
13743    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
13744        #[inline]
13745        unsafe fn encode(
13746            self,
13747            encoder: &mut fidl::encoding::Encoder<'_, D>,
13748            offset: usize,
13749            _depth: fidl::encoding::Depth,
13750        ) -> fidl::Result<()> {
13751            encoder.debug_check_bounds::<Value>(offset);
13752            encoder.write_num::<u64>(self.ordinal(), offset);
13753            match self {
13754                Value::Vector1(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13755                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13756                    encoder,
13757                    offset + 8,
13758                    _depth,
13759                ),
13760                Value::Vector2(ref val) => fidl::encoding::encode_in_envelope::<Vec2, D>(
13761                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(val),
13762                    encoder,
13763                    offset + 8,
13764                    _depth,
13765                ),
13766                Value::Vector3(ref val) => fidl::encoding::encode_in_envelope::<Vec3, D>(
13767                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(val),
13768                    encoder,
13769                    offset + 8,
13770                    _depth,
13771                ),
13772                Value::Vector4(ref val) => fidl::encoding::encode_in_envelope::<Vec4, D>(
13773                    <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13774                    encoder,
13775                    offset + 8,
13776                    _depth,
13777                ),
13778                Value::Matrix4x4(ref val) => fidl::encoding::encode_in_envelope::<Mat4, D>(
13779                    <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13780                    encoder,
13781                    offset + 8,
13782                    _depth,
13783                ),
13784                Value::ColorRgba(ref val) => fidl::encoding::encode_in_envelope::<ColorRgba, D>(
13785                    <ColorRgba as fidl::encoding::ValueTypeMarker>::borrow(val),
13786                    encoder,
13787                    offset + 8,
13788                    _depth,
13789                ),
13790                Value::ColorRgb(ref val) => fidl::encoding::encode_in_envelope::<ColorRgb, D>(
13791                    <ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(val),
13792                    encoder,
13793                    offset + 8,
13794                    _depth,
13795                ),
13796                Value::Degrees(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13797                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13798                    encoder,
13799                    offset + 8,
13800                    _depth,
13801                ),
13802                Value::Quaternion(ref val) => fidl::encoding::encode_in_envelope::<Quaternion, D>(
13803                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(val),
13804                    encoder,
13805                    offset + 8,
13806                    _depth,
13807                ),
13808                Value::Transform(ref val) => {
13809                    fidl::encoding::encode_in_envelope::<FactoredTransform, D>(
13810                        <FactoredTransform as fidl::encoding::ValueTypeMarker>::borrow(val),
13811                        encoder,
13812                        offset + 8,
13813                        _depth,
13814                    )
13815                }
13816                Value::VariableId(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
13817                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13818                    encoder,
13819                    offset + 8,
13820                    _depth,
13821                ),
13822            }
13823        }
13824    }
13825
13826    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
13827        #[inline(always)]
13828        fn new_empty() -> Self {
13829            Self::Vector1(fidl::new_empty!(f32, D))
13830        }
13831
13832        #[inline]
13833        unsafe fn decode(
13834            &mut self,
13835            decoder: &mut fidl::encoding::Decoder<'_, D>,
13836            offset: usize,
13837            mut depth: fidl::encoding::Depth,
13838        ) -> fidl::Result<()> {
13839            decoder.debug_check_bounds::<Self>(offset);
13840            #[allow(unused_variables)]
13841            let next_out_of_line = decoder.next_out_of_line();
13842            let handles_before = decoder.remaining_handles();
13843            let (ordinal, inlined, num_bytes, num_handles) =
13844                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13845
13846            let member_inline_size = match ordinal {
13847                1 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13848                2 => <Vec2 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13849                3 => <Vec3 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13850                4 => <Vec4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13851                5 => <Mat4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13852                6 => <ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13853                7 => <ColorRgb as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13854                8 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13855                9 => <Quaternion as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13856                10 => {
13857                    <FactoredTransform as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13858                }
13859                11 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13860                _ => return Err(fidl::Error::UnknownUnionTag),
13861            };
13862
13863            if inlined != (member_inline_size <= 4) {
13864                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13865            }
13866            let _inner_offset;
13867            if inlined {
13868                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13869                _inner_offset = offset + 8;
13870            } else {
13871                depth.increment()?;
13872                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13873            }
13874            match ordinal {
13875                1 => {
13876                    #[allow(irrefutable_let_patterns)]
13877                    if let Value::Vector1(_) = self {
13878                        // Do nothing, read the value into the object
13879                    } else {
13880                        // Initialize `self` to the right variant
13881                        *self = Value::Vector1(fidl::new_empty!(f32, D));
13882                    }
13883                    #[allow(irrefutable_let_patterns)]
13884                    if let Value::Vector1(ref mut val) = self {
13885                        fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
13886                    } else {
13887                        unreachable!()
13888                    }
13889                }
13890                2 => {
13891                    #[allow(irrefutable_let_patterns)]
13892                    if let Value::Vector2(_) = self {
13893                        // Do nothing, read the value into the object
13894                    } else {
13895                        // Initialize `self` to the right variant
13896                        *self = Value::Vector2(fidl::new_empty!(Vec2, D));
13897                    }
13898                    #[allow(irrefutable_let_patterns)]
13899                    if let Value::Vector2(ref mut val) = self {
13900                        fidl::decode!(Vec2, D, val, decoder, _inner_offset, depth)?;
13901                    } else {
13902                        unreachable!()
13903                    }
13904                }
13905                3 => {
13906                    #[allow(irrefutable_let_patterns)]
13907                    if let Value::Vector3(_) = self {
13908                        // Do nothing, read the value into the object
13909                    } else {
13910                        // Initialize `self` to the right variant
13911                        *self = Value::Vector3(fidl::new_empty!(Vec3, D));
13912                    }
13913                    #[allow(irrefutable_let_patterns)]
13914                    if let Value::Vector3(ref mut val) = self {
13915                        fidl::decode!(Vec3, D, val, decoder, _inner_offset, depth)?;
13916                    } else {
13917                        unreachable!()
13918                    }
13919                }
13920                4 => {
13921                    #[allow(irrefutable_let_patterns)]
13922                    if let Value::Vector4(_) = self {
13923                        // Do nothing, read the value into the object
13924                    } else {
13925                        // Initialize `self` to the right variant
13926                        *self = Value::Vector4(fidl::new_empty!(Vec4, D));
13927                    }
13928                    #[allow(irrefutable_let_patterns)]
13929                    if let Value::Vector4(ref mut val) = self {
13930                        fidl::decode!(Vec4, D, val, decoder, _inner_offset, depth)?;
13931                    } else {
13932                        unreachable!()
13933                    }
13934                }
13935                5 => {
13936                    #[allow(irrefutable_let_patterns)]
13937                    if let Value::Matrix4x4(_) = self {
13938                        // Do nothing, read the value into the object
13939                    } else {
13940                        // Initialize `self` to the right variant
13941                        *self = Value::Matrix4x4(fidl::new_empty!(Mat4, D));
13942                    }
13943                    #[allow(irrefutable_let_patterns)]
13944                    if let Value::Matrix4x4(ref mut val) = self {
13945                        fidl::decode!(Mat4, D, val, decoder, _inner_offset, depth)?;
13946                    } else {
13947                        unreachable!()
13948                    }
13949                }
13950                6 => {
13951                    #[allow(irrefutable_let_patterns)]
13952                    if let Value::ColorRgba(_) = self {
13953                        // Do nothing, read the value into the object
13954                    } else {
13955                        // Initialize `self` to the right variant
13956                        *self = Value::ColorRgba(fidl::new_empty!(ColorRgba, D));
13957                    }
13958                    #[allow(irrefutable_let_patterns)]
13959                    if let Value::ColorRgba(ref mut val) = self {
13960                        fidl::decode!(ColorRgba, D, val, decoder, _inner_offset, depth)?;
13961                    } else {
13962                        unreachable!()
13963                    }
13964                }
13965                7 => {
13966                    #[allow(irrefutable_let_patterns)]
13967                    if let Value::ColorRgb(_) = self {
13968                        // Do nothing, read the value into the object
13969                    } else {
13970                        // Initialize `self` to the right variant
13971                        *self = Value::ColorRgb(fidl::new_empty!(ColorRgb, D));
13972                    }
13973                    #[allow(irrefutable_let_patterns)]
13974                    if let Value::ColorRgb(ref mut val) = self {
13975                        fidl::decode!(ColorRgb, D, val, decoder, _inner_offset, depth)?;
13976                    } else {
13977                        unreachable!()
13978                    }
13979                }
13980                8 => {
13981                    #[allow(irrefutable_let_patterns)]
13982                    if let Value::Degrees(_) = self {
13983                        // Do nothing, read the value into the object
13984                    } else {
13985                        // Initialize `self` to the right variant
13986                        *self = Value::Degrees(fidl::new_empty!(f32, D));
13987                    }
13988                    #[allow(irrefutable_let_patterns)]
13989                    if let Value::Degrees(ref mut val) = self {
13990                        fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
13991                    } else {
13992                        unreachable!()
13993                    }
13994                }
13995                9 => {
13996                    #[allow(irrefutable_let_patterns)]
13997                    if let Value::Quaternion(_) = self {
13998                        // Do nothing, read the value into the object
13999                    } else {
14000                        // Initialize `self` to the right variant
14001                        *self = Value::Quaternion(fidl::new_empty!(Quaternion, D));
14002                    }
14003                    #[allow(irrefutable_let_patterns)]
14004                    if let Value::Quaternion(ref mut val) = self {
14005                        fidl::decode!(Quaternion, D, val, decoder, _inner_offset, depth)?;
14006                    } else {
14007                        unreachable!()
14008                    }
14009                }
14010                10 => {
14011                    #[allow(irrefutable_let_patterns)]
14012                    if let Value::Transform(_) = self {
14013                        // Do nothing, read the value into the object
14014                    } else {
14015                        // Initialize `self` to the right variant
14016                        *self = Value::Transform(fidl::new_empty!(FactoredTransform, D));
14017                    }
14018                    #[allow(irrefutable_let_patterns)]
14019                    if let Value::Transform(ref mut val) = self {
14020                        fidl::decode!(FactoredTransform, D, val, decoder, _inner_offset, depth)?;
14021                    } else {
14022                        unreachable!()
14023                    }
14024                }
14025                11 => {
14026                    #[allow(irrefutable_let_patterns)]
14027                    if let Value::VariableId(_) = self {
14028                        // Do nothing, read the value into the object
14029                    } else {
14030                        // Initialize `self` to the right variant
14031                        *self = Value::VariableId(fidl::new_empty!(u32, D));
14032                    }
14033                    #[allow(irrefutable_let_patterns)]
14034                    if let Value::VariableId(ref mut val) = self {
14035                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
14036                    } else {
14037                        unreachable!()
14038                    }
14039                }
14040                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14041            }
14042            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14043                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14044            }
14045            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14046                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14047            }
14048            Ok(())
14049        }
14050    }
14051}