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::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
1924mod internal {
1925    use super::*;
1926    unsafe impl fidl::encoding::TypeMarker for HitTestBehavior {
1927        type Owned = Self;
1928
1929        #[inline(always)]
1930        fn inline_align(_context: fidl::encoding::Context) -> usize {
1931            std::mem::align_of::<u32>()
1932        }
1933
1934        #[inline(always)]
1935        fn inline_size(_context: fidl::encoding::Context) -> usize {
1936            std::mem::size_of::<u32>()
1937        }
1938
1939        #[inline(always)]
1940        fn encode_is_copy() -> bool {
1941            true
1942        }
1943
1944        #[inline(always)]
1945        fn decode_is_copy() -> bool {
1946            false
1947        }
1948    }
1949
1950    impl fidl::encoding::ValueTypeMarker for HitTestBehavior {
1951        type Borrowed<'a> = Self;
1952        #[inline(always)]
1953        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1954            *value
1955        }
1956    }
1957
1958    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1959        for HitTestBehavior
1960    {
1961        #[inline]
1962        unsafe fn encode(
1963            self,
1964            encoder: &mut fidl::encoding::Encoder<'_, D>,
1965            offset: usize,
1966            _depth: fidl::encoding::Depth,
1967        ) -> fidl::Result<()> {
1968            encoder.debug_check_bounds::<Self>(offset);
1969            encoder.write_num(self.into_primitive(), offset);
1970            Ok(())
1971        }
1972    }
1973
1974    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitTestBehavior {
1975        #[inline(always)]
1976        fn new_empty() -> Self {
1977            Self::KDefault
1978        }
1979
1980        #[inline]
1981        unsafe fn decode(
1982            &mut self,
1983            decoder: &mut fidl::encoding::Decoder<'_, D>,
1984            offset: usize,
1985            _depth: fidl::encoding::Depth,
1986        ) -> fidl::Result<()> {
1987            decoder.debug_check_bounds::<Self>(offset);
1988            let prim = decoder.read_num::<u32>(offset);
1989
1990            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1991            Ok(())
1992        }
1993    }
1994    unsafe impl fidl::encoding::TypeMarker for ImportSpec {
1995        type Owned = Self;
1996
1997        #[inline(always)]
1998        fn inline_align(_context: fidl::encoding::Context) -> usize {
1999            std::mem::align_of::<u32>()
2000        }
2001
2002        #[inline(always)]
2003        fn inline_size(_context: fidl::encoding::Context) -> usize {
2004            std::mem::size_of::<u32>()
2005        }
2006
2007        #[inline(always)]
2008        fn encode_is_copy() -> bool {
2009            true
2010        }
2011
2012        #[inline(always)]
2013        fn decode_is_copy() -> bool {
2014            false
2015        }
2016    }
2017
2018    impl fidl::encoding::ValueTypeMarker for ImportSpec {
2019        type Borrowed<'a> = Self;
2020        #[inline(always)]
2021        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2022            *value
2023        }
2024    }
2025
2026    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImportSpec {
2027        #[inline]
2028        unsafe fn encode(
2029            self,
2030            encoder: &mut fidl::encoding::Encoder<'_, D>,
2031            offset: usize,
2032            _depth: fidl::encoding::Depth,
2033        ) -> fidl::Result<()> {
2034            encoder.debug_check_bounds::<Self>(offset);
2035            encoder.write_num(self.into_primitive(), offset);
2036            Ok(())
2037        }
2038    }
2039
2040    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportSpec {
2041        #[inline(always)]
2042        fn new_empty() -> Self {
2043            Self::Node
2044        }
2045
2046        #[inline]
2047        unsafe fn decode(
2048            &mut self,
2049            decoder: &mut fidl::encoding::Decoder<'_, D>,
2050            offset: usize,
2051            _depth: fidl::encoding::Depth,
2052        ) -> fidl::Result<()> {
2053            decoder.debug_check_bounds::<Self>(offset);
2054            let prim = decoder.read_num::<u32>(offset);
2055
2056            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2057            Ok(())
2058        }
2059    }
2060    unsafe impl fidl::encoding::TypeMarker for MeshIndexFormat {
2061        type Owned = Self;
2062
2063        #[inline(always)]
2064        fn inline_align(_context: fidl::encoding::Context) -> usize {
2065            std::mem::align_of::<u32>()
2066        }
2067
2068        #[inline(always)]
2069        fn inline_size(_context: fidl::encoding::Context) -> usize {
2070            std::mem::size_of::<u32>()
2071        }
2072
2073        #[inline(always)]
2074        fn encode_is_copy() -> bool {
2075            true
2076        }
2077
2078        #[inline(always)]
2079        fn decode_is_copy() -> bool {
2080            false
2081        }
2082    }
2083
2084    impl fidl::encoding::ValueTypeMarker for MeshIndexFormat {
2085        type Borrowed<'a> = Self;
2086        #[inline(always)]
2087        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2088            *value
2089        }
2090    }
2091
2092    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2093        for MeshIndexFormat
2094    {
2095        #[inline]
2096        unsafe fn encode(
2097            self,
2098            encoder: &mut fidl::encoding::Encoder<'_, D>,
2099            offset: usize,
2100            _depth: fidl::encoding::Depth,
2101        ) -> fidl::Result<()> {
2102            encoder.debug_check_bounds::<Self>(offset);
2103            encoder.write_num(self.into_primitive(), offset);
2104            Ok(())
2105        }
2106    }
2107
2108    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshIndexFormat {
2109        #[inline(always)]
2110        fn new_empty() -> Self {
2111            Self::KUint16
2112        }
2113
2114        #[inline]
2115        unsafe fn decode(
2116            &mut self,
2117            decoder: &mut fidl::encoding::Decoder<'_, D>,
2118            offset: usize,
2119            _depth: fidl::encoding::Depth,
2120        ) -> fidl::Result<()> {
2121            decoder.debug_check_bounds::<Self>(offset);
2122            let prim = decoder.read_num::<u32>(offset);
2123
2124            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2125            Ok(())
2126        }
2127    }
2128    unsafe impl fidl::encoding::TypeMarker for RenderFrequency {
2129        type Owned = Self;
2130
2131        #[inline(always)]
2132        fn inline_align(_context: fidl::encoding::Context) -> usize {
2133            std::mem::align_of::<u32>()
2134        }
2135
2136        #[inline(always)]
2137        fn inline_size(_context: fidl::encoding::Context) -> usize {
2138            std::mem::size_of::<u32>()
2139        }
2140
2141        #[inline(always)]
2142        fn encode_is_copy() -> bool {
2143            true
2144        }
2145
2146        #[inline(always)]
2147        fn decode_is_copy() -> bool {
2148            false
2149        }
2150    }
2151
2152    impl fidl::encoding::ValueTypeMarker for RenderFrequency {
2153        type Borrowed<'a> = Self;
2154        #[inline(always)]
2155        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2156            *value
2157        }
2158    }
2159
2160    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2161        for RenderFrequency
2162    {
2163        #[inline]
2164        unsafe fn encode(
2165            self,
2166            encoder: &mut fidl::encoding::Encoder<'_, D>,
2167            offset: usize,
2168            _depth: fidl::encoding::Depth,
2169        ) -> fidl::Result<()> {
2170            encoder.debug_check_bounds::<Self>(offset);
2171            encoder.write_num(self.into_primitive(), offset);
2172            Ok(())
2173        }
2174    }
2175
2176    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RenderFrequency {
2177        #[inline(always)]
2178        fn new_empty() -> Self {
2179            Self::WhenRequested
2180        }
2181
2182        #[inline]
2183        unsafe fn decode(
2184            &mut self,
2185            decoder: &mut fidl::encoding::Decoder<'_, D>,
2186            offset: usize,
2187            _depth: fidl::encoding::Depth,
2188        ) -> fidl::Result<()> {
2189            decoder.debug_check_bounds::<Self>(offset);
2190            let prim = decoder.read_num::<u32>(offset);
2191
2192            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2193            Ok(())
2194        }
2195    }
2196    unsafe impl fidl::encoding::TypeMarker for ShadowTechnique {
2197        type Owned = Self;
2198
2199        #[inline(always)]
2200        fn inline_align(_context: fidl::encoding::Context) -> usize {
2201            std::mem::align_of::<u32>()
2202        }
2203
2204        #[inline(always)]
2205        fn inline_size(_context: fidl::encoding::Context) -> usize {
2206            std::mem::size_of::<u32>()
2207        }
2208
2209        #[inline(always)]
2210        fn encode_is_copy() -> bool {
2211            true
2212        }
2213
2214        #[inline(always)]
2215        fn decode_is_copy() -> bool {
2216            false
2217        }
2218    }
2219
2220    impl fidl::encoding::ValueTypeMarker for ShadowTechnique {
2221        type Borrowed<'a> = Self;
2222        #[inline(always)]
2223        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2224            *value
2225        }
2226    }
2227
2228    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2229        for ShadowTechnique
2230    {
2231        #[inline]
2232        unsafe fn encode(
2233            self,
2234            encoder: &mut fidl::encoding::Encoder<'_, D>,
2235            offset: usize,
2236            _depth: fidl::encoding::Depth,
2237        ) -> fidl::Result<()> {
2238            encoder.debug_check_bounds::<Self>(offset);
2239            encoder.write_num(self.into_primitive(), offset);
2240            Ok(())
2241        }
2242    }
2243
2244    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShadowTechnique {
2245        #[inline(always)]
2246        fn new_empty() -> Self {
2247            Self::Unshadowed
2248        }
2249
2250        #[inline]
2251        unsafe fn decode(
2252            &mut self,
2253            decoder: &mut fidl::encoding::Decoder<'_, D>,
2254            offset: usize,
2255            _depth: fidl::encoding::Depth,
2256        ) -> fidl::Result<()> {
2257            decoder.debug_check_bounds::<Self>(offset);
2258            let prim = decoder.read_num::<u32>(offset);
2259
2260            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2261            Ok(())
2262        }
2263    }
2264    unsafe impl fidl::encoding::TypeMarker for ValueType {
2265        type Owned = Self;
2266
2267        #[inline(always)]
2268        fn inline_align(_context: fidl::encoding::Context) -> usize {
2269            std::mem::align_of::<u32>()
2270        }
2271
2272        #[inline(always)]
2273        fn inline_size(_context: fidl::encoding::Context) -> usize {
2274            std::mem::size_of::<u32>()
2275        }
2276
2277        #[inline(always)]
2278        fn encode_is_copy() -> bool {
2279            true
2280        }
2281
2282        #[inline(always)]
2283        fn decode_is_copy() -> bool {
2284            false
2285        }
2286    }
2287
2288    impl fidl::encoding::ValueTypeMarker for ValueType {
2289        type Borrowed<'a> = Self;
2290        #[inline(always)]
2291        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2292            *value
2293        }
2294    }
2295
2296    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ValueType {
2297        #[inline]
2298        unsafe fn encode(
2299            self,
2300            encoder: &mut fidl::encoding::Encoder<'_, D>,
2301            offset: usize,
2302            _depth: fidl::encoding::Depth,
2303        ) -> fidl::Result<()> {
2304            encoder.debug_check_bounds::<Self>(offset);
2305            encoder.write_num(self.into_primitive(), offset);
2306            Ok(())
2307        }
2308    }
2309
2310    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValueType {
2311        #[inline(always)]
2312        fn new_empty() -> Self {
2313            Self::KNone
2314        }
2315
2316        #[inline]
2317        unsafe fn decode(
2318            &mut self,
2319            decoder: &mut fidl::encoding::Decoder<'_, D>,
2320            offset: usize,
2321            _depth: fidl::encoding::Depth,
2322        ) -> fidl::Result<()> {
2323            decoder.debug_check_bounds::<Self>(offset);
2324            let prim = decoder.read_num::<u32>(offset);
2325
2326            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2327            Ok(())
2328        }
2329    }
2330
2331    impl fidl::encoding::ValueTypeMarker for AddChildCmd {
2332        type Borrowed<'a> = &'a Self;
2333        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2334            value
2335        }
2336    }
2337
2338    unsafe impl fidl::encoding::TypeMarker for AddChildCmd {
2339        type Owned = Self;
2340
2341        #[inline(always)]
2342        fn inline_align(_context: fidl::encoding::Context) -> usize {
2343            4
2344        }
2345
2346        #[inline(always)]
2347        fn inline_size(_context: fidl::encoding::Context) -> usize {
2348            8
2349        }
2350        #[inline(always)]
2351        fn encode_is_copy() -> bool {
2352            true
2353        }
2354
2355        #[inline(always)]
2356        fn decode_is_copy() -> bool {
2357            true
2358        }
2359    }
2360
2361    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddChildCmd, D>
2362        for &AddChildCmd
2363    {
2364        #[inline]
2365        unsafe fn encode(
2366            self,
2367            encoder: &mut fidl::encoding::Encoder<'_, D>,
2368            offset: usize,
2369            _depth: fidl::encoding::Depth,
2370        ) -> fidl::Result<()> {
2371            encoder.debug_check_bounds::<AddChildCmd>(offset);
2372            unsafe {
2373                // Copy the object into the buffer.
2374                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2375                (buf_ptr as *mut AddChildCmd).write_unaligned((self as *const AddChildCmd).read());
2376                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2377                // done second because the memcpy will write garbage to these bytes.
2378            }
2379            Ok(())
2380        }
2381    }
2382    unsafe impl<
2383            D: fidl::encoding::ResourceDialect,
2384            T0: fidl::encoding::Encode<u32, D>,
2385            T1: fidl::encoding::Encode<u32, D>,
2386        > fidl::encoding::Encode<AddChildCmd, D> for (T0, T1)
2387    {
2388        #[inline]
2389        unsafe fn encode(
2390            self,
2391            encoder: &mut fidl::encoding::Encoder<'_, D>,
2392            offset: usize,
2393            depth: fidl::encoding::Depth,
2394        ) -> fidl::Result<()> {
2395            encoder.debug_check_bounds::<AddChildCmd>(offset);
2396            // Zero out padding regions. There's no need to apply masks
2397            // because the unmasked parts will be overwritten by fields.
2398            // Write the fields.
2399            self.0.encode(encoder, offset + 0, depth)?;
2400            self.1.encode(encoder, offset + 4, depth)?;
2401            Ok(())
2402        }
2403    }
2404
2405    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddChildCmd {
2406        #[inline(always)]
2407        fn new_empty() -> Self {
2408            Self { node_id: fidl::new_empty!(u32, D), child_id: fidl::new_empty!(u32, D) }
2409        }
2410
2411        #[inline]
2412        unsafe fn decode(
2413            &mut self,
2414            decoder: &mut fidl::encoding::Decoder<'_, D>,
2415            offset: usize,
2416            _depth: fidl::encoding::Depth,
2417        ) -> fidl::Result<()> {
2418            decoder.debug_check_bounds::<Self>(offset);
2419            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2420            // Verify that padding bytes are zero.
2421            // Copy from the buffer into the object.
2422            unsafe {
2423                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2424            }
2425            Ok(())
2426        }
2427    }
2428
2429    impl fidl::encoding::ValueTypeMarker for AddLayerCmd {
2430        type Borrowed<'a> = &'a Self;
2431        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2432            value
2433        }
2434    }
2435
2436    unsafe impl fidl::encoding::TypeMarker for AddLayerCmd {
2437        type Owned = Self;
2438
2439        #[inline(always)]
2440        fn inline_align(_context: fidl::encoding::Context) -> usize {
2441            4
2442        }
2443
2444        #[inline(always)]
2445        fn inline_size(_context: fidl::encoding::Context) -> usize {
2446            8
2447        }
2448        #[inline(always)]
2449        fn encode_is_copy() -> bool {
2450            true
2451        }
2452
2453        #[inline(always)]
2454        fn decode_is_copy() -> bool {
2455            true
2456        }
2457    }
2458
2459    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLayerCmd, D>
2460        for &AddLayerCmd
2461    {
2462        #[inline]
2463        unsafe fn encode(
2464            self,
2465            encoder: &mut fidl::encoding::Encoder<'_, D>,
2466            offset: usize,
2467            _depth: fidl::encoding::Depth,
2468        ) -> fidl::Result<()> {
2469            encoder.debug_check_bounds::<AddLayerCmd>(offset);
2470            unsafe {
2471                // Copy the object into the buffer.
2472                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2473                (buf_ptr as *mut AddLayerCmd).write_unaligned((self as *const AddLayerCmd).read());
2474                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2475                // done second because the memcpy will write garbage to these bytes.
2476            }
2477            Ok(())
2478        }
2479    }
2480    unsafe impl<
2481            D: fidl::encoding::ResourceDialect,
2482            T0: fidl::encoding::Encode<u32, D>,
2483            T1: fidl::encoding::Encode<u32, D>,
2484        > fidl::encoding::Encode<AddLayerCmd, D> for (T0, T1)
2485    {
2486        #[inline]
2487        unsafe fn encode(
2488            self,
2489            encoder: &mut fidl::encoding::Encoder<'_, D>,
2490            offset: usize,
2491            depth: fidl::encoding::Depth,
2492        ) -> fidl::Result<()> {
2493            encoder.debug_check_bounds::<AddLayerCmd>(offset);
2494            // Zero out padding regions. There's no need to apply masks
2495            // because the unmasked parts will be overwritten by fields.
2496            // Write the fields.
2497            self.0.encode(encoder, offset + 0, depth)?;
2498            self.1.encode(encoder, offset + 4, depth)?;
2499            Ok(())
2500        }
2501    }
2502
2503    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLayerCmd {
2504        #[inline(always)]
2505        fn new_empty() -> Self {
2506            Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
2507        }
2508
2509        #[inline]
2510        unsafe fn decode(
2511            &mut self,
2512            decoder: &mut fidl::encoding::Decoder<'_, D>,
2513            offset: usize,
2514            _depth: fidl::encoding::Depth,
2515        ) -> fidl::Result<()> {
2516            decoder.debug_check_bounds::<Self>(offset);
2517            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2518            // Verify that padding bytes are zero.
2519            // Copy from the buffer into the object.
2520            unsafe {
2521                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2522            }
2523            Ok(())
2524        }
2525    }
2526
2527    impl fidl::encoding::ValueTypeMarker for AddLightCmd {
2528        type Borrowed<'a> = &'a Self;
2529        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2530            value
2531        }
2532    }
2533
2534    unsafe impl fidl::encoding::TypeMarker for AddLightCmd {
2535        type Owned = Self;
2536
2537        #[inline(always)]
2538        fn inline_align(_context: fidl::encoding::Context) -> usize {
2539            4
2540        }
2541
2542        #[inline(always)]
2543        fn inline_size(_context: fidl::encoding::Context) -> usize {
2544            8
2545        }
2546        #[inline(always)]
2547        fn encode_is_copy() -> bool {
2548            true
2549        }
2550
2551        #[inline(always)]
2552        fn decode_is_copy() -> bool {
2553            true
2554        }
2555    }
2556
2557    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLightCmd, D>
2558        for &AddLightCmd
2559    {
2560        #[inline]
2561        unsafe fn encode(
2562            self,
2563            encoder: &mut fidl::encoding::Encoder<'_, D>,
2564            offset: usize,
2565            _depth: fidl::encoding::Depth,
2566        ) -> fidl::Result<()> {
2567            encoder.debug_check_bounds::<AddLightCmd>(offset);
2568            unsafe {
2569                // Copy the object into the buffer.
2570                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2571                (buf_ptr as *mut AddLightCmd).write_unaligned((self as *const AddLightCmd).read());
2572                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2573                // done second because the memcpy will write garbage to these bytes.
2574            }
2575            Ok(())
2576        }
2577    }
2578    unsafe impl<
2579            D: fidl::encoding::ResourceDialect,
2580            T0: fidl::encoding::Encode<u32, D>,
2581            T1: fidl::encoding::Encode<u32, D>,
2582        > fidl::encoding::Encode<AddLightCmd, D> for (T0, T1)
2583    {
2584        #[inline]
2585        unsafe fn encode(
2586            self,
2587            encoder: &mut fidl::encoding::Encoder<'_, D>,
2588            offset: usize,
2589            depth: fidl::encoding::Depth,
2590        ) -> fidl::Result<()> {
2591            encoder.debug_check_bounds::<AddLightCmd>(offset);
2592            // Zero out padding regions. There's no need to apply masks
2593            // because the unmasked parts will be overwritten by fields.
2594            // Write the fields.
2595            self.0.encode(encoder, offset + 0, depth)?;
2596            self.1.encode(encoder, offset + 4, depth)?;
2597            Ok(())
2598        }
2599    }
2600
2601    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLightCmd {
2602        #[inline(always)]
2603        fn new_empty() -> Self {
2604            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
2605        }
2606
2607        #[inline]
2608        unsafe fn decode(
2609            &mut self,
2610            decoder: &mut fidl::encoding::Decoder<'_, D>,
2611            offset: usize,
2612            _depth: fidl::encoding::Depth,
2613        ) -> fidl::Result<()> {
2614            decoder.debug_check_bounds::<Self>(offset);
2615            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2616            // Verify that padding bytes are zero.
2617            // Copy from the buffer into the object.
2618            unsafe {
2619                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2620            }
2621            Ok(())
2622        }
2623    }
2624
2625    impl fidl::encoding::ValueTypeMarker for AddPartCmd {
2626        type Borrowed<'a> = &'a Self;
2627        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2628            value
2629        }
2630    }
2631
2632    unsafe impl fidl::encoding::TypeMarker for AddPartCmd {
2633        type Owned = Self;
2634
2635        #[inline(always)]
2636        fn inline_align(_context: fidl::encoding::Context) -> usize {
2637            4
2638        }
2639
2640        #[inline(always)]
2641        fn inline_size(_context: fidl::encoding::Context) -> usize {
2642            8
2643        }
2644        #[inline(always)]
2645        fn encode_is_copy() -> bool {
2646            true
2647        }
2648
2649        #[inline(always)]
2650        fn decode_is_copy() -> bool {
2651            true
2652        }
2653    }
2654
2655    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddPartCmd, D>
2656        for &AddPartCmd
2657    {
2658        #[inline]
2659        unsafe fn encode(
2660            self,
2661            encoder: &mut fidl::encoding::Encoder<'_, D>,
2662            offset: usize,
2663            _depth: fidl::encoding::Depth,
2664        ) -> fidl::Result<()> {
2665            encoder.debug_check_bounds::<AddPartCmd>(offset);
2666            unsafe {
2667                // Copy the object into the buffer.
2668                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2669                (buf_ptr as *mut AddPartCmd).write_unaligned((self as *const AddPartCmd).read());
2670                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2671                // done second because the memcpy will write garbage to these bytes.
2672            }
2673            Ok(())
2674        }
2675    }
2676    unsafe impl<
2677            D: fidl::encoding::ResourceDialect,
2678            T0: fidl::encoding::Encode<u32, D>,
2679            T1: fidl::encoding::Encode<u32, D>,
2680        > fidl::encoding::Encode<AddPartCmd, D> for (T0, T1)
2681    {
2682        #[inline]
2683        unsafe fn encode(
2684            self,
2685            encoder: &mut fidl::encoding::Encoder<'_, D>,
2686            offset: usize,
2687            depth: fidl::encoding::Depth,
2688        ) -> fidl::Result<()> {
2689            encoder.debug_check_bounds::<AddPartCmd>(offset);
2690            // Zero out padding regions. There's no need to apply masks
2691            // because the unmasked parts will be overwritten by fields.
2692            // Write the fields.
2693            self.0.encode(encoder, offset + 0, depth)?;
2694            self.1.encode(encoder, offset + 4, depth)?;
2695            Ok(())
2696        }
2697    }
2698
2699    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddPartCmd {
2700        #[inline(always)]
2701        fn new_empty() -> Self {
2702            Self { node_id: fidl::new_empty!(u32, D), part_id: fidl::new_empty!(u32, D) }
2703        }
2704
2705        #[inline]
2706        unsafe fn decode(
2707            &mut self,
2708            decoder: &mut fidl::encoding::Decoder<'_, D>,
2709            offset: usize,
2710            _depth: fidl::encoding::Depth,
2711        ) -> fidl::Result<()> {
2712            decoder.debug_check_bounds::<Self>(offset);
2713            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2714            // Verify that padding bytes are zero.
2715            // Copy from the buffer into the object.
2716            unsafe {
2717                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2718            }
2719            Ok(())
2720        }
2721    }
2722
2723    impl fidl::encoding::ValueTypeMarker for AmbientLightArgs {
2724        type Borrowed<'a> = &'a Self;
2725        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2726            value
2727        }
2728    }
2729
2730    unsafe impl fidl::encoding::TypeMarker for AmbientLightArgs {
2731        type Owned = Self;
2732
2733        #[inline(always)]
2734        fn inline_align(_context: fidl::encoding::Context) -> usize {
2735            4
2736        }
2737
2738        #[inline(always)]
2739        fn inline_size(_context: fidl::encoding::Context) -> usize {
2740            4
2741        }
2742        #[inline(always)]
2743        fn encode_is_copy() -> bool {
2744            true
2745        }
2746
2747        #[inline(always)]
2748        fn decode_is_copy() -> bool {
2749            true
2750        }
2751    }
2752
2753    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AmbientLightArgs, D>
2754        for &AmbientLightArgs
2755    {
2756        #[inline]
2757        unsafe fn encode(
2758            self,
2759            encoder: &mut fidl::encoding::Encoder<'_, D>,
2760            offset: usize,
2761            _depth: fidl::encoding::Depth,
2762        ) -> fidl::Result<()> {
2763            encoder.debug_check_bounds::<AmbientLightArgs>(offset);
2764            unsafe {
2765                // Copy the object into the buffer.
2766                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2767                (buf_ptr as *mut AmbientLightArgs)
2768                    .write_unaligned((self as *const AmbientLightArgs).read());
2769                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2770                // done second because the memcpy will write garbage to these bytes.
2771            }
2772            Ok(())
2773        }
2774    }
2775    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2776        fidl::encoding::Encode<AmbientLightArgs, D> for (T0,)
2777    {
2778        #[inline]
2779        unsafe fn encode(
2780            self,
2781            encoder: &mut fidl::encoding::Encoder<'_, D>,
2782            offset: usize,
2783            depth: fidl::encoding::Depth,
2784        ) -> fidl::Result<()> {
2785            encoder.debug_check_bounds::<AmbientLightArgs>(offset);
2786            // Zero out padding regions. There's no need to apply masks
2787            // because the unmasked parts will be overwritten by fields.
2788            // Write the fields.
2789            self.0.encode(encoder, offset + 0, depth)?;
2790            Ok(())
2791        }
2792    }
2793
2794    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AmbientLightArgs {
2795        #[inline(always)]
2796        fn new_empty() -> Self {
2797            Self { dummy: fidl::new_empty!(u32, D) }
2798        }
2799
2800        #[inline]
2801        unsafe fn decode(
2802            &mut self,
2803            decoder: &mut fidl::encoding::Decoder<'_, D>,
2804            offset: usize,
2805            _depth: fidl::encoding::Depth,
2806        ) -> fidl::Result<()> {
2807            decoder.debug_check_bounds::<Self>(offset);
2808            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2809            // Verify that padding bytes are zero.
2810            // Copy from the buffer into the object.
2811            unsafe {
2812                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2813            }
2814            Ok(())
2815        }
2816    }
2817
2818    impl fidl::encoding::ValueTypeMarker for BindMeshBuffersCmd {
2819        type Borrowed<'a> = &'a Self;
2820        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2821            value
2822        }
2823    }
2824
2825    unsafe impl fidl::encoding::TypeMarker for BindMeshBuffersCmd {
2826        type Owned = Self;
2827
2828        #[inline(always)]
2829        fn inline_align(_context: fidl::encoding::Context) -> usize {
2830            8
2831        }
2832
2833        #[inline(always)]
2834        fn inline_size(_context: fidl::encoding::Context) -> usize {
2835            88
2836        }
2837    }
2838
2839    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BindMeshBuffersCmd, D>
2840        for &BindMeshBuffersCmd
2841    {
2842        #[inline]
2843        unsafe fn encode(
2844            self,
2845            encoder: &mut fidl::encoding::Encoder<'_, D>,
2846            offset: usize,
2847            _depth: fidl::encoding::Depth,
2848        ) -> fidl::Result<()> {
2849            encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
2850            // Delegate to tuple encoding.
2851            fidl::encoding::Encode::<BindMeshBuffersCmd, D>::encode(
2852                (
2853                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mesh_id),
2854                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_buffer_id),
2855                    <MeshIndexFormat as fidl::encoding::ValueTypeMarker>::borrow(
2856                        &self.index_format,
2857                    ),
2858                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_offset),
2859                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_count),
2860                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_buffer_id),
2861                    <MeshVertexFormat as fidl::encoding::ValueTypeMarker>::borrow(
2862                        &self.vertex_format,
2863                    ),
2864                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_offset),
2865                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_count),
2866                    <BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
2867                ),
2868                encoder,
2869                offset,
2870                _depth,
2871            )
2872        }
2873    }
2874    unsafe impl<
2875            D: fidl::encoding::ResourceDialect,
2876            T0: fidl::encoding::Encode<u32, D>,
2877            T1: fidl::encoding::Encode<u32, D>,
2878            T2: fidl::encoding::Encode<MeshIndexFormat, D>,
2879            T3: fidl::encoding::Encode<u64, D>,
2880            T4: fidl::encoding::Encode<u32, D>,
2881            T5: fidl::encoding::Encode<u32, D>,
2882            T6: fidl::encoding::Encode<MeshVertexFormat, D>,
2883            T7: fidl::encoding::Encode<u64, D>,
2884            T8: fidl::encoding::Encode<u32, D>,
2885            T9: fidl::encoding::Encode<BoundingBox, D>,
2886        > fidl::encoding::Encode<BindMeshBuffersCmd, D>
2887        for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
2888    {
2889        #[inline]
2890        unsafe fn encode(
2891            self,
2892            encoder: &mut fidl::encoding::Encoder<'_, D>,
2893            offset: usize,
2894            depth: fidl::encoding::Depth,
2895        ) -> fidl::Result<()> {
2896            encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
2897            // Zero out padding regions. There's no need to apply masks
2898            // because the unmasked parts will be overwritten by fields.
2899            unsafe {
2900                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2901                (ptr as *mut u64).write_unaligned(0);
2902            }
2903            unsafe {
2904                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
2905                (ptr as *mut u64).write_unaligned(0);
2906            }
2907            unsafe {
2908                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(80);
2909                (ptr as *mut u64).write_unaligned(0);
2910            }
2911            // Write the fields.
2912            self.0.encode(encoder, offset + 0, depth)?;
2913            self.1.encode(encoder, offset + 4, depth)?;
2914            self.2.encode(encoder, offset + 8, depth)?;
2915            self.3.encode(encoder, offset + 16, depth)?;
2916            self.4.encode(encoder, offset + 24, depth)?;
2917            self.5.encode(encoder, offset + 28, depth)?;
2918            self.6.encode(encoder, offset + 32, depth)?;
2919            self.7.encode(encoder, offset + 48, depth)?;
2920            self.8.encode(encoder, offset + 56, depth)?;
2921            self.9.encode(encoder, offset + 60, depth)?;
2922            Ok(())
2923        }
2924    }
2925
2926    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BindMeshBuffersCmd {
2927        #[inline(always)]
2928        fn new_empty() -> Self {
2929            Self {
2930                mesh_id: fidl::new_empty!(u32, D),
2931                index_buffer_id: fidl::new_empty!(u32, D),
2932                index_format: fidl::new_empty!(MeshIndexFormat, D),
2933                index_offset: fidl::new_empty!(u64, D),
2934                index_count: fidl::new_empty!(u32, D),
2935                vertex_buffer_id: fidl::new_empty!(u32, D),
2936                vertex_format: fidl::new_empty!(MeshVertexFormat, D),
2937                vertex_offset: fidl::new_empty!(u64, D),
2938                vertex_count: fidl::new_empty!(u32, D),
2939                bounding_box: fidl::new_empty!(BoundingBox, D),
2940            }
2941        }
2942
2943        #[inline]
2944        unsafe fn decode(
2945            &mut self,
2946            decoder: &mut fidl::encoding::Decoder<'_, D>,
2947            offset: usize,
2948            _depth: fidl::encoding::Depth,
2949        ) -> fidl::Result<()> {
2950            decoder.debug_check_bounds::<Self>(offset);
2951            // Verify that padding bytes are zero.
2952            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2953            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2954            let mask = 0xffffffff00000000u64;
2955            let maskedval = padval & mask;
2956            if maskedval != 0 {
2957                return Err(fidl::Error::NonZeroPadding {
2958                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2959                });
2960            }
2961            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
2962            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2963            let mask = 0xffffffff00000000u64;
2964            let maskedval = padval & mask;
2965            if maskedval != 0 {
2966                return Err(fidl::Error::NonZeroPadding {
2967                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
2968                });
2969            }
2970            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
2971            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2972            let mask = 0xffffffff00000000u64;
2973            let maskedval = padval & mask;
2974            if maskedval != 0 {
2975                return Err(fidl::Error::NonZeroPadding {
2976                    padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
2977                });
2978            }
2979            fidl::decode!(u32, D, &mut self.mesh_id, decoder, offset + 0, _depth)?;
2980            fidl::decode!(u32, D, &mut self.index_buffer_id, decoder, offset + 4, _depth)?;
2981            fidl::decode!(MeshIndexFormat, D, &mut self.index_format, decoder, offset + 8, _depth)?;
2982            fidl::decode!(u64, D, &mut self.index_offset, decoder, offset + 16, _depth)?;
2983            fidl::decode!(u32, D, &mut self.index_count, decoder, offset + 24, _depth)?;
2984            fidl::decode!(u32, D, &mut self.vertex_buffer_id, decoder, offset + 28, _depth)?;
2985            fidl::decode!(
2986                MeshVertexFormat,
2987                D,
2988                &mut self.vertex_format,
2989                decoder,
2990                offset + 32,
2991                _depth
2992            )?;
2993            fidl::decode!(u64, D, &mut self.vertex_offset, decoder, offset + 48, _depth)?;
2994            fidl::decode!(u32, D, &mut self.vertex_count, decoder, offset + 56, _depth)?;
2995            fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 60, _depth)?;
2996            Ok(())
2997        }
2998    }
2999
3000    impl fidl::encoding::ValueTypeMarker for BoundingBox {
3001        type Borrowed<'a> = &'a Self;
3002        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3003            value
3004        }
3005    }
3006
3007    unsafe impl fidl::encoding::TypeMarker for BoundingBox {
3008        type Owned = Self;
3009
3010        #[inline(always)]
3011        fn inline_align(_context: fidl::encoding::Context) -> usize {
3012            4
3013        }
3014
3015        #[inline(always)]
3016        fn inline_size(_context: fidl::encoding::Context) -> usize {
3017            24
3018        }
3019    }
3020
3021    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BoundingBox, D>
3022        for &BoundingBox
3023    {
3024        #[inline]
3025        unsafe fn encode(
3026            self,
3027            encoder: &mut fidl::encoding::Encoder<'_, D>,
3028            offset: usize,
3029            _depth: fidl::encoding::Depth,
3030        ) -> fidl::Result<()> {
3031            encoder.debug_check_bounds::<BoundingBox>(offset);
3032            // Delegate to tuple encoding.
3033            fidl::encoding::Encode::<BoundingBox, D>::encode(
3034                (
3035                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.min),
3036                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.max),
3037                ),
3038                encoder,
3039                offset,
3040                _depth,
3041            )
3042        }
3043    }
3044    unsafe impl<
3045            D: fidl::encoding::ResourceDialect,
3046            T0: fidl::encoding::Encode<Vec3, D>,
3047            T1: fidl::encoding::Encode<Vec3, D>,
3048        > fidl::encoding::Encode<BoundingBox, D> for (T0, T1)
3049    {
3050        #[inline]
3051        unsafe fn encode(
3052            self,
3053            encoder: &mut fidl::encoding::Encoder<'_, D>,
3054            offset: usize,
3055            depth: fidl::encoding::Depth,
3056        ) -> fidl::Result<()> {
3057            encoder.debug_check_bounds::<BoundingBox>(offset);
3058            // Zero out padding regions. There's no need to apply masks
3059            // because the unmasked parts will be overwritten by fields.
3060            // Write the fields.
3061            self.0.encode(encoder, offset + 0, depth)?;
3062            self.1.encode(encoder, offset + 12, depth)?;
3063            Ok(())
3064        }
3065    }
3066
3067    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoundingBox {
3068        #[inline(always)]
3069        fn new_empty() -> Self {
3070            Self { min: fidl::new_empty!(Vec3, D), max: fidl::new_empty!(Vec3, D) }
3071        }
3072
3073        #[inline]
3074        unsafe fn decode(
3075            &mut self,
3076            decoder: &mut fidl::encoding::Decoder<'_, D>,
3077            offset: usize,
3078            _depth: fidl::encoding::Depth,
3079        ) -> fidl::Result<()> {
3080            decoder.debug_check_bounds::<Self>(offset);
3081            // Verify that padding bytes are zero.
3082            fidl::decode!(Vec3, D, &mut self.min, decoder, offset + 0, _depth)?;
3083            fidl::decode!(Vec3, D, &mut self.max, decoder, offset + 12, _depth)?;
3084            Ok(())
3085        }
3086    }
3087
3088    impl fidl::encoding::ValueTypeMarker for BufferArgs {
3089        type Borrowed<'a> = &'a Self;
3090        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3091            value
3092        }
3093    }
3094
3095    unsafe impl fidl::encoding::TypeMarker for BufferArgs {
3096        type Owned = Self;
3097
3098        #[inline(always)]
3099        fn inline_align(_context: fidl::encoding::Context) -> usize {
3100            4
3101        }
3102
3103        #[inline(always)]
3104        fn inline_size(_context: fidl::encoding::Context) -> usize {
3105            12
3106        }
3107        #[inline(always)]
3108        fn encode_is_copy() -> bool {
3109            true
3110        }
3111
3112        #[inline(always)]
3113        fn decode_is_copy() -> bool {
3114            true
3115        }
3116    }
3117
3118    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferArgs, D>
3119        for &BufferArgs
3120    {
3121        #[inline]
3122        unsafe fn encode(
3123            self,
3124            encoder: &mut fidl::encoding::Encoder<'_, D>,
3125            offset: usize,
3126            _depth: fidl::encoding::Depth,
3127        ) -> fidl::Result<()> {
3128            encoder.debug_check_bounds::<BufferArgs>(offset);
3129            unsafe {
3130                // Copy the object into the buffer.
3131                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3132                (buf_ptr as *mut BufferArgs).write_unaligned((self as *const BufferArgs).read());
3133                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3134                // done second because the memcpy will write garbage to these bytes.
3135            }
3136            Ok(())
3137        }
3138    }
3139    unsafe impl<
3140            D: fidl::encoding::ResourceDialect,
3141            T0: fidl::encoding::Encode<u32, D>,
3142            T1: fidl::encoding::Encode<u32, D>,
3143            T2: fidl::encoding::Encode<u32, D>,
3144        > fidl::encoding::Encode<BufferArgs, D> for (T0, T1, T2)
3145    {
3146        #[inline]
3147        unsafe fn encode(
3148            self,
3149            encoder: &mut fidl::encoding::Encoder<'_, D>,
3150            offset: usize,
3151            depth: fidl::encoding::Depth,
3152        ) -> fidl::Result<()> {
3153            encoder.debug_check_bounds::<BufferArgs>(offset);
3154            // Zero out padding regions. There's no need to apply masks
3155            // because the unmasked parts will be overwritten by fields.
3156            // Write the fields.
3157            self.0.encode(encoder, offset + 0, depth)?;
3158            self.1.encode(encoder, offset + 4, depth)?;
3159            self.2.encode(encoder, offset + 8, depth)?;
3160            Ok(())
3161        }
3162    }
3163
3164    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferArgs {
3165        #[inline(always)]
3166        fn new_empty() -> Self {
3167            Self {
3168                memory_id: fidl::new_empty!(u32, D),
3169                memory_offset: fidl::new_empty!(u32, D),
3170                num_bytes: fidl::new_empty!(u32, D),
3171            }
3172        }
3173
3174        #[inline]
3175        unsafe fn decode(
3176            &mut self,
3177            decoder: &mut fidl::encoding::Decoder<'_, D>,
3178            offset: usize,
3179            _depth: fidl::encoding::Depth,
3180        ) -> fidl::Result<()> {
3181            decoder.debug_check_bounds::<Self>(offset);
3182            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3183            // Verify that padding bytes are zero.
3184            // Copy from the buffer into the object.
3185            unsafe {
3186                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
3187            }
3188            Ok(())
3189        }
3190    }
3191
3192    impl fidl::encoding::ValueTypeMarker for CameraArgs {
3193        type Borrowed<'a> = &'a Self;
3194        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3195            value
3196        }
3197    }
3198
3199    unsafe impl fidl::encoding::TypeMarker for CameraArgs {
3200        type Owned = Self;
3201
3202        #[inline(always)]
3203        fn inline_align(_context: fidl::encoding::Context) -> usize {
3204            4
3205        }
3206
3207        #[inline(always)]
3208        fn inline_size(_context: fidl::encoding::Context) -> usize {
3209            4
3210        }
3211        #[inline(always)]
3212        fn encode_is_copy() -> bool {
3213            true
3214        }
3215
3216        #[inline(always)]
3217        fn decode_is_copy() -> bool {
3218            true
3219        }
3220    }
3221
3222    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CameraArgs, D>
3223        for &CameraArgs
3224    {
3225        #[inline]
3226        unsafe fn encode(
3227            self,
3228            encoder: &mut fidl::encoding::Encoder<'_, D>,
3229            offset: usize,
3230            _depth: fidl::encoding::Depth,
3231        ) -> fidl::Result<()> {
3232            encoder.debug_check_bounds::<CameraArgs>(offset);
3233            unsafe {
3234                // Copy the object into the buffer.
3235                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3236                (buf_ptr as *mut CameraArgs).write_unaligned((self as *const CameraArgs).read());
3237                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3238                // done second because the memcpy will write garbage to these bytes.
3239            }
3240            Ok(())
3241        }
3242    }
3243    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3244        fidl::encoding::Encode<CameraArgs, D> for (T0,)
3245    {
3246        #[inline]
3247        unsafe fn encode(
3248            self,
3249            encoder: &mut fidl::encoding::Encoder<'_, D>,
3250            offset: usize,
3251            depth: fidl::encoding::Depth,
3252        ) -> fidl::Result<()> {
3253            encoder.debug_check_bounds::<CameraArgs>(offset);
3254            // Zero out padding regions. There's no need to apply masks
3255            // because the unmasked parts will be overwritten by fields.
3256            // Write the fields.
3257            self.0.encode(encoder, offset + 0, depth)?;
3258            Ok(())
3259        }
3260    }
3261
3262    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CameraArgs {
3263        #[inline(always)]
3264        fn new_empty() -> Self {
3265            Self { scene_id: fidl::new_empty!(u32, D) }
3266        }
3267
3268        #[inline]
3269        unsafe fn decode(
3270            &mut self,
3271            decoder: &mut fidl::encoding::Decoder<'_, D>,
3272            offset: usize,
3273            _depth: fidl::encoding::Depth,
3274        ) -> fidl::Result<()> {
3275            decoder.debug_check_bounds::<Self>(offset);
3276            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3277            // Verify that padding bytes are zero.
3278            // Copy from the buffer into the object.
3279            unsafe {
3280                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3281            }
3282            Ok(())
3283        }
3284    }
3285
3286    impl fidl::encoding::ValueTypeMarker for CircleArgs {
3287        type Borrowed<'a> = &'a Self;
3288        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3289            value
3290        }
3291    }
3292
3293    unsafe impl fidl::encoding::TypeMarker for CircleArgs {
3294        type Owned = Self;
3295
3296        #[inline(always)]
3297        fn inline_align(_context: fidl::encoding::Context) -> usize {
3298            8
3299        }
3300
3301        #[inline(always)]
3302        fn inline_size(_context: fidl::encoding::Context) -> usize {
3303            16
3304        }
3305    }
3306
3307    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CircleArgs, D>
3308        for &CircleArgs
3309    {
3310        #[inline]
3311        unsafe fn encode(
3312            self,
3313            encoder: &mut fidl::encoding::Encoder<'_, D>,
3314            offset: usize,
3315            _depth: fidl::encoding::Depth,
3316        ) -> fidl::Result<()> {
3317            encoder.debug_check_bounds::<CircleArgs>(offset);
3318            // Delegate to tuple encoding.
3319            fidl::encoding::Encode::<CircleArgs, D>::encode(
3320                (<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.radius),),
3321                encoder,
3322                offset,
3323                _depth,
3324            )
3325        }
3326    }
3327    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Value, D>>
3328        fidl::encoding::Encode<CircleArgs, D> for (T0,)
3329    {
3330        #[inline]
3331        unsafe fn encode(
3332            self,
3333            encoder: &mut fidl::encoding::Encoder<'_, D>,
3334            offset: usize,
3335            depth: fidl::encoding::Depth,
3336        ) -> fidl::Result<()> {
3337            encoder.debug_check_bounds::<CircleArgs>(offset);
3338            // Zero out padding regions. There's no need to apply masks
3339            // because the unmasked parts will be overwritten by fields.
3340            // Write the fields.
3341            self.0.encode(encoder, offset + 0, depth)?;
3342            Ok(())
3343        }
3344    }
3345
3346    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CircleArgs {
3347        #[inline(always)]
3348        fn new_empty() -> Self {
3349            Self { radius: fidl::new_empty!(Value, D) }
3350        }
3351
3352        #[inline]
3353        unsafe fn decode(
3354            &mut self,
3355            decoder: &mut fidl::encoding::Decoder<'_, D>,
3356            offset: usize,
3357            _depth: fidl::encoding::Depth,
3358        ) -> fidl::Result<()> {
3359            decoder.debug_check_bounds::<Self>(offset);
3360            // Verify that padding bytes are zero.
3361            fidl::decode!(Value, D, &mut self.radius, decoder, offset + 0, _depth)?;
3362            Ok(())
3363        }
3364    }
3365
3366    impl fidl::encoding::ValueTypeMarker for ClipNodeArgs {
3367        type Borrowed<'a> = &'a Self;
3368        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3369            value
3370        }
3371    }
3372
3373    unsafe impl fidl::encoding::TypeMarker for ClipNodeArgs {
3374        type Owned = Self;
3375
3376        #[inline(always)]
3377        fn inline_align(_context: fidl::encoding::Context) -> usize {
3378            4
3379        }
3380
3381        #[inline(always)]
3382        fn inline_size(_context: fidl::encoding::Context) -> usize {
3383            4
3384        }
3385        #[inline(always)]
3386        fn encode_is_copy() -> bool {
3387            true
3388        }
3389
3390        #[inline(always)]
3391        fn decode_is_copy() -> bool {
3392            true
3393        }
3394    }
3395
3396    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClipNodeArgs, D>
3397        for &ClipNodeArgs
3398    {
3399        #[inline]
3400        unsafe fn encode(
3401            self,
3402            encoder: &mut fidl::encoding::Encoder<'_, D>,
3403            offset: usize,
3404            _depth: fidl::encoding::Depth,
3405        ) -> fidl::Result<()> {
3406            encoder.debug_check_bounds::<ClipNodeArgs>(offset);
3407            unsafe {
3408                // Copy the object into the buffer.
3409                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3410                (buf_ptr as *mut ClipNodeArgs)
3411                    .write_unaligned((self as *const ClipNodeArgs).read());
3412                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3413                // done second because the memcpy will write garbage to these bytes.
3414            }
3415            Ok(())
3416        }
3417    }
3418    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3419        fidl::encoding::Encode<ClipNodeArgs, D> for (T0,)
3420    {
3421        #[inline]
3422        unsafe fn encode(
3423            self,
3424            encoder: &mut fidl::encoding::Encoder<'_, D>,
3425            offset: usize,
3426            depth: fidl::encoding::Depth,
3427        ) -> fidl::Result<()> {
3428            encoder.debug_check_bounds::<ClipNodeArgs>(offset);
3429            // Zero out padding regions. There's no need to apply masks
3430            // because the unmasked parts will be overwritten by fields.
3431            // Write the fields.
3432            self.0.encode(encoder, offset + 0, depth)?;
3433            Ok(())
3434        }
3435    }
3436
3437    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClipNodeArgs {
3438        #[inline(always)]
3439        fn new_empty() -> Self {
3440            Self { unused: fidl::new_empty!(u32, D) }
3441        }
3442
3443        #[inline]
3444        unsafe fn decode(
3445            &mut self,
3446            decoder: &mut fidl::encoding::Decoder<'_, D>,
3447            offset: usize,
3448            _depth: fidl::encoding::Depth,
3449        ) -> fidl::Result<()> {
3450            decoder.debug_check_bounds::<Self>(offset);
3451            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3452            // Verify that padding bytes are zero.
3453            // Copy from the buffer into the object.
3454            unsafe {
3455                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3456            }
3457            Ok(())
3458        }
3459    }
3460
3461    impl fidl::encoding::ValueTypeMarker for ColorRgb {
3462        type Borrowed<'a> = &'a Self;
3463        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3464            value
3465        }
3466    }
3467
3468    unsafe impl fidl::encoding::TypeMarker for ColorRgb {
3469        type Owned = Self;
3470
3471        #[inline(always)]
3472        fn inline_align(_context: fidl::encoding::Context) -> usize {
3473            4
3474        }
3475
3476        #[inline(always)]
3477        fn inline_size(_context: fidl::encoding::Context) -> usize {
3478            12
3479        }
3480    }
3481
3482    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgb, D> for &ColorRgb {
3483        #[inline]
3484        unsafe fn encode(
3485            self,
3486            encoder: &mut fidl::encoding::Encoder<'_, D>,
3487            offset: usize,
3488            _depth: fidl::encoding::Depth,
3489        ) -> fidl::Result<()> {
3490            encoder.debug_check_bounds::<ColorRgb>(offset);
3491            // Delegate to tuple encoding.
3492            fidl::encoding::Encode::<ColorRgb, D>::encode(
3493                (
3494                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
3495                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
3496                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
3497                ),
3498                encoder,
3499                offset,
3500                _depth,
3501            )
3502        }
3503    }
3504    unsafe impl<
3505            D: fidl::encoding::ResourceDialect,
3506            T0: fidl::encoding::Encode<f32, D>,
3507            T1: fidl::encoding::Encode<f32, D>,
3508            T2: fidl::encoding::Encode<f32, D>,
3509        > fidl::encoding::Encode<ColorRgb, D> for (T0, T1, T2)
3510    {
3511        #[inline]
3512        unsafe fn encode(
3513            self,
3514            encoder: &mut fidl::encoding::Encoder<'_, D>,
3515            offset: usize,
3516            depth: fidl::encoding::Depth,
3517        ) -> fidl::Result<()> {
3518            encoder.debug_check_bounds::<ColorRgb>(offset);
3519            // Zero out padding regions. There's no need to apply masks
3520            // because the unmasked parts will be overwritten by fields.
3521            // Write the fields.
3522            self.0.encode(encoder, offset + 0, depth)?;
3523            self.1.encode(encoder, offset + 4, depth)?;
3524            self.2.encode(encoder, offset + 8, depth)?;
3525            Ok(())
3526        }
3527    }
3528
3529    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgb {
3530        #[inline(always)]
3531        fn new_empty() -> Self {
3532            Self {
3533                red: fidl::new_empty!(f32, D),
3534                green: fidl::new_empty!(f32, D),
3535                blue: fidl::new_empty!(f32, D),
3536            }
3537        }
3538
3539        #[inline]
3540        unsafe fn decode(
3541            &mut self,
3542            decoder: &mut fidl::encoding::Decoder<'_, D>,
3543            offset: usize,
3544            _depth: fidl::encoding::Depth,
3545        ) -> fidl::Result<()> {
3546            decoder.debug_check_bounds::<Self>(offset);
3547            // Verify that padding bytes are zero.
3548            fidl::decode!(f32, D, &mut self.red, decoder, offset + 0, _depth)?;
3549            fidl::decode!(f32, D, &mut self.green, decoder, offset + 4, _depth)?;
3550            fidl::decode!(f32, D, &mut self.blue, decoder, offset + 8, _depth)?;
3551            Ok(())
3552        }
3553    }
3554
3555    impl fidl::encoding::ValueTypeMarker for ColorRgbValue {
3556        type Borrowed<'a> = &'a Self;
3557        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3558            value
3559        }
3560    }
3561
3562    unsafe impl fidl::encoding::TypeMarker for ColorRgbValue {
3563        type Owned = Self;
3564
3565        #[inline(always)]
3566        fn inline_align(_context: fidl::encoding::Context) -> usize {
3567            4
3568        }
3569
3570        #[inline(always)]
3571        fn inline_size(_context: fidl::encoding::Context) -> usize {
3572            16
3573        }
3574    }
3575
3576    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbValue, D>
3577        for &ColorRgbValue
3578    {
3579        #[inline]
3580        unsafe fn encode(
3581            self,
3582            encoder: &mut fidl::encoding::Encoder<'_, D>,
3583            offset: usize,
3584            _depth: fidl::encoding::Depth,
3585        ) -> fidl::Result<()> {
3586            encoder.debug_check_bounds::<ColorRgbValue>(offset);
3587            // Delegate to tuple encoding.
3588            fidl::encoding::Encode::<ColorRgbValue, D>::encode(
3589                (
3590                    <ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3591                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
3592                ),
3593                encoder,
3594                offset,
3595                _depth,
3596            )
3597        }
3598    }
3599    unsafe impl<
3600            D: fidl::encoding::ResourceDialect,
3601            T0: fidl::encoding::Encode<ColorRgb, D>,
3602            T1: fidl::encoding::Encode<u32, D>,
3603        > fidl::encoding::Encode<ColorRgbValue, D> for (T0, T1)
3604    {
3605        #[inline]
3606        unsafe fn encode(
3607            self,
3608            encoder: &mut fidl::encoding::Encoder<'_, D>,
3609            offset: usize,
3610            depth: fidl::encoding::Depth,
3611        ) -> fidl::Result<()> {
3612            encoder.debug_check_bounds::<ColorRgbValue>(offset);
3613            // Zero out padding regions. There's no need to apply masks
3614            // because the unmasked parts will be overwritten by fields.
3615            // Write the fields.
3616            self.0.encode(encoder, offset + 0, depth)?;
3617            self.1.encode(encoder, offset + 12, depth)?;
3618            Ok(())
3619        }
3620    }
3621
3622    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbValue {
3623        #[inline(always)]
3624        fn new_empty() -> Self {
3625            Self { value: fidl::new_empty!(ColorRgb, D), variable_id: fidl::new_empty!(u32, D) }
3626        }
3627
3628        #[inline]
3629        unsafe fn decode(
3630            &mut self,
3631            decoder: &mut fidl::encoding::Decoder<'_, D>,
3632            offset: usize,
3633            _depth: fidl::encoding::Depth,
3634        ) -> fidl::Result<()> {
3635            decoder.debug_check_bounds::<Self>(offset);
3636            // Verify that padding bytes are zero.
3637            fidl::decode!(ColorRgb, D, &mut self.value, decoder, offset + 0, _depth)?;
3638            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
3639            Ok(())
3640        }
3641    }
3642
3643    impl fidl::encoding::ValueTypeMarker for ColorRgba {
3644        type Borrowed<'a> = &'a Self;
3645        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3646            value
3647        }
3648    }
3649
3650    unsafe impl fidl::encoding::TypeMarker for ColorRgba {
3651        type Owned = Self;
3652
3653        #[inline(always)]
3654        fn inline_align(_context: fidl::encoding::Context) -> usize {
3655            1
3656        }
3657
3658        #[inline(always)]
3659        fn inline_size(_context: fidl::encoding::Context) -> usize {
3660            4
3661        }
3662        #[inline(always)]
3663        fn encode_is_copy() -> bool {
3664            true
3665        }
3666
3667        #[inline(always)]
3668        fn decode_is_copy() -> bool {
3669            true
3670        }
3671    }
3672
3673    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgba, D>
3674        for &ColorRgba
3675    {
3676        #[inline]
3677        unsafe fn encode(
3678            self,
3679            encoder: &mut fidl::encoding::Encoder<'_, D>,
3680            offset: usize,
3681            _depth: fidl::encoding::Depth,
3682        ) -> fidl::Result<()> {
3683            encoder.debug_check_bounds::<ColorRgba>(offset);
3684            unsafe {
3685                // Copy the object into the buffer.
3686                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3687                (buf_ptr as *mut ColorRgba).write_unaligned((self as *const ColorRgba).read());
3688                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3689                // done second because the memcpy will write garbage to these bytes.
3690            }
3691            Ok(())
3692        }
3693    }
3694    unsafe impl<
3695            D: fidl::encoding::ResourceDialect,
3696            T0: fidl::encoding::Encode<u8, D>,
3697            T1: fidl::encoding::Encode<u8, D>,
3698            T2: fidl::encoding::Encode<u8, D>,
3699            T3: fidl::encoding::Encode<u8, D>,
3700        > fidl::encoding::Encode<ColorRgba, D> for (T0, T1, T2, T3)
3701    {
3702        #[inline]
3703        unsafe fn encode(
3704            self,
3705            encoder: &mut fidl::encoding::Encoder<'_, D>,
3706            offset: usize,
3707            depth: fidl::encoding::Depth,
3708        ) -> fidl::Result<()> {
3709            encoder.debug_check_bounds::<ColorRgba>(offset);
3710            // Zero out padding regions. There's no need to apply masks
3711            // because the unmasked parts will be overwritten by fields.
3712            // Write the fields.
3713            self.0.encode(encoder, offset + 0, depth)?;
3714            self.1.encode(encoder, offset + 1, depth)?;
3715            self.2.encode(encoder, offset + 2, depth)?;
3716            self.3.encode(encoder, offset + 3, depth)?;
3717            Ok(())
3718        }
3719    }
3720
3721    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgba {
3722        #[inline(always)]
3723        fn new_empty() -> Self {
3724            Self {
3725                red: fidl::new_empty!(u8, D),
3726                green: fidl::new_empty!(u8, D),
3727                blue: fidl::new_empty!(u8, D),
3728                alpha: fidl::new_empty!(u8, D),
3729            }
3730        }
3731
3732        #[inline]
3733        unsafe fn decode(
3734            &mut self,
3735            decoder: &mut fidl::encoding::Decoder<'_, D>,
3736            offset: usize,
3737            _depth: fidl::encoding::Depth,
3738        ) -> fidl::Result<()> {
3739            decoder.debug_check_bounds::<Self>(offset);
3740            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3741            // Verify that padding bytes are zero.
3742            // Copy from the buffer into the object.
3743            unsafe {
3744                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3745            }
3746            Ok(())
3747        }
3748    }
3749
3750    impl fidl::encoding::ValueTypeMarker for ColorRgbaValue {
3751        type Borrowed<'a> = &'a Self;
3752        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3753            value
3754        }
3755    }
3756
3757    unsafe impl fidl::encoding::TypeMarker for ColorRgbaValue {
3758        type Owned = Self;
3759
3760        #[inline(always)]
3761        fn inline_align(_context: fidl::encoding::Context) -> usize {
3762            4
3763        }
3764
3765        #[inline(always)]
3766        fn inline_size(_context: fidl::encoding::Context) -> usize {
3767            8
3768        }
3769        #[inline(always)]
3770        fn encode_is_copy() -> bool {
3771            true
3772        }
3773
3774        #[inline(always)]
3775        fn decode_is_copy() -> bool {
3776            true
3777        }
3778    }
3779
3780    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbaValue, D>
3781        for &ColorRgbaValue
3782    {
3783        #[inline]
3784        unsafe fn encode(
3785            self,
3786            encoder: &mut fidl::encoding::Encoder<'_, D>,
3787            offset: usize,
3788            _depth: fidl::encoding::Depth,
3789        ) -> fidl::Result<()> {
3790            encoder.debug_check_bounds::<ColorRgbaValue>(offset);
3791            unsafe {
3792                // Copy the object into the buffer.
3793                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3794                (buf_ptr as *mut ColorRgbaValue)
3795                    .write_unaligned((self as *const ColorRgbaValue).read());
3796                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3797                // done second because the memcpy will write garbage to these bytes.
3798            }
3799            Ok(())
3800        }
3801    }
3802    unsafe impl<
3803            D: fidl::encoding::ResourceDialect,
3804            T0: fidl::encoding::Encode<ColorRgba, D>,
3805            T1: fidl::encoding::Encode<u32, D>,
3806        > fidl::encoding::Encode<ColorRgbaValue, D> for (T0, T1)
3807    {
3808        #[inline]
3809        unsafe fn encode(
3810            self,
3811            encoder: &mut fidl::encoding::Encoder<'_, D>,
3812            offset: usize,
3813            depth: fidl::encoding::Depth,
3814        ) -> fidl::Result<()> {
3815            encoder.debug_check_bounds::<ColorRgbaValue>(offset);
3816            // Zero out padding regions. There's no need to apply masks
3817            // because the unmasked parts will be overwritten by fields.
3818            // Write the fields.
3819            self.0.encode(encoder, offset + 0, depth)?;
3820            self.1.encode(encoder, offset + 4, depth)?;
3821            Ok(())
3822        }
3823    }
3824
3825    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbaValue {
3826        #[inline(always)]
3827        fn new_empty() -> Self {
3828            Self { value: fidl::new_empty!(ColorRgba, D), variable_id: fidl::new_empty!(u32, D) }
3829        }
3830
3831        #[inline]
3832        unsafe fn decode(
3833            &mut self,
3834            decoder: &mut fidl::encoding::Decoder<'_, D>,
3835            offset: usize,
3836            _depth: fidl::encoding::Depth,
3837        ) -> fidl::Result<()> {
3838            decoder.debug_check_bounds::<Self>(offset);
3839            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3840            // Verify that padding bytes are zero.
3841            // Copy from the buffer into the object.
3842            unsafe {
3843                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3844            }
3845            Ok(())
3846        }
3847    }
3848
3849    impl fidl::encoding::ValueTypeMarker for CompositorArgs {
3850        type Borrowed<'a> = &'a Self;
3851        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3852            value
3853        }
3854    }
3855
3856    unsafe impl fidl::encoding::TypeMarker for CompositorArgs {
3857        type Owned = Self;
3858
3859        #[inline(always)]
3860        fn inline_align(_context: fidl::encoding::Context) -> usize {
3861            4
3862        }
3863
3864        #[inline(always)]
3865        fn inline_size(_context: fidl::encoding::Context) -> usize {
3866            4
3867        }
3868        #[inline(always)]
3869        fn encode_is_copy() -> bool {
3870            true
3871        }
3872
3873        #[inline(always)]
3874        fn decode_is_copy() -> bool {
3875            true
3876        }
3877    }
3878
3879    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompositorArgs, D>
3880        for &CompositorArgs
3881    {
3882        #[inline]
3883        unsafe fn encode(
3884            self,
3885            encoder: &mut fidl::encoding::Encoder<'_, D>,
3886            offset: usize,
3887            _depth: fidl::encoding::Depth,
3888        ) -> fidl::Result<()> {
3889            encoder.debug_check_bounds::<CompositorArgs>(offset);
3890            unsafe {
3891                // Copy the object into the buffer.
3892                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3893                (buf_ptr as *mut CompositorArgs)
3894                    .write_unaligned((self as *const CompositorArgs).read());
3895                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3896                // done second because the memcpy will write garbage to these bytes.
3897            }
3898            Ok(())
3899        }
3900    }
3901    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3902        fidl::encoding::Encode<CompositorArgs, D> for (T0,)
3903    {
3904        #[inline]
3905        unsafe fn encode(
3906            self,
3907            encoder: &mut fidl::encoding::Encoder<'_, D>,
3908            offset: usize,
3909            depth: fidl::encoding::Depth,
3910        ) -> fidl::Result<()> {
3911            encoder.debug_check_bounds::<CompositorArgs>(offset);
3912            // Zero out padding regions. There's no need to apply masks
3913            // because the unmasked parts will be overwritten by fields.
3914            // Write the fields.
3915            self.0.encode(encoder, offset + 0, depth)?;
3916            Ok(())
3917        }
3918    }
3919
3920    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositorArgs {
3921        #[inline(always)]
3922        fn new_empty() -> Self {
3923            Self { dummy: fidl::new_empty!(u32, D) }
3924        }
3925
3926        #[inline]
3927        unsafe fn decode(
3928            &mut self,
3929            decoder: &mut fidl::encoding::Decoder<'_, D>,
3930            offset: usize,
3931            _depth: fidl::encoding::Depth,
3932        ) -> fidl::Result<()> {
3933            decoder.debug_check_bounds::<Self>(offset);
3934            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3935            // Verify that padding bytes are zero.
3936            // Copy from the buffer into the object.
3937            unsafe {
3938                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3939            }
3940            Ok(())
3941        }
3942    }
3943
3944    impl fidl::encoding::ValueTypeMarker for DetachChildrenCmd {
3945        type Borrowed<'a> = &'a Self;
3946        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3947            value
3948        }
3949    }
3950
3951    unsafe impl fidl::encoding::TypeMarker for DetachChildrenCmd {
3952        type Owned = Self;
3953
3954        #[inline(always)]
3955        fn inline_align(_context: fidl::encoding::Context) -> usize {
3956            4
3957        }
3958
3959        #[inline(always)]
3960        fn inline_size(_context: fidl::encoding::Context) -> usize {
3961            4
3962        }
3963        #[inline(always)]
3964        fn encode_is_copy() -> bool {
3965            true
3966        }
3967
3968        #[inline(always)]
3969        fn decode_is_copy() -> bool {
3970            true
3971        }
3972    }
3973
3974    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachChildrenCmd, D>
3975        for &DetachChildrenCmd
3976    {
3977        #[inline]
3978        unsafe fn encode(
3979            self,
3980            encoder: &mut fidl::encoding::Encoder<'_, D>,
3981            offset: usize,
3982            _depth: fidl::encoding::Depth,
3983        ) -> fidl::Result<()> {
3984            encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
3985            unsafe {
3986                // Copy the object into the buffer.
3987                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3988                (buf_ptr as *mut DetachChildrenCmd)
3989                    .write_unaligned((self as *const DetachChildrenCmd).read());
3990                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3991                // done second because the memcpy will write garbage to these bytes.
3992            }
3993            Ok(())
3994        }
3995    }
3996    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3997        fidl::encoding::Encode<DetachChildrenCmd, D> for (T0,)
3998    {
3999        #[inline]
4000        unsafe fn encode(
4001            self,
4002            encoder: &mut fidl::encoding::Encoder<'_, D>,
4003            offset: usize,
4004            depth: fidl::encoding::Depth,
4005        ) -> fidl::Result<()> {
4006            encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
4007            // Zero out padding regions. There's no need to apply masks
4008            // because the unmasked parts will be overwritten by fields.
4009            // Write the fields.
4010            self.0.encode(encoder, offset + 0, depth)?;
4011            Ok(())
4012        }
4013    }
4014
4015    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachChildrenCmd {
4016        #[inline(always)]
4017        fn new_empty() -> Self {
4018            Self { node_id: fidl::new_empty!(u32, D) }
4019        }
4020
4021        #[inline]
4022        unsafe fn decode(
4023            &mut self,
4024            decoder: &mut fidl::encoding::Decoder<'_, D>,
4025            offset: usize,
4026            _depth: fidl::encoding::Depth,
4027        ) -> fidl::Result<()> {
4028            decoder.debug_check_bounds::<Self>(offset);
4029            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4030            // Verify that padding bytes are zero.
4031            // Copy from the buffer into the object.
4032            unsafe {
4033                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4034            }
4035            Ok(())
4036        }
4037    }
4038
4039    impl fidl::encoding::ValueTypeMarker for DetachCmd {
4040        type Borrowed<'a> = &'a Self;
4041        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4042            value
4043        }
4044    }
4045
4046    unsafe impl fidl::encoding::TypeMarker for DetachCmd {
4047        type Owned = Self;
4048
4049        #[inline(always)]
4050        fn inline_align(_context: fidl::encoding::Context) -> usize {
4051            4
4052        }
4053
4054        #[inline(always)]
4055        fn inline_size(_context: fidl::encoding::Context) -> usize {
4056            4
4057        }
4058        #[inline(always)]
4059        fn encode_is_copy() -> bool {
4060            true
4061        }
4062
4063        #[inline(always)]
4064        fn decode_is_copy() -> bool {
4065            true
4066        }
4067    }
4068
4069    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachCmd, D>
4070        for &DetachCmd
4071    {
4072        #[inline]
4073        unsafe fn encode(
4074            self,
4075            encoder: &mut fidl::encoding::Encoder<'_, D>,
4076            offset: usize,
4077            _depth: fidl::encoding::Depth,
4078        ) -> fidl::Result<()> {
4079            encoder.debug_check_bounds::<DetachCmd>(offset);
4080            unsafe {
4081                // Copy the object into the buffer.
4082                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4083                (buf_ptr as *mut DetachCmd).write_unaligned((self as *const DetachCmd).read());
4084                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4085                // done second because the memcpy will write garbage to these bytes.
4086            }
4087            Ok(())
4088        }
4089    }
4090    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4091        fidl::encoding::Encode<DetachCmd, D> for (T0,)
4092    {
4093        #[inline]
4094        unsafe fn encode(
4095            self,
4096            encoder: &mut fidl::encoding::Encoder<'_, D>,
4097            offset: usize,
4098            depth: fidl::encoding::Depth,
4099        ) -> fidl::Result<()> {
4100            encoder.debug_check_bounds::<DetachCmd>(offset);
4101            // Zero out padding regions. There's no need to apply masks
4102            // because the unmasked parts will be overwritten by fields.
4103            // Write the fields.
4104            self.0.encode(encoder, offset + 0, depth)?;
4105            Ok(())
4106        }
4107    }
4108
4109    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachCmd {
4110        #[inline(always)]
4111        fn new_empty() -> Self {
4112            Self { id: fidl::new_empty!(u32, D) }
4113        }
4114
4115        #[inline]
4116        unsafe fn decode(
4117            &mut self,
4118            decoder: &mut fidl::encoding::Decoder<'_, D>,
4119            offset: usize,
4120            _depth: fidl::encoding::Depth,
4121        ) -> fidl::Result<()> {
4122            decoder.debug_check_bounds::<Self>(offset);
4123            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4124            // Verify that padding bytes are zero.
4125            // Copy from the buffer into the object.
4126            unsafe {
4127                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4128            }
4129            Ok(())
4130        }
4131    }
4132
4133    impl fidl::encoding::ValueTypeMarker for DetachLightCmd {
4134        type Borrowed<'a> = &'a Self;
4135        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4136            value
4137        }
4138    }
4139
4140    unsafe impl fidl::encoding::TypeMarker for DetachLightCmd {
4141        type Owned = Self;
4142
4143        #[inline(always)]
4144        fn inline_align(_context: fidl::encoding::Context) -> usize {
4145            4
4146        }
4147
4148        #[inline(always)]
4149        fn inline_size(_context: fidl::encoding::Context) -> usize {
4150            4
4151        }
4152        #[inline(always)]
4153        fn encode_is_copy() -> bool {
4154            true
4155        }
4156
4157        #[inline(always)]
4158        fn decode_is_copy() -> bool {
4159            true
4160        }
4161    }
4162
4163    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightCmd, D>
4164        for &DetachLightCmd
4165    {
4166        #[inline]
4167        unsafe fn encode(
4168            self,
4169            encoder: &mut fidl::encoding::Encoder<'_, D>,
4170            offset: usize,
4171            _depth: fidl::encoding::Depth,
4172        ) -> fidl::Result<()> {
4173            encoder.debug_check_bounds::<DetachLightCmd>(offset);
4174            unsafe {
4175                // Copy the object into the buffer.
4176                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4177                (buf_ptr as *mut DetachLightCmd)
4178                    .write_unaligned((self as *const DetachLightCmd).read());
4179                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4180                // done second because the memcpy will write garbage to these bytes.
4181            }
4182            Ok(())
4183        }
4184    }
4185    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4186        fidl::encoding::Encode<DetachLightCmd, D> for (T0,)
4187    {
4188        #[inline]
4189        unsafe fn encode(
4190            self,
4191            encoder: &mut fidl::encoding::Encoder<'_, D>,
4192            offset: usize,
4193            depth: fidl::encoding::Depth,
4194        ) -> fidl::Result<()> {
4195            encoder.debug_check_bounds::<DetachLightCmd>(offset);
4196            // Zero out padding regions. There's no need to apply masks
4197            // because the unmasked parts will be overwritten by fields.
4198            // Write the fields.
4199            self.0.encode(encoder, offset + 0, depth)?;
4200            Ok(())
4201        }
4202    }
4203
4204    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightCmd {
4205        #[inline(always)]
4206        fn new_empty() -> Self {
4207            Self { light_id: fidl::new_empty!(u32, D) }
4208        }
4209
4210        #[inline]
4211        unsafe fn decode(
4212            &mut self,
4213            decoder: &mut fidl::encoding::Decoder<'_, D>,
4214            offset: usize,
4215            _depth: fidl::encoding::Depth,
4216        ) -> fidl::Result<()> {
4217            decoder.debug_check_bounds::<Self>(offset);
4218            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4219            // Verify that padding bytes are zero.
4220            // Copy from the buffer into the object.
4221            unsafe {
4222                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4223            }
4224            Ok(())
4225        }
4226    }
4227
4228    impl fidl::encoding::ValueTypeMarker for DetachLightsCmd {
4229        type Borrowed<'a> = &'a Self;
4230        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4231            value
4232        }
4233    }
4234
4235    unsafe impl fidl::encoding::TypeMarker for DetachLightsCmd {
4236        type Owned = Self;
4237
4238        #[inline(always)]
4239        fn inline_align(_context: fidl::encoding::Context) -> usize {
4240            4
4241        }
4242
4243        #[inline(always)]
4244        fn inline_size(_context: fidl::encoding::Context) -> usize {
4245            4
4246        }
4247        #[inline(always)]
4248        fn encode_is_copy() -> bool {
4249            true
4250        }
4251
4252        #[inline(always)]
4253        fn decode_is_copy() -> bool {
4254            true
4255        }
4256    }
4257
4258    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightsCmd, D>
4259        for &DetachLightsCmd
4260    {
4261        #[inline]
4262        unsafe fn encode(
4263            self,
4264            encoder: &mut fidl::encoding::Encoder<'_, D>,
4265            offset: usize,
4266            _depth: fidl::encoding::Depth,
4267        ) -> fidl::Result<()> {
4268            encoder.debug_check_bounds::<DetachLightsCmd>(offset);
4269            unsafe {
4270                // Copy the object into the buffer.
4271                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4272                (buf_ptr as *mut DetachLightsCmd)
4273                    .write_unaligned((self as *const DetachLightsCmd).read());
4274                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4275                // done second because the memcpy will write garbage to these bytes.
4276            }
4277            Ok(())
4278        }
4279    }
4280    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4281        fidl::encoding::Encode<DetachLightsCmd, D> for (T0,)
4282    {
4283        #[inline]
4284        unsafe fn encode(
4285            self,
4286            encoder: &mut fidl::encoding::Encoder<'_, D>,
4287            offset: usize,
4288            depth: fidl::encoding::Depth,
4289        ) -> fidl::Result<()> {
4290            encoder.debug_check_bounds::<DetachLightsCmd>(offset);
4291            // Zero out padding regions. There's no need to apply masks
4292            // because the unmasked parts will be overwritten by fields.
4293            // Write the fields.
4294            self.0.encode(encoder, offset + 0, depth)?;
4295            Ok(())
4296        }
4297    }
4298
4299    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightsCmd {
4300        #[inline(always)]
4301        fn new_empty() -> Self {
4302            Self { scene_id: fidl::new_empty!(u32, D) }
4303        }
4304
4305        #[inline]
4306        unsafe fn decode(
4307            &mut self,
4308            decoder: &mut fidl::encoding::Decoder<'_, D>,
4309            offset: usize,
4310            _depth: fidl::encoding::Depth,
4311        ) -> fidl::Result<()> {
4312            decoder.debug_check_bounds::<Self>(offset);
4313            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4314            // Verify that padding bytes are zero.
4315            // Copy from the buffer into the object.
4316            unsafe {
4317                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4318            }
4319            Ok(())
4320        }
4321    }
4322
4323    impl fidl::encoding::ValueTypeMarker for DirectionalLightArgs {
4324        type Borrowed<'a> = &'a Self;
4325        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4326            value
4327        }
4328    }
4329
4330    unsafe impl fidl::encoding::TypeMarker for DirectionalLightArgs {
4331        type Owned = Self;
4332
4333        #[inline(always)]
4334        fn inline_align(_context: fidl::encoding::Context) -> usize {
4335            4
4336        }
4337
4338        #[inline(always)]
4339        fn inline_size(_context: fidl::encoding::Context) -> usize {
4340            4
4341        }
4342        #[inline(always)]
4343        fn encode_is_copy() -> bool {
4344            true
4345        }
4346
4347        #[inline(always)]
4348        fn decode_is_copy() -> bool {
4349            true
4350        }
4351    }
4352
4353    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectionalLightArgs, D>
4354        for &DirectionalLightArgs
4355    {
4356        #[inline]
4357        unsafe fn encode(
4358            self,
4359            encoder: &mut fidl::encoding::Encoder<'_, D>,
4360            offset: usize,
4361            _depth: fidl::encoding::Depth,
4362        ) -> fidl::Result<()> {
4363            encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
4364            unsafe {
4365                // Copy the object into the buffer.
4366                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4367                (buf_ptr as *mut DirectionalLightArgs)
4368                    .write_unaligned((self as *const DirectionalLightArgs).read());
4369                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4370                // done second because the memcpy will write garbage to these bytes.
4371            }
4372            Ok(())
4373        }
4374    }
4375    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4376        fidl::encoding::Encode<DirectionalLightArgs, D> for (T0,)
4377    {
4378        #[inline]
4379        unsafe fn encode(
4380            self,
4381            encoder: &mut fidl::encoding::Encoder<'_, D>,
4382            offset: usize,
4383            depth: fidl::encoding::Depth,
4384        ) -> fidl::Result<()> {
4385            encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
4386            // Zero out padding regions. There's no need to apply masks
4387            // because the unmasked parts will be overwritten by fields.
4388            // Write the fields.
4389            self.0.encode(encoder, offset + 0, depth)?;
4390            Ok(())
4391        }
4392    }
4393
4394    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectionalLightArgs {
4395        #[inline(always)]
4396        fn new_empty() -> Self {
4397            Self { dummy: fidl::new_empty!(u32, D) }
4398        }
4399
4400        #[inline]
4401        unsafe fn decode(
4402            &mut self,
4403            decoder: &mut fidl::encoding::Decoder<'_, D>,
4404            offset: usize,
4405            _depth: fidl::encoding::Depth,
4406        ) -> fidl::Result<()> {
4407            decoder.debug_check_bounds::<Self>(offset);
4408            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4409            // Verify that padding bytes are zero.
4410            // Copy from the buffer into the object.
4411            unsafe {
4412                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4413            }
4414            Ok(())
4415        }
4416    }
4417
4418    impl fidl::encoding::ValueTypeMarker for DisplayCompositorArgs {
4419        type Borrowed<'a> = &'a Self;
4420        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4421            value
4422        }
4423    }
4424
4425    unsafe impl fidl::encoding::TypeMarker for DisplayCompositorArgs {
4426        type Owned = Self;
4427
4428        #[inline(always)]
4429        fn inline_align(_context: fidl::encoding::Context) -> usize {
4430            4
4431        }
4432
4433        #[inline(always)]
4434        fn inline_size(_context: fidl::encoding::Context) -> usize {
4435            4
4436        }
4437        #[inline(always)]
4438        fn encode_is_copy() -> bool {
4439            true
4440        }
4441
4442        #[inline(always)]
4443        fn decode_is_copy() -> bool {
4444            true
4445        }
4446    }
4447
4448    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayCompositorArgs, D>
4449        for &DisplayCompositorArgs
4450    {
4451        #[inline]
4452        unsafe fn encode(
4453            self,
4454            encoder: &mut fidl::encoding::Encoder<'_, D>,
4455            offset: usize,
4456            _depth: fidl::encoding::Depth,
4457        ) -> fidl::Result<()> {
4458            encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
4459            unsafe {
4460                // Copy the object into the buffer.
4461                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4462                (buf_ptr as *mut DisplayCompositorArgs)
4463                    .write_unaligned((self as *const DisplayCompositorArgs).read());
4464                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4465                // done second because the memcpy will write garbage to these bytes.
4466            }
4467            Ok(())
4468        }
4469    }
4470    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4471        fidl::encoding::Encode<DisplayCompositorArgs, D> for (T0,)
4472    {
4473        #[inline]
4474        unsafe fn encode(
4475            self,
4476            encoder: &mut fidl::encoding::Encoder<'_, D>,
4477            offset: usize,
4478            depth: fidl::encoding::Depth,
4479        ) -> fidl::Result<()> {
4480            encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
4481            // Zero out padding regions. There's no need to apply masks
4482            // because the unmasked parts will be overwritten by fields.
4483            // Write the fields.
4484            self.0.encode(encoder, offset + 0, depth)?;
4485            Ok(())
4486        }
4487    }
4488
4489    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayCompositorArgs {
4490        #[inline(always)]
4491        fn new_empty() -> Self {
4492            Self { dummy: fidl::new_empty!(u32, D) }
4493        }
4494
4495        #[inline]
4496        unsafe fn decode(
4497            &mut self,
4498            decoder: &mut fidl::encoding::Decoder<'_, D>,
4499            offset: usize,
4500            _depth: fidl::encoding::Depth,
4501        ) -> fidl::Result<()> {
4502            decoder.debug_check_bounds::<Self>(offset);
4503            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4504            // Verify that padding bytes are zero.
4505            // Copy from the buffer into the object.
4506            unsafe {
4507                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4508            }
4509            Ok(())
4510        }
4511    }
4512
4513    impl fidl::encoding::ValueTypeMarker for DisplayInfo {
4514        type Borrowed<'a> = &'a Self;
4515        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4516            value
4517        }
4518    }
4519
4520    unsafe impl fidl::encoding::TypeMarker for DisplayInfo {
4521        type Owned = Self;
4522
4523        #[inline(always)]
4524        fn inline_align(_context: fidl::encoding::Context) -> usize {
4525            4
4526        }
4527
4528        #[inline(always)]
4529        fn inline_size(_context: fidl::encoding::Context) -> usize {
4530            8
4531        }
4532        #[inline(always)]
4533        fn encode_is_copy() -> bool {
4534            true
4535        }
4536
4537        #[inline(always)]
4538        fn decode_is_copy() -> bool {
4539            true
4540        }
4541    }
4542
4543    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayInfo, D>
4544        for &DisplayInfo
4545    {
4546        #[inline]
4547        unsafe fn encode(
4548            self,
4549            encoder: &mut fidl::encoding::Encoder<'_, D>,
4550            offset: usize,
4551            _depth: fidl::encoding::Depth,
4552        ) -> fidl::Result<()> {
4553            encoder.debug_check_bounds::<DisplayInfo>(offset);
4554            unsafe {
4555                // Copy the object into the buffer.
4556                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4557                (buf_ptr as *mut DisplayInfo).write_unaligned((self as *const DisplayInfo).read());
4558                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4559                // done second because the memcpy will write garbage to these bytes.
4560            }
4561            Ok(())
4562        }
4563    }
4564    unsafe impl<
4565            D: fidl::encoding::ResourceDialect,
4566            T0: fidl::encoding::Encode<u32, D>,
4567            T1: fidl::encoding::Encode<u32, D>,
4568        > fidl::encoding::Encode<DisplayInfo, D> for (T0, T1)
4569    {
4570        #[inline]
4571        unsafe fn encode(
4572            self,
4573            encoder: &mut fidl::encoding::Encoder<'_, D>,
4574            offset: usize,
4575            depth: fidl::encoding::Depth,
4576        ) -> fidl::Result<()> {
4577            encoder.debug_check_bounds::<DisplayInfo>(offset);
4578            // Zero out padding regions. There's no need to apply masks
4579            // because the unmasked parts will be overwritten by fields.
4580            // Write the fields.
4581            self.0.encode(encoder, offset + 0, depth)?;
4582            self.1.encode(encoder, offset + 4, depth)?;
4583            Ok(())
4584        }
4585    }
4586
4587    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayInfo {
4588        #[inline(always)]
4589        fn new_empty() -> Self {
4590            Self { width_in_px: fidl::new_empty!(u32, D), height_in_px: fidl::new_empty!(u32, D) }
4591        }
4592
4593        #[inline]
4594        unsafe fn decode(
4595            &mut self,
4596            decoder: &mut fidl::encoding::Decoder<'_, D>,
4597            offset: usize,
4598            _depth: fidl::encoding::Depth,
4599        ) -> fidl::Result<()> {
4600            decoder.debug_check_bounds::<Self>(offset);
4601            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4602            // Verify that padding bytes are zero.
4603            // Copy from the buffer into the object.
4604            unsafe {
4605                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4606            }
4607            Ok(())
4608        }
4609    }
4610
4611    impl fidl::encoding::ValueTypeMarker for EntityNodeArgs {
4612        type Borrowed<'a> = &'a Self;
4613        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4614            value
4615        }
4616    }
4617
4618    unsafe impl fidl::encoding::TypeMarker for EntityNodeArgs {
4619        type Owned = Self;
4620
4621        #[inline(always)]
4622        fn inline_align(_context: fidl::encoding::Context) -> usize {
4623            4
4624        }
4625
4626        #[inline(always)]
4627        fn inline_size(_context: fidl::encoding::Context) -> usize {
4628            4
4629        }
4630        #[inline(always)]
4631        fn encode_is_copy() -> bool {
4632            true
4633        }
4634
4635        #[inline(always)]
4636        fn decode_is_copy() -> bool {
4637            true
4638        }
4639    }
4640
4641    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EntityNodeArgs, D>
4642        for &EntityNodeArgs
4643    {
4644        #[inline]
4645        unsafe fn encode(
4646            self,
4647            encoder: &mut fidl::encoding::Encoder<'_, D>,
4648            offset: usize,
4649            _depth: fidl::encoding::Depth,
4650        ) -> fidl::Result<()> {
4651            encoder.debug_check_bounds::<EntityNodeArgs>(offset);
4652            unsafe {
4653                // Copy the object into the buffer.
4654                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4655                (buf_ptr as *mut EntityNodeArgs)
4656                    .write_unaligned((self as *const EntityNodeArgs).read());
4657                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4658                // done second because the memcpy will write garbage to these bytes.
4659            }
4660            Ok(())
4661        }
4662    }
4663    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4664        fidl::encoding::Encode<EntityNodeArgs, D> for (T0,)
4665    {
4666        #[inline]
4667        unsafe fn encode(
4668            self,
4669            encoder: &mut fidl::encoding::Encoder<'_, D>,
4670            offset: usize,
4671            depth: fidl::encoding::Depth,
4672        ) -> fidl::Result<()> {
4673            encoder.debug_check_bounds::<EntityNodeArgs>(offset);
4674            // Zero out padding regions. There's no need to apply masks
4675            // because the unmasked parts will be overwritten by fields.
4676            // Write the fields.
4677            self.0.encode(encoder, offset + 0, depth)?;
4678            Ok(())
4679        }
4680    }
4681
4682    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EntityNodeArgs {
4683        #[inline(always)]
4684        fn new_empty() -> Self {
4685            Self { unused: fidl::new_empty!(u32, D) }
4686        }
4687
4688        #[inline]
4689        unsafe fn decode(
4690            &mut self,
4691            decoder: &mut fidl::encoding::Decoder<'_, D>,
4692            offset: usize,
4693            _depth: fidl::encoding::Depth,
4694        ) -> fidl::Result<()> {
4695            decoder.debug_check_bounds::<Self>(offset);
4696            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4697            // Verify that padding bytes are zero.
4698            // Copy from the buffer into the object.
4699            unsafe {
4700                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4701            }
4702            Ok(())
4703        }
4704    }
4705
4706    impl fidl::encoding::ValueTypeMarker for FactoredTransform {
4707        type Borrowed<'a> = &'a Self;
4708        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4709            value
4710        }
4711    }
4712
4713    unsafe impl fidl::encoding::TypeMarker for FactoredTransform {
4714        type Owned = Self;
4715
4716        #[inline(always)]
4717        fn inline_align(_context: fidl::encoding::Context) -> usize {
4718            4
4719        }
4720
4721        #[inline(always)]
4722        fn inline_size(_context: fidl::encoding::Context) -> usize {
4723            52
4724        }
4725    }
4726
4727    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FactoredTransform, D>
4728        for &FactoredTransform
4729    {
4730        #[inline]
4731        unsafe fn encode(
4732            self,
4733            encoder: &mut fidl::encoding::Encoder<'_, D>,
4734            offset: usize,
4735            _depth: fidl::encoding::Depth,
4736        ) -> fidl::Result<()> {
4737            encoder.debug_check_bounds::<FactoredTransform>(offset);
4738            // Delegate to tuple encoding.
4739            fidl::encoding::Encode::<FactoredTransform, D>::encode(
4740                (
4741                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
4742                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
4743                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.anchor),
4744                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.rotation),
4745                ),
4746                encoder,
4747                offset,
4748                _depth,
4749            )
4750        }
4751    }
4752    unsafe impl<
4753            D: fidl::encoding::ResourceDialect,
4754            T0: fidl::encoding::Encode<Vec3, D>,
4755            T1: fidl::encoding::Encode<Vec3, D>,
4756            T2: fidl::encoding::Encode<Vec3, D>,
4757            T3: fidl::encoding::Encode<Quaternion, D>,
4758        > fidl::encoding::Encode<FactoredTransform, D> for (T0, T1, T2, T3)
4759    {
4760        #[inline]
4761        unsafe fn encode(
4762            self,
4763            encoder: &mut fidl::encoding::Encoder<'_, D>,
4764            offset: usize,
4765            depth: fidl::encoding::Depth,
4766        ) -> fidl::Result<()> {
4767            encoder.debug_check_bounds::<FactoredTransform>(offset);
4768            // Zero out padding regions. There's no need to apply masks
4769            // because the unmasked parts will be overwritten by fields.
4770            // Write the fields.
4771            self.0.encode(encoder, offset + 0, depth)?;
4772            self.1.encode(encoder, offset + 12, depth)?;
4773            self.2.encode(encoder, offset + 24, depth)?;
4774            self.3.encode(encoder, offset + 36, depth)?;
4775            Ok(())
4776        }
4777    }
4778
4779    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FactoredTransform {
4780        #[inline(always)]
4781        fn new_empty() -> Self {
4782            Self {
4783                translation: fidl::new_empty!(Vec3, D),
4784                scale: fidl::new_empty!(Vec3, D),
4785                anchor: fidl::new_empty!(Vec3, D),
4786                rotation: fidl::new_empty!(Quaternion, D),
4787            }
4788        }
4789
4790        #[inline]
4791        unsafe fn decode(
4792            &mut self,
4793            decoder: &mut fidl::encoding::Decoder<'_, D>,
4794            offset: usize,
4795            _depth: fidl::encoding::Depth,
4796        ) -> fidl::Result<()> {
4797            decoder.debug_check_bounds::<Self>(offset);
4798            // Verify that padding bytes are zero.
4799            fidl::decode!(Vec3, D, &mut self.translation, decoder, offset + 0, _depth)?;
4800            fidl::decode!(Vec3, D, &mut self.scale, decoder, offset + 12, _depth)?;
4801            fidl::decode!(Vec3, D, &mut self.anchor, decoder, offset + 24, _depth)?;
4802            fidl::decode!(Quaternion, D, &mut self.rotation, decoder, offset + 36, _depth)?;
4803            Ok(())
4804        }
4805    }
4806
4807    impl fidl::encoding::ValueTypeMarker for FloatValue {
4808        type Borrowed<'a> = &'a Self;
4809        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4810            value
4811        }
4812    }
4813
4814    unsafe impl fidl::encoding::TypeMarker for FloatValue {
4815        type Owned = Self;
4816
4817        #[inline(always)]
4818        fn inline_align(_context: fidl::encoding::Context) -> usize {
4819            4
4820        }
4821
4822        #[inline(always)]
4823        fn inline_size(_context: fidl::encoding::Context) -> usize {
4824            8
4825        }
4826    }
4827
4828    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FloatValue, D>
4829        for &FloatValue
4830    {
4831        #[inline]
4832        unsafe fn encode(
4833            self,
4834            encoder: &mut fidl::encoding::Encoder<'_, D>,
4835            offset: usize,
4836            _depth: fidl::encoding::Depth,
4837        ) -> fidl::Result<()> {
4838            encoder.debug_check_bounds::<FloatValue>(offset);
4839            // Delegate to tuple encoding.
4840            fidl::encoding::Encode::<FloatValue, D>::encode(
4841                (
4842                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4843                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
4844                ),
4845                encoder,
4846                offset,
4847                _depth,
4848            )
4849        }
4850    }
4851    unsafe impl<
4852            D: fidl::encoding::ResourceDialect,
4853            T0: fidl::encoding::Encode<f32, D>,
4854            T1: fidl::encoding::Encode<u32, D>,
4855        > fidl::encoding::Encode<FloatValue, D> for (T0, T1)
4856    {
4857        #[inline]
4858        unsafe fn encode(
4859            self,
4860            encoder: &mut fidl::encoding::Encoder<'_, D>,
4861            offset: usize,
4862            depth: fidl::encoding::Depth,
4863        ) -> fidl::Result<()> {
4864            encoder.debug_check_bounds::<FloatValue>(offset);
4865            // Zero out padding regions. There's no need to apply masks
4866            // because the unmasked parts will be overwritten by fields.
4867            // Write the fields.
4868            self.0.encode(encoder, offset + 0, depth)?;
4869            self.1.encode(encoder, offset + 4, depth)?;
4870            Ok(())
4871        }
4872    }
4873
4874    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FloatValue {
4875        #[inline(always)]
4876        fn new_empty() -> Self {
4877            Self { value: fidl::new_empty!(f32, D), variable_id: fidl::new_empty!(u32, D) }
4878        }
4879
4880        #[inline]
4881        unsafe fn decode(
4882            &mut self,
4883            decoder: &mut fidl::encoding::Decoder<'_, D>,
4884            offset: usize,
4885            _depth: fidl::encoding::Depth,
4886        ) -> fidl::Result<()> {
4887            decoder.debug_check_bounds::<Self>(offset);
4888            // Verify that padding bytes are zero.
4889            fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
4890            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 4, _depth)?;
4891            Ok(())
4892        }
4893    }
4894
4895    impl fidl::encoding::ValueTypeMarker for ImageArgs {
4896        type Borrowed<'a> = &'a Self;
4897        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4898            value
4899        }
4900    }
4901
4902    unsafe impl fidl::encoding::TypeMarker for ImageArgs {
4903        type Owned = Self;
4904
4905        #[inline(always)]
4906        fn inline_align(_context: fidl::encoding::Context) -> usize {
4907            4
4908        }
4909
4910        #[inline(always)]
4911        fn inline_size(_context: fidl::encoding::Context) -> usize {
4912            40
4913        }
4914    }
4915
4916    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs, D>
4917        for &ImageArgs
4918    {
4919        #[inline]
4920        unsafe fn encode(
4921            self,
4922            encoder: &mut fidl::encoding::Encoder<'_, D>,
4923            offset: usize,
4924            _depth: fidl::encoding::Depth,
4925        ) -> fidl::Result<()> {
4926            encoder.debug_check_bounds::<ImageArgs>(offset);
4927            // Delegate to tuple encoding.
4928            fidl::encoding::Encode::<ImageArgs, D>::encode(
4929                (
4930                    <fidl_fuchsia_images::ImageInfo as fidl::encoding::ValueTypeMarker>::borrow(
4931                        &self.info,
4932                    ),
4933                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_id),
4934                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_offset),
4935                ),
4936                encoder,
4937                offset,
4938                _depth,
4939            )
4940        }
4941    }
4942    unsafe impl<
4943            D: fidl::encoding::ResourceDialect,
4944            T0: fidl::encoding::Encode<fidl_fuchsia_images::ImageInfo, D>,
4945            T1: fidl::encoding::Encode<u32, D>,
4946            T2: fidl::encoding::Encode<u32, D>,
4947        > fidl::encoding::Encode<ImageArgs, D> for (T0, T1, T2)
4948    {
4949        #[inline]
4950        unsafe fn encode(
4951            self,
4952            encoder: &mut fidl::encoding::Encoder<'_, D>,
4953            offset: usize,
4954            depth: fidl::encoding::Depth,
4955        ) -> fidl::Result<()> {
4956            encoder.debug_check_bounds::<ImageArgs>(offset);
4957            // Zero out padding regions. There's no need to apply masks
4958            // because the unmasked parts will be overwritten by fields.
4959            // Write the fields.
4960            self.0.encode(encoder, offset + 0, depth)?;
4961            self.1.encode(encoder, offset + 32, depth)?;
4962            self.2.encode(encoder, offset + 36, depth)?;
4963            Ok(())
4964        }
4965    }
4966
4967    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs {
4968        #[inline(always)]
4969        fn new_empty() -> Self {
4970            Self {
4971                info: fidl::new_empty!(fidl_fuchsia_images::ImageInfo, D),
4972                memory_id: fidl::new_empty!(u32, D),
4973                memory_offset: fidl::new_empty!(u32, D),
4974            }
4975        }
4976
4977        #[inline]
4978        unsafe fn decode(
4979            &mut self,
4980            decoder: &mut fidl::encoding::Decoder<'_, D>,
4981            offset: usize,
4982            _depth: fidl::encoding::Depth,
4983        ) -> fidl::Result<()> {
4984            decoder.debug_check_bounds::<Self>(offset);
4985            // Verify that padding bytes are zero.
4986            fidl::decode!(
4987                fidl_fuchsia_images::ImageInfo,
4988                D,
4989                &mut self.info,
4990                decoder,
4991                offset + 0,
4992                _depth
4993            )?;
4994            fidl::decode!(u32, D, &mut self.memory_id, decoder, offset + 32, _depth)?;
4995            fidl::decode!(u32, D, &mut self.memory_offset, decoder, offset + 36, _depth)?;
4996            Ok(())
4997        }
4998    }
4999
5000    impl fidl::encoding::ValueTypeMarker for ImageArgs2 {
5001        type Borrowed<'a> = &'a Self;
5002        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5003            value
5004        }
5005    }
5006
5007    unsafe impl fidl::encoding::TypeMarker for ImageArgs2 {
5008        type Owned = Self;
5009
5010        #[inline(always)]
5011        fn inline_align(_context: fidl::encoding::Context) -> usize {
5012            4
5013        }
5014
5015        #[inline(always)]
5016        fn inline_size(_context: fidl::encoding::Context) -> usize {
5017            16
5018        }
5019        #[inline(always)]
5020        fn encode_is_copy() -> bool {
5021            true
5022        }
5023
5024        #[inline(always)]
5025        fn decode_is_copy() -> bool {
5026            true
5027        }
5028    }
5029
5030    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs2, D>
5031        for &ImageArgs2
5032    {
5033        #[inline]
5034        unsafe fn encode(
5035            self,
5036            encoder: &mut fidl::encoding::Encoder<'_, D>,
5037            offset: usize,
5038            _depth: fidl::encoding::Depth,
5039        ) -> fidl::Result<()> {
5040            encoder.debug_check_bounds::<ImageArgs2>(offset);
5041            unsafe {
5042                // Copy the object into the buffer.
5043                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5044                (buf_ptr as *mut ImageArgs2).write_unaligned((self as *const ImageArgs2).read());
5045                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5046                // done second because the memcpy will write garbage to these bytes.
5047            }
5048            Ok(())
5049        }
5050    }
5051    unsafe impl<
5052            D: fidl::encoding::ResourceDialect,
5053            T0: fidl::encoding::Encode<u32, D>,
5054            T1: fidl::encoding::Encode<u32, D>,
5055            T2: fidl::encoding::Encode<u32, D>,
5056            T3: fidl::encoding::Encode<u32, D>,
5057        > fidl::encoding::Encode<ImageArgs2, D> for (T0, T1, T2, T3)
5058    {
5059        #[inline]
5060        unsafe fn encode(
5061            self,
5062            encoder: &mut fidl::encoding::Encoder<'_, D>,
5063            offset: usize,
5064            depth: fidl::encoding::Depth,
5065        ) -> fidl::Result<()> {
5066            encoder.debug_check_bounds::<ImageArgs2>(offset);
5067            // Zero out padding regions. There's no need to apply masks
5068            // because the unmasked parts will be overwritten by fields.
5069            // Write the fields.
5070            self.0.encode(encoder, offset + 0, depth)?;
5071            self.1.encode(encoder, offset + 4, depth)?;
5072            self.2.encode(encoder, offset + 8, depth)?;
5073            self.3.encode(encoder, offset + 12, depth)?;
5074            Ok(())
5075        }
5076    }
5077
5078    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs2 {
5079        #[inline(always)]
5080        fn new_empty() -> Self {
5081            Self {
5082                width: fidl::new_empty!(u32, D),
5083                height: fidl::new_empty!(u32, D),
5084                buffer_collection_id: fidl::new_empty!(u32, D),
5085                buffer_collection_index: fidl::new_empty!(u32, D),
5086            }
5087        }
5088
5089        #[inline]
5090        unsafe fn decode(
5091            &mut self,
5092            decoder: &mut fidl::encoding::Decoder<'_, D>,
5093            offset: usize,
5094            _depth: fidl::encoding::Depth,
5095        ) -> fidl::Result<()> {
5096            decoder.debug_check_bounds::<Self>(offset);
5097            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5098            // Verify that padding bytes are zero.
5099            // Copy from the buffer into the object.
5100            unsafe {
5101                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5102            }
5103            Ok(())
5104        }
5105    }
5106
5107    impl fidl::encoding::ValueTypeMarker for ImportUnboundEvent {
5108        type Borrowed<'a> = &'a Self;
5109        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5110            value
5111        }
5112    }
5113
5114    unsafe impl fidl::encoding::TypeMarker for ImportUnboundEvent {
5115        type Owned = Self;
5116
5117        #[inline(always)]
5118        fn inline_align(_context: fidl::encoding::Context) -> usize {
5119            4
5120        }
5121
5122        #[inline(always)]
5123        fn inline_size(_context: fidl::encoding::Context) -> usize {
5124            4
5125        }
5126        #[inline(always)]
5127        fn encode_is_copy() -> bool {
5128            true
5129        }
5130
5131        #[inline(always)]
5132        fn decode_is_copy() -> bool {
5133            true
5134        }
5135    }
5136
5137    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImportUnboundEvent, D>
5138        for &ImportUnboundEvent
5139    {
5140        #[inline]
5141        unsafe fn encode(
5142            self,
5143            encoder: &mut fidl::encoding::Encoder<'_, D>,
5144            offset: usize,
5145            _depth: fidl::encoding::Depth,
5146        ) -> fidl::Result<()> {
5147            encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5148            unsafe {
5149                // Copy the object into the buffer.
5150                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5151                (buf_ptr as *mut ImportUnboundEvent)
5152                    .write_unaligned((self as *const ImportUnboundEvent).read());
5153                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5154                // done second because the memcpy will write garbage to these bytes.
5155            }
5156            Ok(())
5157        }
5158    }
5159    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5160        fidl::encoding::Encode<ImportUnboundEvent, D> for (T0,)
5161    {
5162        #[inline]
5163        unsafe fn encode(
5164            self,
5165            encoder: &mut fidl::encoding::Encoder<'_, D>,
5166            offset: usize,
5167            depth: fidl::encoding::Depth,
5168        ) -> fidl::Result<()> {
5169            encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5170            // Zero out padding regions. There's no need to apply masks
5171            // because the unmasked parts will be overwritten by fields.
5172            // Write the fields.
5173            self.0.encode(encoder, offset + 0, depth)?;
5174            Ok(())
5175        }
5176    }
5177
5178    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportUnboundEvent {
5179        #[inline(always)]
5180        fn new_empty() -> Self {
5181            Self { resource_id: fidl::new_empty!(u32, D) }
5182        }
5183
5184        #[inline]
5185        unsafe fn decode(
5186            &mut self,
5187            decoder: &mut fidl::encoding::Decoder<'_, D>,
5188            offset: usize,
5189            _depth: fidl::encoding::Depth,
5190        ) -> fidl::Result<()> {
5191            decoder.debug_check_bounds::<Self>(offset);
5192            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5193            // Verify that padding bytes are zero.
5194            // Copy from the buffer into the object.
5195            unsafe {
5196                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5197            }
5198            Ok(())
5199        }
5200    }
5201
5202    impl fidl::encoding::ValueTypeMarker for LayerArgs {
5203        type Borrowed<'a> = &'a Self;
5204        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5205            value
5206        }
5207    }
5208
5209    unsafe impl fidl::encoding::TypeMarker for LayerArgs {
5210        type Owned = Self;
5211
5212        #[inline(always)]
5213        fn inline_align(_context: fidl::encoding::Context) -> usize {
5214            4
5215        }
5216
5217        #[inline(always)]
5218        fn inline_size(_context: fidl::encoding::Context) -> usize {
5219            4
5220        }
5221        #[inline(always)]
5222        fn encode_is_copy() -> bool {
5223            true
5224        }
5225
5226        #[inline(always)]
5227        fn decode_is_copy() -> bool {
5228            true
5229        }
5230    }
5231
5232    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerArgs, D>
5233        for &LayerArgs
5234    {
5235        #[inline]
5236        unsafe fn encode(
5237            self,
5238            encoder: &mut fidl::encoding::Encoder<'_, D>,
5239            offset: usize,
5240            _depth: fidl::encoding::Depth,
5241        ) -> fidl::Result<()> {
5242            encoder.debug_check_bounds::<LayerArgs>(offset);
5243            unsafe {
5244                // Copy the object into the buffer.
5245                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5246                (buf_ptr as *mut LayerArgs).write_unaligned((self as *const LayerArgs).read());
5247                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5248                // done second because the memcpy will write garbage to these bytes.
5249            }
5250            Ok(())
5251        }
5252    }
5253    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5254        fidl::encoding::Encode<LayerArgs, D> for (T0,)
5255    {
5256        #[inline]
5257        unsafe fn encode(
5258            self,
5259            encoder: &mut fidl::encoding::Encoder<'_, D>,
5260            offset: usize,
5261            depth: fidl::encoding::Depth,
5262        ) -> fidl::Result<()> {
5263            encoder.debug_check_bounds::<LayerArgs>(offset);
5264            // Zero out padding regions. There's no need to apply masks
5265            // because the unmasked parts will be overwritten by fields.
5266            // Write the fields.
5267            self.0.encode(encoder, offset + 0, depth)?;
5268            Ok(())
5269        }
5270    }
5271
5272    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerArgs {
5273        #[inline(always)]
5274        fn new_empty() -> Self {
5275            Self { dummy: fidl::new_empty!(u32, D) }
5276        }
5277
5278        #[inline]
5279        unsafe fn decode(
5280            &mut self,
5281            decoder: &mut fidl::encoding::Decoder<'_, D>,
5282            offset: usize,
5283            _depth: fidl::encoding::Depth,
5284        ) -> fidl::Result<()> {
5285            decoder.debug_check_bounds::<Self>(offset);
5286            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5287            // Verify that padding bytes are zero.
5288            // Copy from the buffer into the object.
5289            unsafe {
5290                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5291            }
5292            Ok(())
5293        }
5294    }
5295
5296    impl fidl::encoding::ValueTypeMarker for LayerStackArgs {
5297        type Borrowed<'a> = &'a Self;
5298        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5299            value
5300        }
5301    }
5302
5303    unsafe impl fidl::encoding::TypeMarker for LayerStackArgs {
5304        type Owned = Self;
5305
5306        #[inline(always)]
5307        fn inline_align(_context: fidl::encoding::Context) -> usize {
5308            4
5309        }
5310
5311        #[inline(always)]
5312        fn inline_size(_context: fidl::encoding::Context) -> usize {
5313            4
5314        }
5315        #[inline(always)]
5316        fn encode_is_copy() -> bool {
5317            true
5318        }
5319
5320        #[inline(always)]
5321        fn decode_is_copy() -> bool {
5322            true
5323        }
5324    }
5325
5326    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerStackArgs, D>
5327        for &LayerStackArgs
5328    {
5329        #[inline]
5330        unsafe fn encode(
5331            self,
5332            encoder: &mut fidl::encoding::Encoder<'_, D>,
5333            offset: usize,
5334            _depth: fidl::encoding::Depth,
5335        ) -> fidl::Result<()> {
5336            encoder.debug_check_bounds::<LayerStackArgs>(offset);
5337            unsafe {
5338                // Copy the object into the buffer.
5339                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5340                (buf_ptr as *mut LayerStackArgs)
5341                    .write_unaligned((self as *const LayerStackArgs).read());
5342                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5343                // done second because the memcpy will write garbage to these bytes.
5344            }
5345            Ok(())
5346        }
5347    }
5348    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5349        fidl::encoding::Encode<LayerStackArgs, D> for (T0,)
5350    {
5351        #[inline]
5352        unsafe fn encode(
5353            self,
5354            encoder: &mut fidl::encoding::Encoder<'_, D>,
5355            offset: usize,
5356            depth: fidl::encoding::Depth,
5357        ) -> fidl::Result<()> {
5358            encoder.debug_check_bounds::<LayerStackArgs>(offset);
5359            // Zero out padding regions. There's no need to apply masks
5360            // because the unmasked parts will be overwritten by fields.
5361            // Write the fields.
5362            self.0.encode(encoder, offset + 0, depth)?;
5363            Ok(())
5364        }
5365    }
5366
5367    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerStackArgs {
5368        #[inline(always)]
5369        fn new_empty() -> Self {
5370            Self { dummy: fidl::new_empty!(u32, D) }
5371        }
5372
5373        #[inline]
5374        unsafe fn decode(
5375            &mut self,
5376            decoder: &mut fidl::encoding::Decoder<'_, D>,
5377            offset: usize,
5378            _depth: fidl::encoding::Depth,
5379        ) -> fidl::Result<()> {
5380            decoder.debug_check_bounds::<Self>(offset);
5381            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5382            // Verify that padding bytes are zero.
5383            // Copy from the buffer into the object.
5384            unsafe {
5385                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5386            }
5387            Ok(())
5388        }
5389    }
5390
5391    impl fidl::encoding::ValueTypeMarker for MaterialArgs {
5392        type Borrowed<'a> = &'a Self;
5393        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5394            value
5395        }
5396    }
5397
5398    unsafe impl fidl::encoding::TypeMarker for MaterialArgs {
5399        type Owned = Self;
5400
5401        #[inline(always)]
5402        fn inline_align(_context: fidl::encoding::Context) -> usize {
5403            4
5404        }
5405
5406        #[inline(always)]
5407        fn inline_size(_context: fidl::encoding::Context) -> usize {
5408            4
5409        }
5410        #[inline(always)]
5411        fn encode_is_copy() -> bool {
5412            true
5413        }
5414
5415        #[inline(always)]
5416        fn decode_is_copy() -> bool {
5417            true
5418        }
5419    }
5420
5421    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MaterialArgs, D>
5422        for &MaterialArgs
5423    {
5424        #[inline]
5425        unsafe fn encode(
5426            self,
5427            encoder: &mut fidl::encoding::Encoder<'_, D>,
5428            offset: usize,
5429            _depth: fidl::encoding::Depth,
5430        ) -> fidl::Result<()> {
5431            encoder.debug_check_bounds::<MaterialArgs>(offset);
5432            unsafe {
5433                // Copy the object into the buffer.
5434                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5435                (buf_ptr as *mut MaterialArgs)
5436                    .write_unaligned((self as *const MaterialArgs).read());
5437                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5438                // done second because the memcpy will write garbage to these bytes.
5439            }
5440            Ok(())
5441        }
5442    }
5443    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5444        fidl::encoding::Encode<MaterialArgs, D> for (T0,)
5445    {
5446        #[inline]
5447        unsafe fn encode(
5448            self,
5449            encoder: &mut fidl::encoding::Encoder<'_, D>,
5450            offset: usize,
5451            depth: fidl::encoding::Depth,
5452        ) -> fidl::Result<()> {
5453            encoder.debug_check_bounds::<MaterialArgs>(offset);
5454            // Zero out padding regions. There's no need to apply masks
5455            // because the unmasked parts will be overwritten by fields.
5456            // Write the fields.
5457            self.0.encode(encoder, offset + 0, depth)?;
5458            Ok(())
5459        }
5460    }
5461
5462    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MaterialArgs {
5463        #[inline(always)]
5464        fn new_empty() -> Self {
5465            Self { dummy: fidl::new_empty!(u32, D) }
5466        }
5467
5468        #[inline]
5469        unsafe fn decode(
5470            &mut self,
5471            decoder: &mut fidl::encoding::Decoder<'_, D>,
5472            offset: usize,
5473            _depth: fidl::encoding::Depth,
5474        ) -> fidl::Result<()> {
5475            decoder.debug_check_bounds::<Self>(offset);
5476            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5477            // Verify that padding bytes are zero.
5478            // Copy from the buffer into the object.
5479            unsafe {
5480                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5481            }
5482            Ok(())
5483        }
5484    }
5485
5486    impl fidl::encoding::ValueTypeMarker for Matrix4Value {
5487        type Borrowed<'a> = &'a Self;
5488        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5489            value
5490        }
5491    }
5492
5493    unsafe impl fidl::encoding::TypeMarker for Matrix4Value {
5494        type Owned = Self;
5495
5496        #[inline(always)]
5497        fn inline_align(_context: fidl::encoding::Context) -> usize {
5498            4
5499        }
5500
5501        #[inline(always)]
5502        fn inline_size(_context: fidl::encoding::Context) -> usize {
5503            68
5504        }
5505    }
5506
5507    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Matrix4Value, D>
5508        for &Matrix4Value
5509    {
5510        #[inline]
5511        unsafe fn encode(
5512            self,
5513            encoder: &mut fidl::encoding::Encoder<'_, D>,
5514            offset: usize,
5515            _depth: fidl::encoding::Depth,
5516        ) -> fidl::Result<()> {
5517            encoder.debug_check_bounds::<Matrix4Value>(offset);
5518            // Delegate to tuple encoding.
5519            fidl::encoding::Encode::<Matrix4Value, D>::encode(
5520                (
5521                    <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5522                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
5523                ),
5524                encoder,
5525                offset,
5526                _depth,
5527            )
5528        }
5529    }
5530    unsafe impl<
5531            D: fidl::encoding::ResourceDialect,
5532            T0: fidl::encoding::Encode<Mat4, D>,
5533            T1: fidl::encoding::Encode<u32, D>,
5534        > fidl::encoding::Encode<Matrix4Value, D> for (T0, T1)
5535    {
5536        #[inline]
5537        unsafe fn encode(
5538            self,
5539            encoder: &mut fidl::encoding::Encoder<'_, D>,
5540            offset: usize,
5541            depth: fidl::encoding::Depth,
5542        ) -> fidl::Result<()> {
5543            encoder.debug_check_bounds::<Matrix4Value>(offset);
5544            // Zero out padding regions. There's no need to apply masks
5545            // because the unmasked parts will be overwritten by fields.
5546            // Write the fields.
5547            self.0.encode(encoder, offset + 0, depth)?;
5548            self.1.encode(encoder, offset + 64, depth)?;
5549            Ok(())
5550        }
5551    }
5552
5553    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Matrix4Value {
5554        #[inline(always)]
5555        fn new_empty() -> Self {
5556            Self { value: fidl::new_empty!(Mat4, D), variable_id: fidl::new_empty!(u32, D) }
5557        }
5558
5559        #[inline]
5560        unsafe fn decode(
5561            &mut self,
5562            decoder: &mut fidl::encoding::Decoder<'_, D>,
5563            offset: usize,
5564            _depth: fidl::encoding::Depth,
5565        ) -> fidl::Result<()> {
5566            decoder.debug_check_bounds::<Self>(offset);
5567            // Verify that padding bytes are zero.
5568            fidl::decode!(Mat4, D, &mut self.value, decoder, offset + 0, _depth)?;
5569            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 64, _depth)?;
5570            Ok(())
5571        }
5572    }
5573
5574    impl fidl::encoding::ValueTypeMarker for MeshArgs {
5575        type Borrowed<'a> = &'a Self;
5576        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5577            value
5578        }
5579    }
5580
5581    unsafe impl fidl::encoding::TypeMarker for MeshArgs {
5582        type Owned = Self;
5583
5584        #[inline(always)]
5585        fn inline_align(_context: fidl::encoding::Context) -> usize {
5586            1
5587        }
5588
5589        #[inline(always)]
5590        fn inline_size(_context: fidl::encoding::Context) -> usize {
5591            1
5592        }
5593    }
5594
5595    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshArgs, D> for &MeshArgs {
5596        #[inline]
5597        unsafe fn encode(
5598            self,
5599            encoder: &mut fidl::encoding::Encoder<'_, D>,
5600            offset: usize,
5601            _depth: fidl::encoding::Depth,
5602        ) -> fidl::Result<()> {
5603            encoder.debug_check_bounds::<MeshArgs>(offset);
5604            encoder.write_num(0u8, offset);
5605            Ok(())
5606        }
5607    }
5608
5609    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshArgs {
5610        #[inline(always)]
5611        fn new_empty() -> Self {
5612            Self
5613        }
5614
5615        #[inline]
5616        unsafe fn decode(
5617            &mut self,
5618            decoder: &mut fidl::encoding::Decoder<'_, D>,
5619            offset: usize,
5620            _depth: fidl::encoding::Depth,
5621        ) -> fidl::Result<()> {
5622            decoder.debug_check_bounds::<Self>(offset);
5623            match decoder.read_num::<u8>(offset) {
5624                0 => Ok(()),
5625                _ => Err(fidl::Error::Invalid),
5626            }
5627        }
5628    }
5629
5630    impl fidl::encoding::ValueTypeMarker for MeshVertexFormat {
5631        type Borrowed<'a> = &'a Self;
5632        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5633            value
5634        }
5635    }
5636
5637    unsafe impl fidl::encoding::TypeMarker for MeshVertexFormat {
5638        type Owned = Self;
5639
5640        #[inline(always)]
5641        fn inline_align(_context: fidl::encoding::Context) -> usize {
5642            4
5643        }
5644
5645        #[inline(always)]
5646        fn inline_size(_context: fidl::encoding::Context) -> usize {
5647            12
5648        }
5649    }
5650
5651    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshVertexFormat, D>
5652        for &MeshVertexFormat
5653    {
5654        #[inline]
5655        unsafe fn encode(
5656            self,
5657            encoder: &mut fidl::encoding::Encoder<'_, D>,
5658            offset: usize,
5659            _depth: fidl::encoding::Depth,
5660        ) -> fidl::Result<()> {
5661            encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5662            // Delegate to tuple encoding.
5663            fidl::encoding::Encode::<MeshVertexFormat, D>::encode(
5664                (
5665                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.position_type),
5666                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.normal_type),
5667                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.tex_coord_type),
5668                ),
5669                encoder,
5670                offset,
5671                _depth,
5672            )
5673        }
5674    }
5675    unsafe impl<
5676            D: fidl::encoding::ResourceDialect,
5677            T0: fidl::encoding::Encode<ValueType, D>,
5678            T1: fidl::encoding::Encode<ValueType, D>,
5679            T2: fidl::encoding::Encode<ValueType, D>,
5680        > fidl::encoding::Encode<MeshVertexFormat, D> for (T0, T1, T2)
5681    {
5682        #[inline]
5683        unsafe fn encode(
5684            self,
5685            encoder: &mut fidl::encoding::Encoder<'_, D>,
5686            offset: usize,
5687            depth: fidl::encoding::Depth,
5688        ) -> fidl::Result<()> {
5689            encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5690            // Zero out padding regions. There's no need to apply masks
5691            // because the unmasked parts will be overwritten by fields.
5692            // Write the fields.
5693            self.0.encode(encoder, offset + 0, depth)?;
5694            self.1.encode(encoder, offset + 4, depth)?;
5695            self.2.encode(encoder, offset + 8, depth)?;
5696            Ok(())
5697        }
5698    }
5699
5700    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshVertexFormat {
5701        #[inline(always)]
5702        fn new_empty() -> Self {
5703            Self {
5704                position_type: fidl::new_empty!(ValueType, D),
5705                normal_type: fidl::new_empty!(ValueType, D),
5706                tex_coord_type: fidl::new_empty!(ValueType, D),
5707            }
5708        }
5709
5710        #[inline]
5711        unsafe fn decode(
5712            &mut self,
5713            decoder: &mut fidl::encoding::Decoder<'_, D>,
5714            offset: usize,
5715            _depth: fidl::encoding::Depth,
5716        ) -> fidl::Result<()> {
5717            decoder.debug_check_bounds::<Self>(offset);
5718            // Verify that padding bytes are zero.
5719            fidl::decode!(ValueType, D, &mut self.position_type, decoder, offset + 0, _depth)?;
5720            fidl::decode!(ValueType, D, &mut self.normal_type, decoder, offset + 4, _depth)?;
5721            fidl::decode!(ValueType, D, &mut self.tex_coord_type, decoder, offset + 8, _depth)?;
5722            Ok(())
5723        }
5724    }
5725
5726    impl fidl::encoding::ValueTypeMarker for Metrics {
5727        type Borrowed<'a> = &'a Self;
5728        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5729            value
5730        }
5731    }
5732
5733    unsafe impl fidl::encoding::TypeMarker for Metrics {
5734        type Owned = Self;
5735
5736        #[inline(always)]
5737        fn inline_align(_context: fidl::encoding::Context) -> usize {
5738            4
5739        }
5740
5741        #[inline(always)]
5742        fn inline_size(_context: fidl::encoding::Context) -> usize {
5743            12
5744        }
5745    }
5746
5747    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metrics, D> for &Metrics {
5748        #[inline]
5749        unsafe fn encode(
5750            self,
5751            encoder: &mut fidl::encoding::Encoder<'_, D>,
5752            offset: usize,
5753            _depth: fidl::encoding::Depth,
5754        ) -> fidl::Result<()> {
5755            encoder.debug_check_bounds::<Metrics>(offset);
5756            // Delegate to tuple encoding.
5757            fidl::encoding::Encode::<Metrics, D>::encode(
5758                (
5759                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_x),
5760                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_y),
5761                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_z),
5762                ),
5763                encoder,
5764                offset,
5765                _depth,
5766            )
5767        }
5768    }
5769    unsafe impl<
5770            D: fidl::encoding::ResourceDialect,
5771            T0: fidl::encoding::Encode<f32, D>,
5772            T1: fidl::encoding::Encode<f32, D>,
5773            T2: fidl::encoding::Encode<f32, D>,
5774        > fidl::encoding::Encode<Metrics, D> for (T0, T1, T2)
5775    {
5776        #[inline]
5777        unsafe fn encode(
5778            self,
5779            encoder: &mut fidl::encoding::Encoder<'_, D>,
5780            offset: usize,
5781            depth: fidl::encoding::Depth,
5782        ) -> fidl::Result<()> {
5783            encoder.debug_check_bounds::<Metrics>(offset);
5784            // Zero out padding regions. There's no need to apply masks
5785            // because the unmasked parts will be overwritten by fields.
5786            // Write the fields.
5787            self.0.encode(encoder, offset + 0, depth)?;
5788            self.1.encode(encoder, offset + 4, depth)?;
5789            self.2.encode(encoder, offset + 8, depth)?;
5790            Ok(())
5791        }
5792    }
5793
5794    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metrics {
5795        #[inline(always)]
5796        fn new_empty() -> Self {
5797            Self {
5798                scale_x: fidl::new_empty!(f32, D),
5799                scale_y: fidl::new_empty!(f32, D),
5800                scale_z: fidl::new_empty!(f32, D),
5801            }
5802        }
5803
5804        #[inline]
5805        unsafe fn decode(
5806            &mut self,
5807            decoder: &mut fidl::encoding::Decoder<'_, D>,
5808            offset: usize,
5809            _depth: fidl::encoding::Depth,
5810        ) -> fidl::Result<()> {
5811            decoder.debug_check_bounds::<Self>(offset);
5812            // Verify that padding bytes are zero.
5813            fidl::decode!(f32, D, &mut self.scale_x, decoder, offset + 0, _depth)?;
5814            fidl::decode!(f32, D, &mut self.scale_y, decoder, offset + 4, _depth)?;
5815            fidl::decode!(f32, D, &mut self.scale_z, decoder, offset + 8, _depth)?;
5816            Ok(())
5817        }
5818    }
5819
5820    impl fidl::encoding::ValueTypeMarker for MetricsEvent {
5821        type Borrowed<'a> = &'a Self;
5822        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5823            value
5824        }
5825    }
5826
5827    unsafe impl fidl::encoding::TypeMarker for MetricsEvent {
5828        type Owned = Self;
5829
5830        #[inline(always)]
5831        fn inline_align(_context: fidl::encoding::Context) -> usize {
5832            4
5833        }
5834
5835        #[inline(always)]
5836        fn inline_size(_context: fidl::encoding::Context) -> usize {
5837            16
5838        }
5839    }
5840
5841    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MetricsEvent, D>
5842        for &MetricsEvent
5843    {
5844        #[inline]
5845        unsafe fn encode(
5846            self,
5847            encoder: &mut fidl::encoding::Encoder<'_, D>,
5848            offset: usize,
5849            _depth: fidl::encoding::Depth,
5850        ) -> fidl::Result<()> {
5851            encoder.debug_check_bounds::<MetricsEvent>(offset);
5852            // Delegate to tuple encoding.
5853            fidl::encoding::Encode::<MetricsEvent, D>::encode(
5854                (
5855                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
5856                    <Metrics as fidl::encoding::ValueTypeMarker>::borrow(&self.metrics),
5857                ),
5858                encoder,
5859                offset,
5860                _depth,
5861            )
5862        }
5863    }
5864    unsafe impl<
5865            D: fidl::encoding::ResourceDialect,
5866            T0: fidl::encoding::Encode<u32, D>,
5867            T1: fidl::encoding::Encode<Metrics, D>,
5868        > fidl::encoding::Encode<MetricsEvent, D> for (T0, T1)
5869    {
5870        #[inline]
5871        unsafe fn encode(
5872            self,
5873            encoder: &mut fidl::encoding::Encoder<'_, D>,
5874            offset: usize,
5875            depth: fidl::encoding::Depth,
5876        ) -> fidl::Result<()> {
5877            encoder.debug_check_bounds::<MetricsEvent>(offset);
5878            // Zero out padding regions. There's no need to apply masks
5879            // because the unmasked parts will be overwritten by fields.
5880            // Write the fields.
5881            self.0.encode(encoder, offset + 0, depth)?;
5882            self.1.encode(encoder, offset + 4, depth)?;
5883            Ok(())
5884        }
5885    }
5886
5887    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MetricsEvent {
5888        #[inline(always)]
5889        fn new_empty() -> Self {
5890            Self { node_id: fidl::new_empty!(u32, D), metrics: fidl::new_empty!(Metrics, D) }
5891        }
5892
5893        #[inline]
5894        unsafe fn decode(
5895            &mut self,
5896            decoder: &mut fidl::encoding::Decoder<'_, D>,
5897            offset: usize,
5898            _depth: fidl::encoding::Depth,
5899        ) -> fidl::Result<()> {
5900            decoder.debug_check_bounds::<Self>(offset);
5901            // Verify that padding bytes are zero.
5902            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
5903            fidl::decode!(Metrics, D, &mut self.metrics, decoder, offset + 4, _depth)?;
5904            Ok(())
5905        }
5906    }
5907
5908    impl fidl::encoding::ValueTypeMarker for OpacityNodeArgsHack {
5909        type Borrowed<'a> = &'a Self;
5910        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5911            value
5912        }
5913    }
5914
5915    unsafe impl fidl::encoding::TypeMarker for OpacityNodeArgsHack {
5916        type Owned = Self;
5917
5918        #[inline(always)]
5919        fn inline_align(_context: fidl::encoding::Context) -> usize {
5920            4
5921        }
5922
5923        #[inline(always)]
5924        fn inline_size(_context: fidl::encoding::Context) -> usize {
5925            4
5926        }
5927        #[inline(always)]
5928        fn encode_is_copy() -> bool {
5929            true
5930        }
5931
5932        #[inline(always)]
5933        fn decode_is_copy() -> bool {
5934            true
5935        }
5936    }
5937
5938    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OpacityNodeArgsHack, D>
5939        for &OpacityNodeArgsHack
5940    {
5941        #[inline]
5942        unsafe fn encode(
5943            self,
5944            encoder: &mut fidl::encoding::Encoder<'_, D>,
5945            offset: usize,
5946            _depth: fidl::encoding::Depth,
5947        ) -> fidl::Result<()> {
5948            encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
5949            unsafe {
5950                // Copy the object into the buffer.
5951                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5952                (buf_ptr as *mut OpacityNodeArgsHack)
5953                    .write_unaligned((self as *const OpacityNodeArgsHack).read());
5954                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5955                // done second because the memcpy will write garbage to these bytes.
5956            }
5957            Ok(())
5958        }
5959    }
5960    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5961        fidl::encoding::Encode<OpacityNodeArgsHack, D> for (T0,)
5962    {
5963        #[inline]
5964        unsafe fn encode(
5965            self,
5966            encoder: &mut fidl::encoding::Encoder<'_, D>,
5967            offset: usize,
5968            depth: fidl::encoding::Depth,
5969        ) -> fidl::Result<()> {
5970            encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
5971            // Zero out padding regions. There's no need to apply masks
5972            // because the unmasked parts will be overwritten by fields.
5973            // Write the fields.
5974            self.0.encode(encoder, offset + 0, depth)?;
5975            Ok(())
5976        }
5977    }
5978
5979    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpacityNodeArgsHack {
5980        #[inline(always)]
5981        fn new_empty() -> Self {
5982            Self { unused: fidl::new_empty!(u32, D) }
5983        }
5984
5985        #[inline]
5986        unsafe fn decode(
5987            &mut self,
5988            decoder: &mut fidl::encoding::Decoder<'_, D>,
5989            offset: usize,
5990            _depth: fidl::encoding::Depth,
5991        ) -> fidl::Result<()> {
5992            decoder.debug_check_bounds::<Self>(offset);
5993            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5994            // Verify that padding bytes are zero.
5995            // Copy from the buffer into the object.
5996            unsafe {
5997                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5998            }
5999            Ok(())
6000        }
6001    }
6002
6003    impl fidl::encoding::ValueTypeMarker for Plane3 {
6004        type Borrowed<'a> = &'a Self;
6005        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6006            value
6007        }
6008    }
6009
6010    unsafe impl fidl::encoding::TypeMarker for Plane3 {
6011        type Owned = Self;
6012
6013        #[inline(always)]
6014        fn inline_align(_context: fidl::encoding::Context) -> usize {
6015            4
6016        }
6017
6018        #[inline(always)]
6019        fn inline_size(_context: fidl::encoding::Context) -> usize {
6020            16
6021        }
6022    }
6023
6024    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Plane3, D> for &Plane3 {
6025        #[inline]
6026        unsafe fn encode(
6027            self,
6028            encoder: &mut fidl::encoding::Encoder<'_, D>,
6029            offset: usize,
6030            _depth: fidl::encoding::Depth,
6031        ) -> fidl::Result<()> {
6032            encoder.debug_check_bounds::<Plane3>(offset);
6033            // Delegate to tuple encoding.
6034            fidl::encoding::Encode::<Plane3, D>::encode(
6035                (
6036                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.dir),
6037                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dist),
6038                ),
6039                encoder,
6040                offset,
6041                _depth,
6042            )
6043        }
6044    }
6045    unsafe impl<
6046            D: fidl::encoding::ResourceDialect,
6047            T0: fidl::encoding::Encode<Vec3, D>,
6048            T1: fidl::encoding::Encode<f32, D>,
6049        > fidl::encoding::Encode<Plane3, D> for (T0, T1)
6050    {
6051        #[inline]
6052        unsafe fn encode(
6053            self,
6054            encoder: &mut fidl::encoding::Encoder<'_, D>,
6055            offset: usize,
6056            depth: fidl::encoding::Depth,
6057        ) -> fidl::Result<()> {
6058            encoder.debug_check_bounds::<Plane3>(offset);
6059            // Zero out padding regions. There's no need to apply masks
6060            // because the unmasked parts will be overwritten by fields.
6061            // Write the fields.
6062            self.0.encode(encoder, offset + 0, depth)?;
6063            self.1.encode(encoder, offset + 12, depth)?;
6064            Ok(())
6065        }
6066    }
6067
6068    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Plane3 {
6069        #[inline(always)]
6070        fn new_empty() -> Self {
6071            Self { dir: fidl::new_empty!(Vec3, D), dist: fidl::new_empty!(f32, D) }
6072        }
6073
6074        #[inline]
6075        unsafe fn decode(
6076            &mut self,
6077            decoder: &mut fidl::encoding::Decoder<'_, D>,
6078            offset: usize,
6079            _depth: fidl::encoding::Depth,
6080        ) -> fidl::Result<()> {
6081            decoder.debug_check_bounds::<Self>(offset);
6082            // Verify that padding bytes are zero.
6083            fidl::decode!(Vec3, D, &mut self.dir, decoder, offset + 0, _depth)?;
6084            fidl::decode!(f32, D, &mut self.dist, decoder, offset + 12, _depth)?;
6085            Ok(())
6086        }
6087    }
6088
6089    impl fidl::encoding::ValueTypeMarker for PointLightArgs {
6090        type Borrowed<'a> = &'a Self;
6091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6092            value
6093        }
6094    }
6095
6096    unsafe impl fidl::encoding::TypeMarker for PointLightArgs {
6097        type Owned = Self;
6098
6099        #[inline(always)]
6100        fn inline_align(_context: fidl::encoding::Context) -> usize {
6101            4
6102        }
6103
6104        #[inline(always)]
6105        fn inline_size(_context: fidl::encoding::Context) -> usize {
6106            4
6107        }
6108        #[inline(always)]
6109        fn encode_is_copy() -> bool {
6110            true
6111        }
6112
6113        #[inline(always)]
6114        fn decode_is_copy() -> bool {
6115            true
6116        }
6117    }
6118
6119    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PointLightArgs, D>
6120        for &PointLightArgs
6121    {
6122        #[inline]
6123        unsafe fn encode(
6124            self,
6125            encoder: &mut fidl::encoding::Encoder<'_, D>,
6126            offset: usize,
6127            _depth: fidl::encoding::Depth,
6128        ) -> fidl::Result<()> {
6129            encoder.debug_check_bounds::<PointLightArgs>(offset);
6130            unsafe {
6131                // Copy the object into the buffer.
6132                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6133                (buf_ptr as *mut PointLightArgs)
6134                    .write_unaligned((self as *const PointLightArgs).read());
6135                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6136                // done second because the memcpy will write garbage to these bytes.
6137            }
6138            Ok(())
6139        }
6140    }
6141    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6142        fidl::encoding::Encode<PointLightArgs, D> for (T0,)
6143    {
6144        #[inline]
6145        unsafe fn encode(
6146            self,
6147            encoder: &mut fidl::encoding::Encoder<'_, D>,
6148            offset: usize,
6149            depth: fidl::encoding::Depth,
6150        ) -> fidl::Result<()> {
6151            encoder.debug_check_bounds::<PointLightArgs>(offset);
6152            // Zero out padding regions. There's no need to apply masks
6153            // because the unmasked parts will be overwritten by fields.
6154            // Write the fields.
6155            self.0.encode(encoder, offset + 0, depth)?;
6156            Ok(())
6157        }
6158    }
6159
6160    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PointLightArgs {
6161        #[inline(always)]
6162        fn new_empty() -> Self {
6163            Self { dummy: fidl::new_empty!(u32, D) }
6164        }
6165
6166        #[inline]
6167        unsafe fn decode(
6168            &mut self,
6169            decoder: &mut fidl::encoding::Decoder<'_, D>,
6170            offset: usize,
6171            _depth: fidl::encoding::Depth,
6172        ) -> fidl::Result<()> {
6173            decoder.debug_check_bounds::<Self>(offset);
6174            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6175            // Verify that padding bytes are zero.
6176            // Copy from the buffer into the object.
6177            unsafe {
6178                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6179            }
6180            Ok(())
6181        }
6182    }
6183
6184    impl fidl::encoding::ValueTypeMarker for Quaternion {
6185        type Borrowed<'a> = &'a Self;
6186        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6187            value
6188        }
6189    }
6190
6191    unsafe impl fidl::encoding::TypeMarker for Quaternion {
6192        type Owned = Self;
6193
6194        #[inline(always)]
6195        fn inline_align(_context: fidl::encoding::Context) -> usize {
6196            4
6197        }
6198
6199        #[inline(always)]
6200        fn inline_size(_context: fidl::encoding::Context) -> usize {
6201            16
6202        }
6203    }
6204
6205    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Quaternion, D>
6206        for &Quaternion
6207    {
6208        #[inline]
6209        unsafe fn encode(
6210            self,
6211            encoder: &mut fidl::encoding::Encoder<'_, D>,
6212            offset: usize,
6213            _depth: fidl::encoding::Depth,
6214        ) -> fidl::Result<()> {
6215            encoder.debug_check_bounds::<Quaternion>(offset);
6216            // Delegate to tuple encoding.
6217            fidl::encoding::Encode::<Quaternion, D>::encode(
6218                (
6219                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
6220                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
6221                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
6222                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
6223                ),
6224                encoder,
6225                offset,
6226                _depth,
6227            )
6228        }
6229    }
6230    unsafe impl<
6231            D: fidl::encoding::ResourceDialect,
6232            T0: fidl::encoding::Encode<f32, D>,
6233            T1: fidl::encoding::Encode<f32, D>,
6234            T2: fidl::encoding::Encode<f32, D>,
6235            T3: fidl::encoding::Encode<f32, D>,
6236        > fidl::encoding::Encode<Quaternion, D> for (T0, T1, T2, T3)
6237    {
6238        #[inline]
6239        unsafe fn encode(
6240            self,
6241            encoder: &mut fidl::encoding::Encoder<'_, D>,
6242            offset: usize,
6243            depth: fidl::encoding::Depth,
6244        ) -> fidl::Result<()> {
6245            encoder.debug_check_bounds::<Quaternion>(offset);
6246            // Zero out padding regions. There's no need to apply masks
6247            // because the unmasked parts will be overwritten by fields.
6248            // Write the fields.
6249            self.0.encode(encoder, offset + 0, depth)?;
6250            self.1.encode(encoder, offset + 4, depth)?;
6251            self.2.encode(encoder, offset + 8, depth)?;
6252            self.3.encode(encoder, offset + 12, depth)?;
6253            Ok(())
6254        }
6255    }
6256
6257    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Quaternion {
6258        #[inline(always)]
6259        fn new_empty() -> Self {
6260            Self {
6261                x: fidl::new_empty!(f32, D),
6262                y: fidl::new_empty!(f32, D),
6263                z: fidl::new_empty!(f32, D),
6264                w: fidl::new_empty!(f32, D),
6265            }
6266        }
6267
6268        #[inline]
6269        unsafe fn decode(
6270            &mut self,
6271            decoder: &mut fidl::encoding::Decoder<'_, D>,
6272            offset: usize,
6273            _depth: fidl::encoding::Depth,
6274        ) -> fidl::Result<()> {
6275            decoder.debug_check_bounds::<Self>(offset);
6276            // Verify that padding bytes are zero.
6277            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
6278            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
6279            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
6280            fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
6281            Ok(())
6282        }
6283    }
6284
6285    impl fidl::encoding::ValueTypeMarker for QuaternionValue {
6286        type Borrowed<'a> = &'a Self;
6287        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6288            value
6289        }
6290    }
6291
6292    unsafe impl fidl::encoding::TypeMarker for QuaternionValue {
6293        type Owned = Self;
6294
6295        #[inline(always)]
6296        fn inline_align(_context: fidl::encoding::Context) -> usize {
6297            4
6298        }
6299
6300        #[inline(always)]
6301        fn inline_size(_context: fidl::encoding::Context) -> usize {
6302            20
6303        }
6304    }
6305
6306    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QuaternionValue, D>
6307        for &QuaternionValue
6308    {
6309        #[inline]
6310        unsafe fn encode(
6311            self,
6312            encoder: &mut fidl::encoding::Encoder<'_, D>,
6313            offset: usize,
6314            _depth: fidl::encoding::Depth,
6315        ) -> fidl::Result<()> {
6316            encoder.debug_check_bounds::<QuaternionValue>(offset);
6317            // Delegate to tuple encoding.
6318            fidl::encoding::Encode::<QuaternionValue, D>::encode(
6319                (
6320                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6321                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
6322                ),
6323                encoder,
6324                offset,
6325                _depth,
6326            )
6327        }
6328    }
6329    unsafe impl<
6330            D: fidl::encoding::ResourceDialect,
6331            T0: fidl::encoding::Encode<Quaternion, D>,
6332            T1: fidl::encoding::Encode<u32, D>,
6333        > fidl::encoding::Encode<QuaternionValue, D> for (T0, T1)
6334    {
6335        #[inline]
6336        unsafe fn encode(
6337            self,
6338            encoder: &mut fidl::encoding::Encoder<'_, D>,
6339            offset: usize,
6340            depth: fidl::encoding::Depth,
6341        ) -> fidl::Result<()> {
6342            encoder.debug_check_bounds::<QuaternionValue>(offset);
6343            // Zero out padding regions. There's no need to apply masks
6344            // because the unmasked parts will be overwritten by fields.
6345            // Write the fields.
6346            self.0.encode(encoder, offset + 0, depth)?;
6347            self.1.encode(encoder, offset + 16, depth)?;
6348            Ok(())
6349        }
6350    }
6351
6352    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QuaternionValue {
6353        #[inline(always)]
6354        fn new_empty() -> Self {
6355            Self { value: fidl::new_empty!(Quaternion, D), variable_id: fidl::new_empty!(u32, D) }
6356        }
6357
6358        #[inline]
6359        unsafe fn decode(
6360            &mut self,
6361            decoder: &mut fidl::encoding::Decoder<'_, D>,
6362            offset: usize,
6363            _depth: fidl::encoding::Depth,
6364        ) -> fidl::Result<()> {
6365            decoder.debug_check_bounds::<Self>(offset);
6366            // Verify that padding bytes are zero.
6367            fidl::decode!(Quaternion, D, &mut self.value, decoder, offset + 0, _depth)?;
6368            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
6369            Ok(())
6370        }
6371    }
6372
6373    impl fidl::encoding::ValueTypeMarker for RectangleArgs {
6374        type Borrowed<'a> = &'a Self;
6375        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6376            value
6377        }
6378    }
6379
6380    unsafe impl fidl::encoding::TypeMarker for RectangleArgs {
6381        type Owned = Self;
6382
6383        #[inline(always)]
6384        fn inline_align(_context: fidl::encoding::Context) -> usize {
6385            8
6386        }
6387
6388        #[inline(always)]
6389        fn inline_size(_context: fidl::encoding::Context) -> usize {
6390            32
6391        }
6392    }
6393
6394    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RectangleArgs, D>
6395        for &RectangleArgs
6396    {
6397        #[inline]
6398        unsafe fn encode(
6399            self,
6400            encoder: &mut fidl::encoding::Encoder<'_, D>,
6401            offset: usize,
6402            _depth: fidl::encoding::Depth,
6403        ) -> fidl::Result<()> {
6404            encoder.debug_check_bounds::<RectangleArgs>(offset);
6405            // Delegate to tuple encoding.
6406            fidl::encoding::Encode::<RectangleArgs, D>::encode(
6407                (
6408                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6409                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6410                ),
6411                encoder,
6412                offset,
6413                _depth,
6414            )
6415        }
6416    }
6417    unsafe impl<
6418            D: fidl::encoding::ResourceDialect,
6419            T0: fidl::encoding::Encode<Value, D>,
6420            T1: fidl::encoding::Encode<Value, D>,
6421        > fidl::encoding::Encode<RectangleArgs, D> for (T0, T1)
6422    {
6423        #[inline]
6424        unsafe fn encode(
6425            self,
6426            encoder: &mut fidl::encoding::Encoder<'_, D>,
6427            offset: usize,
6428            depth: fidl::encoding::Depth,
6429        ) -> fidl::Result<()> {
6430            encoder.debug_check_bounds::<RectangleArgs>(offset);
6431            // Zero out padding regions. There's no need to apply masks
6432            // because the unmasked parts will be overwritten by fields.
6433            // Write the fields.
6434            self.0.encode(encoder, offset + 0, depth)?;
6435            self.1.encode(encoder, offset + 16, depth)?;
6436            Ok(())
6437        }
6438    }
6439
6440    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RectangleArgs {
6441        #[inline(always)]
6442        fn new_empty() -> Self {
6443            Self { width: fidl::new_empty!(Value, D), height: fidl::new_empty!(Value, D) }
6444        }
6445
6446        #[inline]
6447        unsafe fn decode(
6448            &mut self,
6449            decoder: &mut fidl::encoding::Decoder<'_, D>,
6450            offset: usize,
6451            _depth: fidl::encoding::Depth,
6452        ) -> fidl::Result<()> {
6453            decoder.debug_check_bounds::<Self>(offset);
6454            // Verify that padding bytes are zero.
6455            fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
6456            fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
6457            Ok(())
6458        }
6459    }
6460
6461    impl fidl::encoding::ValueTypeMarker for ReleaseResourceCmd {
6462        type Borrowed<'a> = &'a Self;
6463        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6464            value
6465        }
6466    }
6467
6468    unsafe impl fidl::encoding::TypeMarker for ReleaseResourceCmd {
6469        type Owned = Self;
6470
6471        #[inline(always)]
6472        fn inline_align(_context: fidl::encoding::Context) -> usize {
6473            4
6474        }
6475
6476        #[inline(always)]
6477        fn inline_size(_context: fidl::encoding::Context) -> usize {
6478            4
6479        }
6480        #[inline(always)]
6481        fn encode_is_copy() -> bool {
6482            true
6483        }
6484
6485        #[inline(always)]
6486        fn decode_is_copy() -> bool {
6487            true
6488        }
6489    }
6490
6491    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReleaseResourceCmd, D>
6492        for &ReleaseResourceCmd
6493    {
6494        #[inline]
6495        unsafe fn encode(
6496            self,
6497            encoder: &mut fidl::encoding::Encoder<'_, D>,
6498            offset: usize,
6499            _depth: fidl::encoding::Depth,
6500        ) -> fidl::Result<()> {
6501            encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6502            unsafe {
6503                // Copy the object into the buffer.
6504                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6505                (buf_ptr as *mut ReleaseResourceCmd)
6506                    .write_unaligned((self as *const ReleaseResourceCmd).read());
6507                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6508                // done second because the memcpy will write garbage to these bytes.
6509            }
6510            Ok(())
6511        }
6512    }
6513    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6514        fidl::encoding::Encode<ReleaseResourceCmd, D> for (T0,)
6515    {
6516        #[inline]
6517        unsafe fn encode(
6518            self,
6519            encoder: &mut fidl::encoding::Encoder<'_, D>,
6520            offset: usize,
6521            depth: fidl::encoding::Depth,
6522        ) -> fidl::Result<()> {
6523            encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6524            // Zero out padding regions. There's no need to apply masks
6525            // because the unmasked parts will be overwritten by fields.
6526            // Write the fields.
6527            self.0.encode(encoder, offset + 0, depth)?;
6528            Ok(())
6529        }
6530    }
6531
6532    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReleaseResourceCmd {
6533        #[inline(always)]
6534        fn new_empty() -> Self {
6535            Self { id: fidl::new_empty!(u32, D) }
6536        }
6537
6538        #[inline]
6539        unsafe fn decode(
6540            &mut self,
6541            decoder: &mut fidl::encoding::Decoder<'_, D>,
6542            offset: usize,
6543            _depth: fidl::encoding::Depth,
6544        ) -> fidl::Result<()> {
6545            decoder.debug_check_bounds::<Self>(offset);
6546            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6547            // Verify that padding bytes are zero.
6548            // Copy from the buffer into the object.
6549            unsafe {
6550                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6551            }
6552            Ok(())
6553        }
6554    }
6555
6556    impl fidl::encoding::ValueTypeMarker for RemoveAllLayersCmd {
6557        type Borrowed<'a> = &'a Self;
6558        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6559            value
6560        }
6561    }
6562
6563    unsafe impl fidl::encoding::TypeMarker for RemoveAllLayersCmd {
6564        type Owned = Self;
6565
6566        #[inline(always)]
6567        fn inline_align(_context: fidl::encoding::Context) -> usize {
6568            4
6569        }
6570
6571        #[inline(always)]
6572        fn inline_size(_context: fidl::encoding::Context) -> usize {
6573            4
6574        }
6575        #[inline(always)]
6576        fn encode_is_copy() -> bool {
6577            true
6578        }
6579
6580        #[inline(always)]
6581        fn decode_is_copy() -> bool {
6582            true
6583        }
6584    }
6585
6586    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveAllLayersCmd, D>
6587        for &RemoveAllLayersCmd
6588    {
6589        #[inline]
6590        unsafe fn encode(
6591            self,
6592            encoder: &mut fidl::encoding::Encoder<'_, D>,
6593            offset: usize,
6594            _depth: fidl::encoding::Depth,
6595        ) -> fidl::Result<()> {
6596            encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6597            unsafe {
6598                // Copy the object into the buffer.
6599                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6600                (buf_ptr as *mut RemoveAllLayersCmd)
6601                    .write_unaligned((self as *const RemoveAllLayersCmd).read());
6602                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6603                // done second because the memcpy will write garbage to these bytes.
6604            }
6605            Ok(())
6606        }
6607    }
6608    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6609        fidl::encoding::Encode<RemoveAllLayersCmd, D> for (T0,)
6610    {
6611        #[inline]
6612        unsafe fn encode(
6613            self,
6614            encoder: &mut fidl::encoding::Encoder<'_, D>,
6615            offset: usize,
6616            depth: fidl::encoding::Depth,
6617        ) -> fidl::Result<()> {
6618            encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6619            // Zero out padding regions. There's no need to apply masks
6620            // because the unmasked parts will be overwritten by fields.
6621            // Write the fields.
6622            self.0.encode(encoder, offset + 0, depth)?;
6623            Ok(())
6624        }
6625    }
6626
6627    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveAllLayersCmd {
6628        #[inline(always)]
6629        fn new_empty() -> Self {
6630            Self { layer_stack_id: fidl::new_empty!(u32, D) }
6631        }
6632
6633        #[inline]
6634        unsafe fn decode(
6635            &mut self,
6636            decoder: &mut fidl::encoding::Decoder<'_, D>,
6637            offset: usize,
6638            _depth: fidl::encoding::Depth,
6639        ) -> fidl::Result<()> {
6640            decoder.debug_check_bounds::<Self>(offset);
6641            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6642            // Verify that padding bytes are zero.
6643            // Copy from the buffer into the object.
6644            unsafe {
6645                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6646            }
6647            Ok(())
6648        }
6649    }
6650
6651    impl fidl::encoding::ValueTypeMarker for RemoveLayerCmd {
6652        type Borrowed<'a> = &'a Self;
6653        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6654            value
6655        }
6656    }
6657
6658    unsafe impl fidl::encoding::TypeMarker for RemoveLayerCmd {
6659        type Owned = Self;
6660
6661        #[inline(always)]
6662        fn inline_align(_context: fidl::encoding::Context) -> usize {
6663            4
6664        }
6665
6666        #[inline(always)]
6667        fn inline_size(_context: fidl::encoding::Context) -> usize {
6668            8
6669        }
6670        #[inline(always)]
6671        fn encode_is_copy() -> bool {
6672            true
6673        }
6674
6675        #[inline(always)]
6676        fn decode_is_copy() -> bool {
6677            true
6678        }
6679    }
6680
6681    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveLayerCmd, D>
6682        for &RemoveLayerCmd
6683    {
6684        #[inline]
6685        unsafe fn encode(
6686            self,
6687            encoder: &mut fidl::encoding::Encoder<'_, D>,
6688            offset: usize,
6689            _depth: fidl::encoding::Depth,
6690        ) -> fidl::Result<()> {
6691            encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6692            unsafe {
6693                // Copy the object into the buffer.
6694                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6695                (buf_ptr as *mut RemoveLayerCmd)
6696                    .write_unaligned((self as *const RemoveLayerCmd).read());
6697                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6698                // done second because the memcpy will write garbage to these bytes.
6699            }
6700            Ok(())
6701        }
6702    }
6703    unsafe impl<
6704            D: fidl::encoding::ResourceDialect,
6705            T0: fidl::encoding::Encode<u32, D>,
6706            T1: fidl::encoding::Encode<u32, D>,
6707        > fidl::encoding::Encode<RemoveLayerCmd, D> for (T0, T1)
6708    {
6709        #[inline]
6710        unsafe fn encode(
6711            self,
6712            encoder: &mut fidl::encoding::Encoder<'_, D>,
6713            offset: usize,
6714            depth: fidl::encoding::Depth,
6715        ) -> fidl::Result<()> {
6716            encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6717            // Zero out padding regions. There's no need to apply masks
6718            // because the unmasked parts will be overwritten by fields.
6719            // Write the fields.
6720            self.0.encode(encoder, offset + 0, depth)?;
6721            self.1.encode(encoder, offset + 4, depth)?;
6722            Ok(())
6723        }
6724    }
6725
6726    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveLayerCmd {
6727        #[inline(always)]
6728        fn new_empty() -> Self {
6729            Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
6730        }
6731
6732        #[inline]
6733        unsafe fn decode(
6734            &mut self,
6735            decoder: &mut fidl::encoding::Decoder<'_, D>,
6736            offset: usize,
6737            _depth: fidl::encoding::Depth,
6738        ) -> fidl::Result<()> {
6739            decoder.debug_check_bounds::<Self>(offset);
6740            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6741            // Verify that padding bytes are zero.
6742            // Copy from the buffer into the object.
6743            unsafe {
6744                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6745            }
6746            Ok(())
6747        }
6748    }
6749
6750    impl fidl::encoding::ValueTypeMarker for RendererArgs {
6751        type Borrowed<'a> = &'a Self;
6752        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6753            value
6754        }
6755    }
6756
6757    unsafe impl fidl::encoding::TypeMarker for RendererArgs {
6758        type Owned = Self;
6759
6760        #[inline(always)]
6761        fn inline_align(_context: fidl::encoding::Context) -> usize {
6762            4
6763        }
6764
6765        #[inline(always)]
6766        fn inline_size(_context: fidl::encoding::Context) -> usize {
6767            4
6768        }
6769        #[inline(always)]
6770        fn encode_is_copy() -> bool {
6771            true
6772        }
6773
6774        #[inline(always)]
6775        fn decode_is_copy() -> bool {
6776            true
6777        }
6778    }
6779
6780    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererArgs, D>
6781        for &RendererArgs
6782    {
6783        #[inline]
6784        unsafe fn encode(
6785            self,
6786            encoder: &mut fidl::encoding::Encoder<'_, D>,
6787            offset: usize,
6788            _depth: fidl::encoding::Depth,
6789        ) -> fidl::Result<()> {
6790            encoder.debug_check_bounds::<RendererArgs>(offset);
6791            unsafe {
6792                // Copy the object into the buffer.
6793                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6794                (buf_ptr as *mut RendererArgs)
6795                    .write_unaligned((self as *const RendererArgs).read());
6796                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6797                // done second because the memcpy will write garbage to these bytes.
6798            }
6799            Ok(())
6800        }
6801    }
6802    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6803        fidl::encoding::Encode<RendererArgs, D> for (T0,)
6804    {
6805        #[inline]
6806        unsafe fn encode(
6807            self,
6808            encoder: &mut fidl::encoding::Encoder<'_, D>,
6809            offset: usize,
6810            depth: fidl::encoding::Depth,
6811        ) -> fidl::Result<()> {
6812            encoder.debug_check_bounds::<RendererArgs>(offset);
6813            // Zero out padding regions. There's no need to apply masks
6814            // because the unmasked parts will be overwritten by fields.
6815            // Write the fields.
6816            self.0.encode(encoder, offset + 0, depth)?;
6817            Ok(())
6818        }
6819    }
6820
6821    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererArgs {
6822        #[inline(always)]
6823        fn new_empty() -> Self {
6824            Self { dummy: fidl::new_empty!(u32, D) }
6825        }
6826
6827        #[inline]
6828        unsafe fn decode(
6829            &mut self,
6830            decoder: &mut fidl::encoding::Decoder<'_, D>,
6831            offset: usize,
6832            _depth: fidl::encoding::Depth,
6833        ) -> fidl::Result<()> {
6834            decoder.debug_check_bounds::<Self>(offset);
6835            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6836            // Verify that padding bytes are zero.
6837            // Copy from the buffer into the object.
6838            unsafe {
6839                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6840            }
6841            Ok(())
6842        }
6843    }
6844
6845    impl fidl::encoding::ValueTypeMarker for RoundedRectangleArgs {
6846        type Borrowed<'a> = &'a Self;
6847        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6848            value
6849        }
6850    }
6851
6852    unsafe impl fidl::encoding::TypeMarker for RoundedRectangleArgs {
6853        type Owned = Self;
6854
6855        #[inline(always)]
6856        fn inline_align(_context: fidl::encoding::Context) -> usize {
6857            8
6858        }
6859
6860        #[inline(always)]
6861        fn inline_size(_context: fidl::encoding::Context) -> usize {
6862            96
6863        }
6864    }
6865
6866    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RoundedRectangleArgs, D>
6867        for &RoundedRectangleArgs
6868    {
6869        #[inline]
6870        unsafe fn encode(
6871            self,
6872            encoder: &mut fidl::encoding::Encoder<'_, D>,
6873            offset: usize,
6874            _depth: fidl::encoding::Depth,
6875        ) -> fidl::Result<()> {
6876            encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6877            // Delegate to tuple encoding.
6878            fidl::encoding::Encode::<RoundedRectangleArgs, D>::encode(
6879                (
6880                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6881                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6882                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_left_radius),
6883                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_right_radius),
6884                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_right_radius),
6885                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_left_radius),
6886                ),
6887                encoder,
6888                offset,
6889                _depth,
6890            )
6891        }
6892    }
6893    unsafe impl<
6894            D: fidl::encoding::ResourceDialect,
6895            T0: fidl::encoding::Encode<Value, D>,
6896            T1: fidl::encoding::Encode<Value, D>,
6897            T2: fidl::encoding::Encode<Value, D>,
6898            T3: fidl::encoding::Encode<Value, D>,
6899            T4: fidl::encoding::Encode<Value, D>,
6900            T5: fidl::encoding::Encode<Value, D>,
6901        > fidl::encoding::Encode<RoundedRectangleArgs, D> for (T0, T1, T2, T3, T4, T5)
6902    {
6903        #[inline]
6904        unsafe fn encode(
6905            self,
6906            encoder: &mut fidl::encoding::Encoder<'_, D>,
6907            offset: usize,
6908            depth: fidl::encoding::Depth,
6909        ) -> fidl::Result<()> {
6910            encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6911            // Zero out padding regions. There's no need to apply masks
6912            // because the unmasked parts will be overwritten by fields.
6913            // Write the fields.
6914            self.0.encode(encoder, offset + 0, depth)?;
6915            self.1.encode(encoder, offset + 16, depth)?;
6916            self.2.encode(encoder, offset + 32, depth)?;
6917            self.3.encode(encoder, offset + 48, depth)?;
6918            self.4.encode(encoder, offset + 64, depth)?;
6919            self.5.encode(encoder, offset + 80, depth)?;
6920            Ok(())
6921        }
6922    }
6923
6924    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RoundedRectangleArgs {
6925        #[inline(always)]
6926        fn new_empty() -> Self {
6927            Self {
6928                width: fidl::new_empty!(Value, D),
6929                height: fidl::new_empty!(Value, D),
6930                top_left_radius: fidl::new_empty!(Value, D),
6931                top_right_radius: fidl::new_empty!(Value, D),
6932                bottom_right_radius: fidl::new_empty!(Value, D),
6933                bottom_left_radius: fidl::new_empty!(Value, D),
6934            }
6935        }
6936
6937        #[inline]
6938        unsafe fn decode(
6939            &mut self,
6940            decoder: &mut fidl::encoding::Decoder<'_, D>,
6941            offset: usize,
6942            _depth: fidl::encoding::Depth,
6943        ) -> fidl::Result<()> {
6944            decoder.debug_check_bounds::<Self>(offset);
6945            // Verify that padding bytes are zero.
6946            fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
6947            fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
6948            fidl::decode!(Value, D, &mut self.top_left_radius, decoder, offset + 32, _depth)?;
6949            fidl::decode!(Value, D, &mut self.top_right_radius, decoder, offset + 48, _depth)?;
6950            fidl::decode!(Value, D, &mut self.bottom_right_radius, decoder, offset + 64, _depth)?;
6951            fidl::decode!(Value, D, &mut self.bottom_left_radius, decoder, offset + 80, _depth)?;
6952            Ok(())
6953        }
6954    }
6955
6956    impl fidl::encoding::ValueTypeMarker for SceneAddAmbientLightCmd {
6957        type Borrowed<'a> = &'a Self;
6958        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6959            value
6960        }
6961    }
6962
6963    unsafe impl fidl::encoding::TypeMarker for SceneAddAmbientLightCmd {
6964        type Owned = Self;
6965
6966        #[inline(always)]
6967        fn inline_align(_context: fidl::encoding::Context) -> usize {
6968            4
6969        }
6970
6971        #[inline(always)]
6972        fn inline_size(_context: fidl::encoding::Context) -> usize {
6973            8
6974        }
6975        #[inline(always)]
6976        fn encode_is_copy() -> bool {
6977            true
6978        }
6979
6980        #[inline(always)]
6981        fn decode_is_copy() -> bool {
6982            true
6983        }
6984    }
6985
6986    unsafe impl<D: fidl::encoding::ResourceDialect>
6987        fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for &SceneAddAmbientLightCmd
6988    {
6989        #[inline]
6990        unsafe fn encode(
6991            self,
6992            encoder: &mut fidl::encoding::Encoder<'_, D>,
6993            offset: usize,
6994            _depth: fidl::encoding::Depth,
6995        ) -> fidl::Result<()> {
6996            encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
6997            unsafe {
6998                // Copy the object into the buffer.
6999                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7000                (buf_ptr as *mut SceneAddAmbientLightCmd)
7001                    .write_unaligned((self as *const SceneAddAmbientLightCmd).read());
7002                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7003                // done second because the memcpy will write garbage to these bytes.
7004            }
7005            Ok(())
7006        }
7007    }
7008    unsafe impl<
7009            D: fidl::encoding::ResourceDialect,
7010            T0: fidl::encoding::Encode<u32, D>,
7011            T1: fidl::encoding::Encode<u32, D>,
7012        > fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for (T0, T1)
7013    {
7014        #[inline]
7015        unsafe fn encode(
7016            self,
7017            encoder: &mut fidl::encoding::Encoder<'_, D>,
7018            offset: usize,
7019            depth: fidl::encoding::Depth,
7020        ) -> fidl::Result<()> {
7021            encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
7022            // Zero out padding regions. There's no need to apply masks
7023            // because the unmasked parts will be overwritten by fields.
7024            // Write the fields.
7025            self.0.encode(encoder, offset + 0, depth)?;
7026            self.1.encode(encoder, offset + 4, depth)?;
7027            Ok(())
7028        }
7029    }
7030
7031    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7032        for SceneAddAmbientLightCmd
7033    {
7034        #[inline(always)]
7035        fn new_empty() -> Self {
7036            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7037        }
7038
7039        #[inline]
7040        unsafe fn decode(
7041            &mut self,
7042            decoder: &mut fidl::encoding::Decoder<'_, D>,
7043            offset: usize,
7044            _depth: fidl::encoding::Depth,
7045        ) -> fidl::Result<()> {
7046            decoder.debug_check_bounds::<Self>(offset);
7047            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7048            // Verify that padding bytes are zero.
7049            // Copy from the buffer into the object.
7050            unsafe {
7051                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7052            }
7053            Ok(())
7054        }
7055    }
7056
7057    impl fidl::encoding::ValueTypeMarker for SceneAddDirectionalLightCmd {
7058        type Borrowed<'a> = &'a Self;
7059        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7060            value
7061        }
7062    }
7063
7064    unsafe impl fidl::encoding::TypeMarker for SceneAddDirectionalLightCmd {
7065        type Owned = Self;
7066
7067        #[inline(always)]
7068        fn inline_align(_context: fidl::encoding::Context) -> usize {
7069            4
7070        }
7071
7072        #[inline(always)]
7073        fn inline_size(_context: fidl::encoding::Context) -> usize {
7074            8
7075        }
7076        #[inline(always)]
7077        fn encode_is_copy() -> bool {
7078            true
7079        }
7080
7081        #[inline(always)]
7082        fn decode_is_copy() -> bool {
7083            true
7084        }
7085    }
7086
7087    unsafe impl<D: fidl::encoding::ResourceDialect>
7088        fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for &SceneAddDirectionalLightCmd
7089    {
7090        #[inline]
7091        unsafe fn encode(
7092            self,
7093            encoder: &mut fidl::encoding::Encoder<'_, D>,
7094            offset: usize,
7095            _depth: fidl::encoding::Depth,
7096        ) -> fidl::Result<()> {
7097            encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7098            unsafe {
7099                // Copy the object into the buffer.
7100                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7101                (buf_ptr as *mut SceneAddDirectionalLightCmd)
7102                    .write_unaligned((self as *const SceneAddDirectionalLightCmd).read());
7103                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7104                // done second because the memcpy will write garbage to these bytes.
7105            }
7106            Ok(())
7107        }
7108    }
7109    unsafe impl<
7110            D: fidl::encoding::ResourceDialect,
7111            T0: fidl::encoding::Encode<u32, D>,
7112            T1: fidl::encoding::Encode<u32, D>,
7113        > fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for (T0, T1)
7114    {
7115        #[inline]
7116        unsafe fn encode(
7117            self,
7118            encoder: &mut fidl::encoding::Encoder<'_, D>,
7119            offset: usize,
7120            depth: fidl::encoding::Depth,
7121        ) -> fidl::Result<()> {
7122            encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7123            // Zero out padding regions. There's no need to apply masks
7124            // because the unmasked parts will be overwritten by fields.
7125            // Write the fields.
7126            self.0.encode(encoder, offset + 0, depth)?;
7127            self.1.encode(encoder, offset + 4, depth)?;
7128            Ok(())
7129        }
7130    }
7131
7132    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7133        for SceneAddDirectionalLightCmd
7134    {
7135        #[inline(always)]
7136        fn new_empty() -> Self {
7137            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7138        }
7139
7140        #[inline]
7141        unsafe fn decode(
7142            &mut self,
7143            decoder: &mut fidl::encoding::Decoder<'_, D>,
7144            offset: usize,
7145            _depth: fidl::encoding::Depth,
7146        ) -> fidl::Result<()> {
7147            decoder.debug_check_bounds::<Self>(offset);
7148            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7149            // Verify that padding bytes are zero.
7150            // Copy from the buffer into the object.
7151            unsafe {
7152                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7153            }
7154            Ok(())
7155        }
7156    }
7157
7158    impl fidl::encoding::ValueTypeMarker for SceneAddPointLightCmd {
7159        type Borrowed<'a> = &'a Self;
7160        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7161            value
7162        }
7163    }
7164
7165    unsafe impl fidl::encoding::TypeMarker for SceneAddPointLightCmd {
7166        type Owned = Self;
7167
7168        #[inline(always)]
7169        fn inline_align(_context: fidl::encoding::Context) -> usize {
7170            4
7171        }
7172
7173        #[inline(always)]
7174        fn inline_size(_context: fidl::encoding::Context) -> usize {
7175            8
7176        }
7177        #[inline(always)]
7178        fn encode_is_copy() -> bool {
7179            true
7180        }
7181
7182        #[inline(always)]
7183        fn decode_is_copy() -> bool {
7184            true
7185        }
7186    }
7187
7188    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneAddPointLightCmd, D>
7189        for &SceneAddPointLightCmd
7190    {
7191        #[inline]
7192        unsafe fn encode(
7193            self,
7194            encoder: &mut fidl::encoding::Encoder<'_, D>,
7195            offset: usize,
7196            _depth: fidl::encoding::Depth,
7197        ) -> fidl::Result<()> {
7198            encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7199            unsafe {
7200                // Copy the object into the buffer.
7201                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7202                (buf_ptr as *mut SceneAddPointLightCmd)
7203                    .write_unaligned((self as *const SceneAddPointLightCmd).read());
7204                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7205                // done second because the memcpy will write garbage to these bytes.
7206            }
7207            Ok(())
7208        }
7209    }
7210    unsafe impl<
7211            D: fidl::encoding::ResourceDialect,
7212            T0: fidl::encoding::Encode<u32, D>,
7213            T1: fidl::encoding::Encode<u32, D>,
7214        > fidl::encoding::Encode<SceneAddPointLightCmd, D> for (T0, T1)
7215    {
7216        #[inline]
7217        unsafe fn encode(
7218            self,
7219            encoder: &mut fidl::encoding::Encoder<'_, D>,
7220            offset: usize,
7221            depth: fidl::encoding::Depth,
7222        ) -> fidl::Result<()> {
7223            encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7224            // Zero out padding regions. There's no need to apply masks
7225            // because the unmasked parts will be overwritten by fields.
7226            // Write the fields.
7227            self.0.encode(encoder, offset + 0, depth)?;
7228            self.1.encode(encoder, offset + 4, depth)?;
7229            Ok(())
7230        }
7231    }
7232
7233    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneAddPointLightCmd {
7234        #[inline(always)]
7235        fn new_empty() -> Self {
7236            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7237        }
7238
7239        #[inline]
7240        unsafe fn decode(
7241            &mut self,
7242            decoder: &mut fidl::encoding::Decoder<'_, D>,
7243            offset: usize,
7244            _depth: fidl::encoding::Depth,
7245        ) -> fidl::Result<()> {
7246            decoder.debug_check_bounds::<Self>(offset);
7247            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7248            // Verify that padding bytes are zero.
7249            // Copy from the buffer into the object.
7250            unsafe {
7251                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7252            }
7253            Ok(())
7254        }
7255    }
7256
7257    impl fidl::encoding::ValueTypeMarker for SceneArgs {
7258        type Borrowed<'a> = &'a Self;
7259        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7260            value
7261        }
7262    }
7263
7264    unsafe impl fidl::encoding::TypeMarker for SceneArgs {
7265        type Owned = Self;
7266
7267        #[inline(always)]
7268        fn inline_align(_context: fidl::encoding::Context) -> usize {
7269            4
7270        }
7271
7272        #[inline(always)]
7273        fn inline_size(_context: fidl::encoding::Context) -> usize {
7274            4
7275        }
7276        #[inline(always)]
7277        fn encode_is_copy() -> bool {
7278            true
7279        }
7280
7281        #[inline(always)]
7282        fn decode_is_copy() -> bool {
7283            true
7284        }
7285    }
7286
7287    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneArgs, D>
7288        for &SceneArgs
7289    {
7290        #[inline]
7291        unsafe fn encode(
7292            self,
7293            encoder: &mut fidl::encoding::Encoder<'_, D>,
7294            offset: usize,
7295            _depth: fidl::encoding::Depth,
7296        ) -> fidl::Result<()> {
7297            encoder.debug_check_bounds::<SceneArgs>(offset);
7298            unsafe {
7299                // Copy the object into the buffer.
7300                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7301                (buf_ptr as *mut SceneArgs).write_unaligned((self as *const SceneArgs).read());
7302                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7303                // done second because the memcpy will write garbage to these bytes.
7304            }
7305            Ok(())
7306        }
7307    }
7308    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7309        fidl::encoding::Encode<SceneArgs, D> for (T0,)
7310    {
7311        #[inline]
7312        unsafe fn encode(
7313            self,
7314            encoder: &mut fidl::encoding::Encoder<'_, D>,
7315            offset: usize,
7316            depth: fidl::encoding::Depth,
7317        ) -> fidl::Result<()> {
7318            encoder.debug_check_bounds::<SceneArgs>(offset);
7319            // Zero out padding regions. There's no need to apply masks
7320            // because the unmasked parts will be overwritten by fields.
7321            // Write the fields.
7322            self.0.encode(encoder, offset + 0, depth)?;
7323            Ok(())
7324        }
7325    }
7326
7327    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneArgs {
7328        #[inline(always)]
7329        fn new_empty() -> Self {
7330            Self { dummy: fidl::new_empty!(u32, D) }
7331        }
7332
7333        #[inline]
7334        unsafe fn decode(
7335            &mut self,
7336            decoder: &mut fidl::encoding::Decoder<'_, D>,
7337            offset: usize,
7338            _depth: fidl::encoding::Depth,
7339        ) -> fidl::Result<()> {
7340            decoder.debug_check_bounds::<Self>(offset);
7341            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7342            // Verify that padding bytes are zero.
7343            // Copy from the buffer into the object.
7344            unsafe {
7345                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7346            }
7347            Ok(())
7348        }
7349    }
7350
7351    impl fidl::encoding::ValueTypeMarker for SendSizeChangeHintCmdHack {
7352        type Borrowed<'a> = &'a Self;
7353        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7354            value
7355        }
7356    }
7357
7358    unsafe impl fidl::encoding::TypeMarker for SendSizeChangeHintCmdHack {
7359        type Owned = Self;
7360
7361        #[inline(always)]
7362        fn inline_align(_context: fidl::encoding::Context) -> usize {
7363            4
7364        }
7365
7366        #[inline(always)]
7367        fn inline_size(_context: fidl::encoding::Context) -> usize {
7368            12
7369        }
7370    }
7371
7372    unsafe impl<D: fidl::encoding::ResourceDialect>
7373        fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for &SendSizeChangeHintCmdHack
7374    {
7375        #[inline]
7376        unsafe fn encode(
7377            self,
7378            encoder: &mut fidl::encoding::Encoder<'_, D>,
7379            offset: usize,
7380            _depth: fidl::encoding::Depth,
7381        ) -> fidl::Result<()> {
7382            encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7383            // Delegate to tuple encoding.
7384            fidl::encoding::Encode::<SendSizeChangeHintCmdHack, D>::encode(
7385                (
7386                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
7387                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
7388                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
7389                ),
7390                encoder,
7391                offset,
7392                _depth,
7393            )
7394        }
7395    }
7396    unsafe impl<
7397            D: fidl::encoding::ResourceDialect,
7398            T0: fidl::encoding::Encode<u32, D>,
7399            T1: fidl::encoding::Encode<f32, D>,
7400            T2: fidl::encoding::Encode<f32, D>,
7401        > fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for (T0, T1, T2)
7402    {
7403        #[inline]
7404        unsafe fn encode(
7405            self,
7406            encoder: &mut fidl::encoding::Encoder<'_, D>,
7407            offset: usize,
7408            depth: fidl::encoding::Depth,
7409        ) -> fidl::Result<()> {
7410            encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7411            // Zero out padding regions. There's no need to apply masks
7412            // because the unmasked parts will be overwritten by fields.
7413            // Write the fields.
7414            self.0.encode(encoder, offset + 0, depth)?;
7415            self.1.encode(encoder, offset + 4, depth)?;
7416            self.2.encode(encoder, offset + 8, depth)?;
7417            Ok(())
7418        }
7419    }
7420
7421    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7422        for SendSizeChangeHintCmdHack
7423    {
7424        #[inline(always)]
7425        fn new_empty() -> Self {
7426            Self {
7427                node_id: fidl::new_empty!(u32, D),
7428                width_change_factor: fidl::new_empty!(f32, D),
7429                height_change_factor: fidl::new_empty!(f32, D),
7430            }
7431        }
7432
7433        #[inline]
7434        unsafe fn decode(
7435            &mut self,
7436            decoder: &mut fidl::encoding::Decoder<'_, D>,
7437            offset: usize,
7438            _depth: fidl::encoding::Depth,
7439        ) -> fidl::Result<()> {
7440            decoder.debug_check_bounds::<Self>(offset);
7441            // Verify that padding bytes are zero.
7442            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
7443            fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
7444            fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
7445            Ok(())
7446        }
7447    }
7448
7449    impl fidl::encoding::ValueTypeMarker for SetAnchorCmd {
7450        type Borrowed<'a> = &'a Self;
7451        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7452            value
7453        }
7454    }
7455
7456    unsafe impl fidl::encoding::TypeMarker for SetAnchorCmd {
7457        type Owned = Self;
7458
7459        #[inline(always)]
7460        fn inline_align(_context: fidl::encoding::Context) -> usize {
7461            4
7462        }
7463
7464        #[inline(always)]
7465        fn inline_size(_context: fidl::encoding::Context) -> usize {
7466            20
7467        }
7468    }
7469
7470    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetAnchorCmd, D>
7471        for &SetAnchorCmd
7472    {
7473        #[inline]
7474        unsafe fn encode(
7475            self,
7476            encoder: &mut fidl::encoding::Encoder<'_, D>,
7477            offset: usize,
7478            _depth: fidl::encoding::Depth,
7479        ) -> fidl::Result<()> {
7480            encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7481            // Delegate to tuple encoding.
7482            fidl::encoding::Encode::<SetAnchorCmd, D>::encode(
7483                (
7484                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
7485                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
7486                ),
7487                encoder,
7488                offset,
7489                _depth,
7490            )
7491        }
7492    }
7493    unsafe impl<
7494            D: fidl::encoding::ResourceDialect,
7495            T0: fidl::encoding::Encode<u32, D>,
7496            T1: fidl::encoding::Encode<Vector3Value, D>,
7497        > fidl::encoding::Encode<SetAnchorCmd, D> for (T0, T1)
7498    {
7499        #[inline]
7500        unsafe fn encode(
7501            self,
7502            encoder: &mut fidl::encoding::Encoder<'_, D>,
7503            offset: usize,
7504            depth: fidl::encoding::Depth,
7505        ) -> fidl::Result<()> {
7506            encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7507            // Zero out padding regions. There's no need to apply masks
7508            // because the unmasked parts will be overwritten by fields.
7509            // Write the fields.
7510            self.0.encode(encoder, offset + 0, depth)?;
7511            self.1.encode(encoder, offset + 4, depth)?;
7512            Ok(())
7513        }
7514    }
7515
7516    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetAnchorCmd {
7517        #[inline(always)]
7518        fn new_empty() -> Self {
7519            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
7520        }
7521
7522        #[inline]
7523        unsafe fn decode(
7524            &mut self,
7525            decoder: &mut fidl::encoding::Decoder<'_, D>,
7526            offset: usize,
7527            _depth: fidl::encoding::Depth,
7528        ) -> fidl::Result<()> {
7529            decoder.debug_check_bounds::<Self>(offset);
7530            // Verify that padding bytes are zero.
7531            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
7532            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
7533            Ok(())
7534        }
7535    }
7536
7537    impl fidl::encoding::ValueTypeMarker for SetCameraClipSpaceTransformCmd {
7538        type Borrowed<'a> = &'a Self;
7539        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7540            value
7541        }
7542    }
7543
7544    unsafe impl fidl::encoding::TypeMarker for SetCameraClipSpaceTransformCmd {
7545        type Owned = Self;
7546
7547        #[inline(always)]
7548        fn inline_align(_context: fidl::encoding::Context) -> usize {
7549            4
7550        }
7551
7552        #[inline(always)]
7553        fn inline_size(_context: fidl::encoding::Context) -> usize {
7554            16
7555        }
7556    }
7557
7558    unsafe impl<D: fidl::encoding::ResourceDialect>
7559        fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D>
7560        for &SetCameraClipSpaceTransformCmd
7561    {
7562        #[inline]
7563        unsafe fn encode(
7564            self,
7565            encoder: &mut fidl::encoding::Encoder<'_, D>,
7566            offset: usize,
7567            _depth: fidl::encoding::Depth,
7568        ) -> fidl::Result<()> {
7569            encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7570            // Delegate to tuple encoding.
7571            fidl::encoding::Encode::<SetCameraClipSpaceTransformCmd, D>::encode(
7572                (
7573                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7574                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
7575                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
7576                ),
7577                encoder,
7578                offset,
7579                _depth,
7580            )
7581        }
7582    }
7583    unsafe impl<
7584            D: fidl::encoding::ResourceDialect,
7585            T0: fidl::encoding::Encode<u32, D>,
7586            T1: fidl::encoding::Encode<Vec2, D>,
7587            T2: fidl::encoding::Encode<f32, D>,
7588        > fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D> for (T0, T1, T2)
7589    {
7590        #[inline]
7591        unsafe fn encode(
7592            self,
7593            encoder: &mut fidl::encoding::Encoder<'_, D>,
7594            offset: usize,
7595            depth: fidl::encoding::Depth,
7596        ) -> fidl::Result<()> {
7597            encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7598            // Zero out padding regions. There's no need to apply masks
7599            // because the unmasked parts will be overwritten by fields.
7600            // Write the fields.
7601            self.0.encode(encoder, offset + 0, depth)?;
7602            self.1.encode(encoder, offset + 4, depth)?;
7603            self.2.encode(encoder, offset + 12, depth)?;
7604            Ok(())
7605        }
7606    }
7607
7608    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7609        for SetCameraClipSpaceTransformCmd
7610    {
7611        #[inline(always)]
7612        fn new_empty() -> Self {
7613            Self {
7614                camera_id: fidl::new_empty!(u32, D),
7615                translation: fidl::new_empty!(Vec2, D),
7616                scale: fidl::new_empty!(f32, D),
7617            }
7618        }
7619
7620        #[inline]
7621        unsafe fn decode(
7622            &mut self,
7623            decoder: &mut fidl::encoding::Decoder<'_, D>,
7624            offset: usize,
7625            _depth: fidl::encoding::Depth,
7626        ) -> fidl::Result<()> {
7627            decoder.debug_check_bounds::<Self>(offset);
7628            // Verify that padding bytes are zero.
7629            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7630            fidl::decode!(Vec2, D, &mut self.translation, decoder, offset + 4, _depth)?;
7631            fidl::decode!(f32, D, &mut self.scale, decoder, offset + 12, _depth)?;
7632            Ok(())
7633        }
7634    }
7635
7636    impl fidl::encoding::ValueTypeMarker for SetCameraCmd {
7637        type Borrowed<'a> = &'a Self;
7638        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7639            value
7640        }
7641    }
7642
7643    unsafe impl fidl::encoding::TypeMarker for SetCameraCmd {
7644        type Owned = Self;
7645
7646        #[inline(always)]
7647        fn inline_align(_context: fidl::encoding::Context) -> usize {
7648            4
7649        }
7650
7651        #[inline(always)]
7652        fn inline_size(_context: fidl::encoding::Context) -> usize {
7653            8
7654        }
7655        #[inline(always)]
7656        fn encode_is_copy() -> bool {
7657            true
7658        }
7659
7660        #[inline(always)]
7661        fn decode_is_copy() -> bool {
7662            true
7663        }
7664    }
7665
7666    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraCmd, D>
7667        for &SetCameraCmd
7668    {
7669        #[inline]
7670        unsafe fn encode(
7671            self,
7672            encoder: &mut fidl::encoding::Encoder<'_, D>,
7673            offset: usize,
7674            _depth: fidl::encoding::Depth,
7675        ) -> fidl::Result<()> {
7676            encoder.debug_check_bounds::<SetCameraCmd>(offset);
7677            unsafe {
7678                // Copy the object into the buffer.
7679                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7680                (buf_ptr as *mut SetCameraCmd)
7681                    .write_unaligned((self as *const SetCameraCmd).read());
7682                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7683                // done second because the memcpy will write garbage to these bytes.
7684            }
7685            Ok(())
7686        }
7687    }
7688    unsafe impl<
7689            D: fidl::encoding::ResourceDialect,
7690            T0: fidl::encoding::Encode<u32, D>,
7691            T1: fidl::encoding::Encode<u32, D>,
7692        > fidl::encoding::Encode<SetCameraCmd, D> for (T0, T1)
7693    {
7694        #[inline]
7695        unsafe fn encode(
7696            self,
7697            encoder: &mut fidl::encoding::Encoder<'_, D>,
7698            offset: usize,
7699            depth: fidl::encoding::Depth,
7700        ) -> fidl::Result<()> {
7701            encoder.debug_check_bounds::<SetCameraCmd>(offset);
7702            // Zero out padding regions. There's no need to apply masks
7703            // because the unmasked parts will be overwritten by fields.
7704            // Write the fields.
7705            self.0.encode(encoder, offset + 0, depth)?;
7706            self.1.encode(encoder, offset + 4, depth)?;
7707            Ok(())
7708        }
7709    }
7710
7711    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraCmd {
7712        #[inline(always)]
7713        fn new_empty() -> Self {
7714            Self { renderer_id: fidl::new_empty!(u32, D), camera_id: fidl::new_empty!(u32, D) }
7715        }
7716
7717        #[inline]
7718        unsafe fn decode(
7719            &mut self,
7720            decoder: &mut fidl::encoding::Decoder<'_, D>,
7721            offset: usize,
7722            _depth: fidl::encoding::Depth,
7723        ) -> fidl::Result<()> {
7724            decoder.debug_check_bounds::<Self>(offset);
7725            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7726            // Verify that padding bytes are zero.
7727            // Copy from the buffer into the object.
7728            unsafe {
7729                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7730            }
7731            Ok(())
7732        }
7733    }
7734
7735    impl fidl::encoding::ValueTypeMarker for SetCameraPoseBufferCmd {
7736        type Borrowed<'a> = &'a Self;
7737        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7738            value
7739        }
7740    }
7741
7742    unsafe impl fidl::encoding::TypeMarker for SetCameraPoseBufferCmd {
7743        type Owned = Self;
7744
7745        #[inline(always)]
7746        fn inline_align(_context: fidl::encoding::Context) -> usize {
7747            8
7748        }
7749
7750        #[inline(always)]
7751        fn inline_size(_context: fidl::encoding::Context) -> usize {
7752            32
7753        }
7754    }
7755
7756    unsafe impl<D: fidl::encoding::ResourceDialect>
7757        fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for &SetCameraPoseBufferCmd
7758    {
7759        #[inline]
7760        unsafe fn encode(
7761            self,
7762            encoder: &mut fidl::encoding::Encoder<'_, D>,
7763            offset: usize,
7764            _depth: fidl::encoding::Depth,
7765        ) -> fidl::Result<()> {
7766            encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7767            unsafe {
7768                // Copy the object into the buffer.
7769                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7770                (buf_ptr as *mut SetCameraPoseBufferCmd)
7771                    .write_unaligned((self as *const SetCameraPoseBufferCmd).read());
7772                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7773                // done second because the memcpy will write garbage to these bytes.
7774                let padding_ptr = buf_ptr.offset(8) as *mut u64;
7775                let padding_mask = 0xffffffff00000000u64;
7776                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
7777            }
7778            Ok(())
7779        }
7780    }
7781    unsafe impl<
7782            D: fidl::encoding::ResourceDialect,
7783            T0: fidl::encoding::Encode<u32, D>,
7784            T1: fidl::encoding::Encode<u32, D>,
7785            T2: fidl::encoding::Encode<u32, D>,
7786            T3: fidl::encoding::Encode<i64, D>,
7787            T4: fidl::encoding::Encode<u64, D>,
7788        > fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for (T0, T1, T2, T3, T4)
7789    {
7790        #[inline]
7791        unsafe fn encode(
7792            self,
7793            encoder: &mut fidl::encoding::Encoder<'_, D>,
7794            offset: usize,
7795            depth: fidl::encoding::Depth,
7796        ) -> fidl::Result<()> {
7797            encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7798            // Zero out padding regions. There's no need to apply masks
7799            // because the unmasked parts will be overwritten by fields.
7800            unsafe {
7801                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
7802                (ptr as *mut u64).write_unaligned(0);
7803            }
7804            // Write the fields.
7805            self.0.encode(encoder, offset + 0, depth)?;
7806            self.1.encode(encoder, offset + 4, depth)?;
7807            self.2.encode(encoder, offset + 8, depth)?;
7808            self.3.encode(encoder, offset + 16, depth)?;
7809            self.4.encode(encoder, offset + 24, depth)?;
7810            Ok(())
7811        }
7812    }
7813
7814    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7815        for SetCameraPoseBufferCmd
7816    {
7817        #[inline(always)]
7818        fn new_empty() -> Self {
7819            Self {
7820                camera_id: fidl::new_empty!(u32, D),
7821                buffer_id: fidl::new_empty!(u32, D),
7822                num_entries: fidl::new_empty!(u32, D),
7823                base_time: fidl::new_empty!(i64, D),
7824                time_interval: fidl::new_empty!(u64, D),
7825            }
7826        }
7827
7828        #[inline]
7829        unsafe fn decode(
7830            &mut self,
7831            decoder: &mut fidl::encoding::Decoder<'_, D>,
7832            offset: usize,
7833            _depth: fidl::encoding::Depth,
7834        ) -> fidl::Result<()> {
7835            decoder.debug_check_bounds::<Self>(offset);
7836            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7837            // Verify that padding bytes are zero.
7838            let ptr = unsafe { buf_ptr.offset(8) };
7839            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7840            let mask = 0xffffffff00000000u64;
7841            let maskedval = padval & mask;
7842            if maskedval != 0 {
7843                return Err(fidl::Error::NonZeroPadding {
7844                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
7845                });
7846            }
7847            // Copy from the buffer into the object.
7848            unsafe {
7849                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
7850            }
7851            Ok(())
7852        }
7853    }
7854
7855    impl fidl::encoding::ValueTypeMarker for SetCameraProjectionCmd {
7856        type Borrowed<'a> = &'a Self;
7857        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7858            value
7859        }
7860    }
7861
7862    unsafe impl fidl::encoding::TypeMarker for SetCameraProjectionCmd {
7863        type Owned = Self;
7864
7865        #[inline(always)]
7866        fn inline_align(_context: fidl::encoding::Context) -> usize {
7867            4
7868        }
7869
7870        #[inline(always)]
7871        fn inline_size(_context: fidl::encoding::Context) -> usize {
7872            12
7873        }
7874    }
7875
7876    unsafe impl<D: fidl::encoding::ResourceDialect>
7877        fidl::encoding::Encode<SetCameraProjectionCmd, D> for &SetCameraProjectionCmd
7878    {
7879        #[inline]
7880        unsafe fn encode(
7881            self,
7882            encoder: &mut fidl::encoding::Encoder<'_, D>,
7883            offset: usize,
7884            _depth: fidl::encoding::Depth,
7885        ) -> fidl::Result<()> {
7886            encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7887            // Delegate to tuple encoding.
7888            fidl::encoding::Encode::<SetCameraProjectionCmd, D>::encode(
7889                (
7890                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7891                    <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.fovy),
7892                ),
7893                encoder,
7894                offset,
7895                _depth,
7896            )
7897        }
7898    }
7899    unsafe impl<
7900            D: fidl::encoding::ResourceDialect,
7901            T0: fidl::encoding::Encode<u32, D>,
7902            T1: fidl::encoding::Encode<FloatValue, D>,
7903        > fidl::encoding::Encode<SetCameraProjectionCmd, D> for (T0, T1)
7904    {
7905        #[inline]
7906        unsafe fn encode(
7907            self,
7908            encoder: &mut fidl::encoding::Encoder<'_, D>,
7909            offset: usize,
7910            depth: fidl::encoding::Depth,
7911        ) -> fidl::Result<()> {
7912            encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7913            // Zero out padding regions. There's no need to apply masks
7914            // because the unmasked parts will be overwritten by fields.
7915            // Write the fields.
7916            self.0.encode(encoder, offset + 0, depth)?;
7917            self.1.encode(encoder, offset + 4, depth)?;
7918            Ok(())
7919        }
7920    }
7921
7922    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7923        for SetCameraProjectionCmd
7924    {
7925        #[inline(always)]
7926        fn new_empty() -> Self {
7927            Self { camera_id: fidl::new_empty!(u32, D), fovy: fidl::new_empty!(FloatValue, D) }
7928        }
7929
7930        #[inline]
7931        unsafe fn decode(
7932            &mut self,
7933            decoder: &mut fidl::encoding::Decoder<'_, D>,
7934            offset: usize,
7935            _depth: fidl::encoding::Depth,
7936        ) -> fidl::Result<()> {
7937            decoder.debug_check_bounds::<Self>(offset);
7938            // Verify that padding bytes are zero.
7939            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7940            fidl::decode!(FloatValue, D, &mut self.fovy, decoder, offset + 4, _depth)?;
7941            Ok(())
7942        }
7943    }
7944
7945    impl fidl::encoding::ValueTypeMarker for SetCameraTransformCmd {
7946        type Borrowed<'a> = &'a Self;
7947        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7948            value
7949        }
7950    }
7951
7952    unsafe impl fidl::encoding::TypeMarker for SetCameraTransformCmd {
7953        type Owned = Self;
7954
7955        #[inline(always)]
7956        fn inline_align(_context: fidl::encoding::Context) -> usize {
7957            4
7958        }
7959
7960        #[inline(always)]
7961        fn inline_size(_context: fidl::encoding::Context) -> usize {
7962            52
7963        }
7964    }
7965
7966    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraTransformCmd, D>
7967        for &SetCameraTransformCmd
7968    {
7969        #[inline]
7970        unsafe fn encode(
7971            self,
7972            encoder: &mut fidl::encoding::Encoder<'_, D>,
7973            offset: usize,
7974            _depth: fidl::encoding::Depth,
7975        ) -> fidl::Result<()> {
7976            encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
7977            // Delegate to tuple encoding.
7978            fidl::encoding::Encode::<SetCameraTransformCmd, D>::encode(
7979                (
7980                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7981                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_position),
7982                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_look_at),
7983                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_up),
7984                ),
7985                encoder,
7986                offset,
7987                _depth,
7988            )
7989        }
7990    }
7991    unsafe impl<
7992            D: fidl::encoding::ResourceDialect,
7993            T0: fidl::encoding::Encode<u32, D>,
7994            T1: fidl::encoding::Encode<Vector3Value, D>,
7995            T2: fidl::encoding::Encode<Vector3Value, D>,
7996            T3: fidl::encoding::Encode<Vector3Value, D>,
7997        > fidl::encoding::Encode<SetCameraTransformCmd, D> for (T0, T1, T2, T3)
7998    {
7999        #[inline]
8000        unsafe fn encode(
8001            self,
8002            encoder: &mut fidl::encoding::Encoder<'_, D>,
8003            offset: usize,
8004            depth: fidl::encoding::Depth,
8005        ) -> fidl::Result<()> {
8006            encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
8007            // Zero out padding regions. There's no need to apply masks
8008            // because the unmasked parts will be overwritten by fields.
8009            // Write the fields.
8010            self.0.encode(encoder, offset + 0, depth)?;
8011            self.1.encode(encoder, offset + 4, depth)?;
8012            self.2.encode(encoder, offset + 20, depth)?;
8013            self.3.encode(encoder, offset + 36, depth)?;
8014            Ok(())
8015        }
8016    }
8017
8018    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraTransformCmd {
8019        #[inline(always)]
8020        fn new_empty() -> Self {
8021            Self {
8022                camera_id: fidl::new_empty!(u32, D),
8023                eye_position: fidl::new_empty!(Vector3Value, D),
8024                eye_look_at: fidl::new_empty!(Vector3Value, D),
8025                eye_up: fidl::new_empty!(Vector3Value, D),
8026            }
8027        }
8028
8029        #[inline]
8030        unsafe fn decode(
8031            &mut self,
8032            decoder: &mut fidl::encoding::Decoder<'_, D>,
8033            offset: usize,
8034            _depth: fidl::encoding::Depth,
8035        ) -> fidl::Result<()> {
8036            decoder.debug_check_bounds::<Self>(offset);
8037            // Verify that padding bytes are zero.
8038            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
8039            fidl::decode!(Vector3Value, D, &mut self.eye_position, decoder, offset + 4, _depth)?;
8040            fidl::decode!(Vector3Value, D, &mut self.eye_look_at, decoder, offset + 20, _depth)?;
8041            fidl::decode!(Vector3Value, D, &mut self.eye_up, decoder, offset + 36, _depth)?;
8042            Ok(())
8043        }
8044    }
8045
8046    impl fidl::encoding::ValueTypeMarker for SetClipCmd {
8047        type Borrowed<'a> = &'a Self;
8048        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8049            value
8050        }
8051    }
8052
8053    unsafe impl fidl::encoding::TypeMarker for SetClipCmd {
8054        type Owned = Self;
8055
8056        #[inline(always)]
8057        fn inline_align(_context: fidl::encoding::Context) -> usize {
8058            4
8059        }
8060
8061        #[inline(always)]
8062        fn inline_size(_context: fidl::encoding::Context) -> usize {
8063            12
8064        }
8065    }
8066
8067    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipCmd, D>
8068        for &SetClipCmd
8069    {
8070        #[inline]
8071        unsafe fn encode(
8072            self,
8073            encoder: &mut fidl::encoding::Encoder<'_, D>,
8074            offset: usize,
8075            _depth: fidl::encoding::Depth,
8076        ) -> fidl::Result<()> {
8077            encoder.debug_check_bounds::<SetClipCmd>(offset);
8078            // Delegate to tuple encoding.
8079            fidl::encoding::Encode::<SetClipCmd, D>::encode(
8080                (
8081                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8082                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_id),
8083                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_to_self),
8084                ),
8085                encoder,
8086                offset,
8087                _depth,
8088            )
8089        }
8090    }
8091    unsafe impl<
8092            D: fidl::encoding::ResourceDialect,
8093            T0: fidl::encoding::Encode<u32, D>,
8094            T1: fidl::encoding::Encode<u32, D>,
8095            T2: fidl::encoding::Encode<bool, D>,
8096        > fidl::encoding::Encode<SetClipCmd, D> for (T0, T1, T2)
8097    {
8098        #[inline]
8099        unsafe fn encode(
8100            self,
8101            encoder: &mut fidl::encoding::Encoder<'_, D>,
8102            offset: usize,
8103            depth: fidl::encoding::Depth,
8104        ) -> fidl::Result<()> {
8105            encoder.debug_check_bounds::<SetClipCmd>(offset);
8106            // Zero out padding regions. There's no need to apply masks
8107            // because the unmasked parts will be overwritten by fields.
8108            unsafe {
8109                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8110                (ptr as *mut u32).write_unaligned(0);
8111            }
8112            // Write the fields.
8113            self.0.encode(encoder, offset + 0, depth)?;
8114            self.1.encode(encoder, offset + 4, depth)?;
8115            self.2.encode(encoder, offset + 8, depth)?;
8116            Ok(())
8117        }
8118    }
8119
8120    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipCmd {
8121        #[inline(always)]
8122        fn new_empty() -> Self {
8123            Self {
8124                node_id: fidl::new_empty!(u32, D),
8125                clip_id: fidl::new_empty!(u32, D),
8126                clip_to_self: fidl::new_empty!(bool, D),
8127            }
8128        }
8129
8130        #[inline]
8131        unsafe fn decode(
8132            &mut self,
8133            decoder: &mut fidl::encoding::Decoder<'_, D>,
8134            offset: usize,
8135            _depth: fidl::encoding::Depth,
8136        ) -> fidl::Result<()> {
8137            decoder.debug_check_bounds::<Self>(offset);
8138            // Verify that padding bytes are zero.
8139            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8140            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8141            let mask = 0xffffff00u32;
8142            let maskedval = padval & mask;
8143            if maskedval != 0 {
8144                return Err(fidl::Error::NonZeroPadding {
8145                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8146                });
8147            }
8148            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8149            fidl::decode!(u32, D, &mut self.clip_id, decoder, offset + 4, _depth)?;
8150            fidl::decode!(bool, D, &mut self.clip_to_self, decoder, offset + 8, _depth)?;
8151            Ok(())
8152        }
8153    }
8154
8155    impl fidl::encoding::ValueTypeMarker for SetClipPlanesCmd {
8156        type Borrowed<'a> = &'a Self;
8157        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8158            value
8159        }
8160    }
8161
8162    unsafe impl fidl::encoding::TypeMarker for SetClipPlanesCmd {
8163        type Owned = Self;
8164
8165        #[inline(always)]
8166        fn inline_align(_context: fidl::encoding::Context) -> usize {
8167            8
8168        }
8169
8170        #[inline(always)]
8171        fn inline_size(_context: fidl::encoding::Context) -> usize {
8172            24
8173        }
8174    }
8175
8176    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipPlanesCmd, D>
8177        for &SetClipPlanesCmd
8178    {
8179        #[inline]
8180        unsafe fn encode(
8181            self,
8182            encoder: &mut fidl::encoding::Encoder<'_, D>,
8183            offset: usize,
8184            _depth: fidl::encoding::Depth,
8185        ) -> fidl::Result<()> {
8186            encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8187            // Delegate to tuple encoding.
8188            fidl::encoding::Encode::<SetClipPlanesCmd, D>::encode(
8189                (
8190                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8191                    <fidl::encoding::UnboundedVector<Plane3> as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_planes),
8192                ),
8193                encoder, offset, _depth
8194            )
8195        }
8196    }
8197    unsafe impl<
8198            D: fidl::encoding::ResourceDialect,
8199            T0: fidl::encoding::Encode<u32, D>,
8200            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Plane3>, D>,
8201        > fidl::encoding::Encode<SetClipPlanesCmd, D> for (T0, T1)
8202    {
8203        #[inline]
8204        unsafe fn encode(
8205            self,
8206            encoder: &mut fidl::encoding::Encoder<'_, D>,
8207            offset: usize,
8208            depth: fidl::encoding::Depth,
8209        ) -> fidl::Result<()> {
8210            encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8211            // Zero out padding regions. There's no need to apply masks
8212            // because the unmasked parts will be overwritten by fields.
8213            unsafe {
8214                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8215                (ptr as *mut u64).write_unaligned(0);
8216            }
8217            // Write the fields.
8218            self.0.encode(encoder, offset + 0, depth)?;
8219            self.1.encode(encoder, offset + 8, depth)?;
8220            Ok(())
8221        }
8222    }
8223
8224    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipPlanesCmd {
8225        #[inline(always)]
8226        fn new_empty() -> Self {
8227            Self {
8228                node_id: fidl::new_empty!(u32, D),
8229                clip_planes: fidl::new_empty!(fidl::encoding::UnboundedVector<Plane3>, D),
8230            }
8231        }
8232
8233        #[inline]
8234        unsafe fn decode(
8235            &mut self,
8236            decoder: &mut fidl::encoding::Decoder<'_, D>,
8237            offset: usize,
8238            _depth: fidl::encoding::Depth,
8239        ) -> fidl::Result<()> {
8240            decoder.debug_check_bounds::<Self>(offset);
8241            // Verify that padding bytes are zero.
8242            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8243            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8244            let mask = 0xffffffff00000000u64;
8245            let maskedval = padval & mask;
8246            if maskedval != 0 {
8247                return Err(fidl::Error::NonZeroPadding {
8248                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8249                });
8250            }
8251            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8252            fidl::decode!(
8253                fidl::encoding::UnboundedVector<Plane3>,
8254                D,
8255                &mut self.clip_planes,
8256                decoder,
8257                offset + 8,
8258                _depth
8259            )?;
8260            Ok(())
8261        }
8262    }
8263
8264    impl fidl::encoding::ValueTypeMarker for SetColorCmd {
8265        type Borrowed<'a> = &'a Self;
8266        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8267            value
8268        }
8269    }
8270
8271    unsafe impl fidl::encoding::TypeMarker for SetColorCmd {
8272        type Owned = Self;
8273
8274        #[inline(always)]
8275        fn inline_align(_context: fidl::encoding::Context) -> usize {
8276            4
8277        }
8278
8279        #[inline(always)]
8280        fn inline_size(_context: fidl::encoding::Context) -> usize {
8281            12
8282        }
8283        #[inline(always)]
8284        fn encode_is_copy() -> bool {
8285            true
8286        }
8287
8288        #[inline(always)]
8289        fn decode_is_copy() -> bool {
8290            true
8291        }
8292    }
8293
8294    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetColorCmd, D>
8295        for &SetColorCmd
8296    {
8297        #[inline]
8298        unsafe fn encode(
8299            self,
8300            encoder: &mut fidl::encoding::Encoder<'_, D>,
8301            offset: usize,
8302            _depth: fidl::encoding::Depth,
8303        ) -> fidl::Result<()> {
8304            encoder.debug_check_bounds::<SetColorCmd>(offset);
8305            unsafe {
8306                // Copy the object into the buffer.
8307                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8308                (buf_ptr as *mut SetColorCmd).write_unaligned((self as *const SetColorCmd).read());
8309                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8310                // done second because the memcpy will write garbage to these bytes.
8311            }
8312            Ok(())
8313        }
8314    }
8315    unsafe impl<
8316            D: fidl::encoding::ResourceDialect,
8317            T0: fidl::encoding::Encode<u32, D>,
8318            T1: fidl::encoding::Encode<ColorRgbaValue, D>,
8319        > fidl::encoding::Encode<SetColorCmd, D> for (T0, T1)
8320    {
8321        #[inline]
8322        unsafe fn encode(
8323            self,
8324            encoder: &mut fidl::encoding::Encoder<'_, D>,
8325            offset: usize,
8326            depth: fidl::encoding::Depth,
8327        ) -> fidl::Result<()> {
8328            encoder.debug_check_bounds::<SetColorCmd>(offset);
8329            // Zero out padding regions. There's no need to apply masks
8330            // because the unmasked parts will be overwritten by fields.
8331            // Write the fields.
8332            self.0.encode(encoder, offset + 0, depth)?;
8333            self.1.encode(encoder, offset + 4, depth)?;
8334            Ok(())
8335        }
8336    }
8337
8338    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetColorCmd {
8339        #[inline(always)]
8340        fn new_empty() -> Self {
8341            Self {
8342                material_id: fidl::new_empty!(u32, D),
8343                color: fidl::new_empty!(ColorRgbaValue, D),
8344            }
8345        }
8346
8347        #[inline]
8348        unsafe fn decode(
8349            &mut self,
8350            decoder: &mut fidl::encoding::Decoder<'_, D>,
8351            offset: usize,
8352            _depth: fidl::encoding::Depth,
8353        ) -> fidl::Result<()> {
8354            decoder.debug_check_bounds::<Self>(offset);
8355            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8356            // Verify that padding bytes are zero.
8357            // Copy from the buffer into the object.
8358            unsafe {
8359                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
8360            }
8361            Ok(())
8362        }
8363    }
8364
8365    impl fidl::encoding::ValueTypeMarker for SetDisableClippingCmd {
8366        type Borrowed<'a> = &'a Self;
8367        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8368            value
8369        }
8370    }
8371
8372    unsafe impl fidl::encoding::TypeMarker for SetDisableClippingCmd {
8373        type Owned = Self;
8374
8375        #[inline(always)]
8376        fn inline_align(_context: fidl::encoding::Context) -> usize {
8377            4
8378        }
8379
8380        #[inline(always)]
8381        fn inline_size(_context: fidl::encoding::Context) -> usize {
8382            8
8383        }
8384    }
8385
8386    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetDisableClippingCmd, D>
8387        for &SetDisableClippingCmd
8388    {
8389        #[inline]
8390        unsafe fn encode(
8391            self,
8392            encoder: &mut fidl::encoding::Encoder<'_, D>,
8393            offset: usize,
8394            _depth: fidl::encoding::Depth,
8395        ) -> fidl::Result<()> {
8396            encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8397            // Delegate to tuple encoding.
8398            fidl::encoding::Encode::<SetDisableClippingCmd, D>::encode(
8399                (
8400                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
8401                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_clipping),
8402                ),
8403                encoder,
8404                offset,
8405                _depth,
8406            )
8407        }
8408    }
8409    unsafe impl<
8410            D: fidl::encoding::ResourceDialect,
8411            T0: fidl::encoding::Encode<u32, D>,
8412            T1: fidl::encoding::Encode<bool, D>,
8413        > fidl::encoding::Encode<SetDisableClippingCmd, D> for (T0, T1)
8414    {
8415        #[inline]
8416        unsafe fn encode(
8417            self,
8418            encoder: &mut fidl::encoding::Encoder<'_, D>,
8419            offset: usize,
8420            depth: fidl::encoding::Depth,
8421        ) -> fidl::Result<()> {
8422            encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8423            // Zero out padding regions. There's no need to apply masks
8424            // because the unmasked parts will be overwritten by fields.
8425            unsafe {
8426                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8427                (ptr as *mut u32).write_unaligned(0);
8428            }
8429            // Write the fields.
8430            self.0.encode(encoder, offset + 0, depth)?;
8431            self.1.encode(encoder, offset + 4, depth)?;
8432            Ok(())
8433        }
8434    }
8435
8436    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetDisableClippingCmd {
8437        #[inline(always)]
8438        fn new_empty() -> Self {
8439            Self {
8440                renderer_id: fidl::new_empty!(u32, D),
8441                disable_clipping: fidl::new_empty!(bool, D),
8442            }
8443        }
8444
8445        #[inline]
8446        unsafe fn decode(
8447            &mut self,
8448            decoder: &mut fidl::encoding::Decoder<'_, D>,
8449            offset: usize,
8450            _depth: fidl::encoding::Depth,
8451        ) -> fidl::Result<()> {
8452            decoder.debug_check_bounds::<Self>(offset);
8453            // Verify that padding bytes are zero.
8454            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8455            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8456            let mask = 0xffffff00u32;
8457            let maskedval = padval & mask;
8458            if maskedval != 0 {
8459                return Err(fidl::Error::NonZeroPadding {
8460                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8461                });
8462            }
8463            fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
8464            fidl::decode!(bool, D, &mut self.disable_clipping, decoder, offset + 4, _depth)?;
8465            Ok(())
8466        }
8467    }
8468
8469    impl fidl::encoding::ValueTypeMarker for SetDisplayColorConversionCmdHack {
8470        type Borrowed<'a> = &'a Self;
8471        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8472            value
8473        }
8474    }
8475
8476    unsafe impl fidl::encoding::TypeMarker for SetDisplayColorConversionCmdHack {
8477        type Owned = Self;
8478
8479        #[inline(always)]
8480        fn inline_align(_context: fidl::encoding::Context) -> usize {
8481            4
8482        }
8483
8484        #[inline(always)]
8485        fn inline_size(_context: fidl::encoding::Context) -> usize {
8486            64
8487        }
8488    }
8489
8490    unsafe impl<D: fidl::encoding::ResourceDialect>
8491        fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D>
8492        for &SetDisplayColorConversionCmdHack
8493    {
8494        #[inline]
8495        unsafe fn encode(
8496            self,
8497            encoder: &mut fidl::encoding::Encoder<'_, D>,
8498            offset: usize,
8499            _depth: fidl::encoding::Depth,
8500        ) -> fidl::Result<()> {
8501            encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8502            // Delegate to tuple encoding.
8503            fidl::encoding::Encode::<SetDisplayColorConversionCmdHack, D>::encode(
8504                (
8505                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.compositor_id),
8506                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8507                        &self.preoffsets,
8508                    ),
8509                    <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(
8510                        &self.matrix,
8511                    ),
8512                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8513                        &self.postoffsets,
8514                    ),
8515                ),
8516                encoder,
8517                offset,
8518                _depth,
8519            )
8520        }
8521    }
8522    unsafe impl<
8523            D: fidl::encoding::ResourceDialect,
8524            T0: fidl::encoding::Encode<u32, D>,
8525            T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8526            T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
8527            T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8528        > fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D> for (T0, T1, T2, T3)
8529    {
8530        #[inline]
8531        unsafe fn encode(
8532            self,
8533            encoder: &mut fidl::encoding::Encoder<'_, D>,
8534            offset: usize,
8535            depth: fidl::encoding::Depth,
8536        ) -> fidl::Result<()> {
8537            encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8538            // Zero out padding regions. There's no need to apply masks
8539            // because the unmasked parts will be overwritten by fields.
8540            // Write the fields.
8541            self.0.encode(encoder, offset + 0, depth)?;
8542            self.1.encode(encoder, offset + 4, depth)?;
8543            self.2.encode(encoder, offset + 16, depth)?;
8544            self.3.encode(encoder, offset + 52, depth)?;
8545            Ok(())
8546        }
8547    }
8548
8549    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8550        for SetDisplayColorConversionCmdHack
8551    {
8552        #[inline(always)]
8553        fn new_empty() -> Self {
8554            Self {
8555                compositor_id: fidl::new_empty!(u32, D),
8556                preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8557                matrix: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
8558                postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8559            }
8560        }
8561
8562        #[inline]
8563        unsafe fn decode(
8564            &mut self,
8565            decoder: &mut fidl::encoding::Decoder<'_, D>,
8566            offset: usize,
8567            _depth: fidl::encoding::Depth,
8568        ) -> fidl::Result<()> {
8569            decoder.debug_check_bounds::<Self>(offset);
8570            // Verify that padding bytes are zero.
8571            fidl::decode!(u32, D, &mut self.compositor_id, decoder, offset + 0, _depth)?;
8572            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 4, _depth)?;
8573            fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.matrix, decoder, offset + 16, _depth)?;
8574            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 52, _depth)?;
8575            Ok(())
8576        }
8577    }
8578
8579    impl fidl::encoding::ValueTypeMarker for SetDisplayMinimumRgbCmdHack {
8580        type Borrowed<'a> = &'a Self;
8581        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8582            value
8583        }
8584    }
8585
8586    unsafe impl fidl::encoding::TypeMarker for SetDisplayMinimumRgbCmdHack {
8587        type Owned = Self;
8588
8589        #[inline(always)]
8590        fn inline_align(_context: fidl::encoding::Context) -> usize {
8591            1
8592        }
8593
8594        #[inline(always)]
8595        fn inline_size(_context: fidl::encoding::Context) -> usize {
8596            1
8597        }
8598        #[inline(always)]
8599        fn encode_is_copy() -> bool {
8600            true
8601        }
8602
8603        #[inline(always)]
8604        fn decode_is_copy() -> bool {
8605            true
8606        }
8607    }
8608
8609    unsafe impl<D: fidl::encoding::ResourceDialect>
8610        fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for &SetDisplayMinimumRgbCmdHack
8611    {
8612        #[inline]
8613        unsafe fn encode(
8614            self,
8615            encoder: &mut fidl::encoding::Encoder<'_, D>,
8616            offset: usize,
8617            _depth: fidl::encoding::Depth,
8618        ) -> fidl::Result<()> {
8619            encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8620            unsafe {
8621                // Copy the object into the buffer.
8622                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8623                (buf_ptr as *mut SetDisplayMinimumRgbCmdHack)
8624                    .write_unaligned((self as *const SetDisplayMinimumRgbCmdHack).read());
8625                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8626                // done second because the memcpy will write garbage to these bytes.
8627            }
8628            Ok(())
8629        }
8630    }
8631    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
8632        fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for (T0,)
8633    {
8634        #[inline]
8635        unsafe fn encode(
8636            self,
8637            encoder: &mut fidl::encoding::Encoder<'_, D>,
8638            offset: usize,
8639            depth: fidl::encoding::Depth,
8640        ) -> fidl::Result<()> {
8641            encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8642            // Zero out padding regions. There's no need to apply masks
8643            // because the unmasked parts will be overwritten by fields.
8644            // Write the fields.
8645            self.0.encode(encoder, offset + 0, depth)?;
8646            Ok(())
8647        }
8648    }
8649
8650    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8651        for SetDisplayMinimumRgbCmdHack
8652    {
8653        #[inline(always)]
8654        fn new_empty() -> Self {
8655            Self { min_value: fidl::new_empty!(u8, D) }
8656        }
8657
8658        #[inline]
8659        unsafe fn decode(
8660            &mut self,
8661            decoder: &mut fidl::encoding::Decoder<'_, D>,
8662            offset: usize,
8663            _depth: fidl::encoding::Depth,
8664        ) -> fidl::Result<()> {
8665            decoder.debug_check_bounds::<Self>(offset);
8666            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8667            // Verify that padding bytes are zero.
8668            // Copy from the buffer into the object.
8669            unsafe {
8670                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
8671            }
8672            Ok(())
8673        }
8674    }
8675
8676    impl fidl::encoding::ValueTypeMarker for SetDisplayRotationCmdHack {
8677        type Borrowed<'a> = &'a Self;
8678        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8679            value
8680        }
8681    }
8682
8683    unsafe impl fidl::encoding::TypeMarker for SetDisplayRotationCmdHack {
8684        type Owned = Self;
8685
8686        #[inline(always)]
8687        fn inline_align(_context: fidl::encoding::Context) -> usize {
8688            4
8689        }
8690
8691        #[inline(always)]
8692        fn inline_size(_context: fidl::encoding::Context) -> usize {
8693            8
8694        }
8695        #[inline(always)]
8696        fn encode_is_copy() -> bool {
8697            true
8698        }
8699
8700        #[inline(always)]
8701        fn decode_is_copy() -> bool {
8702            true
8703        }
8704    }
8705
8706    unsafe impl<D: fidl::encoding::ResourceDialect>
8707        fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for &SetDisplayRotationCmdHack
8708    {
8709        #[inline]
8710        unsafe fn encode(
8711            self,
8712            encoder: &mut fidl::encoding::Encoder<'_, D>,
8713            offset: usize,
8714            _depth: fidl::encoding::Depth,
8715        ) -> fidl::Result<()> {
8716            encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8717            unsafe {
8718                // Copy the object into the buffer.
8719                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8720                (buf_ptr as *mut SetDisplayRotationCmdHack)
8721                    .write_unaligned((self as *const SetDisplayRotationCmdHack).read());
8722                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8723                // done second because the memcpy will write garbage to these bytes.
8724            }
8725            Ok(())
8726        }
8727    }
8728    unsafe impl<
8729            D: fidl::encoding::ResourceDialect,
8730            T0: fidl::encoding::Encode<u32, D>,
8731            T1: fidl::encoding::Encode<u32, D>,
8732        > fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for (T0, T1)
8733    {
8734        #[inline]
8735        unsafe fn encode(
8736            self,
8737            encoder: &mut fidl::encoding::Encoder<'_, D>,
8738            offset: usize,
8739            depth: fidl::encoding::Depth,
8740        ) -> fidl::Result<()> {
8741            encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8742            // Zero out padding regions. There's no need to apply masks
8743            // because the unmasked parts will be overwritten by fields.
8744            // Write the fields.
8745            self.0.encode(encoder, offset + 0, depth)?;
8746            self.1.encode(encoder, offset + 4, depth)?;
8747            Ok(())
8748        }
8749    }
8750
8751    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8752        for SetDisplayRotationCmdHack
8753    {
8754        #[inline(always)]
8755        fn new_empty() -> Self {
8756            Self {
8757                compositor_id: fidl::new_empty!(u32, D),
8758                rotation_degrees: fidl::new_empty!(u32, D),
8759            }
8760        }
8761
8762        #[inline]
8763        unsafe fn decode(
8764            &mut self,
8765            decoder: &mut fidl::encoding::Decoder<'_, D>,
8766            offset: usize,
8767            _depth: fidl::encoding::Depth,
8768        ) -> fidl::Result<()> {
8769            decoder.debug_check_bounds::<Self>(offset);
8770            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8771            // Verify that padding bytes are zero.
8772            // Copy from the buffer into the object.
8773            unsafe {
8774                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8775            }
8776            Ok(())
8777        }
8778    }
8779
8780    impl fidl::encoding::ValueTypeMarker for SetEnableDebugViewBoundsCmd {
8781        type Borrowed<'a> = &'a Self;
8782        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8783            value
8784        }
8785    }
8786
8787    unsafe impl fidl::encoding::TypeMarker for SetEnableDebugViewBoundsCmd {
8788        type Owned = Self;
8789
8790        #[inline(always)]
8791        fn inline_align(_context: fidl::encoding::Context) -> usize {
8792            4
8793        }
8794
8795        #[inline(always)]
8796        fn inline_size(_context: fidl::encoding::Context) -> usize {
8797            8
8798        }
8799    }
8800
8801    unsafe impl<D: fidl::encoding::ResourceDialect>
8802        fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for &SetEnableDebugViewBoundsCmd
8803    {
8804        #[inline]
8805        unsafe fn encode(
8806            self,
8807            encoder: &mut fidl::encoding::Encoder<'_, D>,
8808            offset: usize,
8809            _depth: fidl::encoding::Depth,
8810        ) -> fidl::Result<()> {
8811            encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8812            // Delegate to tuple encoding.
8813            fidl::encoding::Encode::<SetEnableDebugViewBoundsCmd, D>::encode(
8814                (
8815                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
8816                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable),
8817                ),
8818                encoder,
8819                offset,
8820                _depth,
8821            )
8822        }
8823    }
8824    unsafe impl<
8825            D: fidl::encoding::ResourceDialect,
8826            T0: fidl::encoding::Encode<u32, D>,
8827            T1: fidl::encoding::Encode<bool, D>,
8828        > fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for (T0, T1)
8829    {
8830        #[inline]
8831        unsafe fn encode(
8832            self,
8833            encoder: &mut fidl::encoding::Encoder<'_, D>,
8834            offset: usize,
8835            depth: fidl::encoding::Depth,
8836        ) -> fidl::Result<()> {
8837            encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8838            // Zero out padding regions. There's no need to apply masks
8839            // because the unmasked parts will be overwritten by fields.
8840            unsafe {
8841                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8842                (ptr as *mut u32).write_unaligned(0);
8843            }
8844            // Write the fields.
8845            self.0.encode(encoder, offset + 0, depth)?;
8846            self.1.encode(encoder, offset + 4, depth)?;
8847            Ok(())
8848        }
8849    }
8850
8851    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8852        for SetEnableDebugViewBoundsCmd
8853    {
8854        #[inline(always)]
8855        fn new_empty() -> Self {
8856            Self { view_id: fidl::new_empty!(u32, D), enable: fidl::new_empty!(bool, D) }
8857        }
8858
8859        #[inline]
8860        unsafe fn decode(
8861            &mut self,
8862            decoder: &mut fidl::encoding::Decoder<'_, D>,
8863            offset: usize,
8864            _depth: fidl::encoding::Depth,
8865        ) -> fidl::Result<()> {
8866            decoder.debug_check_bounds::<Self>(offset);
8867            // Verify that padding bytes are zero.
8868            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8869            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8870            let mask = 0xffffff00u32;
8871            let maskedval = padval & mask;
8872            if maskedval != 0 {
8873                return Err(fidl::Error::NonZeroPadding {
8874                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8875                });
8876            }
8877            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
8878            fidl::decode!(bool, D, &mut self.enable, decoder, offset + 4, _depth)?;
8879            Ok(())
8880        }
8881    }
8882
8883    impl fidl::encoding::ValueTypeMarker for SetEventMaskCmd {
8884        type Borrowed<'a> = &'a Self;
8885        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8886            value
8887        }
8888    }
8889
8890    unsafe impl fidl::encoding::TypeMarker for SetEventMaskCmd {
8891        type Owned = Self;
8892
8893        #[inline(always)]
8894        fn inline_align(_context: fidl::encoding::Context) -> usize {
8895            4
8896        }
8897
8898        #[inline(always)]
8899        fn inline_size(_context: fidl::encoding::Context) -> usize {
8900            8
8901        }
8902        #[inline(always)]
8903        fn encode_is_copy() -> bool {
8904            true
8905        }
8906
8907        #[inline(always)]
8908        fn decode_is_copy() -> bool {
8909            true
8910        }
8911    }
8912
8913    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetEventMaskCmd, D>
8914        for &SetEventMaskCmd
8915    {
8916        #[inline]
8917        unsafe fn encode(
8918            self,
8919            encoder: &mut fidl::encoding::Encoder<'_, D>,
8920            offset: usize,
8921            _depth: fidl::encoding::Depth,
8922        ) -> fidl::Result<()> {
8923            encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
8924            unsafe {
8925                // Copy the object into the buffer.
8926                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8927                (buf_ptr as *mut SetEventMaskCmd)
8928                    .write_unaligned((self as *const SetEventMaskCmd).read());
8929                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8930                // done second because the memcpy will write garbage to these bytes.
8931            }
8932            Ok(())
8933        }
8934    }
8935    unsafe impl<
8936            D: fidl::encoding::ResourceDialect,
8937            T0: fidl::encoding::Encode<u32, D>,
8938            T1: fidl::encoding::Encode<u32, D>,
8939        > fidl::encoding::Encode<SetEventMaskCmd, D> for (T0, T1)
8940    {
8941        #[inline]
8942        unsafe fn encode(
8943            self,
8944            encoder: &mut fidl::encoding::Encoder<'_, D>,
8945            offset: usize,
8946            depth: fidl::encoding::Depth,
8947        ) -> fidl::Result<()> {
8948            encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
8949            // Zero out padding regions. There's no need to apply masks
8950            // because the unmasked parts will be overwritten by fields.
8951            // Write the fields.
8952            self.0.encode(encoder, offset + 0, depth)?;
8953            self.1.encode(encoder, offset + 4, depth)?;
8954            Ok(())
8955        }
8956    }
8957
8958    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetEventMaskCmd {
8959        #[inline(always)]
8960        fn new_empty() -> Self {
8961            Self { id: fidl::new_empty!(u32, D), event_mask: fidl::new_empty!(u32, D) }
8962        }
8963
8964        #[inline]
8965        unsafe fn decode(
8966            &mut self,
8967            decoder: &mut fidl::encoding::Decoder<'_, D>,
8968            offset: usize,
8969            _depth: fidl::encoding::Depth,
8970        ) -> fidl::Result<()> {
8971            decoder.debug_check_bounds::<Self>(offset);
8972            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8973            // Verify that padding bytes are zero.
8974            // Copy from the buffer into the object.
8975            unsafe {
8976                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8977            }
8978            Ok(())
8979        }
8980    }
8981
8982    impl fidl::encoding::ValueTypeMarker for SetHitTestBehaviorCmd {
8983        type Borrowed<'a> = &'a Self;
8984        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8985            value
8986        }
8987    }
8988
8989    unsafe impl fidl::encoding::TypeMarker for SetHitTestBehaviorCmd {
8990        type Owned = Self;
8991
8992        #[inline(always)]
8993        fn inline_align(_context: fidl::encoding::Context) -> usize {
8994            4
8995        }
8996
8997        #[inline(always)]
8998        fn inline_size(_context: fidl::encoding::Context) -> usize {
8999            8
9000        }
9001    }
9002
9003    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetHitTestBehaviorCmd, D>
9004        for &SetHitTestBehaviorCmd
9005    {
9006        #[inline]
9007        unsafe fn encode(
9008            self,
9009            encoder: &mut fidl::encoding::Encoder<'_, D>,
9010            offset: usize,
9011            _depth: fidl::encoding::Depth,
9012        ) -> fidl::Result<()> {
9013            encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9014            // Delegate to tuple encoding.
9015            fidl::encoding::Encode::<SetHitTestBehaviorCmd, D>::encode(
9016                (
9017                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9018                    <HitTestBehavior as fidl::encoding::ValueTypeMarker>::borrow(
9019                        &self.hit_test_behavior,
9020                    ),
9021                ),
9022                encoder,
9023                offset,
9024                _depth,
9025            )
9026        }
9027    }
9028    unsafe impl<
9029            D: fidl::encoding::ResourceDialect,
9030            T0: fidl::encoding::Encode<u32, D>,
9031            T1: fidl::encoding::Encode<HitTestBehavior, D>,
9032        > fidl::encoding::Encode<SetHitTestBehaviorCmd, D> for (T0, T1)
9033    {
9034        #[inline]
9035        unsafe fn encode(
9036            self,
9037            encoder: &mut fidl::encoding::Encoder<'_, D>,
9038            offset: usize,
9039            depth: fidl::encoding::Depth,
9040        ) -> fidl::Result<()> {
9041            encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9042            // Zero out padding regions. There's no need to apply masks
9043            // because the unmasked parts will be overwritten by fields.
9044            // Write the fields.
9045            self.0.encode(encoder, offset + 0, depth)?;
9046            self.1.encode(encoder, offset + 4, depth)?;
9047            Ok(())
9048        }
9049    }
9050
9051    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetHitTestBehaviorCmd {
9052        #[inline(always)]
9053        fn new_empty() -> Self {
9054            Self {
9055                node_id: fidl::new_empty!(u32, D),
9056                hit_test_behavior: fidl::new_empty!(HitTestBehavior, D),
9057            }
9058        }
9059
9060        #[inline]
9061        unsafe fn decode(
9062            &mut self,
9063            decoder: &mut fidl::encoding::Decoder<'_, D>,
9064            offset: usize,
9065            _depth: fidl::encoding::Depth,
9066        ) -> fidl::Result<()> {
9067            decoder.debug_check_bounds::<Self>(offset);
9068            // Verify that padding bytes are zero.
9069            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9070            fidl::decode!(
9071                HitTestBehavior,
9072                D,
9073                &mut self.hit_test_behavior,
9074                decoder,
9075                offset + 4,
9076                _depth
9077            )?;
9078            Ok(())
9079        }
9080    }
9081
9082    impl fidl::encoding::ValueTypeMarker for SetImportFocusCmdDeprecated {
9083        type Borrowed<'a> = &'a Self;
9084        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9085            value
9086        }
9087    }
9088
9089    unsafe impl fidl::encoding::TypeMarker for SetImportFocusCmdDeprecated {
9090        type Owned = Self;
9091
9092        #[inline(always)]
9093        fn inline_align(_context: fidl::encoding::Context) -> usize {
9094            1
9095        }
9096
9097        #[inline(always)]
9098        fn inline_size(_context: fidl::encoding::Context) -> usize {
9099            1
9100        }
9101    }
9102
9103    unsafe impl<D: fidl::encoding::ResourceDialect>
9104        fidl::encoding::Encode<SetImportFocusCmdDeprecated, D> for &SetImportFocusCmdDeprecated
9105    {
9106        #[inline]
9107        unsafe fn encode(
9108            self,
9109            encoder: &mut fidl::encoding::Encoder<'_, D>,
9110            offset: usize,
9111            _depth: fidl::encoding::Depth,
9112        ) -> fidl::Result<()> {
9113            encoder.debug_check_bounds::<SetImportFocusCmdDeprecated>(offset);
9114            encoder.write_num(0u8, offset);
9115            Ok(())
9116        }
9117    }
9118
9119    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9120        for SetImportFocusCmdDeprecated
9121    {
9122        #[inline(always)]
9123        fn new_empty() -> Self {
9124            Self
9125        }
9126
9127        #[inline]
9128        unsafe fn decode(
9129            &mut self,
9130            decoder: &mut fidl::encoding::Decoder<'_, D>,
9131            offset: usize,
9132            _depth: fidl::encoding::Depth,
9133        ) -> fidl::Result<()> {
9134            decoder.debug_check_bounds::<Self>(offset);
9135            match decoder.read_num::<u8>(offset) {
9136                0 => Ok(()),
9137                _ => Err(fidl::Error::Invalid),
9138            }
9139        }
9140    }
9141
9142    impl fidl::encoding::ValueTypeMarker for SetLabelCmd {
9143        type Borrowed<'a> = &'a Self;
9144        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9145            value
9146        }
9147    }
9148
9149    unsafe impl fidl::encoding::TypeMarker for SetLabelCmd {
9150        type Owned = Self;
9151
9152        #[inline(always)]
9153        fn inline_align(_context: fidl::encoding::Context) -> usize {
9154            8
9155        }
9156
9157        #[inline(always)]
9158        fn inline_size(_context: fidl::encoding::Context) -> usize {
9159            24
9160        }
9161    }
9162
9163    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLabelCmd, D>
9164        for &SetLabelCmd
9165    {
9166        #[inline]
9167        unsafe fn encode(
9168            self,
9169            encoder: &mut fidl::encoding::Encoder<'_, D>,
9170            offset: usize,
9171            _depth: fidl::encoding::Depth,
9172        ) -> fidl::Result<()> {
9173            encoder.debug_check_bounds::<SetLabelCmd>(offset);
9174            // Delegate to tuple encoding.
9175            fidl::encoding::Encode::<SetLabelCmd, D>::encode(
9176                (
9177                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9178                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9179                        &self.label,
9180                    ),
9181                ),
9182                encoder,
9183                offset,
9184                _depth,
9185            )
9186        }
9187    }
9188    unsafe impl<
9189            D: fidl::encoding::ResourceDialect,
9190            T0: fidl::encoding::Encode<u32, D>,
9191            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9192        > fidl::encoding::Encode<SetLabelCmd, D> for (T0, T1)
9193    {
9194        #[inline]
9195        unsafe fn encode(
9196            self,
9197            encoder: &mut fidl::encoding::Encoder<'_, D>,
9198            offset: usize,
9199            depth: fidl::encoding::Depth,
9200        ) -> fidl::Result<()> {
9201            encoder.debug_check_bounds::<SetLabelCmd>(offset);
9202            // Zero out padding regions. There's no need to apply masks
9203            // because the unmasked parts will be overwritten by fields.
9204            unsafe {
9205                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9206                (ptr as *mut u64).write_unaligned(0);
9207            }
9208            // Write the fields.
9209            self.0.encode(encoder, offset + 0, depth)?;
9210            self.1.encode(encoder, offset + 8, depth)?;
9211            Ok(())
9212        }
9213    }
9214
9215    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLabelCmd {
9216        #[inline(always)]
9217        fn new_empty() -> Self {
9218            Self {
9219                id: fidl::new_empty!(u32, D),
9220                label: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9221            }
9222        }
9223
9224        #[inline]
9225        unsafe fn decode(
9226            &mut self,
9227            decoder: &mut fidl::encoding::Decoder<'_, D>,
9228            offset: usize,
9229            _depth: fidl::encoding::Depth,
9230        ) -> fidl::Result<()> {
9231            decoder.debug_check_bounds::<Self>(offset);
9232            // Verify that padding bytes are zero.
9233            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9234            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9235            let mask = 0xffffffff00000000u64;
9236            let maskedval = padval & mask;
9237            if maskedval != 0 {
9238                return Err(fidl::Error::NonZeroPadding {
9239                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9240                });
9241            }
9242            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
9243            fidl::decode!(
9244                fidl::encoding::UnboundedString,
9245                D,
9246                &mut self.label,
9247                decoder,
9248                offset + 8,
9249                _depth
9250            )?;
9251            Ok(())
9252        }
9253    }
9254
9255    impl fidl::encoding::ValueTypeMarker for SetLayerStackCmd {
9256        type Borrowed<'a> = &'a Self;
9257        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9258            value
9259        }
9260    }
9261
9262    unsafe impl fidl::encoding::TypeMarker for SetLayerStackCmd {
9263        type Owned = Self;
9264
9265        #[inline(always)]
9266        fn inline_align(_context: fidl::encoding::Context) -> usize {
9267            4
9268        }
9269
9270        #[inline(always)]
9271        fn inline_size(_context: fidl::encoding::Context) -> usize {
9272            8
9273        }
9274        #[inline(always)]
9275        fn encode_is_copy() -> bool {
9276            true
9277        }
9278
9279        #[inline(always)]
9280        fn decode_is_copy() -> bool {
9281            true
9282        }
9283    }
9284
9285    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLayerStackCmd, D>
9286        for &SetLayerStackCmd
9287    {
9288        #[inline]
9289        unsafe fn encode(
9290            self,
9291            encoder: &mut fidl::encoding::Encoder<'_, D>,
9292            offset: usize,
9293            _depth: fidl::encoding::Depth,
9294        ) -> fidl::Result<()> {
9295            encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9296            unsafe {
9297                // Copy the object into the buffer.
9298                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9299                (buf_ptr as *mut SetLayerStackCmd)
9300                    .write_unaligned((self as *const SetLayerStackCmd).read());
9301                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9302                // done second because the memcpy will write garbage to these bytes.
9303            }
9304            Ok(())
9305        }
9306    }
9307    unsafe impl<
9308            D: fidl::encoding::ResourceDialect,
9309            T0: fidl::encoding::Encode<u32, D>,
9310            T1: fidl::encoding::Encode<u32, D>,
9311        > fidl::encoding::Encode<SetLayerStackCmd, D> for (T0, T1)
9312    {
9313        #[inline]
9314        unsafe fn encode(
9315            self,
9316            encoder: &mut fidl::encoding::Encoder<'_, D>,
9317            offset: usize,
9318            depth: fidl::encoding::Depth,
9319        ) -> fidl::Result<()> {
9320            encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9321            // Zero out padding regions. There's no need to apply masks
9322            // because the unmasked parts will be overwritten by fields.
9323            // Write the fields.
9324            self.0.encode(encoder, offset + 0, depth)?;
9325            self.1.encode(encoder, offset + 4, depth)?;
9326            Ok(())
9327        }
9328    }
9329
9330    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLayerStackCmd {
9331        #[inline(always)]
9332        fn new_empty() -> Self {
9333            Self {
9334                compositor_id: fidl::new_empty!(u32, D),
9335                layer_stack_id: fidl::new_empty!(u32, D),
9336            }
9337        }
9338
9339        #[inline]
9340        unsafe fn decode(
9341            &mut self,
9342            decoder: &mut fidl::encoding::Decoder<'_, D>,
9343            offset: usize,
9344            _depth: fidl::encoding::Depth,
9345        ) -> fidl::Result<()> {
9346            decoder.debug_check_bounds::<Self>(offset);
9347            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9348            // Verify that padding bytes are zero.
9349            // Copy from the buffer into the object.
9350            unsafe {
9351                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9352            }
9353            Ok(())
9354        }
9355    }
9356
9357    impl fidl::encoding::ValueTypeMarker for SetLightColorCmd {
9358        type Borrowed<'a> = &'a Self;
9359        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9360            value
9361        }
9362    }
9363
9364    unsafe impl fidl::encoding::TypeMarker for SetLightColorCmd {
9365        type Owned = Self;
9366
9367        #[inline(always)]
9368        fn inline_align(_context: fidl::encoding::Context) -> usize {
9369            4
9370        }
9371
9372        #[inline(always)]
9373        fn inline_size(_context: fidl::encoding::Context) -> usize {
9374            20
9375        }
9376    }
9377
9378    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightColorCmd, D>
9379        for &SetLightColorCmd
9380    {
9381        #[inline]
9382        unsafe fn encode(
9383            self,
9384            encoder: &mut fidl::encoding::Encoder<'_, D>,
9385            offset: usize,
9386            _depth: fidl::encoding::Depth,
9387        ) -> fidl::Result<()> {
9388            encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9389            // Delegate to tuple encoding.
9390            fidl::encoding::Encode::<SetLightColorCmd, D>::encode(
9391                (
9392                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9393                    <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
9394                ),
9395                encoder,
9396                offset,
9397                _depth,
9398            )
9399        }
9400    }
9401    unsafe impl<
9402            D: fidl::encoding::ResourceDialect,
9403            T0: fidl::encoding::Encode<u32, D>,
9404            T1: fidl::encoding::Encode<ColorRgbValue, D>,
9405        > fidl::encoding::Encode<SetLightColorCmd, D> for (T0, T1)
9406    {
9407        #[inline]
9408        unsafe fn encode(
9409            self,
9410            encoder: &mut fidl::encoding::Encoder<'_, D>,
9411            offset: usize,
9412            depth: fidl::encoding::Depth,
9413        ) -> fidl::Result<()> {
9414            encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9415            // Zero out padding regions. There's no need to apply masks
9416            // because the unmasked parts will be overwritten by fields.
9417            // Write the fields.
9418            self.0.encode(encoder, offset + 0, depth)?;
9419            self.1.encode(encoder, offset + 4, depth)?;
9420            Ok(())
9421        }
9422    }
9423
9424    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightColorCmd {
9425        #[inline(always)]
9426        fn new_empty() -> Self {
9427            Self { light_id: fidl::new_empty!(u32, D), color: fidl::new_empty!(ColorRgbValue, D) }
9428        }
9429
9430        #[inline]
9431        unsafe fn decode(
9432            &mut self,
9433            decoder: &mut fidl::encoding::Decoder<'_, D>,
9434            offset: usize,
9435            _depth: fidl::encoding::Depth,
9436        ) -> fidl::Result<()> {
9437            decoder.debug_check_bounds::<Self>(offset);
9438            // Verify that padding bytes are zero.
9439            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9440            fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
9441            Ok(())
9442        }
9443    }
9444
9445    impl fidl::encoding::ValueTypeMarker for SetLightDirectionCmd {
9446        type Borrowed<'a> = &'a Self;
9447        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9448            value
9449        }
9450    }
9451
9452    unsafe impl fidl::encoding::TypeMarker for SetLightDirectionCmd {
9453        type Owned = Self;
9454
9455        #[inline(always)]
9456        fn inline_align(_context: fidl::encoding::Context) -> usize {
9457            4
9458        }
9459
9460        #[inline(always)]
9461        fn inline_size(_context: fidl::encoding::Context) -> usize {
9462            20
9463        }
9464    }
9465
9466    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightDirectionCmd, D>
9467        for &SetLightDirectionCmd
9468    {
9469        #[inline]
9470        unsafe fn encode(
9471            self,
9472            encoder: &mut fidl::encoding::Encoder<'_, D>,
9473            offset: usize,
9474            _depth: fidl::encoding::Depth,
9475        ) -> fidl::Result<()> {
9476            encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9477            // Delegate to tuple encoding.
9478            fidl::encoding::Encode::<SetLightDirectionCmd, D>::encode(
9479                (
9480                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9481                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.direction),
9482                ),
9483                encoder,
9484                offset,
9485                _depth,
9486            )
9487        }
9488    }
9489    unsafe impl<
9490            D: fidl::encoding::ResourceDialect,
9491            T0: fidl::encoding::Encode<u32, D>,
9492            T1: fidl::encoding::Encode<Vector3Value, D>,
9493        > fidl::encoding::Encode<SetLightDirectionCmd, D> for (T0, T1)
9494    {
9495        #[inline]
9496        unsafe fn encode(
9497            self,
9498            encoder: &mut fidl::encoding::Encoder<'_, D>,
9499            offset: usize,
9500            depth: fidl::encoding::Depth,
9501        ) -> fidl::Result<()> {
9502            encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9503            // Zero out padding regions. There's no need to apply masks
9504            // because the unmasked parts will be overwritten by fields.
9505            // Write the fields.
9506            self.0.encode(encoder, offset + 0, depth)?;
9507            self.1.encode(encoder, offset + 4, depth)?;
9508            Ok(())
9509        }
9510    }
9511
9512    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightDirectionCmd {
9513        #[inline(always)]
9514        fn new_empty() -> Self {
9515            Self {
9516                light_id: fidl::new_empty!(u32, D),
9517                direction: fidl::new_empty!(Vector3Value, D),
9518            }
9519        }
9520
9521        #[inline]
9522        unsafe fn decode(
9523            &mut self,
9524            decoder: &mut fidl::encoding::Decoder<'_, D>,
9525            offset: usize,
9526            _depth: fidl::encoding::Depth,
9527        ) -> fidl::Result<()> {
9528            decoder.debug_check_bounds::<Self>(offset);
9529            // Verify that padding bytes are zero.
9530            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9531            fidl::decode!(Vector3Value, D, &mut self.direction, decoder, offset + 4, _depth)?;
9532            Ok(())
9533        }
9534    }
9535
9536    impl fidl::encoding::ValueTypeMarker for SetMaterialCmd {
9537        type Borrowed<'a> = &'a Self;
9538        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9539            value
9540        }
9541    }
9542
9543    unsafe impl fidl::encoding::TypeMarker for SetMaterialCmd {
9544        type Owned = Self;
9545
9546        #[inline(always)]
9547        fn inline_align(_context: fidl::encoding::Context) -> usize {
9548            4
9549        }
9550
9551        #[inline(always)]
9552        fn inline_size(_context: fidl::encoding::Context) -> usize {
9553            8
9554        }
9555        #[inline(always)]
9556        fn encode_is_copy() -> bool {
9557            true
9558        }
9559
9560        #[inline(always)]
9561        fn decode_is_copy() -> bool {
9562            true
9563        }
9564    }
9565
9566    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetMaterialCmd, D>
9567        for &SetMaterialCmd
9568    {
9569        #[inline]
9570        unsafe fn encode(
9571            self,
9572            encoder: &mut fidl::encoding::Encoder<'_, D>,
9573            offset: usize,
9574            _depth: fidl::encoding::Depth,
9575        ) -> fidl::Result<()> {
9576            encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9577            unsafe {
9578                // Copy the object into the buffer.
9579                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9580                (buf_ptr as *mut SetMaterialCmd)
9581                    .write_unaligned((self as *const SetMaterialCmd).read());
9582                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9583                // done second because the memcpy will write garbage to these bytes.
9584            }
9585            Ok(())
9586        }
9587    }
9588    unsafe impl<
9589            D: fidl::encoding::ResourceDialect,
9590            T0: fidl::encoding::Encode<u32, D>,
9591            T1: fidl::encoding::Encode<u32, D>,
9592        > fidl::encoding::Encode<SetMaterialCmd, D> for (T0, T1)
9593    {
9594        #[inline]
9595        unsafe fn encode(
9596            self,
9597            encoder: &mut fidl::encoding::Encoder<'_, D>,
9598            offset: usize,
9599            depth: fidl::encoding::Depth,
9600        ) -> fidl::Result<()> {
9601            encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9602            // Zero out padding regions. There's no need to apply masks
9603            // because the unmasked parts will be overwritten by fields.
9604            // Write the fields.
9605            self.0.encode(encoder, offset + 0, depth)?;
9606            self.1.encode(encoder, offset + 4, depth)?;
9607            Ok(())
9608        }
9609    }
9610
9611    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetMaterialCmd {
9612        #[inline(always)]
9613        fn new_empty() -> Self {
9614            Self { node_id: fidl::new_empty!(u32, D), material_id: fidl::new_empty!(u32, D) }
9615        }
9616
9617        #[inline]
9618        unsafe fn decode(
9619            &mut self,
9620            decoder: &mut fidl::encoding::Decoder<'_, D>,
9621            offset: usize,
9622            _depth: fidl::encoding::Depth,
9623        ) -> fidl::Result<()> {
9624            decoder.debug_check_bounds::<Self>(offset);
9625            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9626            // Verify that padding bytes are zero.
9627            // Copy from the buffer into the object.
9628            unsafe {
9629                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9630            }
9631            Ok(())
9632        }
9633    }
9634
9635    impl fidl::encoding::ValueTypeMarker for SetOpacityCmd {
9636        type Borrowed<'a> = &'a Self;
9637        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9638            value
9639        }
9640    }
9641
9642    unsafe impl fidl::encoding::TypeMarker for SetOpacityCmd {
9643        type Owned = Self;
9644
9645        #[inline(always)]
9646        fn inline_align(_context: fidl::encoding::Context) -> usize {
9647            4
9648        }
9649
9650        #[inline(always)]
9651        fn inline_size(_context: fidl::encoding::Context) -> usize {
9652            8
9653        }
9654    }
9655
9656    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetOpacityCmd, D>
9657        for &SetOpacityCmd
9658    {
9659        #[inline]
9660        unsafe fn encode(
9661            self,
9662            encoder: &mut fidl::encoding::Encoder<'_, D>,
9663            offset: usize,
9664            _depth: fidl::encoding::Depth,
9665        ) -> fidl::Result<()> {
9666            encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9667            // Delegate to tuple encoding.
9668            fidl::encoding::Encode::<SetOpacityCmd, D>::encode(
9669                (
9670                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9671                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.opacity),
9672                ),
9673                encoder,
9674                offset,
9675                _depth,
9676            )
9677        }
9678    }
9679    unsafe impl<
9680            D: fidl::encoding::ResourceDialect,
9681            T0: fidl::encoding::Encode<u32, D>,
9682            T1: fidl::encoding::Encode<f32, D>,
9683        > fidl::encoding::Encode<SetOpacityCmd, D> for (T0, T1)
9684    {
9685        #[inline]
9686        unsafe fn encode(
9687            self,
9688            encoder: &mut fidl::encoding::Encoder<'_, D>,
9689            offset: usize,
9690            depth: fidl::encoding::Depth,
9691        ) -> fidl::Result<()> {
9692            encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9693            // Zero out padding regions. There's no need to apply masks
9694            // because the unmasked parts will be overwritten by fields.
9695            // Write the fields.
9696            self.0.encode(encoder, offset + 0, depth)?;
9697            self.1.encode(encoder, offset + 4, depth)?;
9698            Ok(())
9699        }
9700    }
9701
9702    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetOpacityCmd {
9703        #[inline(always)]
9704        fn new_empty() -> Self {
9705            Self { node_id: fidl::new_empty!(u32, D), opacity: fidl::new_empty!(f32, D) }
9706        }
9707
9708        #[inline]
9709        unsafe fn decode(
9710            &mut self,
9711            decoder: &mut fidl::encoding::Decoder<'_, D>,
9712            offset: usize,
9713            _depth: fidl::encoding::Depth,
9714        ) -> fidl::Result<()> {
9715            decoder.debug_check_bounds::<Self>(offset);
9716            // Verify that padding bytes are zero.
9717            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9718            fidl::decode!(f32, D, &mut self.opacity, decoder, offset + 4, _depth)?;
9719            Ok(())
9720        }
9721    }
9722
9723    impl fidl::encoding::ValueTypeMarker for SetPointLightFalloffCmd {
9724        type Borrowed<'a> = &'a Self;
9725        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9726            value
9727        }
9728    }
9729
9730    unsafe impl fidl::encoding::TypeMarker for SetPointLightFalloffCmd {
9731        type Owned = Self;
9732
9733        #[inline(always)]
9734        fn inline_align(_context: fidl::encoding::Context) -> usize {
9735            4
9736        }
9737
9738        #[inline(always)]
9739        fn inline_size(_context: fidl::encoding::Context) -> usize {
9740            12
9741        }
9742    }
9743
9744    unsafe impl<D: fidl::encoding::ResourceDialect>
9745        fidl::encoding::Encode<SetPointLightFalloffCmd, D> for &SetPointLightFalloffCmd
9746    {
9747        #[inline]
9748        unsafe fn encode(
9749            self,
9750            encoder: &mut fidl::encoding::Encoder<'_, D>,
9751            offset: usize,
9752            _depth: fidl::encoding::Depth,
9753        ) -> fidl::Result<()> {
9754            encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9755            // Delegate to tuple encoding.
9756            fidl::encoding::Encode::<SetPointLightFalloffCmd, D>::encode(
9757                (
9758                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9759                    <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.falloff),
9760                ),
9761                encoder,
9762                offset,
9763                _depth,
9764            )
9765        }
9766    }
9767    unsafe impl<
9768            D: fidl::encoding::ResourceDialect,
9769            T0: fidl::encoding::Encode<u32, D>,
9770            T1: fidl::encoding::Encode<FloatValue, D>,
9771        > fidl::encoding::Encode<SetPointLightFalloffCmd, D> for (T0, T1)
9772    {
9773        #[inline]
9774        unsafe fn encode(
9775            self,
9776            encoder: &mut fidl::encoding::Encoder<'_, D>,
9777            offset: usize,
9778            depth: fidl::encoding::Depth,
9779        ) -> fidl::Result<()> {
9780            encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9781            // Zero out padding regions. There's no need to apply masks
9782            // because the unmasked parts will be overwritten by fields.
9783            // Write the fields.
9784            self.0.encode(encoder, offset + 0, depth)?;
9785            self.1.encode(encoder, offset + 4, depth)?;
9786            Ok(())
9787        }
9788    }
9789
9790    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9791        for SetPointLightFalloffCmd
9792    {
9793        #[inline(always)]
9794        fn new_empty() -> Self {
9795            Self { light_id: fidl::new_empty!(u32, D), falloff: fidl::new_empty!(FloatValue, D) }
9796        }
9797
9798        #[inline]
9799        unsafe fn decode(
9800            &mut self,
9801            decoder: &mut fidl::encoding::Decoder<'_, D>,
9802            offset: usize,
9803            _depth: fidl::encoding::Depth,
9804        ) -> fidl::Result<()> {
9805            decoder.debug_check_bounds::<Self>(offset);
9806            // Verify that padding bytes are zero.
9807            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9808            fidl::decode!(FloatValue, D, &mut self.falloff, decoder, offset + 4, _depth)?;
9809            Ok(())
9810        }
9811    }
9812
9813    impl fidl::encoding::ValueTypeMarker for SetPointLightPositionCmd {
9814        type Borrowed<'a> = &'a Self;
9815        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9816            value
9817        }
9818    }
9819
9820    unsafe impl fidl::encoding::TypeMarker for SetPointLightPositionCmd {
9821        type Owned = Self;
9822
9823        #[inline(always)]
9824        fn inline_align(_context: fidl::encoding::Context) -> usize {
9825            4
9826        }
9827
9828        #[inline(always)]
9829        fn inline_size(_context: fidl::encoding::Context) -> usize {
9830            20
9831        }
9832    }
9833
9834    unsafe impl<D: fidl::encoding::ResourceDialect>
9835        fidl::encoding::Encode<SetPointLightPositionCmd, D> for &SetPointLightPositionCmd
9836    {
9837        #[inline]
9838        unsafe fn encode(
9839            self,
9840            encoder: &mut fidl::encoding::Encoder<'_, D>,
9841            offset: usize,
9842            _depth: fidl::encoding::Depth,
9843        ) -> fidl::Result<()> {
9844            encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9845            // Delegate to tuple encoding.
9846            fidl::encoding::Encode::<SetPointLightPositionCmd, D>::encode(
9847                (
9848                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9849                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.position),
9850                ),
9851                encoder,
9852                offset,
9853                _depth,
9854            )
9855        }
9856    }
9857    unsafe impl<
9858            D: fidl::encoding::ResourceDialect,
9859            T0: fidl::encoding::Encode<u32, D>,
9860            T1: fidl::encoding::Encode<Vector3Value, D>,
9861        > fidl::encoding::Encode<SetPointLightPositionCmd, D> for (T0, T1)
9862    {
9863        #[inline]
9864        unsafe fn encode(
9865            self,
9866            encoder: &mut fidl::encoding::Encoder<'_, D>,
9867            offset: usize,
9868            depth: fidl::encoding::Depth,
9869        ) -> fidl::Result<()> {
9870            encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9871            // Zero out padding regions. There's no need to apply masks
9872            // because the unmasked parts will be overwritten by fields.
9873            // Write the fields.
9874            self.0.encode(encoder, offset + 0, depth)?;
9875            self.1.encode(encoder, offset + 4, depth)?;
9876            Ok(())
9877        }
9878    }
9879
9880    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9881        for SetPointLightPositionCmd
9882    {
9883        #[inline(always)]
9884        fn new_empty() -> Self {
9885            Self { light_id: fidl::new_empty!(u32, D), position: fidl::new_empty!(Vector3Value, D) }
9886        }
9887
9888        #[inline]
9889        unsafe fn decode(
9890            &mut self,
9891            decoder: &mut fidl::encoding::Decoder<'_, D>,
9892            offset: usize,
9893            _depth: fidl::encoding::Depth,
9894        ) -> fidl::Result<()> {
9895            decoder.debug_check_bounds::<Self>(offset);
9896            // Verify that padding bytes are zero.
9897            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9898            fidl::decode!(Vector3Value, D, &mut self.position, decoder, offset + 4, _depth)?;
9899            Ok(())
9900        }
9901    }
9902
9903    impl fidl::encoding::ValueTypeMarker for SetRendererCmd {
9904        type Borrowed<'a> = &'a Self;
9905        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9906            value
9907        }
9908    }
9909
9910    unsafe impl fidl::encoding::TypeMarker for SetRendererCmd {
9911        type Owned = Self;
9912
9913        #[inline(always)]
9914        fn inline_align(_context: fidl::encoding::Context) -> usize {
9915            4
9916        }
9917
9918        #[inline(always)]
9919        fn inline_size(_context: fidl::encoding::Context) -> usize {
9920            8
9921        }
9922        #[inline(always)]
9923        fn encode_is_copy() -> bool {
9924            true
9925        }
9926
9927        #[inline(always)]
9928        fn decode_is_copy() -> bool {
9929            true
9930        }
9931    }
9932
9933    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererCmd, D>
9934        for &SetRendererCmd
9935    {
9936        #[inline]
9937        unsafe fn encode(
9938            self,
9939            encoder: &mut fidl::encoding::Encoder<'_, D>,
9940            offset: usize,
9941            _depth: fidl::encoding::Depth,
9942        ) -> fidl::Result<()> {
9943            encoder.debug_check_bounds::<SetRendererCmd>(offset);
9944            unsafe {
9945                // Copy the object into the buffer.
9946                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9947                (buf_ptr as *mut SetRendererCmd)
9948                    .write_unaligned((self as *const SetRendererCmd).read());
9949                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9950                // done second because the memcpy will write garbage to these bytes.
9951            }
9952            Ok(())
9953        }
9954    }
9955    unsafe impl<
9956            D: fidl::encoding::ResourceDialect,
9957            T0: fidl::encoding::Encode<u32, D>,
9958            T1: fidl::encoding::Encode<u32, D>,
9959        > fidl::encoding::Encode<SetRendererCmd, D> for (T0, T1)
9960    {
9961        #[inline]
9962        unsafe fn encode(
9963            self,
9964            encoder: &mut fidl::encoding::Encoder<'_, D>,
9965            offset: usize,
9966            depth: fidl::encoding::Depth,
9967        ) -> fidl::Result<()> {
9968            encoder.debug_check_bounds::<SetRendererCmd>(offset);
9969            // Zero out padding regions. There's no need to apply masks
9970            // because the unmasked parts will be overwritten by fields.
9971            // Write the fields.
9972            self.0.encode(encoder, offset + 0, depth)?;
9973            self.1.encode(encoder, offset + 4, depth)?;
9974            Ok(())
9975        }
9976    }
9977
9978    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererCmd {
9979        #[inline(always)]
9980        fn new_empty() -> Self {
9981            Self { layer_id: fidl::new_empty!(u32, D), renderer_id: fidl::new_empty!(u32, D) }
9982        }
9983
9984        #[inline]
9985        unsafe fn decode(
9986            &mut self,
9987            decoder: &mut fidl::encoding::Decoder<'_, D>,
9988            offset: usize,
9989            _depth: fidl::encoding::Depth,
9990        ) -> fidl::Result<()> {
9991            decoder.debug_check_bounds::<Self>(offset);
9992            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9993            // Verify that padding bytes are zero.
9994            // Copy from the buffer into the object.
9995            unsafe {
9996                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9997            }
9998            Ok(())
9999        }
10000    }
10001
10002    impl fidl::encoding::ValueTypeMarker for SetRendererParamCmd {
10003        type Borrowed<'a> = &'a Self;
10004        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10005            value
10006        }
10007    }
10008
10009    unsafe impl fidl::encoding::TypeMarker for SetRendererParamCmd {
10010        type Owned = Self;
10011
10012        #[inline(always)]
10013        fn inline_align(_context: fidl::encoding::Context) -> usize {
10014            8
10015        }
10016
10017        #[inline(always)]
10018        fn inline_size(_context: fidl::encoding::Context) -> usize {
10019            24
10020        }
10021    }
10022
10023    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererParamCmd, D>
10024        for &SetRendererParamCmd
10025    {
10026        #[inline]
10027        unsafe fn encode(
10028            self,
10029            encoder: &mut fidl::encoding::Encoder<'_, D>,
10030            offset: usize,
10031            _depth: fidl::encoding::Depth,
10032        ) -> fidl::Result<()> {
10033            encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10034            // Delegate to tuple encoding.
10035            fidl::encoding::Encode::<SetRendererParamCmd, D>::encode(
10036                (
10037                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
10038                    <RendererParam as fidl::encoding::ValueTypeMarker>::borrow(&self.param),
10039                ),
10040                encoder,
10041                offset,
10042                _depth,
10043            )
10044        }
10045    }
10046    unsafe impl<
10047            D: fidl::encoding::ResourceDialect,
10048            T0: fidl::encoding::Encode<u32, D>,
10049            T1: fidl::encoding::Encode<RendererParam, D>,
10050        > fidl::encoding::Encode<SetRendererParamCmd, D> for (T0, T1)
10051    {
10052        #[inline]
10053        unsafe fn encode(
10054            self,
10055            encoder: &mut fidl::encoding::Encoder<'_, D>,
10056            offset: usize,
10057            depth: fidl::encoding::Depth,
10058        ) -> fidl::Result<()> {
10059            encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10060            // Zero out padding regions. There's no need to apply masks
10061            // because the unmasked parts will be overwritten by fields.
10062            unsafe {
10063                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10064                (ptr as *mut u64).write_unaligned(0);
10065            }
10066            // Write the fields.
10067            self.0.encode(encoder, offset + 0, depth)?;
10068            self.1.encode(encoder, offset + 8, depth)?;
10069            Ok(())
10070        }
10071    }
10072
10073    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererParamCmd {
10074        #[inline(always)]
10075        fn new_empty() -> Self {
10076            Self {
10077                renderer_id: fidl::new_empty!(u32, D),
10078                param: fidl::new_empty!(RendererParam, D),
10079            }
10080        }
10081
10082        #[inline]
10083        unsafe fn decode(
10084            &mut self,
10085            decoder: &mut fidl::encoding::Decoder<'_, D>,
10086            offset: usize,
10087            _depth: fidl::encoding::Depth,
10088        ) -> fidl::Result<()> {
10089            decoder.debug_check_bounds::<Self>(offset);
10090            // Verify that padding bytes are zero.
10091            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10092            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10093            let mask = 0xffffffff00000000u64;
10094            let maskedval = padval & mask;
10095            if maskedval != 0 {
10096                return Err(fidl::Error::NonZeroPadding {
10097                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10098                });
10099            }
10100            fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
10101            fidl::decode!(RendererParam, D, &mut self.param, decoder, offset + 8, _depth)?;
10102            Ok(())
10103        }
10104    }
10105
10106    impl fidl::encoding::ValueTypeMarker for SetRotationCmd {
10107        type Borrowed<'a> = &'a Self;
10108        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10109            value
10110        }
10111    }
10112
10113    unsafe impl fidl::encoding::TypeMarker for SetRotationCmd {
10114        type Owned = Self;
10115
10116        #[inline(always)]
10117        fn inline_align(_context: fidl::encoding::Context) -> usize {
10118            4
10119        }
10120
10121        #[inline(always)]
10122        fn inline_size(_context: fidl::encoding::Context) -> usize {
10123            24
10124        }
10125    }
10126
10127    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRotationCmd, D>
10128        for &SetRotationCmd
10129    {
10130        #[inline]
10131        unsafe fn encode(
10132            self,
10133            encoder: &mut fidl::encoding::Encoder<'_, D>,
10134            offset: usize,
10135            _depth: fidl::encoding::Depth,
10136        ) -> fidl::Result<()> {
10137            encoder.debug_check_bounds::<SetRotationCmd>(offset);
10138            // Delegate to tuple encoding.
10139            fidl::encoding::Encode::<SetRotationCmd, D>::encode(
10140                (
10141                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10142                    <QuaternionValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10143                ),
10144                encoder,
10145                offset,
10146                _depth,
10147            )
10148        }
10149    }
10150    unsafe impl<
10151            D: fidl::encoding::ResourceDialect,
10152            T0: fidl::encoding::Encode<u32, D>,
10153            T1: fidl::encoding::Encode<QuaternionValue, D>,
10154        > fidl::encoding::Encode<SetRotationCmd, D> for (T0, T1)
10155    {
10156        #[inline]
10157        unsafe fn encode(
10158            self,
10159            encoder: &mut fidl::encoding::Encoder<'_, D>,
10160            offset: usize,
10161            depth: fidl::encoding::Depth,
10162        ) -> fidl::Result<()> {
10163            encoder.debug_check_bounds::<SetRotationCmd>(offset);
10164            // Zero out padding regions. There's no need to apply masks
10165            // because the unmasked parts will be overwritten by fields.
10166            // Write the fields.
10167            self.0.encode(encoder, offset + 0, depth)?;
10168            self.1.encode(encoder, offset + 4, depth)?;
10169            Ok(())
10170        }
10171    }
10172
10173    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRotationCmd {
10174        #[inline(always)]
10175        fn new_empty() -> Self {
10176            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(QuaternionValue, D) }
10177        }
10178
10179        #[inline]
10180        unsafe fn decode(
10181            &mut self,
10182            decoder: &mut fidl::encoding::Decoder<'_, D>,
10183            offset: usize,
10184            _depth: fidl::encoding::Depth,
10185        ) -> fidl::Result<()> {
10186            decoder.debug_check_bounds::<Self>(offset);
10187            // Verify that padding bytes are zero.
10188            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10189            fidl::decode!(QuaternionValue, D, &mut self.value, decoder, offset + 4, _depth)?;
10190            Ok(())
10191        }
10192    }
10193
10194    impl fidl::encoding::ValueTypeMarker for SetScaleCmd {
10195        type Borrowed<'a> = &'a Self;
10196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10197            value
10198        }
10199    }
10200
10201    unsafe impl fidl::encoding::TypeMarker for SetScaleCmd {
10202        type Owned = Self;
10203
10204        #[inline(always)]
10205        fn inline_align(_context: fidl::encoding::Context) -> usize {
10206            4
10207        }
10208
10209        #[inline(always)]
10210        fn inline_size(_context: fidl::encoding::Context) -> usize {
10211            20
10212        }
10213    }
10214
10215    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetScaleCmd, D>
10216        for &SetScaleCmd
10217    {
10218        #[inline]
10219        unsafe fn encode(
10220            self,
10221            encoder: &mut fidl::encoding::Encoder<'_, D>,
10222            offset: usize,
10223            _depth: fidl::encoding::Depth,
10224        ) -> fidl::Result<()> {
10225            encoder.debug_check_bounds::<SetScaleCmd>(offset);
10226            // Delegate to tuple encoding.
10227            fidl::encoding::Encode::<SetScaleCmd, D>::encode(
10228                (
10229                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10230                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10231                ),
10232                encoder,
10233                offset,
10234                _depth,
10235            )
10236        }
10237    }
10238    unsafe impl<
10239            D: fidl::encoding::ResourceDialect,
10240            T0: fidl::encoding::Encode<u32, D>,
10241            T1: fidl::encoding::Encode<Vector3Value, D>,
10242        > fidl::encoding::Encode<SetScaleCmd, D> for (T0, T1)
10243    {
10244        #[inline]
10245        unsafe fn encode(
10246            self,
10247            encoder: &mut fidl::encoding::Encoder<'_, D>,
10248            offset: usize,
10249            depth: fidl::encoding::Depth,
10250        ) -> fidl::Result<()> {
10251            encoder.debug_check_bounds::<SetScaleCmd>(offset);
10252            // Zero out padding regions. There's no need to apply masks
10253            // because the unmasked parts will be overwritten by fields.
10254            // Write the fields.
10255            self.0.encode(encoder, offset + 0, depth)?;
10256            self.1.encode(encoder, offset + 4, depth)?;
10257            Ok(())
10258        }
10259    }
10260
10261    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetScaleCmd {
10262        #[inline(always)]
10263        fn new_empty() -> Self {
10264            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
10265        }
10266
10267        #[inline]
10268        unsafe fn decode(
10269            &mut self,
10270            decoder: &mut fidl::encoding::Decoder<'_, D>,
10271            offset: usize,
10272            _depth: fidl::encoding::Depth,
10273        ) -> fidl::Result<()> {
10274            decoder.debug_check_bounds::<Self>(offset);
10275            // Verify that padding bytes are zero.
10276            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10277            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10278            Ok(())
10279        }
10280    }
10281
10282    impl fidl::encoding::ValueTypeMarker for SetSemanticVisibilityCmd {
10283        type Borrowed<'a> = &'a Self;
10284        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10285            value
10286        }
10287    }
10288
10289    unsafe impl fidl::encoding::TypeMarker for SetSemanticVisibilityCmd {
10290        type Owned = Self;
10291
10292        #[inline(always)]
10293        fn inline_align(_context: fidl::encoding::Context) -> usize {
10294            4
10295        }
10296
10297        #[inline(always)]
10298        fn inline_size(_context: fidl::encoding::Context) -> usize {
10299            8
10300        }
10301    }
10302
10303    unsafe impl<D: fidl::encoding::ResourceDialect>
10304        fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for &SetSemanticVisibilityCmd
10305    {
10306        #[inline]
10307        unsafe fn encode(
10308            self,
10309            encoder: &mut fidl::encoding::Encoder<'_, D>,
10310            offset: usize,
10311            _depth: fidl::encoding::Depth,
10312        ) -> fidl::Result<()> {
10313            encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10314            // Delegate to tuple encoding.
10315            fidl::encoding::Encode::<SetSemanticVisibilityCmd, D>::encode(
10316                (
10317                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
10318                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.visible),
10319                ),
10320                encoder,
10321                offset,
10322                _depth,
10323            )
10324        }
10325    }
10326    unsafe impl<
10327            D: fidl::encoding::ResourceDialect,
10328            T0: fidl::encoding::Encode<u32, D>,
10329            T1: fidl::encoding::Encode<bool, D>,
10330        > fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for (T0, T1)
10331    {
10332        #[inline]
10333        unsafe fn encode(
10334            self,
10335            encoder: &mut fidl::encoding::Encoder<'_, D>,
10336            offset: usize,
10337            depth: fidl::encoding::Depth,
10338        ) -> fidl::Result<()> {
10339            encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10340            // Zero out padding regions. There's no need to apply masks
10341            // because the unmasked parts will be overwritten by fields.
10342            unsafe {
10343                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
10344                (ptr as *mut u32).write_unaligned(0);
10345            }
10346            // Write the fields.
10347            self.0.encode(encoder, offset + 0, depth)?;
10348            self.1.encode(encoder, offset + 4, depth)?;
10349            Ok(())
10350        }
10351    }
10352
10353    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10354        for SetSemanticVisibilityCmd
10355    {
10356        #[inline(always)]
10357        fn new_empty() -> Self {
10358            Self { node_id: fidl::new_empty!(u32, D), visible: fidl::new_empty!(bool, D) }
10359        }
10360
10361        #[inline]
10362        unsafe fn decode(
10363            &mut self,
10364            decoder: &mut fidl::encoding::Decoder<'_, D>,
10365            offset: usize,
10366            _depth: fidl::encoding::Depth,
10367        ) -> fidl::Result<()> {
10368            decoder.debug_check_bounds::<Self>(offset);
10369            // Verify that padding bytes are zero.
10370            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
10371            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10372            let mask = 0xffffff00u32;
10373            let maskedval = padval & mask;
10374            if maskedval != 0 {
10375                return Err(fidl::Error::NonZeroPadding {
10376                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
10377                });
10378            }
10379            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
10380            fidl::decode!(bool, D, &mut self.visible, decoder, offset + 4, _depth)?;
10381            Ok(())
10382        }
10383    }
10384
10385    impl fidl::encoding::ValueTypeMarker for SetShapeCmd {
10386        type Borrowed<'a> = &'a Self;
10387        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10388            value
10389        }
10390    }
10391
10392    unsafe impl fidl::encoding::TypeMarker for SetShapeCmd {
10393        type Owned = Self;
10394
10395        #[inline(always)]
10396        fn inline_align(_context: fidl::encoding::Context) -> usize {
10397            4
10398        }
10399
10400        #[inline(always)]
10401        fn inline_size(_context: fidl::encoding::Context) -> usize {
10402            8
10403        }
10404        #[inline(always)]
10405        fn encode_is_copy() -> bool {
10406            true
10407        }
10408
10409        #[inline(always)]
10410        fn decode_is_copy() -> bool {
10411            true
10412        }
10413    }
10414
10415    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetShapeCmd, D>
10416        for &SetShapeCmd
10417    {
10418        #[inline]
10419        unsafe fn encode(
10420            self,
10421            encoder: &mut fidl::encoding::Encoder<'_, D>,
10422            offset: usize,
10423            _depth: fidl::encoding::Depth,
10424        ) -> fidl::Result<()> {
10425            encoder.debug_check_bounds::<SetShapeCmd>(offset);
10426            unsafe {
10427                // Copy the object into the buffer.
10428                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10429                (buf_ptr as *mut SetShapeCmd).write_unaligned((self as *const SetShapeCmd).read());
10430                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10431                // done second because the memcpy will write garbage to these bytes.
10432            }
10433            Ok(())
10434        }
10435    }
10436    unsafe impl<
10437            D: fidl::encoding::ResourceDialect,
10438            T0: fidl::encoding::Encode<u32, D>,
10439            T1: fidl::encoding::Encode<u32, D>,
10440        > fidl::encoding::Encode<SetShapeCmd, D> for (T0, T1)
10441    {
10442        #[inline]
10443        unsafe fn encode(
10444            self,
10445            encoder: &mut fidl::encoding::Encoder<'_, D>,
10446            offset: usize,
10447            depth: fidl::encoding::Depth,
10448        ) -> fidl::Result<()> {
10449            encoder.debug_check_bounds::<SetShapeCmd>(offset);
10450            // Zero out padding regions. There's no need to apply masks
10451            // because the unmasked parts will be overwritten by fields.
10452            // Write the fields.
10453            self.0.encode(encoder, offset + 0, depth)?;
10454            self.1.encode(encoder, offset + 4, depth)?;
10455            Ok(())
10456        }
10457    }
10458
10459    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetShapeCmd {
10460        #[inline(always)]
10461        fn new_empty() -> Self {
10462            Self { node_id: fidl::new_empty!(u32, D), shape_id: fidl::new_empty!(u32, D) }
10463        }
10464
10465        #[inline]
10466        unsafe fn decode(
10467            &mut self,
10468            decoder: &mut fidl::encoding::Decoder<'_, D>,
10469            offset: usize,
10470            _depth: fidl::encoding::Depth,
10471        ) -> fidl::Result<()> {
10472            decoder.debug_check_bounds::<Self>(offset);
10473            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10474            // Verify that padding bytes are zero.
10475            // Copy from the buffer into the object.
10476            unsafe {
10477                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10478            }
10479            Ok(())
10480        }
10481    }
10482
10483    impl fidl::encoding::ValueTypeMarker for SetSizeCmd {
10484        type Borrowed<'a> = &'a Self;
10485        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10486            value
10487        }
10488    }
10489
10490    unsafe impl fidl::encoding::TypeMarker for SetSizeCmd {
10491        type Owned = Self;
10492
10493        #[inline(always)]
10494        fn inline_align(_context: fidl::encoding::Context) -> usize {
10495            4
10496        }
10497
10498        #[inline(always)]
10499        fn inline_size(_context: fidl::encoding::Context) -> usize {
10500            16
10501        }
10502    }
10503
10504    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetSizeCmd, D>
10505        for &SetSizeCmd
10506    {
10507        #[inline]
10508        unsafe fn encode(
10509            self,
10510            encoder: &mut fidl::encoding::Encoder<'_, D>,
10511            offset: usize,
10512            _depth: fidl::encoding::Depth,
10513        ) -> fidl::Result<()> {
10514            encoder.debug_check_bounds::<SetSizeCmd>(offset);
10515            // Delegate to tuple encoding.
10516            fidl::encoding::Encode::<SetSizeCmd, D>::encode(
10517                (
10518                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10519                    <Vector2Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10520                ),
10521                encoder,
10522                offset,
10523                _depth,
10524            )
10525        }
10526    }
10527    unsafe impl<
10528            D: fidl::encoding::ResourceDialect,
10529            T0: fidl::encoding::Encode<u32, D>,
10530            T1: fidl::encoding::Encode<Vector2Value, D>,
10531        > fidl::encoding::Encode<SetSizeCmd, D> for (T0, T1)
10532    {
10533        #[inline]
10534        unsafe fn encode(
10535            self,
10536            encoder: &mut fidl::encoding::Encoder<'_, D>,
10537            offset: usize,
10538            depth: fidl::encoding::Depth,
10539        ) -> fidl::Result<()> {
10540            encoder.debug_check_bounds::<SetSizeCmd>(offset);
10541            // Zero out padding regions. There's no need to apply masks
10542            // because the unmasked parts will be overwritten by fields.
10543            // Write the fields.
10544            self.0.encode(encoder, offset + 0, depth)?;
10545            self.1.encode(encoder, offset + 4, depth)?;
10546            Ok(())
10547        }
10548    }
10549
10550    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetSizeCmd {
10551        #[inline(always)]
10552        fn new_empty() -> Self {
10553            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector2Value, D) }
10554        }
10555
10556        #[inline]
10557        unsafe fn decode(
10558            &mut self,
10559            decoder: &mut fidl::encoding::Decoder<'_, D>,
10560            offset: usize,
10561            _depth: fidl::encoding::Depth,
10562        ) -> fidl::Result<()> {
10563            decoder.debug_check_bounds::<Self>(offset);
10564            // Verify that padding bytes are zero.
10565            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10566            fidl::decode!(Vector2Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10567            Ok(())
10568        }
10569    }
10570
10571    impl fidl::encoding::ValueTypeMarker for SetStereoCameraProjectionCmd {
10572        type Borrowed<'a> = &'a Self;
10573        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10574            value
10575        }
10576    }
10577
10578    unsafe impl fidl::encoding::TypeMarker for SetStereoCameraProjectionCmd {
10579        type Owned = Self;
10580
10581        #[inline(always)]
10582        fn inline_align(_context: fidl::encoding::Context) -> usize {
10583            4
10584        }
10585
10586        #[inline(always)]
10587        fn inline_size(_context: fidl::encoding::Context) -> usize {
10588            140
10589        }
10590    }
10591
10592    unsafe impl<D: fidl::encoding::ResourceDialect>
10593        fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for &SetStereoCameraProjectionCmd
10594    {
10595        #[inline]
10596        unsafe fn encode(
10597            self,
10598            encoder: &mut fidl::encoding::Encoder<'_, D>,
10599            offset: usize,
10600            _depth: fidl::encoding::Depth,
10601        ) -> fidl::Result<()> {
10602            encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10603            // Delegate to tuple encoding.
10604            fidl::encoding::Encode::<SetStereoCameraProjectionCmd, D>::encode(
10605                (
10606                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
10607                    <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10608                        &self.left_projection,
10609                    ),
10610                    <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10611                        &self.right_projection,
10612                    ),
10613                ),
10614                encoder,
10615                offset,
10616                _depth,
10617            )
10618        }
10619    }
10620    unsafe impl<
10621            D: fidl::encoding::ResourceDialect,
10622            T0: fidl::encoding::Encode<u32, D>,
10623            T1: fidl::encoding::Encode<Matrix4Value, D>,
10624            T2: fidl::encoding::Encode<Matrix4Value, D>,
10625        > fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for (T0, T1, T2)
10626    {
10627        #[inline]
10628        unsafe fn encode(
10629            self,
10630            encoder: &mut fidl::encoding::Encoder<'_, D>,
10631            offset: usize,
10632            depth: fidl::encoding::Depth,
10633        ) -> fidl::Result<()> {
10634            encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10635            // Zero out padding regions. There's no need to apply masks
10636            // because the unmasked parts will be overwritten by fields.
10637            // Write the fields.
10638            self.0.encode(encoder, offset + 0, depth)?;
10639            self.1.encode(encoder, offset + 4, depth)?;
10640            self.2.encode(encoder, offset + 72, depth)?;
10641            Ok(())
10642        }
10643    }
10644
10645    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10646        for SetStereoCameraProjectionCmd
10647    {
10648        #[inline(always)]
10649        fn new_empty() -> Self {
10650            Self {
10651                camera_id: fidl::new_empty!(u32, D),
10652                left_projection: fidl::new_empty!(Matrix4Value, D),
10653                right_projection: fidl::new_empty!(Matrix4Value, D),
10654            }
10655        }
10656
10657        #[inline]
10658        unsafe fn decode(
10659            &mut self,
10660            decoder: &mut fidl::encoding::Decoder<'_, D>,
10661            offset: usize,
10662            _depth: fidl::encoding::Depth,
10663        ) -> fidl::Result<()> {
10664            decoder.debug_check_bounds::<Self>(offset);
10665            // Verify that padding bytes are zero.
10666            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
10667            fidl::decode!(Matrix4Value, D, &mut self.left_projection, decoder, offset + 4, _depth)?;
10668            fidl::decode!(
10669                Matrix4Value,
10670                D,
10671                &mut self.right_projection,
10672                decoder,
10673                offset + 72,
10674                _depth
10675            )?;
10676            Ok(())
10677        }
10678    }
10679
10680    impl fidl::encoding::ValueTypeMarker for SetTagCmd {
10681        type Borrowed<'a> = &'a Self;
10682        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10683            value
10684        }
10685    }
10686
10687    unsafe impl fidl::encoding::TypeMarker for SetTagCmd {
10688        type Owned = Self;
10689
10690        #[inline(always)]
10691        fn inline_align(_context: fidl::encoding::Context) -> usize {
10692            4
10693        }
10694
10695        #[inline(always)]
10696        fn inline_size(_context: fidl::encoding::Context) -> usize {
10697            8
10698        }
10699        #[inline(always)]
10700        fn encode_is_copy() -> bool {
10701            true
10702        }
10703
10704        #[inline(always)]
10705        fn decode_is_copy() -> bool {
10706            true
10707        }
10708    }
10709
10710    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTagCmd, D>
10711        for &SetTagCmd
10712    {
10713        #[inline]
10714        unsafe fn encode(
10715            self,
10716            encoder: &mut fidl::encoding::Encoder<'_, D>,
10717            offset: usize,
10718            _depth: fidl::encoding::Depth,
10719        ) -> fidl::Result<()> {
10720            encoder.debug_check_bounds::<SetTagCmd>(offset);
10721            unsafe {
10722                // Copy the object into the buffer.
10723                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10724                (buf_ptr as *mut SetTagCmd).write_unaligned((self as *const SetTagCmd).read());
10725                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10726                // done second because the memcpy will write garbage to these bytes.
10727            }
10728            Ok(())
10729        }
10730    }
10731    unsafe impl<
10732            D: fidl::encoding::ResourceDialect,
10733            T0: fidl::encoding::Encode<u32, D>,
10734            T1: fidl::encoding::Encode<u32, D>,
10735        > fidl::encoding::Encode<SetTagCmd, D> for (T0, T1)
10736    {
10737        #[inline]
10738        unsafe fn encode(
10739            self,
10740            encoder: &mut fidl::encoding::Encoder<'_, D>,
10741            offset: usize,
10742            depth: fidl::encoding::Depth,
10743        ) -> fidl::Result<()> {
10744            encoder.debug_check_bounds::<SetTagCmd>(offset);
10745            // Zero out padding regions. There's no need to apply masks
10746            // because the unmasked parts will be overwritten by fields.
10747            // Write the fields.
10748            self.0.encode(encoder, offset + 0, depth)?;
10749            self.1.encode(encoder, offset + 4, depth)?;
10750            Ok(())
10751        }
10752    }
10753
10754    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTagCmd {
10755        #[inline(always)]
10756        fn new_empty() -> Self {
10757            Self { node_id: fidl::new_empty!(u32, D), tag_value: fidl::new_empty!(u32, D) }
10758        }
10759
10760        #[inline]
10761        unsafe fn decode(
10762            &mut self,
10763            decoder: &mut fidl::encoding::Decoder<'_, D>,
10764            offset: usize,
10765            _depth: fidl::encoding::Depth,
10766        ) -> fidl::Result<()> {
10767            decoder.debug_check_bounds::<Self>(offset);
10768            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10769            // Verify that padding bytes are zero.
10770            // Copy from the buffer into the object.
10771            unsafe {
10772                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10773            }
10774            Ok(())
10775        }
10776    }
10777
10778    impl fidl::encoding::ValueTypeMarker for SetTextureCmd {
10779        type Borrowed<'a> = &'a Self;
10780        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10781            value
10782        }
10783    }
10784
10785    unsafe impl fidl::encoding::TypeMarker for SetTextureCmd {
10786        type Owned = Self;
10787
10788        #[inline(always)]
10789        fn inline_align(_context: fidl::encoding::Context) -> usize {
10790            4
10791        }
10792
10793        #[inline(always)]
10794        fn inline_size(_context: fidl::encoding::Context) -> usize {
10795            8
10796        }
10797        #[inline(always)]
10798        fn encode_is_copy() -> bool {
10799            true
10800        }
10801
10802        #[inline(always)]
10803        fn decode_is_copy() -> bool {
10804            true
10805        }
10806    }
10807
10808    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTextureCmd, D>
10809        for &SetTextureCmd
10810    {
10811        #[inline]
10812        unsafe fn encode(
10813            self,
10814            encoder: &mut fidl::encoding::Encoder<'_, D>,
10815            offset: usize,
10816            _depth: fidl::encoding::Depth,
10817        ) -> fidl::Result<()> {
10818            encoder.debug_check_bounds::<SetTextureCmd>(offset);
10819            unsafe {
10820                // Copy the object into the buffer.
10821                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10822                (buf_ptr as *mut SetTextureCmd)
10823                    .write_unaligned((self as *const SetTextureCmd).read());
10824                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10825                // done second because the memcpy will write garbage to these bytes.
10826            }
10827            Ok(())
10828        }
10829    }
10830    unsafe impl<
10831            D: fidl::encoding::ResourceDialect,
10832            T0: fidl::encoding::Encode<u32, D>,
10833            T1: fidl::encoding::Encode<u32, D>,
10834        > fidl::encoding::Encode<SetTextureCmd, D> for (T0, T1)
10835    {
10836        #[inline]
10837        unsafe fn encode(
10838            self,
10839            encoder: &mut fidl::encoding::Encoder<'_, D>,
10840            offset: usize,
10841            depth: fidl::encoding::Depth,
10842        ) -> fidl::Result<()> {
10843            encoder.debug_check_bounds::<SetTextureCmd>(offset);
10844            // Zero out padding regions. There's no need to apply masks
10845            // because the unmasked parts will be overwritten by fields.
10846            // Write the fields.
10847            self.0.encode(encoder, offset + 0, depth)?;
10848            self.1.encode(encoder, offset + 4, depth)?;
10849            Ok(())
10850        }
10851    }
10852
10853    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTextureCmd {
10854        #[inline(always)]
10855        fn new_empty() -> Self {
10856            Self { material_id: fidl::new_empty!(u32, D), texture_id: fidl::new_empty!(u32, D) }
10857        }
10858
10859        #[inline]
10860        unsafe fn decode(
10861            &mut self,
10862            decoder: &mut fidl::encoding::Decoder<'_, D>,
10863            offset: usize,
10864            _depth: fidl::encoding::Depth,
10865        ) -> fidl::Result<()> {
10866            decoder.debug_check_bounds::<Self>(offset);
10867            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10868            // Verify that padding bytes are zero.
10869            // Copy from the buffer into the object.
10870            unsafe {
10871                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10872            }
10873            Ok(())
10874        }
10875    }
10876
10877    impl fidl::encoding::ValueTypeMarker for SetTranslationCmd {
10878        type Borrowed<'a> = &'a Self;
10879        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10880            value
10881        }
10882    }
10883
10884    unsafe impl fidl::encoding::TypeMarker for SetTranslationCmd {
10885        type Owned = Self;
10886
10887        #[inline(always)]
10888        fn inline_align(_context: fidl::encoding::Context) -> usize {
10889            4
10890        }
10891
10892        #[inline(always)]
10893        fn inline_size(_context: fidl::encoding::Context) -> usize {
10894            20
10895        }
10896    }
10897
10898    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTranslationCmd, D>
10899        for &SetTranslationCmd
10900    {
10901        #[inline]
10902        unsafe fn encode(
10903            self,
10904            encoder: &mut fidl::encoding::Encoder<'_, D>,
10905            offset: usize,
10906            _depth: fidl::encoding::Depth,
10907        ) -> fidl::Result<()> {
10908            encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10909            // Delegate to tuple encoding.
10910            fidl::encoding::Encode::<SetTranslationCmd, D>::encode(
10911                (
10912                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10913                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10914                ),
10915                encoder,
10916                offset,
10917                _depth,
10918            )
10919        }
10920    }
10921    unsafe impl<
10922            D: fidl::encoding::ResourceDialect,
10923            T0: fidl::encoding::Encode<u32, D>,
10924            T1: fidl::encoding::Encode<Vector3Value, D>,
10925        > fidl::encoding::Encode<SetTranslationCmd, D> for (T0, T1)
10926    {
10927        #[inline]
10928        unsafe fn encode(
10929            self,
10930            encoder: &mut fidl::encoding::Encoder<'_, D>,
10931            offset: usize,
10932            depth: fidl::encoding::Depth,
10933        ) -> fidl::Result<()> {
10934            encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10935            // Zero out padding regions. There's no need to apply masks
10936            // because the unmasked parts will be overwritten by fields.
10937            // Write the fields.
10938            self.0.encode(encoder, offset + 0, depth)?;
10939            self.1.encode(encoder, offset + 4, depth)?;
10940            Ok(())
10941        }
10942    }
10943
10944    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTranslationCmd {
10945        #[inline(always)]
10946        fn new_empty() -> Self {
10947            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
10948        }
10949
10950        #[inline]
10951        unsafe fn decode(
10952            &mut self,
10953            decoder: &mut fidl::encoding::Decoder<'_, D>,
10954            offset: usize,
10955            _depth: fidl::encoding::Depth,
10956        ) -> fidl::Result<()> {
10957            decoder.debug_check_bounds::<Self>(offset);
10958            // Verify that padding bytes are zero.
10959            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10960            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10961            Ok(())
10962        }
10963    }
10964
10965    impl fidl::encoding::ValueTypeMarker for SetViewHolderBoundsColorCmd {
10966        type Borrowed<'a> = &'a Self;
10967        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10968            value
10969        }
10970    }
10971
10972    unsafe impl fidl::encoding::TypeMarker for SetViewHolderBoundsColorCmd {
10973        type Owned = Self;
10974
10975        #[inline(always)]
10976        fn inline_align(_context: fidl::encoding::Context) -> usize {
10977            4
10978        }
10979
10980        #[inline(always)]
10981        fn inline_size(_context: fidl::encoding::Context) -> usize {
10982            20
10983        }
10984    }
10985
10986    unsafe impl<D: fidl::encoding::ResourceDialect>
10987        fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for &SetViewHolderBoundsColorCmd
10988    {
10989        #[inline]
10990        unsafe fn encode(
10991            self,
10992            encoder: &mut fidl::encoding::Encoder<'_, D>,
10993            offset: usize,
10994            _depth: fidl::encoding::Depth,
10995        ) -> fidl::Result<()> {
10996            encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
10997            // Delegate to tuple encoding.
10998            fidl::encoding::Encode::<SetViewHolderBoundsColorCmd, D>::encode(
10999                (
11000                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
11001                    <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
11002                ),
11003                encoder,
11004                offset,
11005                _depth,
11006            )
11007        }
11008    }
11009    unsafe impl<
11010            D: fidl::encoding::ResourceDialect,
11011            T0: fidl::encoding::Encode<u32, D>,
11012            T1: fidl::encoding::Encode<ColorRgbValue, D>,
11013        > fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for (T0, T1)
11014    {
11015        #[inline]
11016        unsafe fn encode(
11017            self,
11018            encoder: &mut fidl::encoding::Encoder<'_, D>,
11019            offset: usize,
11020            depth: fidl::encoding::Depth,
11021        ) -> fidl::Result<()> {
11022            encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
11023            // Zero out padding regions. There's no need to apply masks
11024            // because the unmasked parts will be overwritten by fields.
11025            // Write the fields.
11026            self.0.encode(encoder, offset + 0, depth)?;
11027            self.1.encode(encoder, offset + 4, depth)?;
11028            Ok(())
11029        }
11030    }
11031
11032    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11033        for SetViewHolderBoundsColorCmd
11034    {
11035        #[inline(always)]
11036        fn new_empty() -> Self {
11037            Self {
11038                view_holder_id: fidl::new_empty!(u32, D),
11039                color: fidl::new_empty!(ColorRgbValue, D),
11040            }
11041        }
11042
11043        #[inline]
11044        unsafe fn decode(
11045            &mut self,
11046            decoder: &mut fidl::encoding::Decoder<'_, D>,
11047            offset: usize,
11048            _depth: fidl::encoding::Depth,
11049        ) -> fidl::Result<()> {
11050            decoder.debug_check_bounds::<Self>(offset);
11051            // Verify that padding bytes are zero.
11052            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11053            fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
11054            Ok(())
11055        }
11056    }
11057
11058    impl fidl::encoding::ValueTypeMarker for SetViewPropertiesCmd {
11059        type Borrowed<'a> = &'a Self;
11060        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11061            value
11062        }
11063    }
11064
11065    unsafe impl fidl::encoding::TypeMarker for SetViewPropertiesCmd {
11066        type Owned = Self;
11067
11068        #[inline(always)]
11069        fn inline_align(_context: fidl::encoding::Context) -> usize {
11070            4
11071        }
11072
11073        #[inline(always)]
11074        fn inline_size(_context: fidl::encoding::Context) -> usize {
11075            56
11076        }
11077    }
11078
11079    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetViewPropertiesCmd, D>
11080        for &SetViewPropertiesCmd
11081    {
11082        #[inline]
11083        unsafe fn encode(
11084            self,
11085            encoder: &mut fidl::encoding::Encoder<'_, D>,
11086            offset: usize,
11087            _depth: fidl::encoding::Depth,
11088        ) -> fidl::Result<()> {
11089            encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11090            // Delegate to tuple encoding.
11091            fidl::encoding::Encode::<SetViewPropertiesCmd, D>::encode(
11092                (
11093                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
11094                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11095                ),
11096                encoder,
11097                offset,
11098                _depth,
11099            )
11100        }
11101    }
11102    unsafe impl<
11103            D: fidl::encoding::ResourceDialect,
11104            T0: fidl::encoding::Encode<u32, D>,
11105            T1: fidl::encoding::Encode<ViewProperties, D>,
11106        > fidl::encoding::Encode<SetViewPropertiesCmd, D> for (T0, T1)
11107    {
11108        #[inline]
11109        unsafe fn encode(
11110            self,
11111            encoder: &mut fidl::encoding::Encoder<'_, D>,
11112            offset: usize,
11113            depth: fidl::encoding::Depth,
11114        ) -> fidl::Result<()> {
11115            encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11116            // Zero out padding regions. There's no need to apply masks
11117            // because the unmasked parts will be overwritten by fields.
11118            // Write the fields.
11119            self.0.encode(encoder, offset + 0, depth)?;
11120            self.1.encode(encoder, offset + 4, depth)?;
11121            Ok(())
11122        }
11123    }
11124
11125    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetViewPropertiesCmd {
11126        #[inline(always)]
11127        fn new_empty() -> Self {
11128            Self {
11129                view_holder_id: fidl::new_empty!(u32, D),
11130                properties: fidl::new_empty!(ViewProperties, D),
11131            }
11132        }
11133
11134        #[inline]
11135        unsafe fn decode(
11136            &mut self,
11137            decoder: &mut fidl::encoding::Decoder<'_, D>,
11138            offset: usize,
11139            _depth: fidl::encoding::Depth,
11140        ) -> fidl::Result<()> {
11141            decoder.debug_check_bounds::<Self>(offset);
11142            // Verify that padding bytes are zero.
11143            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11144            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11145            Ok(())
11146        }
11147    }
11148
11149    impl fidl::encoding::ValueTypeMarker for ShapeNodeArgs {
11150        type Borrowed<'a> = &'a Self;
11151        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11152            value
11153        }
11154    }
11155
11156    unsafe impl fidl::encoding::TypeMarker for ShapeNodeArgs {
11157        type Owned = Self;
11158
11159        #[inline(always)]
11160        fn inline_align(_context: fidl::encoding::Context) -> usize {
11161            4
11162        }
11163
11164        #[inline(always)]
11165        fn inline_size(_context: fidl::encoding::Context) -> usize {
11166            4
11167        }
11168        #[inline(always)]
11169        fn encode_is_copy() -> bool {
11170            true
11171        }
11172
11173        #[inline(always)]
11174        fn decode_is_copy() -> bool {
11175            true
11176        }
11177    }
11178
11179    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ShapeNodeArgs, D>
11180        for &ShapeNodeArgs
11181    {
11182        #[inline]
11183        unsafe fn encode(
11184            self,
11185            encoder: &mut fidl::encoding::Encoder<'_, D>,
11186            offset: usize,
11187            _depth: fidl::encoding::Depth,
11188        ) -> fidl::Result<()> {
11189            encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11190            unsafe {
11191                // Copy the object into the buffer.
11192                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11193                (buf_ptr as *mut ShapeNodeArgs)
11194                    .write_unaligned((self as *const ShapeNodeArgs).read());
11195                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11196                // done second because the memcpy will write garbage to these bytes.
11197            }
11198            Ok(())
11199        }
11200    }
11201    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11202        fidl::encoding::Encode<ShapeNodeArgs, D> for (T0,)
11203    {
11204        #[inline]
11205        unsafe fn encode(
11206            self,
11207            encoder: &mut fidl::encoding::Encoder<'_, D>,
11208            offset: usize,
11209            depth: fidl::encoding::Depth,
11210        ) -> fidl::Result<()> {
11211            encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11212            // Zero out padding regions. There's no need to apply masks
11213            // because the unmasked parts will be overwritten by fields.
11214            // Write the fields.
11215            self.0.encode(encoder, offset + 0, depth)?;
11216            Ok(())
11217        }
11218    }
11219
11220    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShapeNodeArgs {
11221        #[inline(always)]
11222        fn new_empty() -> Self {
11223            Self { unused: fidl::new_empty!(u32, D) }
11224        }
11225
11226        #[inline]
11227        unsafe fn decode(
11228            &mut self,
11229            decoder: &mut fidl::encoding::Decoder<'_, D>,
11230            offset: usize,
11231            _depth: fidl::encoding::Depth,
11232        ) -> fidl::Result<()> {
11233            decoder.debug_check_bounds::<Self>(offset);
11234            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11235            // Verify that padding bytes are zero.
11236            // Copy from the buffer into the object.
11237            unsafe {
11238                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11239            }
11240            Ok(())
11241        }
11242    }
11243
11244    impl fidl::encoding::ValueTypeMarker for SizeChangeHintEvent {
11245        type Borrowed<'a> = &'a Self;
11246        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11247            value
11248        }
11249    }
11250
11251    unsafe impl fidl::encoding::TypeMarker for SizeChangeHintEvent {
11252        type Owned = Self;
11253
11254        #[inline(always)]
11255        fn inline_align(_context: fidl::encoding::Context) -> usize {
11256            4
11257        }
11258
11259        #[inline(always)]
11260        fn inline_size(_context: fidl::encoding::Context) -> usize {
11261            12
11262        }
11263    }
11264
11265    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SizeChangeHintEvent, D>
11266        for &SizeChangeHintEvent
11267    {
11268        #[inline]
11269        unsafe fn encode(
11270            self,
11271            encoder: &mut fidl::encoding::Encoder<'_, D>,
11272            offset: usize,
11273            _depth: fidl::encoding::Depth,
11274        ) -> fidl::Result<()> {
11275            encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11276            // Delegate to tuple encoding.
11277            fidl::encoding::Encode::<SizeChangeHintEvent, D>::encode(
11278                (
11279                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
11280                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
11281                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
11282                ),
11283                encoder,
11284                offset,
11285                _depth,
11286            )
11287        }
11288    }
11289    unsafe impl<
11290            D: fidl::encoding::ResourceDialect,
11291            T0: fidl::encoding::Encode<u32, D>,
11292            T1: fidl::encoding::Encode<f32, D>,
11293            T2: fidl::encoding::Encode<f32, D>,
11294        > fidl::encoding::Encode<SizeChangeHintEvent, D> for (T0, T1, T2)
11295    {
11296        #[inline]
11297        unsafe fn encode(
11298            self,
11299            encoder: &mut fidl::encoding::Encoder<'_, D>,
11300            offset: usize,
11301            depth: fidl::encoding::Depth,
11302        ) -> fidl::Result<()> {
11303            encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11304            // Zero out padding regions. There's no need to apply masks
11305            // because the unmasked parts will be overwritten by fields.
11306            // Write the fields.
11307            self.0.encode(encoder, offset + 0, depth)?;
11308            self.1.encode(encoder, offset + 4, depth)?;
11309            self.2.encode(encoder, offset + 8, depth)?;
11310            Ok(())
11311        }
11312    }
11313
11314    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SizeChangeHintEvent {
11315        #[inline(always)]
11316        fn new_empty() -> Self {
11317            Self {
11318                node_id: fidl::new_empty!(u32, D),
11319                width_change_factor: fidl::new_empty!(f32, D),
11320                height_change_factor: fidl::new_empty!(f32, D),
11321            }
11322        }
11323
11324        #[inline]
11325        unsafe fn decode(
11326            &mut self,
11327            decoder: &mut fidl::encoding::Decoder<'_, D>,
11328            offset: usize,
11329            _depth: fidl::encoding::Depth,
11330        ) -> fidl::Result<()> {
11331            decoder.debug_check_bounds::<Self>(offset);
11332            // Verify that padding bytes are zero.
11333            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
11334            fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
11335            fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
11336            Ok(())
11337        }
11338    }
11339
11340    impl fidl::encoding::ValueTypeMarker for StereoCameraArgs {
11341        type Borrowed<'a> = &'a Self;
11342        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11343            value
11344        }
11345    }
11346
11347    unsafe impl fidl::encoding::TypeMarker for StereoCameraArgs {
11348        type Owned = Self;
11349
11350        #[inline(always)]
11351        fn inline_align(_context: fidl::encoding::Context) -> usize {
11352            4
11353        }
11354
11355        #[inline(always)]
11356        fn inline_size(_context: fidl::encoding::Context) -> usize {
11357            4
11358        }
11359        #[inline(always)]
11360        fn encode_is_copy() -> bool {
11361            true
11362        }
11363
11364        #[inline(always)]
11365        fn decode_is_copy() -> bool {
11366            true
11367        }
11368    }
11369
11370    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StereoCameraArgs, D>
11371        for &StereoCameraArgs
11372    {
11373        #[inline]
11374        unsafe fn encode(
11375            self,
11376            encoder: &mut fidl::encoding::Encoder<'_, D>,
11377            offset: usize,
11378            _depth: fidl::encoding::Depth,
11379        ) -> fidl::Result<()> {
11380            encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11381            unsafe {
11382                // Copy the object into the buffer.
11383                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11384                (buf_ptr as *mut StereoCameraArgs)
11385                    .write_unaligned((self as *const StereoCameraArgs).read());
11386                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11387                // done second because the memcpy will write garbage to these bytes.
11388            }
11389            Ok(())
11390        }
11391    }
11392    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11393        fidl::encoding::Encode<StereoCameraArgs, D> for (T0,)
11394    {
11395        #[inline]
11396        unsafe fn encode(
11397            self,
11398            encoder: &mut fidl::encoding::Encoder<'_, D>,
11399            offset: usize,
11400            depth: fidl::encoding::Depth,
11401        ) -> fidl::Result<()> {
11402            encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11403            // Zero out padding regions. There's no need to apply masks
11404            // because the unmasked parts will be overwritten by fields.
11405            // Write the fields.
11406            self.0.encode(encoder, offset + 0, depth)?;
11407            Ok(())
11408        }
11409    }
11410
11411    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StereoCameraArgs {
11412        #[inline(always)]
11413        fn new_empty() -> Self {
11414            Self { scene_id: fidl::new_empty!(u32, D) }
11415        }
11416
11417        #[inline]
11418        unsafe fn decode(
11419            &mut self,
11420            decoder: &mut fidl::encoding::Decoder<'_, D>,
11421            offset: usize,
11422            _depth: fidl::encoding::Depth,
11423        ) -> fidl::Result<()> {
11424            decoder.debug_check_bounds::<Self>(offset);
11425            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11426            // Verify that padding bytes are zero.
11427            // Copy from the buffer into the object.
11428            unsafe {
11429                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11430            }
11431            Ok(())
11432        }
11433    }
11434
11435    impl fidl::encoding::ValueTypeMarker for VariableArgs {
11436        type Borrowed<'a> = &'a Self;
11437        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11438            value
11439        }
11440    }
11441
11442    unsafe impl fidl::encoding::TypeMarker for VariableArgs {
11443        type Owned = Self;
11444
11445        #[inline(always)]
11446        fn inline_align(_context: fidl::encoding::Context) -> usize {
11447            8
11448        }
11449
11450        #[inline(always)]
11451        fn inline_size(_context: fidl::encoding::Context) -> usize {
11452            24
11453        }
11454    }
11455
11456    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VariableArgs, D>
11457        for &VariableArgs
11458    {
11459        #[inline]
11460        unsafe fn encode(
11461            self,
11462            encoder: &mut fidl::encoding::Encoder<'_, D>,
11463            offset: usize,
11464            _depth: fidl::encoding::Depth,
11465        ) -> fidl::Result<()> {
11466            encoder.debug_check_bounds::<VariableArgs>(offset);
11467            // Delegate to tuple encoding.
11468            fidl::encoding::Encode::<VariableArgs, D>::encode(
11469                (
11470                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
11471                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.initial_value),
11472                ),
11473                encoder,
11474                offset,
11475                _depth,
11476            )
11477        }
11478    }
11479    unsafe impl<
11480            D: fidl::encoding::ResourceDialect,
11481            T0: fidl::encoding::Encode<ValueType, D>,
11482            T1: fidl::encoding::Encode<Value, D>,
11483        > fidl::encoding::Encode<VariableArgs, D> for (T0, T1)
11484    {
11485        #[inline]
11486        unsafe fn encode(
11487            self,
11488            encoder: &mut fidl::encoding::Encoder<'_, D>,
11489            offset: usize,
11490            depth: fidl::encoding::Depth,
11491        ) -> fidl::Result<()> {
11492            encoder.debug_check_bounds::<VariableArgs>(offset);
11493            // Zero out padding regions. There's no need to apply masks
11494            // because the unmasked parts will be overwritten by fields.
11495            unsafe {
11496                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11497                (ptr as *mut u64).write_unaligned(0);
11498            }
11499            // Write the fields.
11500            self.0.encode(encoder, offset + 0, depth)?;
11501            self.1.encode(encoder, offset + 8, depth)?;
11502            Ok(())
11503        }
11504    }
11505
11506    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VariableArgs {
11507        #[inline(always)]
11508        fn new_empty() -> Self {
11509            Self {
11510                type_: fidl::new_empty!(ValueType, D),
11511                initial_value: fidl::new_empty!(Value, D),
11512            }
11513        }
11514
11515        #[inline]
11516        unsafe fn decode(
11517            &mut self,
11518            decoder: &mut fidl::encoding::Decoder<'_, D>,
11519            offset: usize,
11520            _depth: fidl::encoding::Depth,
11521        ) -> fidl::Result<()> {
11522            decoder.debug_check_bounds::<Self>(offset);
11523            // Verify that padding bytes are zero.
11524            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11525            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11526            let mask = 0xffffffff00000000u64;
11527            let maskedval = padval & mask;
11528            if maskedval != 0 {
11529                return Err(fidl::Error::NonZeroPadding {
11530                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11531                });
11532            }
11533            fidl::decode!(ValueType, D, &mut self.type_, decoder, offset + 0, _depth)?;
11534            fidl::decode!(Value, D, &mut self.initial_value, decoder, offset + 8, _depth)?;
11535            Ok(())
11536        }
11537    }
11538
11539    impl fidl::encoding::ValueTypeMarker for Vector2Value {
11540        type Borrowed<'a> = &'a Self;
11541        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11542            value
11543        }
11544    }
11545
11546    unsafe impl fidl::encoding::TypeMarker for Vector2Value {
11547        type Owned = Self;
11548
11549        #[inline(always)]
11550        fn inline_align(_context: fidl::encoding::Context) -> usize {
11551            4
11552        }
11553
11554        #[inline(always)]
11555        fn inline_size(_context: fidl::encoding::Context) -> usize {
11556            12
11557        }
11558    }
11559
11560    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector2Value, D>
11561        for &Vector2Value
11562    {
11563        #[inline]
11564        unsafe fn encode(
11565            self,
11566            encoder: &mut fidl::encoding::Encoder<'_, D>,
11567            offset: usize,
11568            _depth: fidl::encoding::Depth,
11569        ) -> fidl::Result<()> {
11570            encoder.debug_check_bounds::<Vector2Value>(offset);
11571            // Delegate to tuple encoding.
11572            fidl::encoding::Encode::<Vector2Value, D>::encode(
11573                (
11574                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11575                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11576                ),
11577                encoder,
11578                offset,
11579                _depth,
11580            )
11581        }
11582    }
11583    unsafe impl<
11584            D: fidl::encoding::ResourceDialect,
11585            T0: fidl::encoding::Encode<Vec2, D>,
11586            T1: fidl::encoding::Encode<u32, D>,
11587        > fidl::encoding::Encode<Vector2Value, D> for (T0, T1)
11588    {
11589        #[inline]
11590        unsafe fn encode(
11591            self,
11592            encoder: &mut fidl::encoding::Encoder<'_, D>,
11593            offset: usize,
11594            depth: fidl::encoding::Depth,
11595        ) -> fidl::Result<()> {
11596            encoder.debug_check_bounds::<Vector2Value>(offset);
11597            // Zero out padding regions. There's no need to apply masks
11598            // because the unmasked parts will be overwritten by fields.
11599            // Write the fields.
11600            self.0.encode(encoder, offset + 0, depth)?;
11601            self.1.encode(encoder, offset + 8, depth)?;
11602            Ok(())
11603        }
11604    }
11605
11606    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector2Value {
11607        #[inline(always)]
11608        fn new_empty() -> Self {
11609            Self { value: fidl::new_empty!(Vec2, D), variable_id: fidl::new_empty!(u32, D) }
11610        }
11611
11612        #[inline]
11613        unsafe fn decode(
11614            &mut self,
11615            decoder: &mut fidl::encoding::Decoder<'_, D>,
11616            offset: usize,
11617            _depth: fidl::encoding::Depth,
11618        ) -> fidl::Result<()> {
11619            decoder.debug_check_bounds::<Self>(offset);
11620            // Verify that padding bytes are zero.
11621            fidl::decode!(Vec2, D, &mut self.value, decoder, offset + 0, _depth)?;
11622            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 8, _depth)?;
11623            Ok(())
11624        }
11625    }
11626
11627    impl fidl::encoding::ValueTypeMarker for Vector3Value {
11628        type Borrowed<'a> = &'a Self;
11629        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11630            value
11631        }
11632    }
11633
11634    unsafe impl fidl::encoding::TypeMarker for Vector3Value {
11635        type Owned = Self;
11636
11637        #[inline(always)]
11638        fn inline_align(_context: fidl::encoding::Context) -> usize {
11639            4
11640        }
11641
11642        #[inline(always)]
11643        fn inline_size(_context: fidl::encoding::Context) -> usize {
11644            16
11645        }
11646    }
11647
11648    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector3Value, D>
11649        for &Vector3Value
11650    {
11651        #[inline]
11652        unsafe fn encode(
11653            self,
11654            encoder: &mut fidl::encoding::Encoder<'_, D>,
11655            offset: usize,
11656            _depth: fidl::encoding::Depth,
11657        ) -> fidl::Result<()> {
11658            encoder.debug_check_bounds::<Vector3Value>(offset);
11659            // Delegate to tuple encoding.
11660            fidl::encoding::Encode::<Vector3Value, D>::encode(
11661                (
11662                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11663                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11664                ),
11665                encoder,
11666                offset,
11667                _depth,
11668            )
11669        }
11670    }
11671    unsafe impl<
11672            D: fidl::encoding::ResourceDialect,
11673            T0: fidl::encoding::Encode<Vec3, D>,
11674            T1: fidl::encoding::Encode<u32, D>,
11675        > fidl::encoding::Encode<Vector3Value, D> for (T0, T1)
11676    {
11677        #[inline]
11678        unsafe fn encode(
11679            self,
11680            encoder: &mut fidl::encoding::Encoder<'_, D>,
11681            offset: usize,
11682            depth: fidl::encoding::Depth,
11683        ) -> fidl::Result<()> {
11684            encoder.debug_check_bounds::<Vector3Value>(offset);
11685            // Zero out padding regions. There's no need to apply masks
11686            // because the unmasked parts will be overwritten by fields.
11687            // Write the fields.
11688            self.0.encode(encoder, offset + 0, depth)?;
11689            self.1.encode(encoder, offset + 12, depth)?;
11690            Ok(())
11691        }
11692    }
11693
11694    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector3Value {
11695        #[inline(always)]
11696        fn new_empty() -> Self {
11697            Self { value: fidl::new_empty!(Vec3, D), variable_id: fidl::new_empty!(u32, D) }
11698        }
11699
11700        #[inline]
11701        unsafe fn decode(
11702            &mut self,
11703            decoder: &mut fidl::encoding::Decoder<'_, D>,
11704            offset: usize,
11705            _depth: fidl::encoding::Depth,
11706        ) -> fidl::Result<()> {
11707            decoder.debug_check_bounds::<Self>(offset);
11708            // Verify that padding bytes are zero.
11709            fidl::decode!(Vec3, D, &mut self.value, decoder, offset + 0, _depth)?;
11710            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
11711            Ok(())
11712        }
11713    }
11714
11715    impl fidl::encoding::ValueTypeMarker for Vector4Value {
11716        type Borrowed<'a> = &'a Self;
11717        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11718            value
11719        }
11720    }
11721
11722    unsafe impl fidl::encoding::TypeMarker for Vector4Value {
11723        type Owned = Self;
11724
11725        #[inline(always)]
11726        fn inline_align(_context: fidl::encoding::Context) -> usize {
11727            4
11728        }
11729
11730        #[inline(always)]
11731        fn inline_size(_context: fidl::encoding::Context) -> usize {
11732            20
11733        }
11734    }
11735
11736    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector4Value, D>
11737        for &Vector4Value
11738    {
11739        #[inline]
11740        unsafe fn encode(
11741            self,
11742            encoder: &mut fidl::encoding::Encoder<'_, D>,
11743            offset: usize,
11744            _depth: fidl::encoding::Depth,
11745        ) -> fidl::Result<()> {
11746            encoder.debug_check_bounds::<Vector4Value>(offset);
11747            // Delegate to tuple encoding.
11748            fidl::encoding::Encode::<Vector4Value, D>::encode(
11749                (
11750                    <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11751                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11752                ),
11753                encoder,
11754                offset,
11755                _depth,
11756            )
11757        }
11758    }
11759    unsafe impl<
11760            D: fidl::encoding::ResourceDialect,
11761            T0: fidl::encoding::Encode<Vec4, D>,
11762            T1: fidl::encoding::Encode<u32, D>,
11763        > fidl::encoding::Encode<Vector4Value, D> for (T0, T1)
11764    {
11765        #[inline]
11766        unsafe fn encode(
11767            self,
11768            encoder: &mut fidl::encoding::Encoder<'_, D>,
11769            offset: usize,
11770            depth: fidl::encoding::Depth,
11771        ) -> fidl::Result<()> {
11772            encoder.debug_check_bounds::<Vector4Value>(offset);
11773            // Zero out padding regions. There's no need to apply masks
11774            // because the unmasked parts will be overwritten by fields.
11775            // Write the fields.
11776            self.0.encode(encoder, offset + 0, depth)?;
11777            self.1.encode(encoder, offset + 16, depth)?;
11778            Ok(())
11779        }
11780    }
11781
11782    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector4Value {
11783        #[inline(always)]
11784        fn new_empty() -> Self {
11785            Self { value: fidl::new_empty!(Vec4, D), variable_id: fidl::new_empty!(u32, D) }
11786        }
11787
11788        #[inline]
11789        unsafe fn decode(
11790            &mut self,
11791            decoder: &mut fidl::encoding::Decoder<'_, D>,
11792            offset: usize,
11793            _depth: fidl::encoding::Depth,
11794        ) -> fidl::Result<()> {
11795            decoder.debug_check_bounds::<Self>(offset);
11796            // Verify that padding bytes are zero.
11797            fidl::decode!(Vec4, D, &mut self.value, decoder, offset + 0, _depth)?;
11798            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
11799            Ok(())
11800        }
11801    }
11802
11803    impl fidl::encoding::ValueTypeMarker for ViewAttachedToSceneEvent {
11804        type Borrowed<'a> = &'a Self;
11805        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11806            value
11807        }
11808    }
11809
11810    unsafe impl fidl::encoding::TypeMarker for ViewAttachedToSceneEvent {
11811        type Owned = Self;
11812
11813        #[inline(always)]
11814        fn inline_align(_context: fidl::encoding::Context) -> usize {
11815            4
11816        }
11817
11818        #[inline(always)]
11819        fn inline_size(_context: fidl::encoding::Context) -> usize {
11820            56
11821        }
11822    }
11823
11824    unsafe impl<D: fidl::encoding::ResourceDialect>
11825        fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for &ViewAttachedToSceneEvent
11826    {
11827        #[inline]
11828        unsafe fn encode(
11829            self,
11830            encoder: &mut fidl::encoding::Encoder<'_, D>,
11831            offset: usize,
11832            _depth: fidl::encoding::Depth,
11833        ) -> fidl::Result<()> {
11834            encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11835            // Delegate to tuple encoding.
11836            fidl::encoding::Encode::<ViewAttachedToSceneEvent, D>::encode(
11837                (
11838                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
11839                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11840                ),
11841                encoder,
11842                offset,
11843                _depth,
11844            )
11845        }
11846    }
11847    unsafe impl<
11848            D: fidl::encoding::ResourceDialect,
11849            T0: fidl::encoding::Encode<u32, D>,
11850            T1: fidl::encoding::Encode<ViewProperties, D>,
11851        > fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for (T0, T1)
11852    {
11853        #[inline]
11854        unsafe fn encode(
11855            self,
11856            encoder: &mut fidl::encoding::Encoder<'_, D>,
11857            offset: usize,
11858            depth: fidl::encoding::Depth,
11859        ) -> fidl::Result<()> {
11860            encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11861            // Zero out padding regions. There's no need to apply masks
11862            // because the unmasked parts will be overwritten by fields.
11863            // Write the fields.
11864            self.0.encode(encoder, offset + 0, depth)?;
11865            self.1.encode(encoder, offset + 4, depth)?;
11866            Ok(())
11867        }
11868    }
11869
11870    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11871        for ViewAttachedToSceneEvent
11872    {
11873        #[inline(always)]
11874        fn new_empty() -> Self {
11875            Self {
11876                view_id: fidl::new_empty!(u32, D),
11877                properties: fidl::new_empty!(ViewProperties, D),
11878            }
11879        }
11880
11881        #[inline]
11882        unsafe fn decode(
11883            &mut self,
11884            decoder: &mut fidl::encoding::Decoder<'_, D>,
11885            offset: usize,
11886            _depth: fidl::encoding::Depth,
11887        ) -> fidl::Result<()> {
11888            decoder.debug_check_bounds::<Self>(offset);
11889            // Verify that padding bytes are zero.
11890            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
11891            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11892            Ok(())
11893        }
11894    }
11895
11896    impl fidl::encoding::ValueTypeMarker for ViewConnectedEvent {
11897        type Borrowed<'a> = &'a Self;
11898        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11899            value
11900        }
11901    }
11902
11903    unsafe impl fidl::encoding::TypeMarker for ViewConnectedEvent {
11904        type Owned = Self;
11905
11906        #[inline(always)]
11907        fn inline_align(_context: fidl::encoding::Context) -> usize {
11908            4
11909        }
11910
11911        #[inline(always)]
11912        fn inline_size(_context: fidl::encoding::Context) -> usize {
11913            4
11914        }
11915        #[inline(always)]
11916        fn encode_is_copy() -> bool {
11917            true
11918        }
11919
11920        #[inline(always)]
11921        fn decode_is_copy() -> bool {
11922            true
11923        }
11924    }
11925
11926    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewConnectedEvent, D>
11927        for &ViewConnectedEvent
11928    {
11929        #[inline]
11930        unsafe fn encode(
11931            self,
11932            encoder: &mut fidl::encoding::Encoder<'_, D>,
11933            offset: usize,
11934            _depth: fidl::encoding::Depth,
11935        ) -> fidl::Result<()> {
11936            encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
11937            unsafe {
11938                // Copy the object into the buffer.
11939                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11940                (buf_ptr as *mut ViewConnectedEvent)
11941                    .write_unaligned((self as *const ViewConnectedEvent).read());
11942                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11943                // done second because the memcpy will write garbage to these bytes.
11944            }
11945            Ok(())
11946        }
11947    }
11948    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11949        fidl::encoding::Encode<ViewConnectedEvent, D> for (T0,)
11950    {
11951        #[inline]
11952        unsafe fn encode(
11953            self,
11954            encoder: &mut fidl::encoding::Encoder<'_, D>,
11955            offset: usize,
11956            depth: fidl::encoding::Depth,
11957        ) -> fidl::Result<()> {
11958            encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
11959            // Zero out padding regions. There's no need to apply masks
11960            // because the unmasked parts will be overwritten by fields.
11961            // Write the fields.
11962            self.0.encode(encoder, offset + 0, depth)?;
11963            Ok(())
11964        }
11965    }
11966
11967    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewConnectedEvent {
11968        #[inline(always)]
11969        fn new_empty() -> Self {
11970            Self { view_holder_id: fidl::new_empty!(u32, D) }
11971        }
11972
11973        #[inline]
11974        unsafe fn decode(
11975            &mut self,
11976            decoder: &mut fidl::encoding::Decoder<'_, D>,
11977            offset: usize,
11978            _depth: fidl::encoding::Depth,
11979        ) -> fidl::Result<()> {
11980            decoder.debug_check_bounds::<Self>(offset);
11981            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11982            // Verify that padding bytes are zero.
11983            // Copy from the buffer into the object.
11984            unsafe {
11985                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11986            }
11987            Ok(())
11988        }
11989    }
11990
11991    impl fidl::encoding::ValueTypeMarker for ViewDetachedFromSceneEvent {
11992        type Borrowed<'a> = &'a Self;
11993        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11994            value
11995        }
11996    }
11997
11998    unsafe impl fidl::encoding::TypeMarker for ViewDetachedFromSceneEvent {
11999        type Owned = Self;
12000
12001        #[inline(always)]
12002        fn inline_align(_context: fidl::encoding::Context) -> usize {
12003            4
12004        }
12005
12006        #[inline(always)]
12007        fn inline_size(_context: fidl::encoding::Context) -> usize {
12008            4
12009        }
12010        #[inline(always)]
12011        fn encode_is_copy() -> bool {
12012            true
12013        }
12014
12015        #[inline(always)]
12016        fn decode_is_copy() -> bool {
12017            true
12018        }
12019    }
12020
12021    unsafe impl<D: fidl::encoding::ResourceDialect>
12022        fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for &ViewDetachedFromSceneEvent
12023    {
12024        #[inline]
12025        unsafe fn encode(
12026            self,
12027            encoder: &mut fidl::encoding::Encoder<'_, D>,
12028            offset: usize,
12029            _depth: fidl::encoding::Depth,
12030        ) -> fidl::Result<()> {
12031            encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12032            unsafe {
12033                // Copy the object into the buffer.
12034                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12035                (buf_ptr as *mut ViewDetachedFromSceneEvent)
12036                    .write_unaligned((self as *const ViewDetachedFromSceneEvent).read());
12037                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12038                // done second because the memcpy will write garbage to these bytes.
12039            }
12040            Ok(())
12041        }
12042    }
12043    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12044        fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for (T0,)
12045    {
12046        #[inline]
12047        unsafe fn encode(
12048            self,
12049            encoder: &mut fidl::encoding::Encoder<'_, D>,
12050            offset: usize,
12051            depth: fidl::encoding::Depth,
12052        ) -> fidl::Result<()> {
12053            encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12054            // Zero out padding regions. There's no need to apply masks
12055            // because the unmasked parts will be overwritten by fields.
12056            // Write the fields.
12057            self.0.encode(encoder, offset + 0, depth)?;
12058            Ok(())
12059        }
12060    }
12061
12062    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12063        for ViewDetachedFromSceneEvent
12064    {
12065        #[inline(always)]
12066        fn new_empty() -> Self {
12067            Self { view_id: fidl::new_empty!(u32, D) }
12068        }
12069
12070        #[inline]
12071        unsafe fn decode(
12072            &mut self,
12073            decoder: &mut fidl::encoding::Decoder<'_, D>,
12074            offset: usize,
12075            _depth: fidl::encoding::Depth,
12076        ) -> fidl::Result<()> {
12077            decoder.debug_check_bounds::<Self>(offset);
12078            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12079            // Verify that padding bytes are zero.
12080            // Copy from the buffer into the object.
12081            unsafe {
12082                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12083            }
12084            Ok(())
12085        }
12086    }
12087
12088    impl fidl::encoding::ValueTypeMarker for ViewDisconnectedEvent {
12089        type Borrowed<'a> = &'a Self;
12090        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12091            value
12092        }
12093    }
12094
12095    unsafe impl fidl::encoding::TypeMarker for ViewDisconnectedEvent {
12096        type Owned = Self;
12097
12098        #[inline(always)]
12099        fn inline_align(_context: fidl::encoding::Context) -> usize {
12100            4
12101        }
12102
12103        #[inline(always)]
12104        fn inline_size(_context: fidl::encoding::Context) -> usize {
12105            4
12106        }
12107        #[inline(always)]
12108        fn encode_is_copy() -> bool {
12109            true
12110        }
12111
12112        #[inline(always)]
12113        fn decode_is_copy() -> bool {
12114            true
12115        }
12116    }
12117
12118    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewDisconnectedEvent, D>
12119        for &ViewDisconnectedEvent
12120    {
12121        #[inline]
12122        unsafe fn encode(
12123            self,
12124            encoder: &mut fidl::encoding::Encoder<'_, D>,
12125            offset: usize,
12126            _depth: fidl::encoding::Depth,
12127        ) -> fidl::Result<()> {
12128            encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12129            unsafe {
12130                // Copy the object into the buffer.
12131                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12132                (buf_ptr as *mut ViewDisconnectedEvent)
12133                    .write_unaligned((self as *const ViewDisconnectedEvent).read());
12134                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12135                // done second because the memcpy will write garbage to these bytes.
12136            }
12137            Ok(())
12138        }
12139    }
12140    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12141        fidl::encoding::Encode<ViewDisconnectedEvent, D> for (T0,)
12142    {
12143        #[inline]
12144        unsafe fn encode(
12145            self,
12146            encoder: &mut fidl::encoding::Encoder<'_, D>,
12147            offset: usize,
12148            depth: fidl::encoding::Depth,
12149        ) -> fidl::Result<()> {
12150            encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12151            // Zero out padding regions. There's no need to apply masks
12152            // because the unmasked parts will be overwritten by fields.
12153            // Write the fields.
12154            self.0.encode(encoder, offset + 0, depth)?;
12155            Ok(())
12156        }
12157    }
12158
12159    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewDisconnectedEvent {
12160        #[inline(always)]
12161        fn new_empty() -> Self {
12162            Self { view_holder_id: fidl::new_empty!(u32, D) }
12163        }
12164
12165        #[inline]
12166        unsafe fn decode(
12167            &mut self,
12168            decoder: &mut fidl::encoding::Decoder<'_, D>,
12169            offset: usize,
12170            _depth: fidl::encoding::Depth,
12171        ) -> fidl::Result<()> {
12172            decoder.debug_check_bounds::<Self>(offset);
12173            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12174            // Verify that padding bytes are zero.
12175            // Copy from the buffer into the object.
12176            unsafe {
12177                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12178            }
12179            Ok(())
12180        }
12181    }
12182
12183    impl fidl::encoding::ValueTypeMarker for ViewHolderConnectedEvent {
12184        type Borrowed<'a> = &'a Self;
12185        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12186            value
12187        }
12188    }
12189
12190    unsafe impl fidl::encoding::TypeMarker for ViewHolderConnectedEvent {
12191        type Owned = Self;
12192
12193        #[inline(always)]
12194        fn inline_align(_context: fidl::encoding::Context) -> usize {
12195            4
12196        }
12197
12198        #[inline(always)]
12199        fn inline_size(_context: fidl::encoding::Context) -> usize {
12200            4
12201        }
12202        #[inline(always)]
12203        fn encode_is_copy() -> bool {
12204            true
12205        }
12206
12207        #[inline(always)]
12208        fn decode_is_copy() -> bool {
12209            true
12210        }
12211    }
12212
12213    unsafe impl<D: fidl::encoding::ResourceDialect>
12214        fidl::encoding::Encode<ViewHolderConnectedEvent, D> for &ViewHolderConnectedEvent
12215    {
12216        #[inline]
12217        unsafe fn encode(
12218            self,
12219            encoder: &mut fidl::encoding::Encoder<'_, D>,
12220            offset: usize,
12221            _depth: fidl::encoding::Depth,
12222        ) -> fidl::Result<()> {
12223            encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12224            unsafe {
12225                // Copy the object into the buffer.
12226                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12227                (buf_ptr as *mut ViewHolderConnectedEvent)
12228                    .write_unaligned((self as *const ViewHolderConnectedEvent).read());
12229                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12230                // done second because the memcpy will write garbage to these bytes.
12231            }
12232            Ok(())
12233        }
12234    }
12235    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12236        fidl::encoding::Encode<ViewHolderConnectedEvent, D> for (T0,)
12237    {
12238        #[inline]
12239        unsafe fn encode(
12240            self,
12241            encoder: &mut fidl::encoding::Encoder<'_, D>,
12242            offset: usize,
12243            depth: fidl::encoding::Depth,
12244        ) -> fidl::Result<()> {
12245            encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12246            // Zero out padding regions. There's no need to apply masks
12247            // because the unmasked parts will be overwritten by fields.
12248            // Write the fields.
12249            self.0.encode(encoder, offset + 0, depth)?;
12250            Ok(())
12251        }
12252    }
12253
12254    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12255        for ViewHolderConnectedEvent
12256    {
12257        #[inline(always)]
12258        fn new_empty() -> Self {
12259            Self { view_id: fidl::new_empty!(u32, D) }
12260        }
12261
12262        #[inline]
12263        unsafe fn decode(
12264            &mut self,
12265            decoder: &mut fidl::encoding::Decoder<'_, D>,
12266            offset: usize,
12267            _depth: fidl::encoding::Depth,
12268        ) -> fidl::Result<()> {
12269            decoder.debug_check_bounds::<Self>(offset);
12270            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12271            // Verify that padding bytes are zero.
12272            // Copy from the buffer into the object.
12273            unsafe {
12274                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12275            }
12276            Ok(())
12277        }
12278    }
12279
12280    impl fidl::encoding::ValueTypeMarker for ViewHolderDisconnectedEvent {
12281        type Borrowed<'a> = &'a Self;
12282        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12283            value
12284        }
12285    }
12286
12287    unsafe impl fidl::encoding::TypeMarker for ViewHolderDisconnectedEvent {
12288        type Owned = Self;
12289
12290        #[inline(always)]
12291        fn inline_align(_context: fidl::encoding::Context) -> usize {
12292            4
12293        }
12294
12295        #[inline(always)]
12296        fn inline_size(_context: fidl::encoding::Context) -> usize {
12297            4
12298        }
12299        #[inline(always)]
12300        fn encode_is_copy() -> bool {
12301            true
12302        }
12303
12304        #[inline(always)]
12305        fn decode_is_copy() -> bool {
12306            true
12307        }
12308    }
12309
12310    unsafe impl<D: fidl::encoding::ResourceDialect>
12311        fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for &ViewHolderDisconnectedEvent
12312    {
12313        #[inline]
12314        unsafe fn encode(
12315            self,
12316            encoder: &mut fidl::encoding::Encoder<'_, D>,
12317            offset: usize,
12318            _depth: fidl::encoding::Depth,
12319        ) -> fidl::Result<()> {
12320            encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12321            unsafe {
12322                // Copy the object into the buffer.
12323                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12324                (buf_ptr as *mut ViewHolderDisconnectedEvent)
12325                    .write_unaligned((self as *const ViewHolderDisconnectedEvent).read());
12326                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12327                // done second because the memcpy will write garbage to these bytes.
12328            }
12329            Ok(())
12330        }
12331    }
12332    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12333        fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for (T0,)
12334    {
12335        #[inline]
12336        unsafe fn encode(
12337            self,
12338            encoder: &mut fidl::encoding::Encoder<'_, D>,
12339            offset: usize,
12340            depth: fidl::encoding::Depth,
12341        ) -> fidl::Result<()> {
12342            encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12343            // Zero out padding regions. There's no need to apply masks
12344            // because the unmasked parts will be overwritten by fields.
12345            // Write the fields.
12346            self.0.encode(encoder, offset + 0, depth)?;
12347            Ok(())
12348        }
12349    }
12350
12351    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12352        for ViewHolderDisconnectedEvent
12353    {
12354        #[inline(always)]
12355        fn new_empty() -> Self {
12356            Self { view_id: fidl::new_empty!(u32, D) }
12357        }
12358
12359        #[inline]
12360        unsafe fn decode(
12361            &mut self,
12362            decoder: &mut fidl::encoding::Decoder<'_, D>,
12363            offset: usize,
12364            _depth: fidl::encoding::Depth,
12365        ) -> fidl::Result<()> {
12366            decoder.debug_check_bounds::<Self>(offset);
12367            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12368            // Verify that padding bytes are zero.
12369            // Copy from the buffer into the object.
12370            unsafe {
12371                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12372            }
12373            Ok(())
12374        }
12375    }
12376
12377    impl fidl::encoding::ValueTypeMarker for ViewProperties {
12378        type Borrowed<'a> = &'a Self;
12379        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12380            value
12381        }
12382    }
12383
12384    unsafe impl fidl::encoding::TypeMarker for ViewProperties {
12385        type Owned = Self;
12386
12387        #[inline(always)]
12388        fn inline_align(_context: fidl::encoding::Context) -> usize {
12389            4
12390        }
12391
12392        #[inline(always)]
12393        fn inline_size(_context: fidl::encoding::Context) -> usize {
12394            52
12395        }
12396    }
12397
12398    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewProperties, D>
12399        for &ViewProperties
12400    {
12401        #[inline]
12402        unsafe fn encode(
12403            self,
12404            encoder: &mut fidl::encoding::Encoder<'_, D>,
12405            offset: usize,
12406            _depth: fidl::encoding::Depth,
12407        ) -> fidl::Result<()> {
12408            encoder.debug_check_bounds::<ViewProperties>(offset);
12409            // Delegate to tuple encoding.
12410            fidl::encoding::Encode::<ViewProperties, D>::encode(
12411                (
12412                    <BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
12413                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_min),
12414                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_max),
12415                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.focus_change),
12416                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.downward_input),
12417                ),
12418                encoder,
12419                offset,
12420                _depth,
12421            )
12422        }
12423    }
12424    unsafe impl<
12425            D: fidl::encoding::ResourceDialect,
12426            T0: fidl::encoding::Encode<BoundingBox, D>,
12427            T1: fidl::encoding::Encode<Vec3, D>,
12428            T2: fidl::encoding::Encode<Vec3, D>,
12429            T3: fidl::encoding::Encode<bool, D>,
12430            T4: fidl::encoding::Encode<bool, D>,
12431        > fidl::encoding::Encode<ViewProperties, D> for (T0, T1, T2, T3, T4)
12432    {
12433        #[inline]
12434        unsafe fn encode(
12435            self,
12436            encoder: &mut fidl::encoding::Encoder<'_, D>,
12437            offset: usize,
12438            depth: fidl::encoding::Depth,
12439        ) -> fidl::Result<()> {
12440            encoder.debug_check_bounds::<ViewProperties>(offset);
12441            // Zero out padding regions. There's no need to apply masks
12442            // because the unmasked parts will be overwritten by fields.
12443            unsafe {
12444                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
12445                (ptr as *mut u32).write_unaligned(0);
12446            }
12447            // Write the fields.
12448            self.0.encode(encoder, offset + 0, depth)?;
12449            self.1.encode(encoder, offset + 24, depth)?;
12450            self.2.encode(encoder, offset + 36, depth)?;
12451            self.3.encode(encoder, offset + 48, depth)?;
12452            self.4.encode(encoder, offset + 49, depth)?;
12453            Ok(())
12454        }
12455    }
12456
12457    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewProperties {
12458        #[inline(always)]
12459        fn new_empty() -> Self {
12460            Self {
12461                bounding_box: fidl::new_empty!(BoundingBox, D),
12462                inset_from_min: fidl::new_empty!(Vec3, D),
12463                inset_from_max: fidl::new_empty!(Vec3, D),
12464                focus_change: fidl::new_empty!(bool, D),
12465                downward_input: fidl::new_empty!(bool, D),
12466            }
12467        }
12468
12469        #[inline]
12470        unsafe fn decode(
12471            &mut self,
12472            decoder: &mut fidl::encoding::Decoder<'_, D>,
12473            offset: usize,
12474            _depth: fidl::encoding::Depth,
12475        ) -> fidl::Result<()> {
12476            decoder.debug_check_bounds::<Self>(offset);
12477            // Verify that padding bytes are zero.
12478            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
12479            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12480            let mask = 0xffff0000u32;
12481            let maskedval = padval & mask;
12482            if maskedval != 0 {
12483                return Err(fidl::Error::NonZeroPadding {
12484                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
12485                });
12486            }
12487            fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 0, _depth)?;
12488            fidl::decode!(Vec3, D, &mut self.inset_from_min, decoder, offset + 24, _depth)?;
12489            fidl::decode!(Vec3, D, &mut self.inset_from_max, decoder, offset + 36, _depth)?;
12490            fidl::decode!(bool, D, &mut self.focus_change, decoder, offset + 48, _depth)?;
12491            fidl::decode!(bool, D, &mut self.downward_input, decoder, offset + 49, _depth)?;
12492            Ok(())
12493        }
12494    }
12495
12496    impl fidl::encoding::ValueTypeMarker for ViewPropertiesChangedEvent {
12497        type Borrowed<'a> = &'a Self;
12498        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12499            value
12500        }
12501    }
12502
12503    unsafe impl fidl::encoding::TypeMarker for ViewPropertiesChangedEvent {
12504        type Owned = Self;
12505
12506        #[inline(always)]
12507        fn inline_align(_context: fidl::encoding::Context) -> usize {
12508            4
12509        }
12510
12511        #[inline(always)]
12512        fn inline_size(_context: fidl::encoding::Context) -> usize {
12513            56
12514        }
12515    }
12516
12517    unsafe impl<D: fidl::encoding::ResourceDialect>
12518        fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for &ViewPropertiesChangedEvent
12519    {
12520        #[inline]
12521        unsafe fn encode(
12522            self,
12523            encoder: &mut fidl::encoding::Encoder<'_, D>,
12524            offset: usize,
12525            _depth: fidl::encoding::Depth,
12526        ) -> fidl::Result<()> {
12527            encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12528            // Delegate to tuple encoding.
12529            fidl::encoding::Encode::<ViewPropertiesChangedEvent, D>::encode(
12530                (
12531                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
12532                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
12533                ),
12534                encoder,
12535                offset,
12536                _depth,
12537            )
12538        }
12539    }
12540    unsafe impl<
12541            D: fidl::encoding::ResourceDialect,
12542            T0: fidl::encoding::Encode<u32, D>,
12543            T1: fidl::encoding::Encode<ViewProperties, D>,
12544        > fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for (T0, T1)
12545    {
12546        #[inline]
12547        unsafe fn encode(
12548            self,
12549            encoder: &mut fidl::encoding::Encoder<'_, D>,
12550            offset: usize,
12551            depth: fidl::encoding::Depth,
12552        ) -> fidl::Result<()> {
12553            encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12554            // Zero out padding regions. There's no need to apply masks
12555            // because the unmasked parts will be overwritten by fields.
12556            // Write the fields.
12557            self.0.encode(encoder, offset + 0, depth)?;
12558            self.1.encode(encoder, offset + 4, depth)?;
12559            Ok(())
12560        }
12561    }
12562
12563    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12564        for ViewPropertiesChangedEvent
12565    {
12566        #[inline(always)]
12567        fn new_empty() -> Self {
12568            Self {
12569                view_id: fidl::new_empty!(u32, D),
12570                properties: fidl::new_empty!(ViewProperties, D),
12571            }
12572        }
12573
12574        #[inline]
12575        unsafe fn decode(
12576            &mut self,
12577            decoder: &mut fidl::encoding::Decoder<'_, D>,
12578            offset: usize,
12579            _depth: fidl::encoding::Depth,
12580        ) -> fidl::Result<()> {
12581            decoder.debug_check_bounds::<Self>(offset);
12582            // Verify that padding bytes are zero.
12583            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
12584            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
12585            Ok(())
12586        }
12587    }
12588
12589    impl fidl::encoding::ValueTypeMarker for ViewState {
12590        type Borrowed<'a> = &'a Self;
12591        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12592            value
12593        }
12594    }
12595
12596    unsafe impl fidl::encoding::TypeMarker for ViewState {
12597        type Owned = Self;
12598
12599        #[inline(always)]
12600        fn inline_align(_context: fidl::encoding::Context) -> usize {
12601            1
12602        }
12603
12604        #[inline(always)]
12605        fn inline_size(_context: fidl::encoding::Context) -> usize {
12606            1
12607        }
12608    }
12609
12610    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewState, D>
12611        for &ViewState
12612    {
12613        #[inline]
12614        unsafe fn encode(
12615            self,
12616            encoder: &mut fidl::encoding::Encoder<'_, D>,
12617            offset: usize,
12618            _depth: fidl::encoding::Depth,
12619        ) -> fidl::Result<()> {
12620            encoder.debug_check_bounds::<ViewState>(offset);
12621            // Delegate to tuple encoding.
12622            fidl::encoding::Encode::<ViewState, D>::encode(
12623                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_rendering),),
12624                encoder,
12625                offset,
12626                _depth,
12627            )
12628        }
12629    }
12630    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12631        fidl::encoding::Encode<ViewState, D> for (T0,)
12632    {
12633        #[inline]
12634        unsafe fn encode(
12635            self,
12636            encoder: &mut fidl::encoding::Encoder<'_, D>,
12637            offset: usize,
12638            depth: fidl::encoding::Depth,
12639        ) -> fidl::Result<()> {
12640            encoder.debug_check_bounds::<ViewState>(offset);
12641            // Zero out padding regions. There's no need to apply masks
12642            // because the unmasked parts will be overwritten by fields.
12643            // Write the fields.
12644            self.0.encode(encoder, offset + 0, depth)?;
12645            Ok(())
12646        }
12647    }
12648
12649    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewState {
12650        #[inline(always)]
12651        fn new_empty() -> Self {
12652            Self { is_rendering: fidl::new_empty!(bool, D) }
12653        }
12654
12655        #[inline]
12656        unsafe fn decode(
12657            &mut self,
12658            decoder: &mut fidl::encoding::Decoder<'_, D>,
12659            offset: usize,
12660            _depth: fidl::encoding::Depth,
12661        ) -> fidl::Result<()> {
12662            decoder.debug_check_bounds::<Self>(offset);
12663            // Verify that padding bytes are zero.
12664            fidl::decode!(bool, D, &mut self.is_rendering, decoder, offset + 0, _depth)?;
12665            Ok(())
12666        }
12667    }
12668
12669    impl fidl::encoding::ValueTypeMarker for ViewStateChangedEvent {
12670        type Borrowed<'a> = &'a Self;
12671        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12672            value
12673        }
12674    }
12675
12676    unsafe impl fidl::encoding::TypeMarker for ViewStateChangedEvent {
12677        type Owned = Self;
12678
12679        #[inline(always)]
12680        fn inline_align(_context: fidl::encoding::Context) -> usize {
12681            4
12682        }
12683
12684        #[inline(always)]
12685        fn inline_size(_context: fidl::encoding::Context) -> usize {
12686            8
12687        }
12688    }
12689
12690    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewStateChangedEvent, D>
12691        for &ViewStateChangedEvent
12692    {
12693        #[inline]
12694        unsafe fn encode(
12695            self,
12696            encoder: &mut fidl::encoding::Encoder<'_, D>,
12697            offset: usize,
12698            _depth: fidl::encoding::Depth,
12699        ) -> fidl::Result<()> {
12700            encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12701            // Delegate to tuple encoding.
12702            fidl::encoding::Encode::<ViewStateChangedEvent, D>::encode(
12703                (
12704                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
12705                    <ViewState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
12706                ),
12707                encoder,
12708                offset,
12709                _depth,
12710            )
12711        }
12712    }
12713    unsafe impl<
12714            D: fidl::encoding::ResourceDialect,
12715            T0: fidl::encoding::Encode<u32, D>,
12716            T1: fidl::encoding::Encode<ViewState, D>,
12717        > fidl::encoding::Encode<ViewStateChangedEvent, D> for (T0, T1)
12718    {
12719        #[inline]
12720        unsafe fn encode(
12721            self,
12722            encoder: &mut fidl::encoding::Encoder<'_, D>,
12723            offset: usize,
12724            depth: fidl::encoding::Depth,
12725        ) -> fidl::Result<()> {
12726            encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12727            // Zero out padding regions. There's no need to apply masks
12728            // because the unmasked parts will be overwritten by fields.
12729            unsafe {
12730                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
12731                (ptr as *mut u32).write_unaligned(0);
12732            }
12733            // Write the fields.
12734            self.0.encode(encoder, offset + 0, depth)?;
12735            self.1.encode(encoder, offset + 4, depth)?;
12736            Ok(())
12737        }
12738    }
12739
12740    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewStateChangedEvent {
12741        #[inline(always)]
12742        fn new_empty() -> Self {
12743            Self { view_holder_id: fidl::new_empty!(u32, D), state: fidl::new_empty!(ViewState, D) }
12744        }
12745
12746        #[inline]
12747        unsafe fn decode(
12748            &mut self,
12749            decoder: &mut fidl::encoding::Decoder<'_, D>,
12750            offset: usize,
12751            _depth: fidl::encoding::Depth,
12752        ) -> fidl::Result<()> {
12753            decoder.debug_check_bounds::<Self>(offset);
12754            // Verify that padding bytes are zero.
12755            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
12756            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12757            let mask = 0xffffff00u32;
12758            let maskedval = padval & mask;
12759            if maskedval != 0 {
12760                return Err(fidl::Error::NonZeroPadding {
12761                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
12762                });
12763            }
12764            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
12765            fidl::decode!(ViewState, D, &mut self.state, decoder, offset + 4, _depth)?;
12766            Ok(())
12767        }
12768    }
12769
12770    impl fidl::encoding::ValueTypeMarker for Mat4 {
12771        type Borrowed<'a> = &'a Self;
12772        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12773            value
12774        }
12775    }
12776
12777    unsafe impl fidl::encoding::TypeMarker for Mat4 {
12778        type Owned = Self;
12779
12780        #[inline(always)]
12781        fn inline_align(_context: fidl::encoding::Context) -> usize {
12782            4
12783        }
12784
12785        #[inline(always)]
12786        fn inline_size(_context: fidl::encoding::Context) -> usize {
12787            64
12788        }
12789    }
12790
12791    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Mat4, D> for &Mat4 {
12792        #[inline]
12793        unsafe fn encode(
12794            self,
12795            encoder: &mut fidl::encoding::Encoder<'_, D>,
12796            offset: usize,
12797            _depth: fidl::encoding::Depth,
12798        ) -> fidl::Result<()> {
12799            encoder.debug_check_bounds::<Mat4>(offset);
12800            // Delegate to tuple encoding.
12801            fidl::encoding::Encode::<Mat4, D>::encode(
12802                (<fidl::encoding::Array<f32, 16> as fidl::encoding::ValueTypeMarker>::borrow(
12803                    &self.matrix,
12804                ),),
12805                encoder,
12806                offset,
12807                _depth,
12808            )
12809        }
12810    }
12811    unsafe impl<
12812            D: fidl::encoding::ResourceDialect,
12813            T0: fidl::encoding::Encode<fidl::encoding::Array<f32, 16>, D>,
12814        > fidl::encoding::Encode<Mat4, D> for (T0,)
12815    {
12816        #[inline]
12817        unsafe fn encode(
12818            self,
12819            encoder: &mut fidl::encoding::Encoder<'_, D>,
12820            offset: usize,
12821            depth: fidl::encoding::Depth,
12822        ) -> fidl::Result<()> {
12823            encoder.debug_check_bounds::<Mat4>(offset);
12824            // Zero out padding regions. There's no need to apply masks
12825            // because the unmasked parts will be overwritten by fields.
12826            // Write the fields.
12827            self.0.encode(encoder, offset + 0, depth)?;
12828            Ok(())
12829        }
12830    }
12831
12832    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Mat4 {
12833        #[inline(always)]
12834        fn new_empty() -> Self {
12835            Self { matrix: fidl::new_empty!(fidl::encoding::Array<f32, 16>, D) }
12836        }
12837
12838        #[inline]
12839        unsafe fn decode(
12840            &mut self,
12841            decoder: &mut fidl::encoding::Decoder<'_, D>,
12842            offset: usize,
12843            _depth: fidl::encoding::Depth,
12844        ) -> fidl::Result<()> {
12845            decoder.debug_check_bounds::<Self>(offset);
12846            // Verify that padding bytes are zero.
12847            fidl::decode!(fidl::encoding::Array<f32, 16>, D, &mut self.matrix, decoder, offset + 0, _depth)?;
12848            Ok(())
12849        }
12850    }
12851
12852    impl fidl::encoding::ValueTypeMarker for Vec2 {
12853        type Borrowed<'a> = &'a Self;
12854        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12855            value
12856        }
12857    }
12858
12859    unsafe impl fidl::encoding::TypeMarker for Vec2 {
12860        type Owned = Self;
12861
12862        #[inline(always)]
12863        fn inline_align(_context: fidl::encoding::Context) -> usize {
12864            4
12865        }
12866
12867        #[inline(always)]
12868        fn inline_size(_context: fidl::encoding::Context) -> usize {
12869            8
12870        }
12871    }
12872
12873    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec2, D> for &Vec2 {
12874        #[inline]
12875        unsafe fn encode(
12876            self,
12877            encoder: &mut fidl::encoding::Encoder<'_, D>,
12878            offset: usize,
12879            _depth: fidl::encoding::Depth,
12880        ) -> fidl::Result<()> {
12881            encoder.debug_check_bounds::<Vec2>(offset);
12882            // Delegate to tuple encoding.
12883            fidl::encoding::Encode::<Vec2, D>::encode(
12884                (
12885                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
12886                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
12887                ),
12888                encoder,
12889                offset,
12890                _depth,
12891            )
12892        }
12893    }
12894    unsafe impl<
12895            D: fidl::encoding::ResourceDialect,
12896            T0: fidl::encoding::Encode<f32, D>,
12897            T1: fidl::encoding::Encode<f32, D>,
12898        > fidl::encoding::Encode<Vec2, D> for (T0, T1)
12899    {
12900        #[inline]
12901        unsafe fn encode(
12902            self,
12903            encoder: &mut fidl::encoding::Encoder<'_, D>,
12904            offset: usize,
12905            depth: fidl::encoding::Depth,
12906        ) -> fidl::Result<()> {
12907            encoder.debug_check_bounds::<Vec2>(offset);
12908            // Zero out padding regions. There's no need to apply masks
12909            // because the unmasked parts will be overwritten by fields.
12910            // Write the fields.
12911            self.0.encode(encoder, offset + 0, depth)?;
12912            self.1.encode(encoder, offset + 4, depth)?;
12913            Ok(())
12914        }
12915    }
12916
12917    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec2 {
12918        #[inline(always)]
12919        fn new_empty() -> Self {
12920            Self { x: fidl::new_empty!(f32, D), y: fidl::new_empty!(f32, D) }
12921        }
12922
12923        #[inline]
12924        unsafe fn decode(
12925            &mut self,
12926            decoder: &mut fidl::encoding::Decoder<'_, D>,
12927            offset: usize,
12928            _depth: fidl::encoding::Depth,
12929        ) -> fidl::Result<()> {
12930            decoder.debug_check_bounds::<Self>(offset);
12931            // Verify that padding bytes are zero.
12932            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
12933            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
12934            Ok(())
12935        }
12936    }
12937
12938    impl fidl::encoding::ValueTypeMarker for Vec3 {
12939        type Borrowed<'a> = &'a Self;
12940        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12941            value
12942        }
12943    }
12944
12945    unsafe impl fidl::encoding::TypeMarker for Vec3 {
12946        type Owned = Self;
12947
12948        #[inline(always)]
12949        fn inline_align(_context: fidl::encoding::Context) -> usize {
12950            4
12951        }
12952
12953        #[inline(always)]
12954        fn inline_size(_context: fidl::encoding::Context) -> usize {
12955            12
12956        }
12957    }
12958
12959    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec3, D> for &Vec3 {
12960        #[inline]
12961        unsafe fn encode(
12962            self,
12963            encoder: &mut fidl::encoding::Encoder<'_, D>,
12964            offset: usize,
12965            _depth: fidl::encoding::Depth,
12966        ) -> fidl::Result<()> {
12967            encoder.debug_check_bounds::<Vec3>(offset);
12968            // Delegate to tuple encoding.
12969            fidl::encoding::Encode::<Vec3, D>::encode(
12970                (
12971                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
12972                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
12973                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
12974                ),
12975                encoder,
12976                offset,
12977                _depth,
12978            )
12979        }
12980    }
12981    unsafe impl<
12982            D: fidl::encoding::ResourceDialect,
12983            T0: fidl::encoding::Encode<f32, D>,
12984            T1: fidl::encoding::Encode<f32, D>,
12985            T2: fidl::encoding::Encode<f32, D>,
12986        > fidl::encoding::Encode<Vec3, D> for (T0, T1, T2)
12987    {
12988        #[inline]
12989        unsafe fn encode(
12990            self,
12991            encoder: &mut fidl::encoding::Encoder<'_, D>,
12992            offset: usize,
12993            depth: fidl::encoding::Depth,
12994        ) -> fidl::Result<()> {
12995            encoder.debug_check_bounds::<Vec3>(offset);
12996            // Zero out padding regions. There's no need to apply masks
12997            // because the unmasked parts will be overwritten by fields.
12998            // Write the fields.
12999            self.0.encode(encoder, offset + 0, depth)?;
13000            self.1.encode(encoder, offset + 4, depth)?;
13001            self.2.encode(encoder, offset + 8, depth)?;
13002            Ok(())
13003        }
13004    }
13005
13006    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec3 {
13007        #[inline(always)]
13008        fn new_empty() -> Self {
13009            Self {
13010                x: fidl::new_empty!(f32, D),
13011                y: fidl::new_empty!(f32, D),
13012                z: fidl::new_empty!(f32, D),
13013            }
13014        }
13015
13016        #[inline]
13017        unsafe fn decode(
13018            &mut self,
13019            decoder: &mut fidl::encoding::Decoder<'_, D>,
13020            offset: usize,
13021            _depth: fidl::encoding::Depth,
13022        ) -> fidl::Result<()> {
13023            decoder.debug_check_bounds::<Self>(offset);
13024            // Verify that padding bytes are zero.
13025            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13026            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13027            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13028            Ok(())
13029        }
13030    }
13031
13032    impl fidl::encoding::ValueTypeMarker for Vec4 {
13033        type Borrowed<'a> = &'a Self;
13034        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13035            value
13036        }
13037    }
13038
13039    unsafe impl fidl::encoding::TypeMarker for Vec4 {
13040        type Owned = Self;
13041
13042        #[inline(always)]
13043        fn inline_align(_context: fidl::encoding::Context) -> usize {
13044            4
13045        }
13046
13047        #[inline(always)]
13048        fn inline_size(_context: fidl::encoding::Context) -> usize {
13049            16
13050        }
13051    }
13052
13053    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec4, D> for &Vec4 {
13054        #[inline]
13055        unsafe fn encode(
13056            self,
13057            encoder: &mut fidl::encoding::Encoder<'_, D>,
13058            offset: usize,
13059            _depth: fidl::encoding::Depth,
13060        ) -> fidl::Result<()> {
13061            encoder.debug_check_bounds::<Vec4>(offset);
13062            // Delegate to tuple encoding.
13063            fidl::encoding::Encode::<Vec4, D>::encode(
13064                (
13065                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
13066                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
13067                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
13068                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
13069                ),
13070                encoder,
13071                offset,
13072                _depth,
13073            )
13074        }
13075    }
13076    unsafe impl<
13077            D: fidl::encoding::ResourceDialect,
13078            T0: fidl::encoding::Encode<f32, D>,
13079            T1: fidl::encoding::Encode<f32, D>,
13080            T2: fidl::encoding::Encode<f32, D>,
13081            T3: fidl::encoding::Encode<f32, D>,
13082        > fidl::encoding::Encode<Vec4, D> for (T0, T1, T2, T3)
13083    {
13084        #[inline]
13085        unsafe fn encode(
13086            self,
13087            encoder: &mut fidl::encoding::Encoder<'_, D>,
13088            offset: usize,
13089            depth: fidl::encoding::Depth,
13090        ) -> fidl::Result<()> {
13091            encoder.debug_check_bounds::<Vec4>(offset);
13092            // Zero out padding regions. There's no need to apply masks
13093            // because the unmasked parts will be overwritten by fields.
13094            // Write the fields.
13095            self.0.encode(encoder, offset + 0, depth)?;
13096            self.1.encode(encoder, offset + 4, depth)?;
13097            self.2.encode(encoder, offset + 8, depth)?;
13098            self.3.encode(encoder, offset + 12, depth)?;
13099            Ok(())
13100        }
13101    }
13102
13103    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec4 {
13104        #[inline(always)]
13105        fn new_empty() -> Self {
13106            Self {
13107                x: fidl::new_empty!(f32, D),
13108                y: fidl::new_empty!(f32, D),
13109                z: fidl::new_empty!(f32, D),
13110                w: fidl::new_empty!(f32, D),
13111            }
13112        }
13113
13114        #[inline]
13115        unsafe fn decode(
13116            &mut self,
13117            decoder: &mut fidl::encoding::Decoder<'_, D>,
13118            offset: usize,
13119            _depth: fidl::encoding::Depth,
13120        ) -> fidl::Result<()> {
13121            decoder.debug_check_bounds::<Self>(offset);
13122            // Verify that padding bytes are zero.
13123            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13124            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13125            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13126            fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
13127            Ok(())
13128        }
13129    }
13130
13131    impl fidl::encoding::ValueTypeMarker for Event {
13132        type Borrowed<'a> = &'a Self;
13133        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13134            value
13135        }
13136    }
13137
13138    unsafe impl fidl::encoding::TypeMarker for Event {
13139        type Owned = Self;
13140
13141        #[inline(always)]
13142        fn inline_align(_context: fidl::encoding::Context) -> usize {
13143            8
13144        }
13145
13146        #[inline(always)]
13147        fn inline_size(_context: fidl::encoding::Context) -> usize {
13148            16
13149        }
13150    }
13151
13152    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Event, D> for &Event {
13153        #[inline]
13154        unsafe fn encode(
13155            self,
13156            encoder: &mut fidl::encoding::Encoder<'_, D>,
13157            offset: usize,
13158            _depth: fidl::encoding::Depth,
13159        ) -> fidl::Result<()> {
13160            encoder.debug_check_bounds::<Event>(offset);
13161            encoder.write_num::<u64>(self.ordinal(), offset);
13162            match self {
13163                Event::Metrics(ref val) => fidl::encoding::encode_in_envelope::<MetricsEvent, D>(
13164                    <MetricsEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13165                    encoder,
13166                    offset + 8,
13167                    _depth,
13168                ),
13169                Event::SizeChangeHint(ref val) => {
13170                    fidl::encoding::encode_in_envelope::<SizeChangeHintEvent, D>(
13171                        <SizeChangeHintEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13172                        encoder,
13173                        offset + 8,
13174                        _depth,
13175                    )
13176                }
13177                Event::ImportUnbound(ref val) => {
13178                    fidl::encoding::encode_in_envelope::<ImportUnboundEvent, D>(
13179                        <ImportUnboundEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13180                        encoder,
13181                        offset + 8,
13182                        _depth,
13183                    )
13184                }
13185                Event::ViewConnected(ref val) => {
13186                    fidl::encoding::encode_in_envelope::<ViewConnectedEvent, D>(
13187                        <ViewConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13188                        encoder,
13189                        offset + 8,
13190                        _depth,
13191                    )
13192                }
13193                Event::ViewDisconnected(ref val) => {
13194                    fidl::encoding::encode_in_envelope::<ViewDisconnectedEvent, D>(
13195                        <ViewDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13196                        encoder,
13197                        offset + 8,
13198                        _depth,
13199                    )
13200                }
13201                Event::ViewHolderDisconnected(ref val) => fidl::encoding::encode_in_envelope::<
13202                    ViewHolderDisconnectedEvent,
13203                    D,
13204                >(
13205                    <ViewHolderDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13206                    encoder,
13207                    offset + 8,
13208                    _depth,
13209                ),
13210                Event::ViewAttachedToScene(ref val) => {
13211                    fidl::encoding::encode_in_envelope::<ViewAttachedToSceneEvent, D>(
13212                        <ViewAttachedToSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13213                        encoder,
13214                        offset + 8,
13215                        _depth,
13216                    )
13217                }
13218                Event::ViewDetachedFromScene(ref val) => fidl::encoding::encode_in_envelope::<
13219                    ViewDetachedFromSceneEvent,
13220                    D,
13221                >(
13222                    <ViewDetachedFromSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13223                    encoder,
13224                    offset + 8,
13225                    _depth,
13226                ),
13227                Event::ViewPropertiesChanged(ref val) => fidl::encoding::encode_in_envelope::<
13228                    ViewPropertiesChangedEvent,
13229                    D,
13230                >(
13231                    <ViewPropertiesChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13232                    encoder,
13233                    offset + 8,
13234                    _depth,
13235                ),
13236                Event::ViewStateChanged(ref val) => {
13237                    fidl::encoding::encode_in_envelope::<ViewStateChangedEvent, D>(
13238                        <ViewStateChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13239                        encoder,
13240                        offset + 8,
13241                        _depth,
13242                    )
13243                }
13244                Event::ViewHolderConnected(ref val) => {
13245                    fidl::encoding::encode_in_envelope::<ViewHolderConnectedEvent, D>(
13246                        <ViewHolderConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13247                        encoder,
13248                        offset + 8,
13249                        _depth,
13250                    )
13251                }
13252            }
13253        }
13254    }
13255
13256    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Event {
13257        #[inline(always)]
13258        fn new_empty() -> Self {
13259            Self::Metrics(fidl::new_empty!(MetricsEvent, D))
13260        }
13261
13262        #[inline]
13263        unsafe fn decode(
13264            &mut self,
13265            decoder: &mut fidl::encoding::Decoder<'_, D>,
13266            offset: usize,
13267            mut depth: fidl::encoding::Depth,
13268        ) -> fidl::Result<()> {
13269            decoder.debug_check_bounds::<Self>(offset);
13270            #[allow(unused_variables)]
13271            let next_out_of_line = decoder.next_out_of_line();
13272            let handles_before = decoder.remaining_handles();
13273            let (ordinal, inlined, num_bytes, num_handles) =
13274                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13275
13276            let member_inline_size = match ordinal {
13277                1 => <MetricsEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13278                2 => <SizeChangeHintEvent as fidl::encoding::TypeMarker>::inline_size(
13279                    decoder.context,
13280                ),
13281                3 => {
13282                    <ImportUnboundEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13283                }
13284                4 => {
13285                    <ViewConnectedEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13286                }
13287                5 => <ViewDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13288                    decoder.context,
13289                ),
13290                6 => <ViewHolderDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13291                    decoder.context,
13292                ),
13293                7 => <ViewAttachedToSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13294                    decoder.context,
13295                ),
13296                8 => <ViewDetachedFromSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13297                    decoder.context,
13298                ),
13299                9 => <ViewPropertiesChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13300                    decoder.context,
13301                ),
13302                10 => <ViewStateChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13303                    decoder.context,
13304                ),
13305                11 => <ViewHolderConnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13306                    decoder.context,
13307                ),
13308                _ => return Err(fidl::Error::UnknownUnionTag),
13309            };
13310
13311            if inlined != (member_inline_size <= 4) {
13312                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13313            }
13314            let _inner_offset;
13315            if inlined {
13316                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13317                _inner_offset = offset + 8;
13318            } else {
13319                depth.increment()?;
13320                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13321            }
13322            match ordinal {
13323                1 => {
13324                    #[allow(irrefutable_let_patterns)]
13325                    if let Event::Metrics(_) = self {
13326                        // Do nothing, read the value into the object
13327                    } else {
13328                        // Initialize `self` to the right variant
13329                        *self = Event::Metrics(fidl::new_empty!(MetricsEvent, D));
13330                    }
13331                    #[allow(irrefutable_let_patterns)]
13332                    if let Event::Metrics(ref mut val) = self {
13333                        fidl::decode!(MetricsEvent, D, val, decoder, _inner_offset, depth)?;
13334                    } else {
13335                        unreachable!()
13336                    }
13337                }
13338                2 => {
13339                    #[allow(irrefutable_let_patterns)]
13340                    if let Event::SizeChangeHint(_) = self {
13341                        // Do nothing, read the value into the object
13342                    } else {
13343                        // Initialize `self` to the right variant
13344                        *self = Event::SizeChangeHint(fidl::new_empty!(SizeChangeHintEvent, D));
13345                    }
13346                    #[allow(irrefutable_let_patterns)]
13347                    if let Event::SizeChangeHint(ref mut val) = self {
13348                        fidl::decode!(SizeChangeHintEvent, D, val, decoder, _inner_offset, depth)?;
13349                    } else {
13350                        unreachable!()
13351                    }
13352                }
13353                3 => {
13354                    #[allow(irrefutable_let_patterns)]
13355                    if let Event::ImportUnbound(_) = self {
13356                        // Do nothing, read the value into the object
13357                    } else {
13358                        // Initialize `self` to the right variant
13359                        *self = Event::ImportUnbound(fidl::new_empty!(ImportUnboundEvent, D));
13360                    }
13361                    #[allow(irrefutable_let_patterns)]
13362                    if let Event::ImportUnbound(ref mut val) = self {
13363                        fidl::decode!(ImportUnboundEvent, D, val, decoder, _inner_offset, depth)?;
13364                    } else {
13365                        unreachable!()
13366                    }
13367                }
13368                4 => {
13369                    #[allow(irrefutable_let_patterns)]
13370                    if let Event::ViewConnected(_) = self {
13371                        // Do nothing, read the value into the object
13372                    } else {
13373                        // Initialize `self` to the right variant
13374                        *self = Event::ViewConnected(fidl::new_empty!(ViewConnectedEvent, D));
13375                    }
13376                    #[allow(irrefutable_let_patterns)]
13377                    if let Event::ViewConnected(ref mut val) = self {
13378                        fidl::decode!(ViewConnectedEvent, D, val, decoder, _inner_offset, depth)?;
13379                    } else {
13380                        unreachable!()
13381                    }
13382                }
13383                5 => {
13384                    #[allow(irrefutable_let_patterns)]
13385                    if let Event::ViewDisconnected(_) = self {
13386                        // Do nothing, read the value into the object
13387                    } else {
13388                        // Initialize `self` to the right variant
13389                        *self = Event::ViewDisconnected(fidl::new_empty!(ViewDisconnectedEvent, D));
13390                    }
13391                    #[allow(irrefutable_let_patterns)]
13392                    if let Event::ViewDisconnected(ref mut val) = self {
13393                        fidl::decode!(
13394                            ViewDisconnectedEvent,
13395                            D,
13396                            val,
13397                            decoder,
13398                            _inner_offset,
13399                            depth
13400                        )?;
13401                    } else {
13402                        unreachable!()
13403                    }
13404                }
13405                6 => {
13406                    #[allow(irrefutable_let_patterns)]
13407                    if let Event::ViewHolderDisconnected(_) = self {
13408                        // Do nothing, read the value into the object
13409                    } else {
13410                        // Initialize `self` to the right variant
13411                        *self = Event::ViewHolderDisconnected(fidl::new_empty!(
13412                            ViewHolderDisconnectedEvent,
13413                            D
13414                        ));
13415                    }
13416                    #[allow(irrefutable_let_patterns)]
13417                    if let Event::ViewHolderDisconnected(ref mut val) = self {
13418                        fidl::decode!(
13419                            ViewHolderDisconnectedEvent,
13420                            D,
13421                            val,
13422                            decoder,
13423                            _inner_offset,
13424                            depth
13425                        )?;
13426                    } else {
13427                        unreachable!()
13428                    }
13429                }
13430                7 => {
13431                    #[allow(irrefutable_let_patterns)]
13432                    if let Event::ViewAttachedToScene(_) = self {
13433                        // Do nothing, read the value into the object
13434                    } else {
13435                        // Initialize `self` to the right variant
13436                        *self = Event::ViewAttachedToScene(fidl::new_empty!(
13437                            ViewAttachedToSceneEvent,
13438                            D
13439                        ));
13440                    }
13441                    #[allow(irrefutable_let_patterns)]
13442                    if let Event::ViewAttachedToScene(ref mut val) = self {
13443                        fidl::decode!(
13444                            ViewAttachedToSceneEvent,
13445                            D,
13446                            val,
13447                            decoder,
13448                            _inner_offset,
13449                            depth
13450                        )?;
13451                    } else {
13452                        unreachable!()
13453                    }
13454                }
13455                8 => {
13456                    #[allow(irrefutable_let_patterns)]
13457                    if let Event::ViewDetachedFromScene(_) = self {
13458                        // Do nothing, read the value into the object
13459                    } else {
13460                        // Initialize `self` to the right variant
13461                        *self = Event::ViewDetachedFromScene(fidl::new_empty!(
13462                            ViewDetachedFromSceneEvent,
13463                            D
13464                        ));
13465                    }
13466                    #[allow(irrefutable_let_patterns)]
13467                    if let Event::ViewDetachedFromScene(ref mut val) = self {
13468                        fidl::decode!(
13469                            ViewDetachedFromSceneEvent,
13470                            D,
13471                            val,
13472                            decoder,
13473                            _inner_offset,
13474                            depth
13475                        )?;
13476                    } else {
13477                        unreachable!()
13478                    }
13479                }
13480                9 => {
13481                    #[allow(irrefutable_let_patterns)]
13482                    if let Event::ViewPropertiesChanged(_) = self {
13483                        // Do nothing, read the value into the object
13484                    } else {
13485                        // Initialize `self` to the right variant
13486                        *self = Event::ViewPropertiesChanged(fidl::new_empty!(
13487                            ViewPropertiesChangedEvent,
13488                            D
13489                        ));
13490                    }
13491                    #[allow(irrefutable_let_patterns)]
13492                    if let Event::ViewPropertiesChanged(ref mut val) = self {
13493                        fidl::decode!(
13494                            ViewPropertiesChangedEvent,
13495                            D,
13496                            val,
13497                            decoder,
13498                            _inner_offset,
13499                            depth
13500                        )?;
13501                    } else {
13502                        unreachable!()
13503                    }
13504                }
13505                10 => {
13506                    #[allow(irrefutable_let_patterns)]
13507                    if let Event::ViewStateChanged(_) = self {
13508                        // Do nothing, read the value into the object
13509                    } else {
13510                        // Initialize `self` to the right variant
13511                        *self = Event::ViewStateChanged(fidl::new_empty!(ViewStateChangedEvent, D));
13512                    }
13513                    #[allow(irrefutable_let_patterns)]
13514                    if let Event::ViewStateChanged(ref mut val) = self {
13515                        fidl::decode!(
13516                            ViewStateChangedEvent,
13517                            D,
13518                            val,
13519                            decoder,
13520                            _inner_offset,
13521                            depth
13522                        )?;
13523                    } else {
13524                        unreachable!()
13525                    }
13526                }
13527                11 => {
13528                    #[allow(irrefutable_let_patterns)]
13529                    if let Event::ViewHolderConnected(_) = self {
13530                        // Do nothing, read the value into the object
13531                    } else {
13532                        // Initialize `self` to the right variant
13533                        *self = Event::ViewHolderConnected(fidl::new_empty!(
13534                            ViewHolderConnectedEvent,
13535                            D
13536                        ));
13537                    }
13538                    #[allow(irrefutable_let_patterns)]
13539                    if let Event::ViewHolderConnected(ref mut val) = self {
13540                        fidl::decode!(
13541                            ViewHolderConnectedEvent,
13542                            D,
13543                            val,
13544                            decoder,
13545                            _inner_offset,
13546                            depth
13547                        )?;
13548                    } else {
13549                        unreachable!()
13550                    }
13551                }
13552                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13553            }
13554            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13555                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13556            }
13557            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13558                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13559            }
13560            Ok(())
13561        }
13562    }
13563
13564    impl fidl::encoding::ValueTypeMarker for RendererParam {
13565        type Borrowed<'a> = &'a Self;
13566        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13567            value
13568        }
13569    }
13570
13571    unsafe impl fidl::encoding::TypeMarker for RendererParam {
13572        type Owned = Self;
13573
13574        #[inline(always)]
13575        fn inline_align(_context: fidl::encoding::Context) -> usize {
13576            8
13577        }
13578
13579        #[inline(always)]
13580        fn inline_size(_context: fidl::encoding::Context) -> usize {
13581            16
13582        }
13583    }
13584
13585    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererParam, D>
13586        for &RendererParam
13587    {
13588        #[inline]
13589        unsafe fn encode(
13590            self,
13591            encoder: &mut fidl::encoding::Encoder<'_, D>,
13592            offset: usize,
13593            _depth: fidl::encoding::Depth,
13594        ) -> fidl::Result<()> {
13595            encoder.debug_check_bounds::<RendererParam>(offset);
13596            encoder.write_num::<u64>(self.ordinal(), offset);
13597            match self {
13598                RendererParam::ShadowTechnique(ref val) => {
13599                    fidl::encoding::encode_in_envelope::<ShadowTechnique, D>(
13600                        <ShadowTechnique as fidl::encoding::ValueTypeMarker>::borrow(val),
13601                        encoder,
13602                        offset + 8,
13603                        _depth,
13604                    )
13605                }
13606                RendererParam::Reserved(ref val) => {
13607                    fidl::encoding::encode_in_envelope::<RenderFrequency, D>(
13608                        <RenderFrequency as fidl::encoding::ValueTypeMarker>::borrow(val),
13609                        encoder,
13610                        offset + 8,
13611                        _depth,
13612                    )
13613                }
13614                RendererParam::EnableDebugging(ref val) => {
13615                    fidl::encoding::encode_in_envelope::<bool, D>(
13616                        <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
13617                        encoder,
13618                        offset + 8,
13619                        _depth,
13620                    )
13621                }
13622            }
13623        }
13624    }
13625
13626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererParam {
13627        #[inline(always)]
13628        fn new_empty() -> Self {
13629            Self::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D))
13630        }
13631
13632        #[inline]
13633        unsafe fn decode(
13634            &mut self,
13635            decoder: &mut fidl::encoding::Decoder<'_, D>,
13636            offset: usize,
13637            mut depth: fidl::encoding::Depth,
13638        ) -> fidl::Result<()> {
13639            decoder.debug_check_bounds::<Self>(offset);
13640            #[allow(unused_variables)]
13641            let next_out_of_line = decoder.next_out_of_line();
13642            let handles_before = decoder.remaining_handles();
13643            let (ordinal, inlined, num_bytes, num_handles) =
13644                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13645
13646            let member_inline_size = match ordinal {
13647                1 => <ShadowTechnique as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13648                2 => <RenderFrequency as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13649                3 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13650                _ => return Err(fidl::Error::UnknownUnionTag),
13651            };
13652
13653            if inlined != (member_inline_size <= 4) {
13654                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13655            }
13656            let _inner_offset;
13657            if inlined {
13658                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13659                _inner_offset = offset + 8;
13660            } else {
13661                depth.increment()?;
13662                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13663            }
13664            match ordinal {
13665                1 => {
13666                    #[allow(irrefutable_let_patterns)]
13667                    if let RendererParam::ShadowTechnique(_) = self {
13668                        // Do nothing, read the value into the object
13669                    } else {
13670                        // Initialize `self` to the right variant
13671                        *self =
13672                            RendererParam::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D));
13673                    }
13674                    #[allow(irrefutable_let_patterns)]
13675                    if let RendererParam::ShadowTechnique(ref mut val) = self {
13676                        fidl::decode!(ShadowTechnique, D, val, decoder, _inner_offset, depth)?;
13677                    } else {
13678                        unreachable!()
13679                    }
13680                }
13681                2 => {
13682                    #[allow(irrefutable_let_patterns)]
13683                    if let RendererParam::Reserved(_) = self {
13684                        // Do nothing, read the value into the object
13685                    } else {
13686                        // Initialize `self` to the right variant
13687                        *self = RendererParam::Reserved(fidl::new_empty!(RenderFrequency, D));
13688                    }
13689                    #[allow(irrefutable_let_patterns)]
13690                    if let RendererParam::Reserved(ref mut val) = self {
13691                        fidl::decode!(RenderFrequency, D, val, decoder, _inner_offset, depth)?;
13692                    } else {
13693                        unreachable!()
13694                    }
13695                }
13696                3 => {
13697                    #[allow(irrefutable_let_patterns)]
13698                    if let RendererParam::EnableDebugging(_) = self {
13699                        // Do nothing, read the value into the object
13700                    } else {
13701                        // Initialize `self` to the right variant
13702                        *self = RendererParam::EnableDebugging(fidl::new_empty!(bool, D));
13703                    }
13704                    #[allow(irrefutable_let_patterns)]
13705                    if let RendererParam::EnableDebugging(ref mut val) = self {
13706                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
13707                    } else {
13708                        unreachable!()
13709                    }
13710                }
13711                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13712            }
13713            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13714                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13715            }
13716            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13717                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13718            }
13719            Ok(())
13720        }
13721    }
13722
13723    impl fidl::encoding::ValueTypeMarker for Value {
13724        type Borrowed<'a> = &'a Self;
13725        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13726            value
13727        }
13728    }
13729
13730    unsafe impl fidl::encoding::TypeMarker for Value {
13731        type Owned = Self;
13732
13733        #[inline(always)]
13734        fn inline_align(_context: fidl::encoding::Context) -> usize {
13735            8
13736        }
13737
13738        #[inline(always)]
13739        fn inline_size(_context: fidl::encoding::Context) -> usize {
13740            16
13741        }
13742    }
13743
13744    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
13745        #[inline]
13746        unsafe fn encode(
13747            self,
13748            encoder: &mut fidl::encoding::Encoder<'_, D>,
13749            offset: usize,
13750            _depth: fidl::encoding::Depth,
13751        ) -> fidl::Result<()> {
13752            encoder.debug_check_bounds::<Value>(offset);
13753            encoder.write_num::<u64>(self.ordinal(), offset);
13754            match self {
13755                Value::Vector1(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13756                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13757                    encoder,
13758                    offset + 8,
13759                    _depth,
13760                ),
13761                Value::Vector2(ref val) => fidl::encoding::encode_in_envelope::<Vec2, D>(
13762                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(val),
13763                    encoder,
13764                    offset + 8,
13765                    _depth,
13766                ),
13767                Value::Vector3(ref val) => fidl::encoding::encode_in_envelope::<Vec3, D>(
13768                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(val),
13769                    encoder,
13770                    offset + 8,
13771                    _depth,
13772                ),
13773                Value::Vector4(ref val) => fidl::encoding::encode_in_envelope::<Vec4, D>(
13774                    <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13775                    encoder,
13776                    offset + 8,
13777                    _depth,
13778                ),
13779                Value::Matrix4x4(ref val) => fidl::encoding::encode_in_envelope::<Mat4, D>(
13780                    <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13781                    encoder,
13782                    offset + 8,
13783                    _depth,
13784                ),
13785                Value::ColorRgba(ref val) => fidl::encoding::encode_in_envelope::<ColorRgba, D>(
13786                    <ColorRgba as fidl::encoding::ValueTypeMarker>::borrow(val),
13787                    encoder,
13788                    offset + 8,
13789                    _depth,
13790                ),
13791                Value::ColorRgb(ref val) => fidl::encoding::encode_in_envelope::<ColorRgb, D>(
13792                    <ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(val),
13793                    encoder,
13794                    offset + 8,
13795                    _depth,
13796                ),
13797                Value::Degrees(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13798                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13799                    encoder,
13800                    offset + 8,
13801                    _depth,
13802                ),
13803                Value::Quaternion(ref val) => fidl::encoding::encode_in_envelope::<Quaternion, D>(
13804                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(val),
13805                    encoder,
13806                    offset + 8,
13807                    _depth,
13808                ),
13809                Value::Transform(ref val) => {
13810                    fidl::encoding::encode_in_envelope::<FactoredTransform, D>(
13811                        <FactoredTransform as fidl::encoding::ValueTypeMarker>::borrow(val),
13812                        encoder,
13813                        offset + 8,
13814                        _depth,
13815                    )
13816                }
13817                Value::VariableId(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
13818                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13819                    encoder,
13820                    offset + 8,
13821                    _depth,
13822                ),
13823            }
13824        }
13825    }
13826
13827    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
13828        #[inline(always)]
13829        fn new_empty() -> Self {
13830            Self::Vector1(fidl::new_empty!(f32, D))
13831        }
13832
13833        #[inline]
13834        unsafe fn decode(
13835            &mut self,
13836            decoder: &mut fidl::encoding::Decoder<'_, D>,
13837            offset: usize,
13838            mut depth: fidl::encoding::Depth,
13839        ) -> fidl::Result<()> {
13840            decoder.debug_check_bounds::<Self>(offset);
13841            #[allow(unused_variables)]
13842            let next_out_of_line = decoder.next_out_of_line();
13843            let handles_before = decoder.remaining_handles();
13844            let (ordinal, inlined, num_bytes, num_handles) =
13845                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13846
13847            let member_inline_size = match ordinal {
13848                1 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13849                2 => <Vec2 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13850                3 => <Vec3 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13851                4 => <Vec4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13852                5 => <Mat4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13853                6 => <ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13854                7 => <ColorRgb as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13855                8 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13856                9 => <Quaternion as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13857                10 => {
13858                    <FactoredTransform as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13859                }
13860                11 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13861                _ => return Err(fidl::Error::UnknownUnionTag),
13862            };
13863
13864            if inlined != (member_inline_size <= 4) {
13865                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13866            }
13867            let _inner_offset;
13868            if inlined {
13869                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13870                _inner_offset = offset + 8;
13871            } else {
13872                depth.increment()?;
13873                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13874            }
13875            match ordinal {
13876                1 => {
13877                    #[allow(irrefutable_let_patterns)]
13878                    if let Value::Vector1(_) = self {
13879                        // Do nothing, read the value into the object
13880                    } else {
13881                        // Initialize `self` to the right variant
13882                        *self = Value::Vector1(fidl::new_empty!(f32, D));
13883                    }
13884                    #[allow(irrefutable_let_patterns)]
13885                    if let Value::Vector1(ref mut val) = self {
13886                        fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
13887                    } else {
13888                        unreachable!()
13889                    }
13890                }
13891                2 => {
13892                    #[allow(irrefutable_let_patterns)]
13893                    if let Value::Vector2(_) = self {
13894                        // Do nothing, read the value into the object
13895                    } else {
13896                        // Initialize `self` to the right variant
13897                        *self = Value::Vector2(fidl::new_empty!(Vec2, D));
13898                    }
13899                    #[allow(irrefutable_let_patterns)]
13900                    if let Value::Vector2(ref mut val) = self {
13901                        fidl::decode!(Vec2, D, val, decoder, _inner_offset, depth)?;
13902                    } else {
13903                        unreachable!()
13904                    }
13905                }
13906                3 => {
13907                    #[allow(irrefutable_let_patterns)]
13908                    if let Value::Vector3(_) = self {
13909                        // Do nothing, read the value into the object
13910                    } else {
13911                        // Initialize `self` to the right variant
13912                        *self = Value::Vector3(fidl::new_empty!(Vec3, D));
13913                    }
13914                    #[allow(irrefutable_let_patterns)]
13915                    if let Value::Vector3(ref mut val) = self {
13916                        fidl::decode!(Vec3, D, val, decoder, _inner_offset, depth)?;
13917                    } else {
13918                        unreachable!()
13919                    }
13920                }
13921                4 => {
13922                    #[allow(irrefutable_let_patterns)]
13923                    if let Value::Vector4(_) = self {
13924                        // Do nothing, read the value into the object
13925                    } else {
13926                        // Initialize `self` to the right variant
13927                        *self = Value::Vector4(fidl::new_empty!(Vec4, D));
13928                    }
13929                    #[allow(irrefutable_let_patterns)]
13930                    if let Value::Vector4(ref mut val) = self {
13931                        fidl::decode!(Vec4, D, val, decoder, _inner_offset, depth)?;
13932                    } else {
13933                        unreachable!()
13934                    }
13935                }
13936                5 => {
13937                    #[allow(irrefutable_let_patterns)]
13938                    if let Value::Matrix4x4(_) = self {
13939                        // Do nothing, read the value into the object
13940                    } else {
13941                        // Initialize `self` to the right variant
13942                        *self = Value::Matrix4x4(fidl::new_empty!(Mat4, D));
13943                    }
13944                    #[allow(irrefutable_let_patterns)]
13945                    if let Value::Matrix4x4(ref mut val) = self {
13946                        fidl::decode!(Mat4, D, val, decoder, _inner_offset, depth)?;
13947                    } else {
13948                        unreachable!()
13949                    }
13950                }
13951                6 => {
13952                    #[allow(irrefutable_let_patterns)]
13953                    if let Value::ColorRgba(_) = self {
13954                        // Do nothing, read the value into the object
13955                    } else {
13956                        // Initialize `self` to the right variant
13957                        *self = Value::ColorRgba(fidl::new_empty!(ColorRgba, D));
13958                    }
13959                    #[allow(irrefutable_let_patterns)]
13960                    if let Value::ColorRgba(ref mut val) = self {
13961                        fidl::decode!(ColorRgba, D, val, decoder, _inner_offset, depth)?;
13962                    } else {
13963                        unreachable!()
13964                    }
13965                }
13966                7 => {
13967                    #[allow(irrefutable_let_patterns)]
13968                    if let Value::ColorRgb(_) = self {
13969                        // Do nothing, read the value into the object
13970                    } else {
13971                        // Initialize `self` to the right variant
13972                        *self = Value::ColorRgb(fidl::new_empty!(ColorRgb, D));
13973                    }
13974                    #[allow(irrefutable_let_patterns)]
13975                    if let Value::ColorRgb(ref mut val) = self {
13976                        fidl::decode!(ColorRgb, D, val, decoder, _inner_offset, depth)?;
13977                    } else {
13978                        unreachable!()
13979                    }
13980                }
13981                8 => {
13982                    #[allow(irrefutable_let_patterns)]
13983                    if let Value::Degrees(_) = self {
13984                        // Do nothing, read the value into the object
13985                    } else {
13986                        // Initialize `self` to the right variant
13987                        *self = Value::Degrees(fidl::new_empty!(f32, D));
13988                    }
13989                    #[allow(irrefutable_let_patterns)]
13990                    if let Value::Degrees(ref mut val) = self {
13991                        fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
13992                    } else {
13993                        unreachable!()
13994                    }
13995                }
13996                9 => {
13997                    #[allow(irrefutable_let_patterns)]
13998                    if let Value::Quaternion(_) = self {
13999                        // Do nothing, read the value into the object
14000                    } else {
14001                        // Initialize `self` to the right variant
14002                        *self = Value::Quaternion(fidl::new_empty!(Quaternion, D));
14003                    }
14004                    #[allow(irrefutable_let_patterns)]
14005                    if let Value::Quaternion(ref mut val) = self {
14006                        fidl::decode!(Quaternion, D, val, decoder, _inner_offset, depth)?;
14007                    } else {
14008                        unreachable!()
14009                    }
14010                }
14011                10 => {
14012                    #[allow(irrefutable_let_patterns)]
14013                    if let Value::Transform(_) = self {
14014                        // Do nothing, read the value into the object
14015                    } else {
14016                        // Initialize `self` to the right variant
14017                        *self = Value::Transform(fidl::new_empty!(FactoredTransform, D));
14018                    }
14019                    #[allow(irrefutable_let_patterns)]
14020                    if let Value::Transform(ref mut val) = self {
14021                        fidl::decode!(FactoredTransform, D, val, decoder, _inner_offset, depth)?;
14022                    } else {
14023                        unreachable!()
14024                    }
14025                }
14026                11 => {
14027                    #[allow(irrefutable_let_patterns)]
14028                    if let Value::VariableId(_) = self {
14029                        // Do nothing, read the value into the object
14030                    } else {
14031                        // Initialize `self` to the right variant
14032                        *self = Value::VariableId(fidl::new_empty!(u32, D));
14033                    }
14034                    #[allow(irrefutable_let_patterns)]
14035                    if let Value::VariableId(ref mut val) = self {
14036                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
14037                    } else {
14038                        unreachable!()
14039                    }
14040                }
14041                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14042            }
14043            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14044                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14045            }
14046            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14047                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14048            }
14049            Ok(())
14050        }
14051    }
14052}