fidl_fuchsia_ui_gfx__common/
fidl_fuchsia_ui_gfx__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// Maximum length for a resource label.
12pub const LABEL_MAX_LENGTH: u32 = 32;
13
14/// Reports metrics information.
15/// This event type is only reported for node resources.
16pub const METRICS_EVENT_MASK: u32 = 1;
17
18pub const SIZE_CHANGE_HINT_EVENT_MASK: u32 = 2;
19
20/// Describes how nodes interact with hit testings.
21#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
22#[repr(u32)]
23pub enum HitTestBehavior {
24    /// Apply hit testing to the node's content, its parts, and its children.
25    KDefault = 0,
26    /// Suppress hit testing of the node and everything it contains.
27    KSuppress = 1,
28}
29
30impl HitTestBehavior {
31    #[inline]
32    pub fn from_primitive(prim: u32) -> Option<Self> {
33        match prim {
34            0 => Some(Self::KDefault),
35            1 => Some(Self::KSuppress),
36            _ => None,
37        }
38    }
39
40    #[inline]
41    pub const fn into_primitive(self) -> u32 {
42        self as u32
43    }
44}
45
46/// Describes an exported resource that is to be imported by an
47/// ImportResourceCmd.
48///
49/// NOTE: Currently just an enum of importable resource types, but may later be
50/// expanded to express concepts like "meshes with a particular vertex format".
51#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
52#[repr(u32)]
53pub enum ImportSpec {
54    Node = 0,
55}
56
57impl ImportSpec {
58    #[inline]
59    pub fn from_primitive(prim: u32) -> Option<Self> {
60        match prim {
61            0 => Some(Self::Node),
62            _ => None,
63        }
64    }
65
66    #[inline]
67    pub const fn into_primitive(self) -> u32 {
68        self as u32
69    }
70}
71
72/// Set a mesh's indices and vertices.
73///
74/// `mesh_id` refs the Mesh to be updated.
75/// `index_buffer_id` refs a Buffer that contains the mesh indices.
76/// `index_format` defines how the index buffer data is to be interpreted.
77/// `index_offset` number of bytes from the start of the index Buffer.
78/// `index_count` number of indices.
79/// `vertex_buffer_id` refs a Buffer that contains the mesh vertices.
80/// `vertex_format` defines how the vertex buffer data is to be interpreted.
81/// `vertex_offset` number of bytes from the start of the vertex Buffer.
82/// `vertex_count` number of vertices.
83/// `bounding_box` must contain all vertices within the specified range.
84///
85/// The MeshVertexFormat defines which per-vertex attributes are provided by the
86/// mesh, and the size of each attribute (and therefore the size of each vertex).
87/// The attributes are ordered within the vertex in the same order that they
88/// appear within the MeshVertexFormat struct.  For example, if the values are
89/// kVector3, kNone and kVector2, then:
90///   - each vertex has a position and UV-coordinates, but no surface normal.
91///   - the 3D position occupies bytes 0-11 (3 dimensions * 4 bytes per float32).
92///   - the UV coords occupy bytes 12-19, since no surface normal is provided.
93#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
94#[repr(u32)]
95pub enum MeshIndexFormat {
96    KUint16 = 1,
97    KUint32 = 2,
98}
99
100impl MeshIndexFormat {
101    #[inline]
102    pub fn from_primitive(prim: u32) -> Option<Self> {
103        match prim {
104            1 => Some(Self::KUint16),
105            2 => Some(Self::KUint32),
106            _ => None,
107        }
108    }
109
110    #[inline]
111    pub const fn into_primitive(self) -> u32 {
112        self as u32
113    }
114}
115
116#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
117#[repr(u32)]
118pub enum RenderFrequency {
119    WhenRequested = 0,
120    Continuously = 1,
121}
122
123impl RenderFrequency {
124    #[inline]
125    pub fn from_primitive(prim: u32) -> Option<Self> {
126        match prim {
127            0 => Some(Self::WhenRequested),
128            1 => Some(Self::Continuously),
129            _ => None,
130        }
131    }
132
133    #[inline]
134    pub const fn into_primitive(self) -> u32 {
135        self as u32
136    }
137}
138
139/// Represents the shadow algorithm that the `Renderer` should use when lighting
140/// the scene.
141#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
142#[repr(u32)]
143pub enum ShadowTechnique {
144    /// No shadows.
145    Unshadowed = 0,
146    /// Default.  Screen-space, depth-buffer based shadows; SSDO-ish.
147    ScreenSpace = 1,
148    /// Basic shadow map.
149    ShadowMap = 2,
150    /// Moment shadow map (see http:///momentsingraphics.de).
151    MomentShadowMap = 3,
152    /// Stencil shadow volume.
153    StencilShadowVolume = 4,
154}
155
156impl ShadowTechnique {
157    #[inline]
158    pub fn from_primitive(prim: u32) -> Option<Self> {
159        match prim {
160            0 => Some(Self::Unshadowed),
161            1 => Some(Self::ScreenSpace),
162            2 => Some(Self::ShadowMap),
163            3 => Some(Self::MomentShadowMap),
164            4 => Some(Self::StencilShadowVolume),
165            _ => None,
166        }
167    }
168
169    #[inline]
170    pub const fn into_primitive(self) -> u32 {
171        self as u32
172    }
173}
174
175#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
176#[repr(u32)]
177pub enum ValueType {
178    KNone = 0,
179    KVector1 = 1,
180    KVector2 = 2,
181    KVector3 = 3,
182    KVector4 = 4,
183    KMatrix4 = 5,
184    KColorRgb = 6,
185    KColorRgba = 7,
186    KQuaternion = 8,
187    KFactoredTransform = 9,
188}
189
190impl ValueType {
191    #[inline]
192    pub fn from_primitive(prim: u32) -> Option<Self> {
193        match prim {
194            0 => Some(Self::KNone),
195            1 => Some(Self::KVector1),
196            2 => Some(Self::KVector2),
197            3 => Some(Self::KVector3),
198            4 => Some(Self::KVector4),
199            5 => Some(Self::KMatrix4),
200            6 => Some(Self::KColorRgb),
201            7 => Some(Self::KColorRgba),
202            8 => Some(Self::KQuaternion),
203            9 => Some(Self::KFactoredTransform),
204            _ => None,
205        }
206    }
207
208    #[inline]
209    pub const fn into_primitive(self) -> u32 {
210        self as u32
211    }
212}
213
214/// Add a node as a child to another node.
215///
216/// Constraints:
217/// - `id` refs a Node with the has_children characteristic.
218/// - `child_id` refs any Node.
219///
220/// Discussion:
221/// The child node is first removed from its existing parent, as if DetachCmd
222/// was applied first.
223#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
224#[repr(C)]
225pub struct AddChildCmd {
226    pub node_id: u32,
227    pub child_id: u32,
228}
229
230impl fidl::Persistable for AddChildCmd {}
231
232/// Add a layer to a layer stack.
233/// Constraints:
234/// - `layer_stack_id` refs a `LayerStack`.
235/// - `layer_id` refs a `Layer`.
236/// - The layer must not already belong to a different stack; it must first be
237///   detached.
238#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
239#[repr(C)]
240pub struct AddLayerCmd {
241    pub layer_stack_id: u32,
242    pub layer_id: u32,
243}
244
245impl fidl::Persistable for AddLayerCmd {}
246
247/// Adds the light specified by `light_id` specified by `light_id` to the scene
248/// identified by `scene_id`.
249#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
250#[repr(C)]
251pub struct AddLightCmd {
252    pub scene_id: u32,
253    pub light_id: u32,
254}
255
256impl fidl::Persistable for AddLightCmd {}
257
258/// Add a node as a part of another node.  The implications of being a part
259/// rather than a child differ based on the type of the part.  However, one
260/// implication is constant: removing all of a node's children (e.g. via
261/// DetachChildrenCmd) does not affect its parts.  This is similar to the
262/// "shadow DOM" in a web browser: the controls of a <video> element are
263/// implemented as using the shadow DOM, and do no show up amongst the children
264/// of that element.
265///
266/// Constraints:
267/// - `id` refs a Node with the has_parts characteristic.
268/// - `part_id` refs any Node.
269///
270/// Discussion:
271/// The part node is first removed from its existing parent, as if DetachCmd
272/// was applied first.
273#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
274#[repr(C)]
275pub struct AddPartCmd {
276    pub node_id: u32,
277    pub part_id: u32,
278}
279
280impl fidl::Persistable for AddPartCmd {}
281
282/// An AmbientLight is a Light that is is assumed to be everywhere in the scene,
283/// in all directions.
284///
285/// Supported commands:
286/// - SetLightColor
287#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
288#[repr(C)]
289pub struct AmbientLightArgs {
290    pub dummy: u32,
291}
292
293impl fidl::Persistable for AmbientLightArgs {}
294
295#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
296pub struct BindMeshBuffersCmd {
297    pub mesh_id: u32,
298    pub index_buffer_id: u32,
299    pub index_format: MeshIndexFormat,
300    pub index_offset: u64,
301    pub index_count: u32,
302    pub vertex_buffer_id: u32,
303    pub vertex_format: MeshVertexFormat,
304    pub vertex_offset: u64,
305    pub vertex_count: u32,
306    pub bounding_box: BoundingBox,
307}
308
309impl fidl::Persistable for BindMeshBuffersCmd {}
310
311/// Represents an axis-aligned bounding box.
312///
313/// If any of the dimensions has a negative extent (e.g. max.x < min.x) then the
314/// bounding box is treated as empty. It is valid for a client to define an
315/// empty bounding box.
316///
317/// An "empty bounding box" is one that does not admit a point inhabitant.
318/// Note that a zero-volume, zero-area bounding box (e.g., a point like
319/// (0,0,0)-(0,0,0), or a line like (0,0,0)-(1,0,0)) is thus not empty.
320#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
321pub struct BoundingBox {
322    pub min: Vec3,
323    pub max: Vec3,
324}
325
326impl fidl::Persistable for BoundingBox {}
327
328/// A buffer mapped to a range of `Memory`.
329#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
330#[repr(C)]
331pub struct BufferArgs {
332    pub memory_id: u32,
333    pub memory_offset: u32,
334    pub num_bytes: u32,
335}
336
337impl fidl::Persistable for BufferArgs {}
338
339/// A Camera is used to render a Scene from a particular viewpoint.  This is
340/// achieved by setting a Renderer to use the camera.
341///
342/// The following commands may be applied to a Camera:
343/// - SetCameraTransform
344/// - SetCameraProjection
345/// - SetCameraPoseBuffer
346#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
347#[repr(C)]
348pub struct CameraArgs {
349    /// The scene that the camera is viewing.
350    pub scene_id: u32,
351}
352
353impl fidl::Persistable for CameraArgs {}
354
355#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
356pub struct CircleArgs {
357    pub radius: Value,
358}
359
360impl fidl::Persistable for CircleArgs {}
361
362/// Characteristics:
363/// - has_parent
364/// - is_clip
365/// - has_parts
366#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
367#[repr(C)]
368pub struct ClipNodeArgs {
369    pub unused: u32,
370}
371
372impl fidl::Persistable for ClipNodeArgs {}
373
374#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
375pub struct ColorRgb {
376    pub red: f32,
377    pub green: f32,
378    pub blue: f32,
379}
380
381impl fidl::Persistable for ColorRgb {}
382
383/// A value that is specified explicitly by `value` if `variable_id` is zero,
384/// or is the value produced by the resource identified by `variable_id`, e.g.
385/// an animation or expression.  In the latter case, the value produced by the
386/// resource must be a ColorRgb, and `value` is ignored.
387#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
388pub struct ColorRgbValue {
389    pub value: ColorRgb,
390    pub variable_id: u32,
391}
392
393impl fidl::Persistable for ColorRgbValue {}
394
395/// sRGB color space and nonlinear transfer function.
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397#[repr(C)]
398pub struct ColorRgba {
399    pub red: u8,
400    pub green: u8,
401    pub blue: u8,
402    pub alpha: u8,
403}
404
405impl fidl::Persistable for ColorRgba {}
406
407/// A value that is specified explicitly by `value` if `variable_id` is zero,
408/// or is the value produced by the resource identified by `variable_id`, e.g.
409/// an animation or expression.  In the latter case, the value produced by the
410/// resource must be a ColorRgba, and `value` is ignored.
411#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
412#[repr(C)]
413pub struct ColorRgbaValue {
414    pub value: ColorRgba,
415    pub variable_id: u32,
416}
417
418impl fidl::Persistable for ColorRgbaValue {}
419
420/// A Compositor draws its `LayerStack` into a framebuffer provided by its
421/// attached `Display`, if any.  If no display is attached, nothing is rendered.
422#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
423#[repr(C)]
424pub struct CompositorArgs {
425    pub dummy: u32,
426}
427
428impl fidl::Persistable for CompositorArgs {}
429
430/// Detaches all of a node's children (but not its parts).
431#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
432#[repr(C)]
433pub struct DetachChildrenCmd {
434    pub node_id: u32,
435}
436
437impl fidl::Persistable for DetachChildrenCmd {}
438
439/// Detaches a parentable object from its parent (e.g. a node from a parent node,
440/// or a layer from a layer stack).  It is illegal to apply this command to a
441/// non-parentable object.  No-op if the target object currently has no parent.
442///
443/// Constraints:
444/// - `id` refs a parentable object
445///
446/// Discussion:
447/// For nodes, this command will detach a node from its parent, regardless of
448/// whether it is a part or a child of its parent.
449#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
450#[repr(C)]
451pub struct DetachCmd {
452    pub id: u32,
453}
454
455impl fidl::Persistable for DetachCmd {}
456
457/// Detach the light specified by `light_id` from the scene that it is attached
458/// to, if any.
459#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
460#[repr(C)]
461pub struct DetachLightCmd {
462    pub light_id: u32,
463}
464
465impl fidl::Persistable for DetachLightCmd {}
466
467/// Detach all lights from the scene specified by `scene_id`.
468#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
469#[repr(C)]
470pub struct DetachLightsCmd {
471    pub scene_id: u32,
472}
473
474impl fidl::Persistable for DetachLightsCmd {}
475
476/// A DirectionalLight is a Light that is emitted from a point at infinity.
477///
478/// Although the light is directional, the light has some amount of angular
479/// dispersion (i.e., the light is not fully columnated). For simplicity, we
480/// assume the dispersion of the light source is symmetric about the light's
481/// primary direction.
482///
483/// Supported commands:
484/// - SetLightColor
485/// - SetLightDirection
486#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
487#[repr(C)]
488pub struct DirectionalLightArgs {
489    pub dummy: u32,
490}
491
492impl fidl::Persistable for DirectionalLightArgs {}
493
494/// A DisplayCompositor draws its attached `LayerStack` into an image that is
495/// presented on a display.
496#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
497#[repr(C)]
498pub struct DisplayCompositorArgs {
499    pub dummy: u32,
500}
501
502impl fidl::Persistable for DisplayCompositorArgs {}
503
504/// Provides information about a display.
505#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
506#[repr(C)]
507pub struct DisplayInfo {
508    /// The size of the display, in physical pixels.
509    pub width_in_px: u32,
510    pub height_in_px: u32,
511}
512
513impl fidl::Persistable for DisplayInfo {}
514
515/// Characteristics:
516/// - has_transform
517/// - has_children
518/// - has_parent
519/// - has_parts
520/// - has_clip
521#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
522#[repr(C)]
523pub struct EntityNodeArgs {
524    pub unused: u32,
525}
526
527impl fidl::Persistable for EntityNodeArgs {}
528
529#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
530pub struct FactoredTransform {
531    pub translation: Vec3,
532    pub scale: Vec3,
533    /// Point around which rotation and scaling occur.
534    pub anchor: Vec3,
535    pub rotation: Quaternion,
536}
537
538impl fidl::Persistable for FactoredTransform {}
539
540/// A value that is specified explicitly by `value` if `variable_id` is zero,
541/// or is the value produced by the resource identified by `variable_id`, e.g.
542/// an animation or expression.  In the latter case, the value produced by the
543/// resource must be a float32, and `value` is ignored.
544#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
545pub struct FloatValue {
546    pub value: f32,
547    pub variable_id: u32,
548}
549
550impl fidl::Persistable for FloatValue {}
551
552/// An image mapped to a range of a `Memory` resource.
553#[derive(Clone, Debug, PartialEq)]
554pub struct ImageArgs {
555    pub info: fidl_fuchsia_images__common::ImageInfo,
556    pub memory_id: u32,
557    pub memory_offset: u32,
558}
559
560impl fidl::Persistable for ImageArgs {}
561
562/// An image mapped to a range of a `Memory` resource.
563#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
564#[repr(C)]
565pub struct ImageArgs2 {
566    pub width: u32,
567    pub height: u32,
568    /// The id of a `BufferCollection`. Before creating this resource, the
569    /// buffer collection should be registered on the same `Session` with
570    /// `RegisterBufferCollection` and it should have its contraints set.
571    /// Once the buffers are allocated successfully (e.g. after calling
572    /// `WaitForBuffersAllocated`), the collection's id can be used to create
573    /// the image resource.
574    pub buffer_collection_id: u32,
575    /// The index of the VMO from the `BufferCollection` that backs this image.
576    pub buffer_collection_index: u32,
577}
578
579impl fidl::Persistable for ImageArgs2 {}
580
581/// Delivered when the imported resource with the given ID is no longer bound to
582/// its host resource, or if the imported resource can not be bound because
583/// the host resource is not available.
584#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
585#[repr(C)]
586pub struct ImportUnboundEvent {
587    pub resource_id: u32,
588}
589
590impl fidl::Persistable for ImportUnboundEvent {}
591
592/// A Layer is a 2-dimensional image that is drawn by a Compositor.  The
593/// contents of each Layer in a Layerstack are independent of each other.
594/// A layer is not drawn unless it has a camera, texture, or color.
595///
596/// Supported commands:
597/// - Detach
598/// - SetCamera
599/// - SetColor
600/// - SetTexture
601/// - SetSize (depth must be zero)
602/// - SetSize
603/// - SetTranslation (z component determines the relative Z-ordering of layers)
604/// - SetRotation (must rotate around Z-axis)
605/// - SetScale
606#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
607#[repr(C)]
608pub struct LayerArgs {
609    pub dummy: u32,
610}
611
612impl fidl::Persistable for LayerArgs {}
613
614/// A LayerStack is a stack of layers that are attached to a Compositor, which
615/// draws them in order of increasing Z-order (or rather, presents the illusion
616/// of drawing them in that order: it may apply any optimizations that don't
617/// affect the output).
618///
619/// Supported commands:
620/// - AddLayer
621#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
622#[repr(C)]
623pub struct LayerStackArgs {
624    pub dummy: u32,
625}
626
627impl fidl::Persistable for LayerStackArgs {}
628
629/// Simple texture-mapped material.
630///
631/// Supported commands:
632/// - SetTextureCmd: sets the texture, or it can be left as zero (no texture).
633///   The texture can be an Image or ImagePipe2.
634/// - SetColorCmd: sets the color.
635#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
636#[repr(C)]
637pub struct MaterialArgs {
638    pub dummy: u32,
639}
640
641impl fidl::Persistable for MaterialArgs {}
642
643/// A value that is specified explicitly by `value` if `variable_id` is zero,
644/// or is the value produced by the resource identified by `variable_id`, e.g.
645/// an animation or expression.  In the latter case, the value produced by the
646/// resource must be a vec4, and `value` is ignored.
647#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
648pub struct Matrix4Value {
649    pub value: Mat4,
650    pub variable_id: u32,
651}
652
653impl fidl::Persistable for Matrix4Value {}
654
655/// A Mesh cannot be rendered until it has been bound to vertex/index buffers;
656/// see BindMeshBuffersCmd.
657#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
658pub struct MeshArgs;
659
660impl fidl::Persistable for MeshArgs {}
661
662#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
663pub struct MeshVertexFormat {
664    /// kVector2 or kVector3.
665    pub position_type: ValueType,
666    /// kVector2 or kVector3 (must match position_type), or kNone.
667    pub normal_type: ValueType,
668    /// kVector2 or kNone.
669    pub tex_coord_type: ValueType,
670}
671
672impl fidl::Persistable for MeshVertexFormat {}
673
674/// Rendering target metrics associated with a node.
675/// See also `MetricsEvent`.
676#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
677pub struct Metrics {
678    /// The ratio between the size of one logical pixel within the node's local
679    /// coordinate system and the size of one physical pixel of the rendering
680    /// target.
681    ///
682    /// This scale factors change in relation to the resolution of the rendering
683    /// target and the scale transformations applied by containing nodes.
684    /// They are always strictly positive and non-zero.
685    ///
686    /// For example, suppose the rendering target is a high resolution display
687    /// with a device pixel ratio of 2.0 meaning that each logical pixel
688    /// within the model corresponds to two physical pixels of the display.
689    /// Assuming no scale transformations affect the node, then its metrics event
690    /// will report a scale factor of 2.0.
691    ///
692    /// Building on this example, if instead the node's parent applies a
693    /// scale transformation of 0.25 to the node, then the node's metrics event
694    /// will report a scale factor of 0.5 indicating that the node should render
695    /// its content at a reduced resolution and level of detail since a smaller
696    /// area of physical pixels (half the size in each dimension) will be rendered.
697    pub scale_x: f32,
698    pub scale_y: f32,
699    pub scale_z: f32,
700}
701
702impl fidl::Persistable for Metrics {}
703
704/// Provides rendering target metrics information about the specified node.
705///
706/// This event is delivered when the following conditions are true:
707/// - The node is a descendant of a `Scene`.
708/// - The node has `kMetricsEventMask` set to an enabled state.
709/// - The node's metrics have changed since they were last delivered, or since
710///   `kMetricsEventMask` transitioned from a disabled state to an enabled state.
711///
712/// Subscribe to this event to receive information about the scale factors you
713/// should apply when generating textures for your nodes.
714#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
715pub struct MetricsEvent {
716    pub node_id: u32,
717    pub metrics: Metrics,
718}
719
720impl fidl::Persistable for MetricsEvent {}
721
722/// Characteristics:
723/// - has_transform
724/// - has_parent
725/// - has_children
726/// - has_parts
727/// - has_opacity
728#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
729#[repr(C)]
730pub struct OpacityNodeArgsHack {
731    pub unused: u32,
732}
733
734impl fidl::Persistable for OpacityNodeArgsHack {}
735
736/// Oriented plane described by a normal vector and a distance
737/// from the origin along that vector.
738#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
739pub struct Plane3 {
740    pub dir: Vec3,
741    pub dist: f32,
742}
743
744impl fidl::Persistable for Plane3 {}
745
746/// A PointLight is a Light that emits light in all directions.  By default, the
747/// intensity of the light falls off according to the physically based
748/// "inverse-square law" (see Wikipedia), although it can be adjusted to other
749/// values for artistic effect.
750///
751/// Supported commands:
752/// - SetLightColor
753/// - SetPointLightPosition
754/// - SetPointLightFalloff
755#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
756#[repr(C)]
757pub struct PointLightArgs {
758    pub dummy: u32,
759}
760
761impl fidl::Persistable for PointLightArgs {}
762
763#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
764pub struct Quaternion {
765    pub x: f32,
766    pub y: f32,
767    pub z: f32,
768    pub w: f32,
769}
770
771impl fidl::Persistable for Quaternion {}
772
773/// A value that is specified explicitly by `value` if `variable_id` is zero,
774/// or is the value produced by the resource identified by `variable_id`, e.g.
775/// an animation or expression.  In the latter case, the value produced by the
776/// resource must be a Quaternion, and `value` is ignored.
777#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
778pub struct QuaternionValue {
779    pub value: Quaternion,
780    pub variable_id: u32,
781}
782
783impl fidl::Persistable for QuaternionValue {}
784
785/// Rectangle centered at (0,0).
786#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
787pub struct RectangleArgs {
788    pub width: Value,
789    pub height: Value,
790}
791
792impl fidl::Persistable for RectangleArgs {}
793
794/// Releases the client's reference to the resource; it is then illegal to use
795/// the ID in subsequent Commands.  Other references to the resource may exist,
796/// so releasing the resource does not result in its immediate destruction; it is
797/// only destroyed once the last reference is released.  For example, the
798/// resource may be required to render an in-progress frame, or it may be
799/// referred to by another resource).  However, the ID will be immediately
800/// unregistered, and may be reused to create a new resource.
801#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
802#[repr(C)]
803pub struct ReleaseResourceCmd {
804    /// ID of the resource to be dereferenced.
805    pub id: u32,
806}
807
808impl fidl::Persistable for ReleaseResourceCmd {}
809
810/// Remove all layers from a layer stack.
811/// Constraints
812/// - `layer_stack_id` refs a `LayerStack`.
813#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
814#[repr(C)]
815pub struct RemoveAllLayersCmd {
816    pub layer_stack_id: u32,
817}
818
819impl fidl::Persistable for RemoveAllLayersCmd {}
820
821/// Remove a layer from a layer stack.
822/// Constraints:
823/// - `layer_stack_id` refs a `LayerStack`.
824/// - `layer_id` refs a `Layer`.
825/// - The layer must belong to this stack.
826#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
827#[repr(C)]
828pub struct RemoveLayerCmd {
829    pub layer_stack_id: u32,
830    pub layer_id: u32,
831}
832
833impl fidl::Persistable for RemoveLayerCmd {}
834
835/// A Renderer renders a Scene via a Camera.
836///
837/// Supported commands:
838/// - SetCamera
839/// - SetRendererParam
840#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
841#[repr(C)]
842pub struct RendererArgs {
843    pub dummy: u32,
844}
845
846impl fidl::Persistable for RendererArgs {}
847
848/// RoundedRectangle centered at (0,0).  Legal parameter values must satisfy the
849/// constraint that the flat sides of the rectangle have non-negative length.
850/// In other words, the following constraints must hold:
851///   - top_left_radius + top_right_radius <= width
852///   - bottom_left_radius + bottom_right_radius <= width
853///   - top_left_radius + bottom_left_radius <= height
854///   - top_right_radius + bottom_right_radius <= height
855#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
856pub struct RoundedRectangleArgs {
857    pub width: Value,
858    pub height: Value,
859    pub top_left_radius: Value,
860    pub top_right_radius: Value,
861    pub bottom_right_radius: Value,
862    pub bottom_left_radius: Value,
863}
864
865impl fidl::Persistable for RoundedRectangleArgs {}
866
867/// Adds the light specified by `light_id` specified by `light_id` to the scene
868/// identified by `scene_id`.
869#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
870#[repr(C)]
871pub struct SceneAddAmbientLightCmd {
872    pub scene_id: u32,
873    pub light_id: u32,
874}
875
876impl fidl::Persistable for SceneAddAmbientLightCmd {}
877
878/// Adds the light specified by `light_id` specified by `light_id` to the scene
879/// identified by `scene_id`.
880#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
881#[repr(C)]
882pub struct SceneAddDirectionalLightCmd {
883    pub scene_id: u32,
884    pub light_id: u32,
885}
886
887impl fidl::Persistable for SceneAddDirectionalLightCmd {}
888
889/// Adds the light specified by `light_id` specified by `light_id` to the scene
890/// identified by `scene_id`.
891#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
892#[repr(C)]
893pub struct SceneAddPointLightCmd {
894    pub scene_id: u32,
895    pub light_id: u32,
896}
897
898impl fidl::Persistable for SceneAddPointLightCmd {}
899
900/// A Scene is the root of a scene-graph, and defines the rendering environment
901/// (lighting, etc.) for the tree of nodes beneath it.
902///
903/// Supported commands:
904/// - Add/RemoveLight
905/// - AddChild
906#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
907#[repr(C)]
908pub struct SceneArgs {
909    pub dummy: u32,
910}
911
912impl fidl::Persistable for SceneArgs {}
913
914/// Sends a hint about a pending size change to the given node and all nodes
915/// below. This is generally sent before an animation.
916///
917/// `width_change_factor` and `height_change_factor` is how much bigger or smaller
918/// the item is expected to be in the near future. This one number encapsulate
919/// both changes in scale, as well as changes to layout width and height.
920#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
921pub struct SendSizeChangeHintCmdHack {
922    pub node_id: u32,
923    pub width_change_factor: f32,
924    pub height_change_factor: f32,
925}
926
927impl fidl::Persistable for SendSizeChangeHintCmdHack {}
928
929/// Sets a Resource's (typically a Node's) anchor point.
930///
931/// Constraints:
932/// - `id` refs a Resource with the has_transform characteristic.
933#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
934pub struct SetAnchorCmd {
935    pub id: u32,
936    pub value: Vector3Value,
937}
938
939impl fidl::Persistable for SetAnchorCmd {}
940
941/// Sets a camera's 2D clip-space transform.
942///
943/// Constraints:
944/// - `camera_id` refs a `Camera`.
945/// - `translation` is the desired translation, in Vulkan NDC.
946/// - `scale` is the scale factor to apply on the x/y plane before translation.
947#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
948pub struct SetCameraClipSpaceTransformCmd {
949    pub camera_id: u32,
950    pub translation: Vec2,
951    pub scale: f32,
952}
953
954impl fidl::Persistable for SetCameraClipSpaceTransformCmd {}
955
956/// Sets a renderer's camera.
957///
958/// Constraints:
959/// - `renderer_id` refs a `Renderer`.
960/// - `camera_id` refs a `Camera`, or stops rendering by passing zero.
961/// - `matrix` is a value or variable of type kMatrix4x4.
962#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
963#[repr(C)]
964pub struct SetCameraCmd {
965    pub renderer_id: u32,
966    pub camera_id: u32,
967}
968
969impl fidl::Persistable for SetCameraCmd {}
970
971/// Sets the "pose buffer" for the camera identified by `camera_id`.
972/// This operation can be applied to both Cameras and StereoCameras.
973///
974/// This will override any position and rotation set for the camera and will
975/// make it take its position and rotation from the pose buffer each frame
976/// based on the presentation time for that frame.
977///
978/// A pose buffer represents a ring buffer of poses for a fixed number of time
979/// points in the future. Each entry in the buffer identified by `buffer_id` is
980/// a quaternion and a position layed out as follows:
981///
982/// struct Pose {
983///   // Quaternion
984///   float32 a;
985///   float32 b;
986///   float32 c;
987///   float32 d;
988///
989///   // Position
990///   float32 x;
991///   float32 y;
992///   float32 z;
993///
994///   // Reserved/Padding
995///   byte[4] reserved;
996/// }
997///
998/// The buffer can be thought of as a packed array of `num_entries` Pose structs
999/// and is required to be at least num_entries * sizeof(Pose) bytes.
1000///
1001/// The quaternions and positions are specified in the space of the camera's
1002/// parent node.
1003///
1004/// `base_time` is a base time point expressed in nanoseconds in the
1005/// `CLOCK_MONOTONIC` timebase and `time_interval` is the time in nanoseconds
1006/// between entries in the buffer. `base_time` must be in the past.
1007///
1008/// For a given point in time `t` expressed in nanoseconds in the
1009/// `CLOCK_MONOTONIC` timebase the index of the corresponding pose in
1010/// the pose buffer can be computed as follows:
1011///
1012/// index(t) = ((t - base_time) / time_interval) % num_entries
1013///
1014/// poses[index(t)] is valid for t over the time interval (t - time_interval, t]
1015/// and should be expected to updated continuously without synchronization
1016/// for the duration of that interval. If a single pose value is needed for
1017/// multiple non-atomic operations a value should be latched and stored outside
1018/// the pose buffer.
1019///
1020/// Because the poses are not protected by any synchronization primitives it is
1021/// possible that when a pose is latched it will be only partially updated, and
1022/// the pose being read will contain some components from the pose before it is
1023/// updated and some components from the updated pose. The safety of using these
1024/// "torn" poses relies on two things:
1025///
1026/// 1) Sequential poses written to poses[index(t)] are very similar to each
1027/// other numerically, so that if some components are taken from the first and
1028/// some are taken from another the result is numerically similar to both
1029///
1030/// 2) The space of positions and quaternions is locally flat at the scale of
1031/// changes between sequential updates, which guarantees that two poses which
1032/// are numerically similar also represent semantically similar poses (i.e.
1033/// there are no discontinuities which will cause a small numerical change in
1034/// the position or quaterninon to cause a large change in the encoded pose)
1035/// For positions this is guaranteed because Scenic uses a Euclidean 3-space
1036/// which is globally flat and for quaternions this is guaranteed because
1037/// quaternions encode rotation as points on a unit 4-sphere, and spheres are
1038/// locally flat. For more details on the encoding of rotations in quaterions
1039/// see https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
1040///
1041/// This commanderation is intended for late latching camera pose to support
1042/// low-latency motion-tracked rendering.
1043#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1044#[repr(C)]
1045pub struct SetCameraPoseBufferCmd {
1046    pub camera_id: u32,
1047    pub buffer_id: u32,
1048    pub num_entries: u32,
1049    pub base_time: i64,
1050    pub time_interval: u64,
1051}
1052
1053impl fidl::Persistable for SetCameraPoseBufferCmd {}
1054
1055/// Sets a camera's projection matrix.
1056/// This operation cannot be applied to a StereoCamera.
1057///
1058/// Constraints:
1059/// - `camera_id` refs a `Camera` that is not a `StereoCamera`.
1060/// - `fovy` is the Y-axis field of view, in radians.
1061///
1062/// NOTE: A default orthographic projection is specified by setting `fovy` to
1063/// zero.  In this case, the camera transform is ignored.
1064#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1065pub struct SetCameraProjectionCmd {
1066    pub camera_id: u32,
1067    pub fovy: FloatValue,
1068}
1069
1070impl fidl::Persistable for SetCameraProjectionCmd {}
1071
1072/// Sets a camera's view matrix.
1073/// This operation can be applied to both Cameras and StereoCameras.
1074///
1075/// Constraints:
1076/// - `camera_id` refs a `Camera`.
1077/// - `eye_position` is the position of the eye.
1078/// - `eye_look_at` is the point is the scene the that eye is pointed at.
1079/// - `eye_up` defines the camera's "up" vector.
1080#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1081pub struct SetCameraTransformCmd {
1082    pub camera_id: u32,
1083    pub eye_position: Vector3Value,
1084    pub eye_look_at: Vector3Value,
1085    pub eye_up: Vector3Value,
1086}
1087
1088impl fidl::Persistable for SetCameraTransformCmd {}
1089
1090/// Sets/clears a node's clip.  DEPRECATED: use SetClipPlanesCmd.
1091///
1092/// Constraints:
1093/// - `node_id` refs a `Node` with the has_clip characteristic.
1094/// - `clip_id` a `Node` with the is_clip characteristic, or nothing.  If the
1095///   referenced node is not rooted, then it will have no effect (since its
1096///   full world-transform cannot be determined).
1097/// - `clip_to_self` If false, children are only clipped to the region specified
1098///   by `clip_id`.  If true, children are additionally clipped to the node's
1099///   shape (as determined by its ShapeNode parts).
1100///
1101/// Discussion:
1102/// If a node has a clip, it will be applied to both the parts and the children
1103/// of the node.  Under some circumstances (TBD), a clip will not be applicable
1104/// to a node; in such cases it will be as though no clip has been specified for
1105/// the node.
1106#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1107pub struct SetClipCmd {
1108    pub node_id: u32,
1109    pub clip_id: u32,
1110    pub clip_to_self: bool,
1111}
1112
1113impl fidl::Persistable for SetClipCmd {}
1114
1115/// Sets the list of clip planes that apply to a Node and all of its children.  Replaces
1116/// the list set by any previous SetClipPlanesCmd.
1117///
1118/// - `node_id` refs a `Node` with the has_clip characteristic.
1119/// - `clip_planes` is the new list of oriented clip planes.
1120#[derive(Clone, Debug, PartialEq, PartialOrd)]
1121pub struct SetClipPlanesCmd {
1122    pub node_id: u32,
1123    pub clip_planes: Vec<Plane3>,
1124}
1125
1126impl fidl::Persistable for SetClipPlanesCmd {}
1127
1128/// Sets a material's color.
1129///
1130/// Constraints:
1131/// - `material_id` refs a `Material`.
1132///
1133/// If a texture is set on the material, then the value sampled from the texture
1134/// is multiplied by the color.
1135#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1136#[repr(C)]
1137pub struct SetColorCmd {
1138    pub material_id: u32,
1139    pub color: ColorRgbaValue,
1140}
1141
1142impl fidl::Persistable for SetColorCmd {}
1143
1144/// Set whether clipping should be disabled for the specified renderer.  For a
1145/// newly-created renderer, clipping will NOT be disabled (i.e. it will be
1146/// enabled).
1147///
1148/// NOTE: this disables visual clipping only; objects are still clipped for the
1149/// purposes of hit-testing.
1150///
1151/// `renderer_id` refs the target renderer.
1152/// `disable_clipping` specifies whether the clipping should be disabled.
1153#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1154pub struct SetDisableClippingCmd {
1155    pub renderer_id: u32,
1156    pub disable_clipping: bool,
1157}
1158
1159impl fidl::Persistable for SetDisableClippingCmd {}
1160
1161/// Set the color conversion applied to the compositor's display.
1162/// The conversion is applied to to each pixel according to the formula:
1163///
1164/// (matrix * (pixel + preoffsets)) + postoffsets
1165///
1166/// where pixel is a column vector consisting of the pixel's 3 components.
1167///
1168/// `matrix` is passed in row-major order. Clients will be responsible
1169/// for passing default values, when needed.
1170/// Default values are not currently supported in fidl.
1171/// Default Values:
1172///   preoffsets = [0 0 0]
1173///   matrix = [1 0 0 0 1 0 0 0 1]
1174///   postoffsets = [0 0 0]
1175#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1176pub struct SetDisplayColorConversionCmdHack {
1177    pub compositor_id: u32,
1178    pub preoffsets: [f32; 3],
1179    pub matrix: [f32; 9],
1180    pub postoffsets: [f32; 3],
1181}
1182
1183impl fidl::Persistable for SetDisplayColorConversionCmdHack {}
1184
1185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1186#[repr(C)]
1187pub struct SetDisplayMinimumRgbCmdHack {
1188    pub min_value: u8,
1189}
1190
1191impl fidl::Persistable for SetDisplayMinimumRgbCmdHack {}
1192
1193/// Depending on the device, the display might be rotated
1194/// with respect to what the lower level device controller
1195/// considers the physical orientation of pixels. The
1196/// compositors and layers must be in alignment with the
1197/// underlying physical orientation which means that for
1198/// certain operations like screenshotting, they cannot
1199/// provide results with the accurate orientation unless
1200/// they have information about how the higher-level display
1201/// is orienting the screen. The only legal values for the
1202/// rotation are 0, 90, 180, and 270, which are each
1203///  applied counterclockwise.
1204#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1205#[repr(C)]
1206pub struct SetDisplayRotationCmdHack {
1207    pub compositor_id: u32,
1208    pub rotation_degrees: u32,
1209}
1210
1211impl fidl::Persistable for SetDisplayRotationCmdHack {}
1212
1213#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1214pub struct SetEnableDebugViewBoundsCmd {
1215    pub view_id: u32,
1216    pub enable: bool,
1217}
1218
1219impl fidl::Persistable for SetEnableDebugViewBoundsCmd {}
1220
1221/// Sets which events a resource should deliver to the session listener.
1222/// This command replaces any prior event mask for the resource.
1223///
1224/// The initial event mask for a resource is zero, meaning no events are
1225/// reported.
1226///
1227/// Constraints:
1228/// - `resource_id` is a valid resource id
1229/// - `event_mask` is zero or a combination of `k*EventMask` bits OR'ed together.
1230#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1231#[repr(C)]
1232pub struct SetEventMaskCmd {
1233    pub id: u32,
1234    pub event_mask: u32,
1235}
1236
1237impl fidl::Persistable for SetEventMaskCmd {}
1238
1239/// Sets a node's hit test behavior.
1240///
1241/// Discussion:
1242/// By default, hit testing is performed on the node's content, its parts,
1243/// and its children.
1244#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1245pub struct SetHitTestBehaviorCmd {
1246    pub node_id: u32,
1247    pub hit_test_behavior: HitTestBehavior,
1248}
1249
1250impl fidl::Persistable for SetHitTestBehaviorCmd {}
1251
1252#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1253pub struct SetImportFocusCmdDeprecated;
1254
1255impl fidl::Persistable for SetImportFocusCmdDeprecated {}
1256
1257/// Sets/clears a label to help developers identify the purpose of the resource
1258/// when using diagnostic tools.
1259///
1260/// The label serves no functional purpose in the scene graph.  It exists only
1261/// to help developers understand its structure.  The scene manager may truncate
1262/// or discard labels at will.
1263///
1264/// Constraints:
1265/// - The label's maximum length is `kLabelMaxLength` characters.
1266/// - Setting the label to an empty string clears it.
1267#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1268pub struct SetLabelCmd {
1269    pub id: u32,
1270    pub label: String,
1271}
1272
1273impl fidl::Persistable for SetLabelCmd {}
1274
1275/// Set a compositor's layer stack, replacing the current stack (if any).
1276/// Constraints:
1277/// - `compositor_id` refs a `DisplayCompositor`.
1278/// - `layer_stack_id` refs a `LayerStack`.
1279#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1280#[repr(C)]
1281pub struct SetLayerStackCmd {
1282    pub compositor_id: u32,
1283    pub layer_stack_id: u32,
1284}
1285
1286impl fidl::Persistable for SetLayerStackCmd {}
1287
1288/// Sets the color of the Light identified by `light_id`.
1289#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1290pub struct SetLightColorCmd {
1291    pub light_id: u32,
1292    pub color: ColorRgbValue,
1293}
1294
1295impl fidl::Persistable for SetLightColorCmd {}
1296
1297/// Sets the direction of the DirectionalLight identified by `light_id`.
1298#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1299pub struct SetLightDirectionCmd {
1300    pub light_id: u32,
1301    pub direction: Vector3Value,
1302}
1303
1304impl fidl::Persistable for SetLightDirectionCmd {}
1305
1306/// Sets/clears a node's material.
1307///
1308/// Constraints:
1309/// - `node_id` refs a `Node` with the has_material characteristic.
1310/// - `material_id` refs a `Material`, or nothing.
1311/// - if this command causes the target to have both a `Shape` and a `Material`,
1312///   then these must be compatible with each other (see README.md regarding
1313///   "Shape/Material Compatibility").
1314///
1315/// Discussion:
1316/// In order to be painted, a node requires both a `Shape` and a `Material`.
1317/// Without a material, a node can still participate in hit-testing and clipping.
1318/// Without a shape, a node cannot do any of the above.
1319#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1320#[repr(C)]
1321pub struct SetMaterialCmd {
1322    pub node_id: u32,
1323    pub material_id: u32,
1324}
1325
1326impl fidl::Persistable for SetMaterialCmd {}
1327
1328/// Sets a node's opacity.
1329///
1330/// Constraints:
1331/// - `node_id` refs a `Node` with the has_opacity characteristic.
1332/// - `opacity` is in the range [0, 1].
1333#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1334pub struct SetOpacityCmd {
1335    pub node_id: u32,
1336    pub opacity: f32,
1337}
1338
1339impl fidl::Persistable for SetOpacityCmd {}
1340
1341/// Sets the falloff factor of the PointLight identified by `light_id`.
1342/// A value of 1.0 corresponds to the physically-based "inverse-square law"
1343/// (see Wikipedia).  Other values can be used for artistic effect, e.g. a
1344/// value of 0.0 means that the radiance of a surface is not dependant on
1345/// its distance from the light.
1346#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1347pub struct SetPointLightFalloffCmd {
1348    pub light_id: u32,
1349    pub falloff: FloatValue,
1350}
1351
1352impl fidl::Persistable for SetPointLightFalloffCmd {}
1353
1354/// Sets the position of the PointLight identified by `light_id`.
1355#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1356pub struct SetPointLightPositionCmd {
1357    pub light_id: u32,
1358    pub position: Vector3Value,
1359}
1360
1361impl fidl::Persistable for SetPointLightPositionCmd {}
1362
1363/// Set a layer's renderer, replacing the current renderer (if any).
1364/// Constraints:
1365/// - `layer_id` refs a `Layer`.
1366/// - `renderer_id` refs a `Renderer`.
1367#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1368#[repr(C)]
1369pub struct SetRendererCmd {
1370    pub layer_id: u32,
1371    pub renderer_id: u32,
1372}
1373
1374impl fidl::Persistable for SetRendererCmd {}
1375
1376/// Sets a parameter that affects how a renderer renders a scene.
1377///
1378/// `renderer_id` refs the Renderer that is being modified.
1379/// `param` describes the parameter that should be set, and to what.
1380#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1381pub struct SetRendererParamCmd {
1382    pub renderer_id: u32,
1383    pub param: RendererParam,
1384}
1385
1386impl fidl::Persistable for SetRendererParamCmd {}
1387
1388/// Sets a Resource's (typically a Node's) rotation.
1389///
1390/// Constraints:
1391/// - `id` refs a Resource with the has_transform characteristic.
1392///
1393/// Discussion:
1394/// Quaternions represent any rotation in a 3D coordinate system. Consisting of
1395/// [a,b,c,d], [a] represents the amount of rotation that should be applied and
1396/// [b,c,d] represents the vector around which the rotation is applied. This
1397/// conforms to the semantics of glm::quat.
1398#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1399pub struct SetRotationCmd {
1400    pub id: u32,
1401    pub value: QuaternionValue,
1402}
1403
1404impl fidl::Persistable for SetRotationCmd {}
1405
1406/// Sets a Resource's (typically a Node's) scale.
1407///
1408/// Constraints:
1409/// - `id` refs a Resource with the has_transform characteristic.
1410#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1411pub struct SetScaleCmd {
1412    pub id: u32,
1413    pub value: Vector3Value,
1414}
1415
1416impl fidl::Persistable for SetScaleCmd {}
1417
1418/// Sets a node's semantic visibility.
1419///
1420/// Discussion:
1421/// By default, all nodes are semantically visible. Semantically invisible nodes and their children
1422/// are ignored by hit tests performed for accessibility.
1423#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1424pub struct SetSemanticVisibilityCmd {
1425    pub node_id: u32,
1426    pub visible: bool,
1427}
1428
1429impl fidl::Persistable for SetSemanticVisibilityCmd {}
1430
1431/// Sets/clears a node's shape.
1432///
1433/// Constraints:
1434/// - `node_id` refs a `Node` with the has_shape characteristic.
1435/// - `shape_id` refs a `Shape`, or nothing.
1436/// - if this command causes the target to have both a `Shape` and a `Material`,
1437///   then these must be compatible with each other (see README.md regarding
1438///   "Shape/Material Compatibility").
1439///
1440/// Discussion:
1441/// In order to be painted, a node requires both a `Shape` and a `Material`.
1442/// Without a material, a node can still participate in hit-testing and clipping.
1443/// Without a shape, a node cannot do any of the above.
1444#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1445#[repr(C)]
1446pub struct SetShapeCmd {
1447    pub node_id: u32,
1448    pub shape_id: u32,
1449}
1450
1451impl fidl::Persistable for SetShapeCmd {}
1452
1453/// Sets an object's size.
1454///
1455/// Constraints:
1456/// - `id` refs a resizeable object.
1457/// - some objects that support this command may have additional constraints
1458///   (e.g. in some cases `depth` must be zero).
1459#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1460pub struct SetSizeCmd {
1461    pub id: u32,
1462    pub value: Vector2Value,
1463}
1464
1465impl fidl::Persistable for SetSizeCmd {}
1466
1467/// Sets a StereoCamera's projection matrices.
1468/// This operation can only be applied to a StereoCamera.
1469///
1470/// Constraints:
1471/// - `camera_id` refs a `StereoCamera`.
1472/// - `left_projection` is the projection matrix for the left eye.
1473/// - `right_projection` is the projection matrix for the right eye.
1474///
1475/// These projection matrices may also contain a transform in camera space for
1476/// their eye if needed.
1477#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1478pub struct SetStereoCameraProjectionCmd {
1479    pub camera_id: u32,
1480    pub left_projection: Matrix4Value,
1481    pub right_projection: Matrix4Value,
1482}
1483
1484impl fidl::Persistable for SetStereoCameraProjectionCmd {}
1485
1486/// Sets/clears a node's tag value.
1487///
1488/// A session can apply a tag value to any node to which it has access, including
1489/// imported nodes.  These tags are private to the session and cannot be read
1490/// or modified by other sessions.  When multiple sessions import the same node,
1491/// each session will only observe its own tag values.
1492///
1493/// Hit test results for a session only include nodes which the session has
1494/// tagged with a non-zero value.  Therefore a session can use tag values to
1495/// associate nodes with their functional purpose when picked.
1496///
1497/// Constraints:
1498/// - `node_id` refs a `Node`.
1499/// - `tag_value` is the tag value to assign, or 0 to remove the tag.
1500#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1501#[repr(C)]
1502pub struct SetTagCmd {
1503    pub node_id: u32,
1504    pub tag_value: u32,
1505}
1506
1507impl fidl::Persistable for SetTagCmd {}
1508
1509/// Sets/clears a material's texture.
1510///
1511/// Constraints:
1512/// - `material_id` refs a `Material`.
1513/// - `texture_id` refs a `Image`, `ImagePipe2`, or nothing.
1514///
1515/// If no texture is provided (i.e. `texture_id` is zero), a solid color is used.
1516/// If a texture is provided, then the value sampled from the texture is
1517/// multiplied by the color.
1518#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1519#[repr(C)]
1520pub struct SetTextureCmd {
1521    pub material_id: u32,
1522    pub texture_id: u32,
1523}
1524
1525impl fidl::Persistable for SetTextureCmd {}
1526
1527/// Sets a Resource's (typically a Node's) translation.
1528///
1529/// Constraints:
1530/// - `id` refs a Resource with the has_transform characteristic.
1531#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1532pub struct SetTranslationCmd {
1533    pub id: u32,
1534    pub value: Vector3Value,
1535}
1536
1537impl fidl::Persistable for SetTranslationCmd {}
1538
1539#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1540pub struct SetViewHolderBoundsColorCmd {
1541    pub view_holder_id: u32,
1542    pub color: ColorRgbValue,
1543}
1544
1545impl fidl::Persistable for SetViewHolderBoundsColorCmd {}
1546
1547/// Sets the properties for a ViewHolder's attached View.
1548///
1549/// Constraints:
1550/// - `view_holder_id` refs a `ViewHolder`.
1551#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1552pub struct SetViewPropertiesCmd {
1553    pub view_holder_id: u32,
1554    pub properties: ViewProperties,
1555}
1556
1557impl fidl::Persistable for SetViewPropertiesCmd {}
1558
1559/// Characteristics:
1560/// - has_parent
1561/// - has_shape
1562/// - has_material
1563#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1564#[repr(C)]
1565pub struct ShapeNodeArgs {
1566    pub unused: u32,
1567}
1568
1569impl fidl::Persistable for ShapeNodeArgs {}
1570
1571/// Delivered in response to a size change hint from a parent node
1572/// (SendSizeChangeHintCmd).
1573///
1574/// This event is delivered when the following conditions are true:
1575/// - The node has `kSizeChangeEventMask` set to an enabled state.
1576/// - A parent node has sent a SendSizeChangeHintCmd.
1577///
1578/// Subscribe to this event to receive information about how large textures you
1579/// will need in the near future for your nodes. The canonical use case is to
1580/// pre-allocate memory to avoid repeated re-allocations.
1581#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1582pub struct SizeChangeHintEvent {
1583    pub node_id: u32,
1584    pub width_change_factor: f32,
1585    pub height_change_factor: f32,
1586}
1587
1588impl fidl::Persistable for SizeChangeHintEvent {}
1589
1590/// A StereoCamera is a Camera that renders the scene in side-by-side stereo.
1591///
1592/// Any command which can be applied to a Camera can also be applied to a
1593/// StereoCamera.
1594/// Additional supported commands:
1595/// - SetStereoCameraProjection
1596#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1597#[repr(C)]
1598pub struct StereoCameraArgs {
1599    /// The scene that the camera is viewing.
1600    pub scene_id: u32,
1601}
1602
1603impl fidl::Persistable for StereoCameraArgs {}
1604
1605/// Describes a typed, client-modifiable value.
1606#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1607pub struct VariableArgs {
1608    pub type_: ValueType,
1609    pub initial_value: Value,
1610}
1611
1612impl fidl::Persistable for VariableArgs {}
1613
1614/// A value that is specified explicitly by `value` if `variable_id` is zero,
1615/// or is the value produced by the resource identified by `variable_id`, e.g.
1616/// an animation or expression.  In the latter case, the value produced by the
1617/// resource must be a vec2, and `value` is ignored.
1618#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1619pub struct Vector2Value {
1620    pub value: Vec2,
1621    pub variable_id: u32,
1622}
1623
1624impl fidl::Persistable for Vector2Value {}
1625
1626/// A value that is specified explicitly by `value` if `variable_id` is zero,
1627/// or is the value produced by the resource identified by `variable_id`, e.g.
1628/// an animation or expression.  In the latter case, the value produced by the
1629/// resource must be a vec3, and `value` is ignored.
1630#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1631pub struct Vector3Value {
1632    pub value: Vec3,
1633    pub variable_id: u32,
1634}
1635
1636impl fidl::Persistable for Vector3Value {}
1637
1638/// A value that is specified explicitly by `value` if `variable_id` is zero,
1639/// or is the value produced by the resource identified by `variable_id`, e.g.
1640/// an animation or expression.  In the latter case, the value produced by the
1641/// resource must be a vec4, and `value` is ignored.
1642#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1643pub struct Vector4Value {
1644    pub value: Vec4,
1645    pub variable_id: u32,
1646}
1647
1648impl fidl::Persistable for Vector4Value {}
1649
1650/// Delivered to a View's Session when the parent ViewHolder for the given View
1651/// becomes a part of a Scene.
1652///
1653/// A ViewHolder is considered to be part of a Scene if there is an unbroken
1654/// chain of parent-child relationships between the Scene node and the
1655/// ViewHolder node.
1656#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1657pub struct ViewAttachedToSceneEvent {
1658    pub view_id: u32,
1659    pub properties: ViewProperties,
1660}
1661
1662impl fidl::Persistable for ViewAttachedToSceneEvent {}
1663
1664/// Delivered to a ViewHolder's Session when its peer View is connected.
1665#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1666#[repr(C)]
1667pub struct ViewConnectedEvent {
1668    pub view_holder_id: u32,
1669}
1670
1671impl fidl::Persistable for ViewConnectedEvent {}
1672
1673/// Delivered to a View's Session when the parent ViewHolder for the given View
1674/// is no longer part of a scene.
1675///
1676/// This can happen if the ViewHolder is detached directly from the scene, or
1677/// if one of its parent nodes is.
1678///
1679/// A ViewHolder is considered to be part of a Scene if there is an unbroken
1680/// chain of parent-child relationships between the Scene node and the
1681/// ViewHolder node.
1682#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1683#[repr(C)]
1684pub struct ViewDetachedFromSceneEvent {
1685    pub view_id: u32,
1686}
1687
1688impl fidl::Persistable for ViewDetachedFromSceneEvent {}
1689
1690/// Delivered to a ViewHolder's Session when its peer View is disconnected or
1691/// destroyed.
1692///
1693/// If the View is destroyed before the connection is established, then this
1694/// event will be delivered immediately when the ViewHolder attempts to connect.
1695#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1696#[repr(C)]
1697pub struct ViewDisconnectedEvent {
1698    pub view_holder_id: u32,
1699}
1700
1701impl fidl::Persistable for ViewDisconnectedEvent {}
1702
1703/// Delivered to a View's Session when its peer ViewHolder is connected.
1704///
1705/// If the ViewHolder is destroyed before the connection is established, then
1706/// this event will not be delivered.
1707#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1708#[repr(C)]
1709pub struct ViewHolderConnectedEvent {
1710    pub view_id: u32,
1711}
1712
1713impl fidl::Persistable for ViewHolderConnectedEvent {}
1714
1715/// Delivered to a View's Session when its peer ViewHolder is disconnected or
1716/// destroyed.
1717///
1718/// If the ViewHolder is destroyed before the connection is established, then
1719/// this event will be delivered immediately when the View attempts to connect.
1720#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1721#[repr(C)]
1722pub struct ViewHolderDisconnectedEvent {
1723    pub view_id: u32,
1724}
1725
1726impl fidl::Persistable for ViewHolderDisconnectedEvent {}
1727
1728/// Represents the properties for a View.
1729#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1730pub struct ViewProperties {
1731    /// The View's bounding box extents can be defined as:
1732    ///    { bounding_box.min, bounding_box.max }
1733    /// Content contained within the View is clipped to this bounding box.
1734    pub bounding_box: BoundingBox,
1735    /// `insets_from_min` and `insets_from_max` specify the distances between the
1736    /// view's bounding box and that of its parent.
1737    ///
1738    /// These properties are not strictly enforced by Scenic, but only used
1739    /// as hints for clients and other components that receives ViewProperties:
1740    ///
1741    /// View clients can assume that anything drawn outside of
1742    ///    { bounding_box.min + inset_from_min, bounding_box.max - inset_from_max }
1743    /// may be obscured by an ancestor view. The reason for obscuring, and the rules
1744    /// surrounding it, is specific to each product.
1745    pub inset_from_min: Vec3,
1746    pub inset_from_max: Vec3,
1747    /// Whether the View can receive a focus event; default is true.  When
1748    /// false, and this View is eligible to receive a focus event, no
1749    /// focus/unfocus event is actually sent to any View.
1750    pub focus_change: bool,
1751    /// Whether the View allows geometrically underlying Views to receive input;
1752    /// default is true. When false, Scenic does not send input events to
1753    /// underlying Views.
1754    pub downward_input: bool,
1755}
1756
1757impl fidl::Persistable for ViewProperties {}
1758
1759/// Delivered when the parent ViewHolder for the given View makes a change to
1760/// the View's properties.
1761#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1762pub struct ViewPropertiesChangedEvent {
1763    pub view_id: u32,
1764    pub properties: ViewProperties,
1765}
1766
1767impl fidl::Persistable for ViewPropertiesChangedEvent {}
1768
1769/// Represents the state of a View in Scenic.
1770#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1771pub struct ViewState {
1772    /// Whether the View is rendering. Default is false. Delivered to the View's
1773    /// corresponding ViewHolder after the View's first frame render request.
1774    pub is_rendering: bool,
1775}
1776
1777impl fidl::Persistable for ViewState {}
1778
1779/// Delivered to a ViewHolder's Session when its peer View's state has changed.
1780#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1781pub struct ViewStateChangedEvent {
1782    pub view_holder_id: u32,
1783    pub state: ViewState,
1784}
1785
1786impl fidl::Persistable for ViewStateChangedEvent {}
1787
1788#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1789pub struct Mat4 {
1790    /// Column major order.
1791    pub matrix: [f32; 16],
1792}
1793
1794impl fidl::Persistable for Mat4 {}
1795
1796#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1797pub struct Vec2 {
1798    pub x: f32,
1799    pub y: f32,
1800}
1801
1802impl fidl::Persistable for Vec2 {}
1803
1804#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1805pub struct Vec3 {
1806    pub x: f32,
1807    pub y: f32,
1808    pub z: f32,
1809}
1810
1811impl fidl::Persistable for Vec3 {}
1812
1813#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1814pub struct Vec4 {
1815    pub x: f32,
1816    pub y: f32,
1817    pub z: f32,
1818    pub w: f32,
1819}
1820
1821impl fidl::Persistable for Vec4 {}
1822
1823/// These are all of the types of events which can be reported by a `Session`.
1824/// Use `SetEventMaskCmd` to enable event delivery for a resource.
1825#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1826pub enum Event {
1827    /// Events which are controlled by a mask.
1828    Metrics(MetricsEvent),
1829    SizeChangeHint(SizeChangeHintEvent),
1830    /// Events which are always delivered, regardless of mask.
1831    ImportUnbound(ImportUnboundEvent),
1832    ViewConnected(ViewConnectedEvent),
1833    ViewDisconnected(ViewDisconnectedEvent),
1834    ViewHolderDisconnected(ViewHolderDisconnectedEvent),
1835    ViewAttachedToScene(ViewAttachedToSceneEvent),
1836    ViewDetachedFromScene(ViewDetachedFromSceneEvent),
1837    ViewPropertiesChanged(ViewPropertiesChangedEvent),
1838    ViewStateChanged(ViewStateChangedEvent),
1839    ViewHolderConnected(ViewHolderConnectedEvent),
1840}
1841
1842impl Event {
1843    #[inline]
1844    pub fn ordinal(&self) -> u64 {
1845        match *self {
1846            Self::Metrics(_) => 1,
1847            Self::SizeChangeHint(_) => 2,
1848            Self::ImportUnbound(_) => 3,
1849            Self::ViewConnected(_) => 4,
1850            Self::ViewDisconnected(_) => 5,
1851            Self::ViewHolderDisconnected(_) => 6,
1852            Self::ViewAttachedToScene(_) => 7,
1853            Self::ViewDetachedFromScene(_) => 8,
1854            Self::ViewPropertiesChanged(_) => 9,
1855            Self::ViewStateChanged(_) => 10,
1856            Self::ViewHolderConnected(_) => 11,
1857        }
1858    }
1859}
1860
1861impl fidl::Persistable for Event {}
1862
1863/// These are all of the types of parameters that can be set to configure a
1864/// `Renderer`.
1865#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1866pub enum RendererParam {
1867    ShadowTechnique(ShadowTechnique),
1868    Reserved(RenderFrequency),
1869    EnableDebugging(bool),
1870}
1871
1872impl RendererParam {
1873    #[inline]
1874    pub fn ordinal(&self) -> u64 {
1875        match *self {
1876            Self::ShadowTechnique(_) => 1,
1877            Self::Reserved(_) => 2,
1878            Self::EnableDebugging(_) => 3,
1879        }
1880    }
1881}
1882
1883impl fidl::Persistable for RendererParam {}
1884
1885#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1886pub enum Value {
1887    Vector1(f32),
1888    Vector2(Vec2),
1889    Vector3(Vec3),
1890    Vector4(Vec4),
1891    Matrix4x4(Mat4),
1892    ColorRgba(ColorRgba),
1893    ColorRgb(ColorRgb),
1894    /// Degrees of counter-clockwise rotation in the XY plane.
1895    Degrees(f32),
1896    Quaternion(Quaternion),
1897    Transform(FactoredTransform),
1898    /// ID of a value-producing resource (an animation or an expression).
1899    /// The type of this value matches the type produced by the named resource.
1900    VariableId(u32),
1901}
1902
1903impl Value {
1904    #[inline]
1905    pub fn ordinal(&self) -> u64 {
1906        match *self {
1907            Self::Vector1(_) => 1,
1908            Self::Vector2(_) => 2,
1909            Self::Vector3(_) => 3,
1910            Self::Vector4(_) => 4,
1911            Self::Matrix4x4(_) => 5,
1912            Self::ColorRgba(_) => 6,
1913            Self::ColorRgb(_) => 7,
1914            Self::Degrees(_) => 8,
1915            Self::Quaternion(_) => 9,
1916            Self::Transform(_) => 10,
1917            Self::VariableId(_) => 11,
1918        }
1919    }
1920}
1921
1922impl fidl::Persistable for Value {}
1923
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__common::ImageInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
4931                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_id),
4932                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_offset),
4933                ),
4934                encoder, offset, _depth
4935            )
4936        }
4937    }
4938    unsafe impl<
4939            D: fidl::encoding::ResourceDialect,
4940            T0: fidl::encoding::Encode<fidl_fuchsia_images__common::ImageInfo, D>,
4941            T1: fidl::encoding::Encode<u32, D>,
4942            T2: fidl::encoding::Encode<u32, D>,
4943        > fidl::encoding::Encode<ImageArgs, D> for (T0, T1, T2)
4944    {
4945        #[inline]
4946        unsafe fn encode(
4947            self,
4948            encoder: &mut fidl::encoding::Encoder<'_, D>,
4949            offset: usize,
4950            depth: fidl::encoding::Depth,
4951        ) -> fidl::Result<()> {
4952            encoder.debug_check_bounds::<ImageArgs>(offset);
4953            // Zero out padding regions. There's no need to apply masks
4954            // because the unmasked parts will be overwritten by fields.
4955            // Write the fields.
4956            self.0.encode(encoder, offset + 0, depth)?;
4957            self.1.encode(encoder, offset + 32, depth)?;
4958            self.2.encode(encoder, offset + 36, depth)?;
4959            Ok(())
4960        }
4961    }
4962
4963    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs {
4964        #[inline(always)]
4965        fn new_empty() -> Self {
4966            Self {
4967                info: fidl::new_empty!(fidl_fuchsia_images__common::ImageInfo, D),
4968                memory_id: fidl::new_empty!(u32, D),
4969                memory_offset: fidl::new_empty!(u32, D),
4970            }
4971        }
4972
4973        #[inline]
4974        unsafe fn decode(
4975            &mut self,
4976            decoder: &mut fidl::encoding::Decoder<'_, D>,
4977            offset: usize,
4978            _depth: fidl::encoding::Depth,
4979        ) -> fidl::Result<()> {
4980            decoder.debug_check_bounds::<Self>(offset);
4981            // Verify that padding bytes are zero.
4982            fidl::decode!(
4983                fidl_fuchsia_images__common::ImageInfo,
4984                D,
4985                &mut self.info,
4986                decoder,
4987                offset + 0,
4988                _depth
4989            )?;
4990            fidl::decode!(u32, D, &mut self.memory_id, decoder, offset + 32, _depth)?;
4991            fidl::decode!(u32, D, &mut self.memory_offset, decoder, offset + 36, _depth)?;
4992            Ok(())
4993        }
4994    }
4995
4996    impl fidl::encoding::ValueTypeMarker for ImageArgs2 {
4997        type Borrowed<'a> = &'a Self;
4998        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4999            value
5000        }
5001    }
5002
5003    unsafe impl fidl::encoding::TypeMarker for ImageArgs2 {
5004        type Owned = Self;
5005
5006        #[inline(always)]
5007        fn inline_align(_context: fidl::encoding::Context) -> usize {
5008            4
5009        }
5010
5011        #[inline(always)]
5012        fn inline_size(_context: fidl::encoding::Context) -> usize {
5013            16
5014        }
5015        #[inline(always)]
5016        fn encode_is_copy() -> bool {
5017            true
5018        }
5019
5020        #[inline(always)]
5021        fn decode_is_copy() -> bool {
5022            true
5023        }
5024    }
5025
5026    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs2, D>
5027        for &ImageArgs2
5028    {
5029        #[inline]
5030        unsafe fn encode(
5031            self,
5032            encoder: &mut fidl::encoding::Encoder<'_, D>,
5033            offset: usize,
5034            _depth: fidl::encoding::Depth,
5035        ) -> fidl::Result<()> {
5036            encoder.debug_check_bounds::<ImageArgs2>(offset);
5037            unsafe {
5038                // Copy the object into the buffer.
5039                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5040                (buf_ptr as *mut ImageArgs2).write_unaligned((self as *const ImageArgs2).read());
5041                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5042                // done second because the memcpy will write garbage to these bytes.
5043            }
5044            Ok(())
5045        }
5046    }
5047    unsafe impl<
5048            D: fidl::encoding::ResourceDialect,
5049            T0: fidl::encoding::Encode<u32, D>,
5050            T1: fidl::encoding::Encode<u32, D>,
5051            T2: fidl::encoding::Encode<u32, D>,
5052            T3: fidl::encoding::Encode<u32, D>,
5053        > fidl::encoding::Encode<ImageArgs2, D> for (T0, T1, T2, T3)
5054    {
5055        #[inline]
5056        unsafe fn encode(
5057            self,
5058            encoder: &mut fidl::encoding::Encoder<'_, D>,
5059            offset: usize,
5060            depth: fidl::encoding::Depth,
5061        ) -> fidl::Result<()> {
5062            encoder.debug_check_bounds::<ImageArgs2>(offset);
5063            // Zero out padding regions. There's no need to apply masks
5064            // because the unmasked parts will be overwritten by fields.
5065            // Write the fields.
5066            self.0.encode(encoder, offset + 0, depth)?;
5067            self.1.encode(encoder, offset + 4, depth)?;
5068            self.2.encode(encoder, offset + 8, depth)?;
5069            self.3.encode(encoder, offset + 12, depth)?;
5070            Ok(())
5071        }
5072    }
5073
5074    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs2 {
5075        #[inline(always)]
5076        fn new_empty() -> Self {
5077            Self {
5078                width: fidl::new_empty!(u32, D),
5079                height: fidl::new_empty!(u32, D),
5080                buffer_collection_id: fidl::new_empty!(u32, D),
5081                buffer_collection_index: fidl::new_empty!(u32, D),
5082            }
5083        }
5084
5085        #[inline]
5086        unsafe fn decode(
5087            &mut self,
5088            decoder: &mut fidl::encoding::Decoder<'_, D>,
5089            offset: usize,
5090            _depth: fidl::encoding::Depth,
5091        ) -> fidl::Result<()> {
5092            decoder.debug_check_bounds::<Self>(offset);
5093            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5094            // Verify that padding bytes are zero.
5095            // Copy from the buffer into the object.
5096            unsafe {
5097                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5098            }
5099            Ok(())
5100        }
5101    }
5102
5103    impl fidl::encoding::ValueTypeMarker for ImportUnboundEvent {
5104        type Borrowed<'a> = &'a Self;
5105        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5106            value
5107        }
5108    }
5109
5110    unsafe impl fidl::encoding::TypeMarker for ImportUnboundEvent {
5111        type Owned = Self;
5112
5113        #[inline(always)]
5114        fn inline_align(_context: fidl::encoding::Context) -> usize {
5115            4
5116        }
5117
5118        #[inline(always)]
5119        fn inline_size(_context: fidl::encoding::Context) -> usize {
5120            4
5121        }
5122        #[inline(always)]
5123        fn encode_is_copy() -> bool {
5124            true
5125        }
5126
5127        #[inline(always)]
5128        fn decode_is_copy() -> bool {
5129            true
5130        }
5131    }
5132
5133    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImportUnboundEvent, D>
5134        for &ImportUnboundEvent
5135    {
5136        #[inline]
5137        unsafe fn encode(
5138            self,
5139            encoder: &mut fidl::encoding::Encoder<'_, D>,
5140            offset: usize,
5141            _depth: fidl::encoding::Depth,
5142        ) -> fidl::Result<()> {
5143            encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5144            unsafe {
5145                // Copy the object into the buffer.
5146                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5147                (buf_ptr as *mut ImportUnboundEvent)
5148                    .write_unaligned((self as *const ImportUnboundEvent).read());
5149                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5150                // done second because the memcpy will write garbage to these bytes.
5151            }
5152            Ok(())
5153        }
5154    }
5155    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5156        fidl::encoding::Encode<ImportUnboundEvent, D> for (T0,)
5157    {
5158        #[inline]
5159        unsafe fn encode(
5160            self,
5161            encoder: &mut fidl::encoding::Encoder<'_, D>,
5162            offset: usize,
5163            depth: fidl::encoding::Depth,
5164        ) -> fidl::Result<()> {
5165            encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
5166            // Zero out padding regions. There's no need to apply masks
5167            // because the unmasked parts will be overwritten by fields.
5168            // Write the fields.
5169            self.0.encode(encoder, offset + 0, depth)?;
5170            Ok(())
5171        }
5172    }
5173
5174    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportUnboundEvent {
5175        #[inline(always)]
5176        fn new_empty() -> Self {
5177            Self { resource_id: fidl::new_empty!(u32, D) }
5178        }
5179
5180        #[inline]
5181        unsafe fn decode(
5182            &mut self,
5183            decoder: &mut fidl::encoding::Decoder<'_, D>,
5184            offset: usize,
5185            _depth: fidl::encoding::Depth,
5186        ) -> fidl::Result<()> {
5187            decoder.debug_check_bounds::<Self>(offset);
5188            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5189            // Verify that padding bytes are zero.
5190            // Copy from the buffer into the object.
5191            unsafe {
5192                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5193            }
5194            Ok(())
5195        }
5196    }
5197
5198    impl fidl::encoding::ValueTypeMarker for LayerArgs {
5199        type Borrowed<'a> = &'a Self;
5200        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5201            value
5202        }
5203    }
5204
5205    unsafe impl fidl::encoding::TypeMarker for LayerArgs {
5206        type Owned = Self;
5207
5208        #[inline(always)]
5209        fn inline_align(_context: fidl::encoding::Context) -> usize {
5210            4
5211        }
5212
5213        #[inline(always)]
5214        fn inline_size(_context: fidl::encoding::Context) -> usize {
5215            4
5216        }
5217        #[inline(always)]
5218        fn encode_is_copy() -> bool {
5219            true
5220        }
5221
5222        #[inline(always)]
5223        fn decode_is_copy() -> bool {
5224            true
5225        }
5226    }
5227
5228    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerArgs, D>
5229        for &LayerArgs
5230    {
5231        #[inline]
5232        unsafe fn encode(
5233            self,
5234            encoder: &mut fidl::encoding::Encoder<'_, D>,
5235            offset: usize,
5236            _depth: fidl::encoding::Depth,
5237        ) -> fidl::Result<()> {
5238            encoder.debug_check_bounds::<LayerArgs>(offset);
5239            unsafe {
5240                // Copy the object into the buffer.
5241                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5242                (buf_ptr as *mut LayerArgs).write_unaligned((self as *const LayerArgs).read());
5243                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5244                // done second because the memcpy will write garbage to these bytes.
5245            }
5246            Ok(())
5247        }
5248    }
5249    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5250        fidl::encoding::Encode<LayerArgs, D> for (T0,)
5251    {
5252        #[inline]
5253        unsafe fn encode(
5254            self,
5255            encoder: &mut fidl::encoding::Encoder<'_, D>,
5256            offset: usize,
5257            depth: fidl::encoding::Depth,
5258        ) -> fidl::Result<()> {
5259            encoder.debug_check_bounds::<LayerArgs>(offset);
5260            // Zero out padding regions. There's no need to apply masks
5261            // because the unmasked parts will be overwritten by fields.
5262            // Write the fields.
5263            self.0.encode(encoder, offset + 0, depth)?;
5264            Ok(())
5265        }
5266    }
5267
5268    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerArgs {
5269        #[inline(always)]
5270        fn new_empty() -> Self {
5271            Self { dummy: fidl::new_empty!(u32, D) }
5272        }
5273
5274        #[inline]
5275        unsafe fn decode(
5276            &mut self,
5277            decoder: &mut fidl::encoding::Decoder<'_, D>,
5278            offset: usize,
5279            _depth: fidl::encoding::Depth,
5280        ) -> fidl::Result<()> {
5281            decoder.debug_check_bounds::<Self>(offset);
5282            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5283            // Verify that padding bytes are zero.
5284            // Copy from the buffer into the object.
5285            unsafe {
5286                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5287            }
5288            Ok(())
5289        }
5290    }
5291
5292    impl fidl::encoding::ValueTypeMarker for LayerStackArgs {
5293        type Borrowed<'a> = &'a Self;
5294        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5295            value
5296        }
5297    }
5298
5299    unsafe impl fidl::encoding::TypeMarker for LayerStackArgs {
5300        type Owned = Self;
5301
5302        #[inline(always)]
5303        fn inline_align(_context: fidl::encoding::Context) -> usize {
5304            4
5305        }
5306
5307        #[inline(always)]
5308        fn inline_size(_context: fidl::encoding::Context) -> usize {
5309            4
5310        }
5311        #[inline(always)]
5312        fn encode_is_copy() -> bool {
5313            true
5314        }
5315
5316        #[inline(always)]
5317        fn decode_is_copy() -> bool {
5318            true
5319        }
5320    }
5321
5322    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerStackArgs, D>
5323        for &LayerStackArgs
5324    {
5325        #[inline]
5326        unsafe fn encode(
5327            self,
5328            encoder: &mut fidl::encoding::Encoder<'_, D>,
5329            offset: usize,
5330            _depth: fidl::encoding::Depth,
5331        ) -> fidl::Result<()> {
5332            encoder.debug_check_bounds::<LayerStackArgs>(offset);
5333            unsafe {
5334                // Copy the object into the buffer.
5335                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5336                (buf_ptr as *mut LayerStackArgs)
5337                    .write_unaligned((self as *const LayerStackArgs).read());
5338                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5339                // done second because the memcpy will write garbage to these bytes.
5340            }
5341            Ok(())
5342        }
5343    }
5344    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5345        fidl::encoding::Encode<LayerStackArgs, D> for (T0,)
5346    {
5347        #[inline]
5348        unsafe fn encode(
5349            self,
5350            encoder: &mut fidl::encoding::Encoder<'_, D>,
5351            offset: usize,
5352            depth: fidl::encoding::Depth,
5353        ) -> fidl::Result<()> {
5354            encoder.debug_check_bounds::<LayerStackArgs>(offset);
5355            // Zero out padding regions. There's no need to apply masks
5356            // because the unmasked parts will be overwritten by fields.
5357            // Write the fields.
5358            self.0.encode(encoder, offset + 0, depth)?;
5359            Ok(())
5360        }
5361    }
5362
5363    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerStackArgs {
5364        #[inline(always)]
5365        fn new_empty() -> Self {
5366            Self { dummy: fidl::new_empty!(u32, D) }
5367        }
5368
5369        #[inline]
5370        unsafe fn decode(
5371            &mut self,
5372            decoder: &mut fidl::encoding::Decoder<'_, D>,
5373            offset: usize,
5374            _depth: fidl::encoding::Depth,
5375        ) -> fidl::Result<()> {
5376            decoder.debug_check_bounds::<Self>(offset);
5377            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5378            // Verify that padding bytes are zero.
5379            // Copy from the buffer into the object.
5380            unsafe {
5381                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5382            }
5383            Ok(())
5384        }
5385    }
5386
5387    impl fidl::encoding::ValueTypeMarker for MaterialArgs {
5388        type Borrowed<'a> = &'a Self;
5389        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5390            value
5391        }
5392    }
5393
5394    unsafe impl fidl::encoding::TypeMarker for MaterialArgs {
5395        type Owned = Self;
5396
5397        #[inline(always)]
5398        fn inline_align(_context: fidl::encoding::Context) -> usize {
5399            4
5400        }
5401
5402        #[inline(always)]
5403        fn inline_size(_context: fidl::encoding::Context) -> usize {
5404            4
5405        }
5406        #[inline(always)]
5407        fn encode_is_copy() -> bool {
5408            true
5409        }
5410
5411        #[inline(always)]
5412        fn decode_is_copy() -> bool {
5413            true
5414        }
5415    }
5416
5417    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MaterialArgs, D>
5418        for &MaterialArgs
5419    {
5420        #[inline]
5421        unsafe fn encode(
5422            self,
5423            encoder: &mut fidl::encoding::Encoder<'_, D>,
5424            offset: usize,
5425            _depth: fidl::encoding::Depth,
5426        ) -> fidl::Result<()> {
5427            encoder.debug_check_bounds::<MaterialArgs>(offset);
5428            unsafe {
5429                // Copy the object into the buffer.
5430                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5431                (buf_ptr as *mut MaterialArgs)
5432                    .write_unaligned((self as *const MaterialArgs).read());
5433                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5434                // done second because the memcpy will write garbage to these bytes.
5435            }
5436            Ok(())
5437        }
5438    }
5439    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5440        fidl::encoding::Encode<MaterialArgs, D> for (T0,)
5441    {
5442        #[inline]
5443        unsafe fn encode(
5444            self,
5445            encoder: &mut fidl::encoding::Encoder<'_, D>,
5446            offset: usize,
5447            depth: fidl::encoding::Depth,
5448        ) -> fidl::Result<()> {
5449            encoder.debug_check_bounds::<MaterialArgs>(offset);
5450            // Zero out padding regions. There's no need to apply masks
5451            // because the unmasked parts will be overwritten by fields.
5452            // Write the fields.
5453            self.0.encode(encoder, offset + 0, depth)?;
5454            Ok(())
5455        }
5456    }
5457
5458    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MaterialArgs {
5459        #[inline(always)]
5460        fn new_empty() -> Self {
5461            Self { dummy: fidl::new_empty!(u32, D) }
5462        }
5463
5464        #[inline]
5465        unsafe fn decode(
5466            &mut self,
5467            decoder: &mut fidl::encoding::Decoder<'_, D>,
5468            offset: usize,
5469            _depth: fidl::encoding::Depth,
5470        ) -> fidl::Result<()> {
5471            decoder.debug_check_bounds::<Self>(offset);
5472            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5473            // Verify that padding bytes are zero.
5474            // Copy from the buffer into the object.
5475            unsafe {
5476                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5477            }
5478            Ok(())
5479        }
5480    }
5481
5482    impl fidl::encoding::ValueTypeMarker for Matrix4Value {
5483        type Borrowed<'a> = &'a Self;
5484        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5485            value
5486        }
5487    }
5488
5489    unsafe impl fidl::encoding::TypeMarker for Matrix4Value {
5490        type Owned = Self;
5491
5492        #[inline(always)]
5493        fn inline_align(_context: fidl::encoding::Context) -> usize {
5494            4
5495        }
5496
5497        #[inline(always)]
5498        fn inline_size(_context: fidl::encoding::Context) -> usize {
5499            68
5500        }
5501    }
5502
5503    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Matrix4Value, D>
5504        for &Matrix4Value
5505    {
5506        #[inline]
5507        unsafe fn encode(
5508            self,
5509            encoder: &mut fidl::encoding::Encoder<'_, D>,
5510            offset: usize,
5511            _depth: fidl::encoding::Depth,
5512        ) -> fidl::Result<()> {
5513            encoder.debug_check_bounds::<Matrix4Value>(offset);
5514            // Delegate to tuple encoding.
5515            fidl::encoding::Encode::<Matrix4Value, D>::encode(
5516                (
5517                    <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5518                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
5519                ),
5520                encoder,
5521                offset,
5522                _depth,
5523            )
5524        }
5525    }
5526    unsafe impl<
5527            D: fidl::encoding::ResourceDialect,
5528            T0: fidl::encoding::Encode<Mat4, D>,
5529            T1: fidl::encoding::Encode<u32, D>,
5530        > fidl::encoding::Encode<Matrix4Value, D> for (T0, T1)
5531    {
5532        #[inline]
5533        unsafe fn encode(
5534            self,
5535            encoder: &mut fidl::encoding::Encoder<'_, D>,
5536            offset: usize,
5537            depth: fidl::encoding::Depth,
5538        ) -> fidl::Result<()> {
5539            encoder.debug_check_bounds::<Matrix4Value>(offset);
5540            // Zero out padding regions. There's no need to apply masks
5541            // because the unmasked parts will be overwritten by fields.
5542            // Write the fields.
5543            self.0.encode(encoder, offset + 0, depth)?;
5544            self.1.encode(encoder, offset + 64, depth)?;
5545            Ok(())
5546        }
5547    }
5548
5549    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Matrix4Value {
5550        #[inline(always)]
5551        fn new_empty() -> Self {
5552            Self { value: fidl::new_empty!(Mat4, D), variable_id: fidl::new_empty!(u32, D) }
5553        }
5554
5555        #[inline]
5556        unsafe fn decode(
5557            &mut self,
5558            decoder: &mut fidl::encoding::Decoder<'_, D>,
5559            offset: usize,
5560            _depth: fidl::encoding::Depth,
5561        ) -> fidl::Result<()> {
5562            decoder.debug_check_bounds::<Self>(offset);
5563            // Verify that padding bytes are zero.
5564            fidl::decode!(Mat4, D, &mut self.value, decoder, offset + 0, _depth)?;
5565            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 64, _depth)?;
5566            Ok(())
5567        }
5568    }
5569
5570    impl fidl::encoding::ValueTypeMarker for MeshArgs {
5571        type Borrowed<'a> = &'a Self;
5572        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5573            value
5574        }
5575    }
5576
5577    unsafe impl fidl::encoding::TypeMarker for MeshArgs {
5578        type Owned = Self;
5579
5580        #[inline(always)]
5581        fn inline_align(_context: fidl::encoding::Context) -> usize {
5582            1
5583        }
5584
5585        #[inline(always)]
5586        fn inline_size(_context: fidl::encoding::Context) -> usize {
5587            1
5588        }
5589    }
5590
5591    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshArgs, D> for &MeshArgs {
5592        #[inline]
5593        unsafe fn encode(
5594            self,
5595            encoder: &mut fidl::encoding::Encoder<'_, D>,
5596            offset: usize,
5597            _depth: fidl::encoding::Depth,
5598        ) -> fidl::Result<()> {
5599            encoder.debug_check_bounds::<MeshArgs>(offset);
5600            encoder.write_num(0u8, offset);
5601            Ok(())
5602        }
5603    }
5604
5605    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshArgs {
5606        #[inline(always)]
5607        fn new_empty() -> Self {
5608            Self
5609        }
5610
5611        #[inline]
5612        unsafe fn decode(
5613            &mut self,
5614            decoder: &mut fidl::encoding::Decoder<'_, D>,
5615            offset: usize,
5616            _depth: fidl::encoding::Depth,
5617        ) -> fidl::Result<()> {
5618            decoder.debug_check_bounds::<Self>(offset);
5619            match decoder.read_num::<u8>(offset) {
5620                0 => Ok(()),
5621                _ => Err(fidl::Error::Invalid),
5622            }
5623        }
5624    }
5625
5626    impl fidl::encoding::ValueTypeMarker for MeshVertexFormat {
5627        type Borrowed<'a> = &'a Self;
5628        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5629            value
5630        }
5631    }
5632
5633    unsafe impl fidl::encoding::TypeMarker for MeshVertexFormat {
5634        type Owned = Self;
5635
5636        #[inline(always)]
5637        fn inline_align(_context: fidl::encoding::Context) -> usize {
5638            4
5639        }
5640
5641        #[inline(always)]
5642        fn inline_size(_context: fidl::encoding::Context) -> usize {
5643            12
5644        }
5645    }
5646
5647    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshVertexFormat, D>
5648        for &MeshVertexFormat
5649    {
5650        #[inline]
5651        unsafe fn encode(
5652            self,
5653            encoder: &mut fidl::encoding::Encoder<'_, D>,
5654            offset: usize,
5655            _depth: fidl::encoding::Depth,
5656        ) -> fidl::Result<()> {
5657            encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5658            // Delegate to tuple encoding.
5659            fidl::encoding::Encode::<MeshVertexFormat, D>::encode(
5660                (
5661                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.position_type),
5662                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.normal_type),
5663                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.tex_coord_type),
5664                ),
5665                encoder,
5666                offset,
5667                _depth,
5668            )
5669        }
5670    }
5671    unsafe impl<
5672            D: fidl::encoding::ResourceDialect,
5673            T0: fidl::encoding::Encode<ValueType, D>,
5674            T1: fidl::encoding::Encode<ValueType, D>,
5675            T2: fidl::encoding::Encode<ValueType, D>,
5676        > fidl::encoding::Encode<MeshVertexFormat, D> for (T0, T1, T2)
5677    {
5678        #[inline]
5679        unsafe fn encode(
5680            self,
5681            encoder: &mut fidl::encoding::Encoder<'_, D>,
5682            offset: usize,
5683            depth: fidl::encoding::Depth,
5684        ) -> fidl::Result<()> {
5685            encoder.debug_check_bounds::<MeshVertexFormat>(offset);
5686            // Zero out padding regions. There's no need to apply masks
5687            // because the unmasked parts will be overwritten by fields.
5688            // Write the fields.
5689            self.0.encode(encoder, offset + 0, depth)?;
5690            self.1.encode(encoder, offset + 4, depth)?;
5691            self.2.encode(encoder, offset + 8, depth)?;
5692            Ok(())
5693        }
5694    }
5695
5696    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshVertexFormat {
5697        #[inline(always)]
5698        fn new_empty() -> Self {
5699            Self {
5700                position_type: fidl::new_empty!(ValueType, D),
5701                normal_type: fidl::new_empty!(ValueType, D),
5702                tex_coord_type: fidl::new_empty!(ValueType, D),
5703            }
5704        }
5705
5706        #[inline]
5707        unsafe fn decode(
5708            &mut self,
5709            decoder: &mut fidl::encoding::Decoder<'_, D>,
5710            offset: usize,
5711            _depth: fidl::encoding::Depth,
5712        ) -> fidl::Result<()> {
5713            decoder.debug_check_bounds::<Self>(offset);
5714            // Verify that padding bytes are zero.
5715            fidl::decode!(ValueType, D, &mut self.position_type, decoder, offset + 0, _depth)?;
5716            fidl::decode!(ValueType, D, &mut self.normal_type, decoder, offset + 4, _depth)?;
5717            fidl::decode!(ValueType, D, &mut self.tex_coord_type, decoder, offset + 8, _depth)?;
5718            Ok(())
5719        }
5720    }
5721
5722    impl fidl::encoding::ValueTypeMarker for Metrics {
5723        type Borrowed<'a> = &'a Self;
5724        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5725            value
5726        }
5727    }
5728
5729    unsafe impl fidl::encoding::TypeMarker for Metrics {
5730        type Owned = Self;
5731
5732        #[inline(always)]
5733        fn inline_align(_context: fidl::encoding::Context) -> usize {
5734            4
5735        }
5736
5737        #[inline(always)]
5738        fn inline_size(_context: fidl::encoding::Context) -> usize {
5739            12
5740        }
5741    }
5742
5743    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metrics, D> for &Metrics {
5744        #[inline]
5745        unsafe fn encode(
5746            self,
5747            encoder: &mut fidl::encoding::Encoder<'_, D>,
5748            offset: usize,
5749            _depth: fidl::encoding::Depth,
5750        ) -> fidl::Result<()> {
5751            encoder.debug_check_bounds::<Metrics>(offset);
5752            // Delegate to tuple encoding.
5753            fidl::encoding::Encode::<Metrics, D>::encode(
5754                (
5755                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_x),
5756                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_y),
5757                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_z),
5758                ),
5759                encoder,
5760                offset,
5761                _depth,
5762            )
5763        }
5764    }
5765    unsafe impl<
5766            D: fidl::encoding::ResourceDialect,
5767            T0: fidl::encoding::Encode<f32, D>,
5768            T1: fidl::encoding::Encode<f32, D>,
5769            T2: fidl::encoding::Encode<f32, D>,
5770        > fidl::encoding::Encode<Metrics, D> for (T0, T1, T2)
5771    {
5772        #[inline]
5773        unsafe fn encode(
5774            self,
5775            encoder: &mut fidl::encoding::Encoder<'_, D>,
5776            offset: usize,
5777            depth: fidl::encoding::Depth,
5778        ) -> fidl::Result<()> {
5779            encoder.debug_check_bounds::<Metrics>(offset);
5780            // Zero out padding regions. There's no need to apply masks
5781            // because the unmasked parts will be overwritten by fields.
5782            // Write the fields.
5783            self.0.encode(encoder, offset + 0, depth)?;
5784            self.1.encode(encoder, offset + 4, depth)?;
5785            self.2.encode(encoder, offset + 8, depth)?;
5786            Ok(())
5787        }
5788    }
5789
5790    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metrics {
5791        #[inline(always)]
5792        fn new_empty() -> Self {
5793            Self {
5794                scale_x: fidl::new_empty!(f32, D),
5795                scale_y: fidl::new_empty!(f32, D),
5796                scale_z: fidl::new_empty!(f32, D),
5797            }
5798        }
5799
5800        #[inline]
5801        unsafe fn decode(
5802            &mut self,
5803            decoder: &mut fidl::encoding::Decoder<'_, D>,
5804            offset: usize,
5805            _depth: fidl::encoding::Depth,
5806        ) -> fidl::Result<()> {
5807            decoder.debug_check_bounds::<Self>(offset);
5808            // Verify that padding bytes are zero.
5809            fidl::decode!(f32, D, &mut self.scale_x, decoder, offset + 0, _depth)?;
5810            fidl::decode!(f32, D, &mut self.scale_y, decoder, offset + 4, _depth)?;
5811            fidl::decode!(f32, D, &mut self.scale_z, decoder, offset + 8, _depth)?;
5812            Ok(())
5813        }
5814    }
5815
5816    impl fidl::encoding::ValueTypeMarker for MetricsEvent {
5817        type Borrowed<'a> = &'a Self;
5818        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5819            value
5820        }
5821    }
5822
5823    unsafe impl fidl::encoding::TypeMarker for MetricsEvent {
5824        type Owned = Self;
5825
5826        #[inline(always)]
5827        fn inline_align(_context: fidl::encoding::Context) -> usize {
5828            4
5829        }
5830
5831        #[inline(always)]
5832        fn inline_size(_context: fidl::encoding::Context) -> usize {
5833            16
5834        }
5835    }
5836
5837    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MetricsEvent, D>
5838        for &MetricsEvent
5839    {
5840        #[inline]
5841        unsafe fn encode(
5842            self,
5843            encoder: &mut fidl::encoding::Encoder<'_, D>,
5844            offset: usize,
5845            _depth: fidl::encoding::Depth,
5846        ) -> fidl::Result<()> {
5847            encoder.debug_check_bounds::<MetricsEvent>(offset);
5848            // Delegate to tuple encoding.
5849            fidl::encoding::Encode::<MetricsEvent, D>::encode(
5850                (
5851                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
5852                    <Metrics as fidl::encoding::ValueTypeMarker>::borrow(&self.metrics),
5853                ),
5854                encoder,
5855                offset,
5856                _depth,
5857            )
5858        }
5859    }
5860    unsafe impl<
5861            D: fidl::encoding::ResourceDialect,
5862            T0: fidl::encoding::Encode<u32, D>,
5863            T1: fidl::encoding::Encode<Metrics, D>,
5864        > fidl::encoding::Encode<MetricsEvent, D> for (T0, T1)
5865    {
5866        #[inline]
5867        unsafe fn encode(
5868            self,
5869            encoder: &mut fidl::encoding::Encoder<'_, D>,
5870            offset: usize,
5871            depth: fidl::encoding::Depth,
5872        ) -> fidl::Result<()> {
5873            encoder.debug_check_bounds::<MetricsEvent>(offset);
5874            // Zero out padding regions. There's no need to apply masks
5875            // because the unmasked parts will be overwritten by fields.
5876            // Write the fields.
5877            self.0.encode(encoder, offset + 0, depth)?;
5878            self.1.encode(encoder, offset + 4, depth)?;
5879            Ok(())
5880        }
5881    }
5882
5883    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MetricsEvent {
5884        #[inline(always)]
5885        fn new_empty() -> Self {
5886            Self { node_id: fidl::new_empty!(u32, D), metrics: fidl::new_empty!(Metrics, D) }
5887        }
5888
5889        #[inline]
5890        unsafe fn decode(
5891            &mut self,
5892            decoder: &mut fidl::encoding::Decoder<'_, D>,
5893            offset: usize,
5894            _depth: fidl::encoding::Depth,
5895        ) -> fidl::Result<()> {
5896            decoder.debug_check_bounds::<Self>(offset);
5897            // Verify that padding bytes are zero.
5898            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
5899            fidl::decode!(Metrics, D, &mut self.metrics, decoder, offset + 4, _depth)?;
5900            Ok(())
5901        }
5902    }
5903
5904    impl fidl::encoding::ValueTypeMarker for OpacityNodeArgsHack {
5905        type Borrowed<'a> = &'a Self;
5906        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5907            value
5908        }
5909    }
5910
5911    unsafe impl fidl::encoding::TypeMarker for OpacityNodeArgsHack {
5912        type Owned = Self;
5913
5914        #[inline(always)]
5915        fn inline_align(_context: fidl::encoding::Context) -> usize {
5916            4
5917        }
5918
5919        #[inline(always)]
5920        fn inline_size(_context: fidl::encoding::Context) -> usize {
5921            4
5922        }
5923        #[inline(always)]
5924        fn encode_is_copy() -> bool {
5925            true
5926        }
5927
5928        #[inline(always)]
5929        fn decode_is_copy() -> bool {
5930            true
5931        }
5932    }
5933
5934    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OpacityNodeArgsHack, D>
5935        for &OpacityNodeArgsHack
5936    {
5937        #[inline]
5938        unsafe fn encode(
5939            self,
5940            encoder: &mut fidl::encoding::Encoder<'_, D>,
5941            offset: usize,
5942            _depth: fidl::encoding::Depth,
5943        ) -> fidl::Result<()> {
5944            encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
5945            unsafe {
5946                // Copy the object into the buffer.
5947                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5948                (buf_ptr as *mut OpacityNodeArgsHack)
5949                    .write_unaligned((self as *const OpacityNodeArgsHack).read());
5950                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5951                // done second because the memcpy will write garbage to these bytes.
5952            }
5953            Ok(())
5954        }
5955    }
5956    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5957        fidl::encoding::Encode<OpacityNodeArgsHack, D> for (T0,)
5958    {
5959        #[inline]
5960        unsafe fn encode(
5961            self,
5962            encoder: &mut fidl::encoding::Encoder<'_, D>,
5963            offset: usize,
5964            depth: fidl::encoding::Depth,
5965        ) -> fidl::Result<()> {
5966            encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
5967            // Zero out padding regions. There's no need to apply masks
5968            // because the unmasked parts will be overwritten by fields.
5969            // Write the fields.
5970            self.0.encode(encoder, offset + 0, depth)?;
5971            Ok(())
5972        }
5973    }
5974
5975    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpacityNodeArgsHack {
5976        #[inline(always)]
5977        fn new_empty() -> Self {
5978            Self { unused: fidl::new_empty!(u32, D) }
5979        }
5980
5981        #[inline]
5982        unsafe fn decode(
5983            &mut self,
5984            decoder: &mut fidl::encoding::Decoder<'_, D>,
5985            offset: usize,
5986            _depth: fidl::encoding::Depth,
5987        ) -> fidl::Result<()> {
5988            decoder.debug_check_bounds::<Self>(offset);
5989            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5990            // Verify that padding bytes are zero.
5991            // Copy from the buffer into the object.
5992            unsafe {
5993                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5994            }
5995            Ok(())
5996        }
5997    }
5998
5999    impl fidl::encoding::ValueTypeMarker for Plane3 {
6000        type Borrowed<'a> = &'a Self;
6001        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6002            value
6003        }
6004    }
6005
6006    unsafe impl fidl::encoding::TypeMarker for Plane3 {
6007        type Owned = Self;
6008
6009        #[inline(always)]
6010        fn inline_align(_context: fidl::encoding::Context) -> usize {
6011            4
6012        }
6013
6014        #[inline(always)]
6015        fn inline_size(_context: fidl::encoding::Context) -> usize {
6016            16
6017        }
6018    }
6019
6020    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Plane3, D> for &Plane3 {
6021        #[inline]
6022        unsafe fn encode(
6023            self,
6024            encoder: &mut fidl::encoding::Encoder<'_, D>,
6025            offset: usize,
6026            _depth: fidl::encoding::Depth,
6027        ) -> fidl::Result<()> {
6028            encoder.debug_check_bounds::<Plane3>(offset);
6029            // Delegate to tuple encoding.
6030            fidl::encoding::Encode::<Plane3, D>::encode(
6031                (
6032                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.dir),
6033                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dist),
6034                ),
6035                encoder,
6036                offset,
6037                _depth,
6038            )
6039        }
6040    }
6041    unsafe impl<
6042            D: fidl::encoding::ResourceDialect,
6043            T0: fidl::encoding::Encode<Vec3, D>,
6044            T1: fidl::encoding::Encode<f32, D>,
6045        > fidl::encoding::Encode<Plane3, D> for (T0, T1)
6046    {
6047        #[inline]
6048        unsafe fn encode(
6049            self,
6050            encoder: &mut fidl::encoding::Encoder<'_, D>,
6051            offset: usize,
6052            depth: fidl::encoding::Depth,
6053        ) -> fidl::Result<()> {
6054            encoder.debug_check_bounds::<Plane3>(offset);
6055            // Zero out padding regions. There's no need to apply masks
6056            // because the unmasked parts will be overwritten by fields.
6057            // Write the fields.
6058            self.0.encode(encoder, offset + 0, depth)?;
6059            self.1.encode(encoder, offset + 12, depth)?;
6060            Ok(())
6061        }
6062    }
6063
6064    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Plane3 {
6065        #[inline(always)]
6066        fn new_empty() -> Self {
6067            Self { dir: fidl::new_empty!(Vec3, D), dist: fidl::new_empty!(f32, D) }
6068        }
6069
6070        #[inline]
6071        unsafe fn decode(
6072            &mut self,
6073            decoder: &mut fidl::encoding::Decoder<'_, D>,
6074            offset: usize,
6075            _depth: fidl::encoding::Depth,
6076        ) -> fidl::Result<()> {
6077            decoder.debug_check_bounds::<Self>(offset);
6078            // Verify that padding bytes are zero.
6079            fidl::decode!(Vec3, D, &mut self.dir, decoder, offset + 0, _depth)?;
6080            fidl::decode!(f32, D, &mut self.dist, decoder, offset + 12, _depth)?;
6081            Ok(())
6082        }
6083    }
6084
6085    impl fidl::encoding::ValueTypeMarker for PointLightArgs {
6086        type Borrowed<'a> = &'a Self;
6087        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6088            value
6089        }
6090    }
6091
6092    unsafe impl fidl::encoding::TypeMarker for PointLightArgs {
6093        type Owned = Self;
6094
6095        #[inline(always)]
6096        fn inline_align(_context: fidl::encoding::Context) -> usize {
6097            4
6098        }
6099
6100        #[inline(always)]
6101        fn inline_size(_context: fidl::encoding::Context) -> usize {
6102            4
6103        }
6104        #[inline(always)]
6105        fn encode_is_copy() -> bool {
6106            true
6107        }
6108
6109        #[inline(always)]
6110        fn decode_is_copy() -> bool {
6111            true
6112        }
6113    }
6114
6115    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PointLightArgs, D>
6116        for &PointLightArgs
6117    {
6118        #[inline]
6119        unsafe fn encode(
6120            self,
6121            encoder: &mut fidl::encoding::Encoder<'_, D>,
6122            offset: usize,
6123            _depth: fidl::encoding::Depth,
6124        ) -> fidl::Result<()> {
6125            encoder.debug_check_bounds::<PointLightArgs>(offset);
6126            unsafe {
6127                // Copy the object into the buffer.
6128                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6129                (buf_ptr as *mut PointLightArgs)
6130                    .write_unaligned((self as *const PointLightArgs).read());
6131                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6132                // done second because the memcpy will write garbage to these bytes.
6133            }
6134            Ok(())
6135        }
6136    }
6137    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6138        fidl::encoding::Encode<PointLightArgs, D> for (T0,)
6139    {
6140        #[inline]
6141        unsafe fn encode(
6142            self,
6143            encoder: &mut fidl::encoding::Encoder<'_, D>,
6144            offset: usize,
6145            depth: fidl::encoding::Depth,
6146        ) -> fidl::Result<()> {
6147            encoder.debug_check_bounds::<PointLightArgs>(offset);
6148            // Zero out padding regions. There's no need to apply masks
6149            // because the unmasked parts will be overwritten by fields.
6150            // Write the fields.
6151            self.0.encode(encoder, offset + 0, depth)?;
6152            Ok(())
6153        }
6154    }
6155
6156    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PointLightArgs {
6157        #[inline(always)]
6158        fn new_empty() -> Self {
6159            Self { dummy: fidl::new_empty!(u32, D) }
6160        }
6161
6162        #[inline]
6163        unsafe fn decode(
6164            &mut self,
6165            decoder: &mut fidl::encoding::Decoder<'_, D>,
6166            offset: usize,
6167            _depth: fidl::encoding::Depth,
6168        ) -> fidl::Result<()> {
6169            decoder.debug_check_bounds::<Self>(offset);
6170            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6171            // Verify that padding bytes are zero.
6172            // Copy from the buffer into the object.
6173            unsafe {
6174                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6175            }
6176            Ok(())
6177        }
6178    }
6179
6180    impl fidl::encoding::ValueTypeMarker for Quaternion {
6181        type Borrowed<'a> = &'a Self;
6182        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6183            value
6184        }
6185    }
6186
6187    unsafe impl fidl::encoding::TypeMarker for Quaternion {
6188        type Owned = Self;
6189
6190        #[inline(always)]
6191        fn inline_align(_context: fidl::encoding::Context) -> usize {
6192            4
6193        }
6194
6195        #[inline(always)]
6196        fn inline_size(_context: fidl::encoding::Context) -> usize {
6197            16
6198        }
6199    }
6200
6201    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Quaternion, D>
6202        for &Quaternion
6203    {
6204        #[inline]
6205        unsafe fn encode(
6206            self,
6207            encoder: &mut fidl::encoding::Encoder<'_, D>,
6208            offset: usize,
6209            _depth: fidl::encoding::Depth,
6210        ) -> fidl::Result<()> {
6211            encoder.debug_check_bounds::<Quaternion>(offset);
6212            // Delegate to tuple encoding.
6213            fidl::encoding::Encode::<Quaternion, D>::encode(
6214                (
6215                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
6216                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
6217                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
6218                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
6219                ),
6220                encoder,
6221                offset,
6222                _depth,
6223            )
6224        }
6225    }
6226    unsafe impl<
6227            D: fidl::encoding::ResourceDialect,
6228            T0: fidl::encoding::Encode<f32, D>,
6229            T1: fidl::encoding::Encode<f32, D>,
6230            T2: fidl::encoding::Encode<f32, D>,
6231            T3: fidl::encoding::Encode<f32, D>,
6232        > fidl::encoding::Encode<Quaternion, D> for (T0, T1, T2, T3)
6233    {
6234        #[inline]
6235        unsafe fn encode(
6236            self,
6237            encoder: &mut fidl::encoding::Encoder<'_, D>,
6238            offset: usize,
6239            depth: fidl::encoding::Depth,
6240        ) -> fidl::Result<()> {
6241            encoder.debug_check_bounds::<Quaternion>(offset);
6242            // Zero out padding regions. There's no need to apply masks
6243            // because the unmasked parts will be overwritten by fields.
6244            // Write the fields.
6245            self.0.encode(encoder, offset + 0, depth)?;
6246            self.1.encode(encoder, offset + 4, depth)?;
6247            self.2.encode(encoder, offset + 8, depth)?;
6248            self.3.encode(encoder, offset + 12, depth)?;
6249            Ok(())
6250        }
6251    }
6252
6253    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Quaternion {
6254        #[inline(always)]
6255        fn new_empty() -> Self {
6256            Self {
6257                x: fidl::new_empty!(f32, D),
6258                y: fidl::new_empty!(f32, D),
6259                z: fidl::new_empty!(f32, D),
6260                w: fidl::new_empty!(f32, D),
6261            }
6262        }
6263
6264        #[inline]
6265        unsafe fn decode(
6266            &mut self,
6267            decoder: &mut fidl::encoding::Decoder<'_, D>,
6268            offset: usize,
6269            _depth: fidl::encoding::Depth,
6270        ) -> fidl::Result<()> {
6271            decoder.debug_check_bounds::<Self>(offset);
6272            // Verify that padding bytes are zero.
6273            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
6274            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
6275            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
6276            fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
6277            Ok(())
6278        }
6279    }
6280
6281    impl fidl::encoding::ValueTypeMarker for QuaternionValue {
6282        type Borrowed<'a> = &'a Self;
6283        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6284            value
6285        }
6286    }
6287
6288    unsafe impl fidl::encoding::TypeMarker for QuaternionValue {
6289        type Owned = Self;
6290
6291        #[inline(always)]
6292        fn inline_align(_context: fidl::encoding::Context) -> usize {
6293            4
6294        }
6295
6296        #[inline(always)]
6297        fn inline_size(_context: fidl::encoding::Context) -> usize {
6298            20
6299        }
6300    }
6301
6302    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QuaternionValue, D>
6303        for &QuaternionValue
6304    {
6305        #[inline]
6306        unsafe fn encode(
6307            self,
6308            encoder: &mut fidl::encoding::Encoder<'_, D>,
6309            offset: usize,
6310            _depth: fidl::encoding::Depth,
6311        ) -> fidl::Result<()> {
6312            encoder.debug_check_bounds::<QuaternionValue>(offset);
6313            // Delegate to tuple encoding.
6314            fidl::encoding::Encode::<QuaternionValue, D>::encode(
6315                (
6316                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6317                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
6318                ),
6319                encoder,
6320                offset,
6321                _depth,
6322            )
6323        }
6324    }
6325    unsafe impl<
6326            D: fidl::encoding::ResourceDialect,
6327            T0: fidl::encoding::Encode<Quaternion, D>,
6328            T1: fidl::encoding::Encode<u32, D>,
6329        > fidl::encoding::Encode<QuaternionValue, D> for (T0, T1)
6330    {
6331        #[inline]
6332        unsafe fn encode(
6333            self,
6334            encoder: &mut fidl::encoding::Encoder<'_, D>,
6335            offset: usize,
6336            depth: fidl::encoding::Depth,
6337        ) -> fidl::Result<()> {
6338            encoder.debug_check_bounds::<QuaternionValue>(offset);
6339            // Zero out padding regions. There's no need to apply masks
6340            // because the unmasked parts will be overwritten by fields.
6341            // Write the fields.
6342            self.0.encode(encoder, offset + 0, depth)?;
6343            self.1.encode(encoder, offset + 16, depth)?;
6344            Ok(())
6345        }
6346    }
6347
6348    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QuaternionValue {
6349        #[inline(always)]
6350        fn new_empty() -> Self {
6351            Self { value: fidl::new_empty!(Quaternion, D), variable_id: fidl::new_empty!(u32, D) }
6352        }
6353
6354        #[inline]
6355        unsafe fn decode(
6356            &mut self,
6357            decoder: &mut fidl::encoding::Decoder<'_, D>,
6358            offset: usize,
6359            _depth: fidl::encoding::Depth,
6360        ) -> fidl::Result<()> {
6361            decoder.debug_check_bounds::<Self>(offset);
6362            // Verify that padding bytes are zero.
6363            fidl::decode!(Quaternion, D, &mut self.value, decoder, offset + 0, _depth)?;
6364            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
6365            Ok(())
6366        }
6367    }
6368
6369    impl fidl::encoding::ValueTypeMarker for RectangleArgs {
6370        type Borrowed<'a> = &'a Self;
6371        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6372            value
6373        }
6374    }
6375
6376    unsafe impl fidl::encoding::TypeMarker for RectangleArgs {
6377        type Owned = Self;
6378
6379        #[inline(always)]
6380        fn inline_align(_context: fidl::encoding::Context) -> usize {
6381            8
6382        }
6383
6384        #[inline(always)]
6385        fn inline_size(_context: fidl::encoding::Context) -> usize {
6386            32
6387        }
6388    }
6389
6390    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RectangleArgs, D>
6391        for &RectangleArgs
6392    {
6393        #[inline]
6394        unsafe fn encode(
6395            self,
6396            encoder: &mut fidl::encoding::Encoder<'_, D>,
6397            offset: usize,
6398            _depth: fidl::encoding::Depth,
6399        ) -> fidl::Result<()> {
6400            encoder.debug_check_bounds::<RectangleArgs>(offset);
6401            // Delegate to tuple encoding.
6402            fidl::encoding::Encode::<RectangleArgs, D>::encode(
6403                (
6404                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6405                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6406                ),
6407                encoder,
6408                offset,
6409                _depth,
6410            )
6411        }
6412    }
6413    unsafe impl<
6414            D: fidl::encoding::ResourceDialect,
6415            T0: fidl::encoding::Encode<Value, D>,
6416            T1: fidl::encoding::Encode<Value, D>,
6417        > fidl::encoding::Encode<RectangleArgs, D> for (T0, T1)
6418    {
6419        #[inline]
6420        unsafe fn encode(
6421            self,
6422            encoder: &mut fidl::encoding::Encoder<'_, D>,
6423            offset: usize,
6424            depth: fidl::encoding::Depth,
6425        ) -> fidl::Result<()> {
6426            encoder.debug_check_bounds::<RectangleArgs>(offset);
6427            // Zero out padding regions. There's no need to apply masks
6428            // because the unmasked parts will be overwritten by fields.
6429            // Write the fields.
6430            self.0.encode(encoder, offset + 0, depth)?;
6431            self.1.encode(encoder, offset + 16, depth)?;
6432            Ok(())
6433        }
6434    }
6435
6436    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RectangleArgs {
6437        #[inline(always)]
6438        fn new_empty() -> Self {
6439            Self { width: fidl::new_empty!(Value, D), height: fidl::new_empty!(Value, D) }
6440        }
6441
6442        #[inline]
6443        unsafe fn decode(
6444            &mut self,
6445            decoder: &mut fidl::encoding::Decoder<'_, D>,
6446            offset: usize,
6447            _depth: fidl::encoding::Depth,
6448        ) -> fidl::Result<()> {
6449            decoder.debug_check_bounds::<Self>(offset);
6450            // Verify that padding bytes are zero.
6451            fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
6452            fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
6453            Ok(())
6454        }
6455    }
6456
6457    impl fidl::encoding::ValueTypeMarker for ReleaseResourceCmd {
6458        type Borrowed<'a> = &'a Self;
6459        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6460            value
6461        }
6462    }
6463
6464    unsafe impl fidl::encoding::TypeMarker for ReleaseResourceCmd {
6465        type Owned = Self;
6466
6467        #[inline(always)]
6468        fn inline_align(_context: fidl::encoding::Context) -> usize {
6469            4
6470        }
6471
6472        #[inline(always)]
6473        fn inline_size(_context: fidl::encoding::Context) -> usize {
6474            4
6475        }
6476        #[inline(always)]
6477        fn encode_is_copy() -> bool {
6478            true
6479        }
6480
6481        #[inline(always)]
6482        fn decode_is_copy() -> bool {
6483            true
6484        }
6485    }
6486
6487    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReleaseResourceCmd, D>
6488        for &ReleaseResourceCmd
6489    {
6490        #[inline]
6491        unsafe fn encode(
6492            self,
6493            encoder: &mut fidl::encoding::Encoder<'_, D>,
6494            offset: usize,
6495            _depth: fidl::encoding::Depth,
6496        ) -> fidl::Result<()> {
6497            encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6498            unsafe {
6499                // Copy the object into the buffer.
6500                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6501                (buf_ptr as *mut ReleaseResourceCmd)
6502                    .write_unaligned((self as *const ReleaseResourceCmd).read());
6503                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6504                // done second because the memcpy will write garbage to these bytes.
6505            }
6506            Ok(())
6507        }
6508    }
6509    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6510        fidl::encoding::Encode<ReleaseResourceCmd, D> for (T0,)
6511    {
6512        #[inline]
6513        unsafe fn encode(
6514            self,
6515            encoder: &mut fidl::encoding::Encoder<'_, D>,
6516            offset: usize,
6517            depth: fidl::encoding::Depth,
6518        ) -> fidl::Result<()> {
6519            encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
6520            // Zero out padding regions. There's no need to apply masks
6521            // because the unmasked parts will be overwritten by fields.
6522            // Write the fields.
6523            self.0.encode(encoder, offset + 0, depth)?;
6524            Ok(())
6525        }
6526    }
6527
6528    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReleaseResourceCmd {
6529        #[inline(always)]
6530        fn new_empty() -> Self {
6531            Self { id: fidl::new_empty!(u32, D) }
6532        }
6533
6534        #[inline]
6535        unsafe fn decode(
6536            &mut self,
6537            decoder: &mut fidl::encoding::Decoder<'_, D>,
6538            offset: usize,
6539            _depth: fidl::encoding::Depth,
6540        ) -> fidl::Result<()> {
6541            decoder.debug_check_bounds::<Self>(offset);
6542            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6543            // Verify that padding bytes are zero.
6544            // Copy from the buffer into the object.
6545            unsafe {
6546                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6547            }
6548            Ok(())
6549        }
6550    }
6551
6552    impl fidl::encoding::ValueTypeMarker for RemoveAllLayersCmd {
6553        type Borrowed<'a> = &'a Self;
6554        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6555            value
6556        }
6557    }
6558
6559    unsafe impl fidl::encoding::TypeMarker for RemoveAllLayersCmd {
6560        type Owned = Self;
6561
6562        #[inline(always)]
6563        fn inline_align(_context: fidl::encoding::Context) -> usize {
6564            4
6565        }
6566
6567        #[inline(always)]
6568        fn inline_size(_context: fidl::encoding::Context) -> usize {
6569            4
6570        }
6571        #[inline(always)]
6572        fn encode_is_copy() -> bool {
6573            true
6574        }
6575
6576        #[inline(always)]
6577        fn decode_is_copy() -> bool {
6578            true
6579        }
6580    }
6581
6582    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveAllLayersCmd, D>
6583        for &RemoveAllLayersCmd
6584    {
6585        #[inline]
6586        unsafe fn encode(
6587            self,
6588            encoder: &mut fidl::encoding::Encoder<'_, D>,
6589            offset: usize,
6590            _depth: fidl::encoding::Depth,
6591        ) -> fidl::Result<()> {
6592            encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6593            unsafe {
6594                // Copy the object into the buffer.
6595                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6596                (buf_ptr as *mut RemoveAllLayersCmd)
6597                    .write_unaligned((self as *const RemoveAllLayersCmd).read());
6598                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6599                // done second because the memcpy will write garbage to these bytes.
6600            }
6601            Ok(())
6602        }
6603    }
6604    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6605        fidl::encoding::Encode<RemoveAllLayersCmd, D> for (T0,)
6606    {
6607        #[inline]
6608        unsafe fn encode(
6609            self,
6610            encoder: &mut fidl::encoding::Encoder<'_, D>,
6611            offset: usize,
6612            depth: fidl::encoding::Depth,
6613        ) -> fidl::Result<()> {
6614            encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
6615            // Zero out padding regions. There's no need to apply masks
6616            // because the unmasked parts will be overwritten by fields.
6617            // Write the fields.
6618            self.0.encode(encoder, offset + 0, depth)?;
6619            Ok(())
6620        }
6621    }
6622
6623    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveAllLayersCmd {
6624        #[inline(always)]
6625        fn new_empty() -> Self {
6626            Self { layer_stack_id: fidl::new_empty!(u32, D) }
6627        }
6628
6629        #[inline]
6630        unsafe fn decode(
6631            &mut self,
6632            decoder: &mut fidl::encoding::Decoder<'_, D>,
6633            offset: usize,
6634            _depth: fidl::encoding::Depth,
6635        ) -> fidl::Result<()> {
6636            decoder.debug_check_bounds::<Self>(offset);
6637            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6638            // Verify that padding bytes are zero.
6639            // Copy from the buffer into the object.
6640            unsafe {
6641                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6642            }
6643            Ok(())
6644        }
6645    }
6646
6647    impl fidl::encoding::ValueTypeMarker for RemoveLayerCmd {
6648        type Borrowed<'a> = &'a Self;
6649        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6650            value
6651        }
6652    }
6653
6654    unsafe impl fidl::encoding::TypeMarker for RemoveLayerCmd {
6655        type Owned = Self;
6656
6657        #[inline(always)]
6658        fn inline_align(_context: fidl::encoding::Context) -> usize {
6659            4
6660        }
6661
6662        #[inline(always)]
6663        fn inline_size(_context: fidl::encoding::Context) -> usize {
6664            8
6665        }
6666        #[inline(always)]
6667        fn encode_is_copy() -> bool {
6668            true
6669        }
6670
6671        #[inline(always)]
6672        fn decode_is_copy() -> bool {
6673            true
6674        }
6675    }
6676
6677    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveLayerCmd, D>
6678        for &RemoveLayerCmd
6679    {
6680        #[inline]
6681        unsafe fn encode(
6682            self,
6683            encoder: &mut fidl::encoding::Encoder<'_, D>,
6684            offset: usize,
6685            _depth: fidl::encoding::Depth,
6686        ) -> fidl::Result<()> {
6687            encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6688            unsafe {
6689                // Copy the object into the buffer.
6690                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6691                (buf_ptr as *mut RemoveLayerCmd)
6692                    .write_unaligned((self as *const RemoveLayerCmd).read());
6693                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6694                // done second because the memcpy will write garbage to these bytes.
6695            }
6696            Ok(())
6697        }
6698    }
6699    unsafe impl<
6700            D: fidl::encoding::ResourceDialect,
6701            T0: fidl::encoding::Encode<u32, D>,
6702            T1: fidl::encoding::Encode<u32, D>,
6703        > fidl::encoding::Encode<RemoveLayerCmd, D> for (T0, T1)
6704    {
6705        #[inline]
6706        unsafe fn encode(
6707            self,
6708            encoder: &mut fidl::encoding::Encoder<'_, D>,
6709            offset: usize,
6710            depth: fidl::encoding::Depth,
6711        ) -> fidl::Result<()> {
6712            encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
6713            // Zero out padding regions. There's no need to apply masks
6714            // because the unmasked parts will be overwritten by fields.
6715            // Write the fields.
6716            self.0.encode(encoder, offset + 0, depth)?;
6717            self.1.encode(encoder, offset + 4, depth)?;
6718            Ok(())
6719        }
6720    }
6721
6722    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveLayerCmd {
6723        #[inline(always)]
6724        fn new_empty() -> Self {
6725            Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
6726        }
6727
6728        #[inline]
6729        unsafe fn decode(
6730            &mut self,
6731            decoder: &mut fidl::encoding::Decoder<'_, D>,
6732            offset: usize,
6733            _depth: fidl::encoding::Depth,
6734        ) -> fidl::Result<()> {
6735            decoder.debug_check_bounds::<Self>(offset);
6736            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6737            // Verify that padding bytes are zero.
6738            // Copy from the buffer into the object.
6739            unsafe {
6740                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6741            }
6742            Ok(())
6743        }
6744    }
6745
6746    impl fidl::encoding::ValueTypeMarker for RendererArgs {
6747        type Borrowed<'a> = &'a Self;
6748        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6749            value
6750        }
6751    }
6752
6753    unsafe impl fidl::encoding::TypeMarker for RendererArgs {
6754        type Owned = Self;
6755
6756        #[inline(always)]
6757        fn inline_align(_context: fidl::encoding::Context) -> usize {
6758            4
6759        }
6760
6761        #[inline(always)]
6762        fn inline_size(_context: fidl::encoding::Context) -> usize {
6763            4
6764        }
6765        #[inline(always)]
6766        fn encode_is_copy() -> bool {
6767            true
6768        }
6769
6770        #[inline(always)]
6771        fn decode_is_copy() -> bool {
6772            true
6773        }
6774    }
6775
6776    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererArgs, D>
6777        for &RendererArgs
6778    {
6779        #[inline]
6780        unsafe fn encode(
6781            self,
6782            encoder: &mut fidl::encoding::Encoder<'_, D>,
6783            offset: usize,
6784            _depth: fidl::encoding::Depth,
6785        ) -> fidl::Result<()> {
6786            encoder.debug_check_bounds::<RendererArgs>(offset);
6787            unsafe {
6788                // Copy the object into the buffer.
6789                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6790                (buf_ptr as *mut RendererArgs)
6791                    .write_unaligned((self as *const RendererArgs).read());
6792                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6793                // done second because the memcpy will write garbage to these bytes.
6794            }
6795            Ok(())
6796        }
6797    }
6798    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6799        fidl::encoding::Encode<RendererArgs, D> for (T0,)
6800    {
6801        #[inline]
6802        unsafe fn encode(
6803            self,
6804            encoder: &mut fidl::encoding::Encoder<'_, D>,
6805            offset: usize,
6806            depth: fidl::encoding::Depth,
6807        ) -> fidl::Result<()> {
6808            encoder.debug_check_bounds::<RendererArgs>(offset);
6809            // Zero out padding regions. There's no need to apply masks
6810            // because the unmasked parts will be overwritten by fields.
6811            // Write the fields.
6812            self.0.encode(encoder, offset + 0, depth)?;
6813            Ok(())
6814        }
6815    }
6816
6817    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererArgs {
6818        #[inline(always)]
6819        fn new_empty() -> Self {
6820            Self { dummy: fidl::new_empty!(u32, D) }
6821        }
6822
6823        #[inline]
6824        unsafe fn decode(
6825            &mut self,
6826            decoder: &mut fidl::encoding::Decoder<'_, D>,
6827            offset: usize,
6828            _depth: fidl::encoding::Depth,
6829        ) -> fidl::Result<()> {
6830            decoder.debug_check_bounds::<Self>(offset);
6831            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6832            // Verify that padding bytes are zero.
6833            // Copy from the buffer into the object.
6834            unsafe {
6835                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6836            }
6837            Ok(())
6838        }
6839    }
6840
6841    impl fidl::encoding::ValueTypeMarker for RoundedRectangleArgs {
6842        type Borrowed<'a> = &'a Self;
6843        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6844            value
6845        }
6846    }
6847
6848    unsafe impl fidl::encoding::TypeMarker for RoundedRectangleArgs {
6849        type Owned = Self;
6850
6851        #[inline(always)]
6852        fn inline_align(_context: fidl::encoding::Context) -> usize {
6853            8
6854        }
6855
6856        #[inline(always)]
6857        fn inline_size(_context: fidl::encoding::Context) -> usize {
6858            96
6859        }
6860    }
6861
6862    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RoundedRectangleArgs, D>
6863        for &RoundedRectangleArgs
6864    {
6865        #[inline]
6866        unsafe fn encode(
6867            self,
6868            encoder: &mut fidl::encoding::Encoder<'_, D>,
6869            offset: usize,
6870            _depth: fidl::encoding::Depth,
6871        ) -> fidl::Result<()> {
6872            encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6873            // Delegate to tuple encoding.
6874            fidl::encoding::Encode::<RoundedRectangleArgs, D>::encode(
6875                (
6876                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
6877                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
6878                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_left_radius),
6879                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_right_radius),
6880                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_right_radius),
6881                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_left_radius),
6882                ),
6883                encoder,
6884                offset,
6885                _depth,
6886            )
6887        }
6888    }
6889    unsafe impl<
6890            D: fidl::encoding::ResourceDialect,
6891            T0: fidl::encoding::Encode<Value, D>,
6892            T1: fidl::encoding::Encode<Value, D>,
6893            T2: fidl::encoding::Encode<Value, D>,
6894            T3: fidl::encoding::Encode<Value, D>,
6895            T4: fidl::encoding::Encode<Value, D>,
6896            T5: fidl::encoding::Encode<Value, D>,
6897        > fidl::encoding::Encode<RoundedRectangleArgs, D> for (T0, T1, T2, T3, T4, T5)
6898    {
6899        #[inline]
6900        unsafe fn encode(
6901            self,
6902            encoder: &mut fidl::encoding::Encoder<'_, D>,
6903            offset: usize,
6904            depth: fidl::encoding::Depth,
6905        ) -> fidl::Result<()> {
6906            encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
6907            // Zero out padding regions. There's no need to apply masks
6908            // because the unmasked parts will be overwritten by fields.
6909            // Write the fields.
6910            self.0.encode(encoder, offset + 0, depth)?;
6911            self.1.encode(encoder, offset + 16, depth)?;
6912            self.2.encode(encoder, offset + 32, depth)?;
6913            self.3.encode(encoder, offset + 48, depth)?;
6914            self.4.encode(encoder, offset + 64, depth)?;
6915            self.5.encode(encoder, offset + 80, depth)?;
6916            Ok(())
6917        }
6918    }
6919
6920    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RoundedRectangleArgs {
6921        #[inline(always)]
6922        fn new_empty() -> Self {
6923            Self {
6924                width: fidl::new_empty!(Value, D),
6925                height: fidl::new_empty!(Value, D),
6926                top_left_radius: fidl::new_empty!(Value, D),
6927                top_right_radius: fidl::new_empty!(Value, D),
6928                bottom_right_radius: fidl::new_empty!(Value, D),
6929                bottom_left_radius: fidl::new_empty!(Value, D),
6930            }
6931        }
6932
6933        #[inline]
6934        unsafe fn decode(
6935            &mut self,
6936            decoder: &mut fidl::encoding::Decoder<'_, D>,
6937            offset: usize,
6938            _depth: fidl::encoding::Depth,
6939        ) -> fidl::Result<()> {
6940            decoder.debug_check_bounds::<Self>(offset);
6941            // Verify that padding bytes are zero.
6942            fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
6943            fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
6944            fidl::decode!(Value, D, &mut self.top_left_radius, decoder, offset + 32, _depth)?;
6945            fidl::decode!(Value, D, &mut self.top_right_radius, decoder, offset + 48, _depth)?;
6946            fidl::decode!(Value, D, &mut self.bottom_right_radius, decoder, offset + 64, _depth)?;
6947            fidl::decode!(Value, D, &mut self.bottom_left_radius, decoder, offset + 80, _depth)?;
6948            Ok(())
6949        }
6950    }
6951
6952    impl fidl::encoding::ValueTypeMarker for SceneAddAmbientLightCmd {
6953        type Borrowed<'a> = &'a Self;
6954        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6955            value
6956        }
6957    }
6958
6959    unsafe impl fidl::encoding::TypeMarker for SceneAddAmbientLightCmd {
6960        type Owned = Self;
6961
6962        #[inline(always)]
6963        fn inline_align(_context: fidl::encoding::Context) -> usize {
6964            4
6965        }
6966
6967        #[inline(always)]
6968        fn inline_size(_context: fidl::encoding::Context) -> usize {
6969            8
6970        }
6971        #[inline(always)]
6972        fn encode_is_copy() -> bool {
6973            true
6974        }
6975
6976        #[inline(always)]
6977        fn decode_is_copy() -> bool {
6978            true
6979        }
6980    }
6981
6982    unsafe impl<D: fidl::encoding::ResourceDialect>
6983        fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for &SceneAddAmbientLightCmd
6984    {
6985        #[inline]
6986        unsafe fn encode(
6987            self,
6988            encoder: &mut fidl::encoding::Encoder<'_, D>,
6989            offset: usize,
6990            _depth: fidl::encoding::Depth,
6991        ) -> fidl::Result<()> {
6992            encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
6993            unsafe {
6994                // Copy the object into the buffer.
6995                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6996                (buf_ptr as *mut SceneAddAmbientLightCmd)
6997                    .write_unaligned((self as *const SceneAddAmbientLightCmd).read());
6998                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6999                // done second because the memcpy will write garbage to these bytes.
7000            }
7001            Ok(())
7002        }
7003    }
7004    unsafe impl<
7005            D: fidl::encoding::ResourceDialect,
7006            T0: fidl::encoding::Encode<u32, D>,
7007            T1: fidl::encoding::Encode<u32, D>,
7008        > fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for (T0, T1)
7009    {
7010        #[inline]
7011        unsafe fn encode(
7012            self,
7013            encoder: &mut fidl::encoding::Encoder<'_, D>,
7014            offset: usize,
7015            depth: fidl::encoding::Depth,
7016        ) -> fidl::Result<()> {
7017            encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
7018            // Zero out padding regions. There's no need to apply masks
7019            // because the unmasked parts will be overwritten by fields.
7020            // Write the fields.
7021            self.0.encode(encoder, offset + 0, depth)?;
7022            self.1.encode(encoder, offset + 4, depth)?;
7023            Ok(())
7024        }
7025    }
7026
7027    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7028        for SceneAddAmbientLightCmd
7029    {
7030        #[inline(always)]
7031        fn new_empty() -> Self {
7032            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7033        }
7034
7035        #[inline]
7036        unsafe fn decode(
7037            &mut self,
7038            decoder: &mut fidl::encoding::Decoder<'_, D>,
7039            offset: usize,
7040            _depth: fidl::encoding::Depth,
7041        ) -> fidl::Result<()> {
7042            decoder.debug_check_bounds::<Self>(offset);
7043            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7044            // Verify that padding bytes are zero.
7045            // Copy from the buffer into the object.
7046            unsafe {
7047                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7048            }
7049            Ok(())
7050        }
7051    }
7052
7053    impl fidl::encoding::ValueTypeMarker for SceneAddDirectionalLightCmd {
7054        type Borrowed<'a> = &'a Self;
7055        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7056            value
7057        }
7058    }
7059
7060    unsafe impl fidl::encoding::TypeMarker for SceneAddDirectionalLightCmd {
7061        type Owned = Self;
7062
7063        #[inline(always)]
7064        fn inline_align(_context: fidl::encoding::Context) -> usize {
7065            4
7066        }
7067
7068        #[inline(always)]
7069        fn inline_size(_context: fidl::encoding::Context) -> usize {
7070            8
7071        }
7072        #[inline(always)]
7073        fn encode_is_copy() -> bool {
7074            true
7075        }
7076
7077        #[inline(always)]
7078        fn decode_is_copy() -> bool {
7079            true
7080        }
7081    }
7082
7083    unsafe impl<D: fidl::encoding::ResourceDialect>
7084        fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for &SceneAddDirectionalLightCmd
7085    {
7086        #[inline]
7087        unsafe fn encode(
7088            self,
7089            encoder: &mut fidl::encoding::Encoder<'_, D>,
7090            offset: usize,
7091            _depth: fidl::encoding::Depth,
7092        ) -> fidl::Result<()> {
7093            encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7094            unsafe {
7095                // Copy the object into the buffer.
7096                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7097                (buf_ptr as *mut SceneAddDirectionalLightCmd)
7098                    .write_unaligned((self as *const SceneAddDirectionalLightCmd).read());
7099                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7100                // done second because the memcpy will write garbage to these bytes.
7101            }
7102            Ok(())
7103        }
7104    }
7105    unsafe impl<
7106            D: fidl::encoding::ResourceDialect,
7107            T0: fidl::encoding::Encode<u32, D>,
7108            T1: fidl::encoding::Encode<u32, D>,
7109        > fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for (T0, T1)
7110    {
7111        #[inline]
7112        unsafe fn encode(
7113            self,
7114            encoder: &mut fidl::encoding::Encoder<'_, D>,
7115            offset: usize,
7116            depth: fidl::encoding::Depth,
7117        ) -> fidl::Result<()> {
7118            encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
7119            // Zero out padding regions. There's no need to apply masks
7120            // because the unmasked parts will be overwritten by fields.
7121            // Write the fields.
7122            self.0.encode(encoder, offset + 0, depth)?;
7123            self.1.encode(encoder, offset + 4, depth)?;
7124            Ok(())
7125        }
7126    }
7127
7128    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7129        for SceneAddDirectionalLightCmd
7130    {
7131        #[inline(always)]
7132        fn new_empty() -> Self {
7133            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7134        }
7135
7136        #[inline]
7137        unsafe fn decode(
7138            &mut self,
7139            decoder: &mut fidl::encoding::Decoder<'_, D>,
7140            offset: usize,
7141            _depth: fidl::encoding::Depth,
7142        ) -> fidl::Result<()> {
7143            decoder.debug_check_bounds::<Self>(offset);
7144            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7145            // Verify that padding bytes are zero.
7146            // Copy from the buffer into the object.
7147            unsafe {
7148                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7149            }
7150            Ok(())
7151        }
7152    }
7153
7154    impl fidl::encoding::ValueTypeMarker for SceneAddPointLightCmd {
7155        type Borrowed<'a> = &'a Self;
7156        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7157            value
7158        }
7159    }
7160
7161    unsafe impl fidl::encoding::TypeMarker for SceneAddPointLightCmd {
7162        type Owned = Self;
7163
7164        #[inline(always)]
7165        fn inline_align(_context: fidl::encoding::Context) -> usize {
7166            4
7167        }
7168
7169        #[inline(always)]
7170        fn inline_size(_context: fidl::encoding::Context) -> usize {
7171            8
7172        }
7173        #[inline(always)]
7174        fn encode_is_copy() -> bool {
7175            true
7176        }
7177
7178        #[inline(always)]
7179        fn decode_is_copy() -> bool {
7180            true
7181        }
7182    }
7183
7184    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneAddPointLightCmd, D>
7185        for &SceneAddPointLightCmd
7186    {
7187        #[inline]
7188        unsafe fn encode(
7189            self,
7190            encoder: &mut fidl::encoding::Encoder<'_, D>,
7191            offset: usize,
7192            _depth: fidl::encoding::Depth,
7193        ) -> fidl::Result<()> {
7194            encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7195            unsafe {
7196                // Copy the object into the buffer.
7197                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7198                (buf_ptr as *mut SceneAddPointLightCmd)
7199                    .write_unaligned((self as *const SceneAddPointLightCmd).read());
7200                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7201                // done second because the memcpy will write garbage to these bytes.
7202            }
7203            Ok(())
7204        }
7205    }
7206    unsafe impl<
7207            D: fidl::encoding::ResourceDialect,
7208            T0: fidl::encoding::Encode<u32, D>,
7209            T1: fidl::encoding::Encode<u32, D>,
7210        > fidl::encoding::Encode<SceneAddPointLightCmd, D> for (T0, T1)
7211    {
7212        #[inline]
7213        unsafe fn encode(
7214            self,
7215            encoder: &mut fidl::encoding::Encoder<'_, D>,
7216            offset: usize,
7217            depth: fidl::encoding::Depth,
7218        ) -> fidl::Result<()> {
7219            encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
7220            // Zero out padding regions. There's no need to apply masks
7221            // because the unmasked parts will be overwritten by fields.
7222            // Write the fields.
7223            self.0.encode(encoder, offset + 0, depth)?;
7224            self.1.encode(encoder, offset + 4, depth)?;
7225            Ok(())
7226        }
7227    }
7228
7229    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneAddPointLightCmd {
7230        #[inline(always)]
7231        fn new_empty() -> Self {
7232            Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
7233        }
7234
7235        #[inline]
7236        unsafe fn decode(
7237            &mut self,
7238            decoder: &mut fidl::encoding::Decoder<'_, D>,
7239            offset: usize,
7240            _depth: fidl::encoding::Depth,
7241        ) -> fidl::Result<()> {
7242            decoder.debug_check_bounds::<Self>(offset);
7243            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7244            // Verify that padding bytes are zero.
7245            // Copy from the buffer into the object.
7246            unsafe {
7247                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7248            }
7249            Ok(())
7250        }
7251    }
7252
7253    impl fidl::encoding::ValueTypeMarker for SceneArgs {
7254        type Borrowed<'a> = &'a Self;
7255        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7256            value
7257        }
7258    }
7259
7260    unsafe impl fidl::encoding::TypeMarker for SceneArgs {
7261        type Owned = Self;
7262
7263        #[inline(always)]
7264        fn inline_align(_context: fidl::encoding::Context) -> usize {
7265            4
7266        }
7267
7268        #[inline(always)]
7269        fn inline_size(_context: fidl::encoding::Context) -> usize {
7270            4
7271        }
7272        #[inline(always)]
7273        fn encode_is_copy() -> bool {
7274            true
7275        }
7276
7277        #[inline(always)]
7278        fn decode_is_copy() -> bool {
7279            true
7280        }
7281    }
7282
7283    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneArgs, D>
7284        for &SceneArgs
7285    {
7286        #[inline]
7287        unsafe fn encode(
7288            self,
7289            encoder: &mut fidl::encoding::Encoder<'_, D>,
7290            offset: usize,
7291            _depth: fidl::encoding::Depth,
7292        ) -> fidl::Result<()> {
7293            encoder.debug_check_bounds::<SceneArgs>(offset);
7294            unsafe {
7295                // Copy the object into the buffer.
7296                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7297                (buf_ptr as *mut SceneArgs).write_unaligned((self as *const SceneArgs).read());
7298                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7299                // done second because the memcpy will write garbage to these bytes.
7300            }
7301            Ok(())
7302        }
7303    }
7304    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7305        fidl::encoding::Encode<SceneArgs, D> for (T0,)
7306    {
7307        #[inline]
7308        unsafe fn encode(
7309            self,
7310            encoder: &mut fidl::encoding::Encoder<'_, D>,
7311            offset: usize,
7312            depth: fidl::encoding::Depth,
7313        ) -> fidl::Result<()> {
7314            encoder.debug_check_bounds::<SceneArgs>(offset);
7315            // Zero out padding regions. There's no need to apply masks
7316            // because the unmasked parts will be overwritten by fields.
7317            // Write the fields.
7318            self.0.encode(encoder, offset + 0, depth)?;
7319            Ok(())
7320        }
7321    }
7322
7323    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneArgs {
7324        #[inline(always)]
7325        fn new_empty() -> Self {
7326            Self { dummy: fidl::new_empty!(u32, D) }
7327        }
7328
7329        #[inline]
7330        unsafe fn decode(
7331            &mut self,
7332            decoder: &mut fidl::encoding::Decoder<'_, D>,
7333            offset: usize,
7334            _depth: fidl::encoding::Depth,
7335        ) -> fidl::Result<()> {
7336            decoder.debug_check_bounds::<Self>(offset);
7337            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7338            // Verify that padding bytes are zero.
7339            // Copy from the buffer into the object.
7340            unsafe {
7341                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7342            }
7343            Ok(())
7344        }
7345    }
7346
7347    impl fidl::encoding::ValueTypeMarker for SendSizeChangeHintCmdHack {
7348        type Borrowed<'a> = &'a Self;
7349        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7350            value
7351        }
7352    }
7353
7354    unsafe impl fidl::encoding::TypeMarker for SendSizeChangeHintCmdHack {
7355        type Owned = Self;
7356
7357        #[inline(always)]
7358        fn inline_align(_context: fidl::encoding::Context) -> usize {
7359            4
7360        }
7361
7362        #[inline(always)]
7363        fn inline_size(_context: fidl::encoding::Context) -> usize {
7364            12
7365        }
7366    }
7367
7368    unsafe impl<D: fidl::encoding::ResourceDialect>
7369        fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for &SendSizeChangeHintCmdHack
7370    {
7371        #[inline]
7372        unsafe fn encode(
7373            self,
7374            encoder: &mut fidl::encoding::Encoder<'_, D>,
7375            offset: usize,
7376            _depth: fidl::encoding::Depth,
7377        ) -> fidl::Result<()> {
7378            encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7379            // Delegate to tuple encoding.
7380            fidl::encoding::Encode::<SendSizeChangeHintCmdHack, D>::encode(
7381                (
7382                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
7383                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
7384                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
7385                ),
7386                encoder,
7387                offset,
7388                _depth,
7389            )
7390        }
7391    }
7392    unsafe impl<
7393            D: fidl::encoding::ResourceDialect,
7394            T0: fidl::encoding::Encode<u32, D>,
7395            T1: fidl::encoding::Encode<f32, D>,
7396            T2: fidl::encoding::Encode<f32, D>,
7397        > fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for (T0, T1, T2)
7398    {
7399        #[inline]
7400        unsafe fn encode(
7401            self,
7402            encoder: &mut fidl::encoding::Encoder<'_, D>,
7403            offset: usize,
7404            depth: fidl::encoding::Depth,
7405        ) -> fidl::Result<()> {
7406            encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
7407            // Zero out padding regions. There's no need to apply masks
7408            // because the unmasked parts will be overwritten by fields.
7409            // Write the fields.
7410            self.0.encode(encoder, offset + 0, depth)?;
7411            self.1.encode(encoder, offset + 4, depth)?;
7412            self.2.encode(encoder, offset + 8, depth)?;
7413            Ok(())
7414        }
7415    }
7416
7417    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7418        for SendSizeChangeHintCmdHack
7419    {
7420        #[inline(always)]
7421        fn new_empty() -> Self {
7422            Self {
7423                node_id: fidl::new_empty!(u32, D),
7424                width_change_factor: fidl::new_empty!(f32, D),
7425                height_change_factor: fidl::new_empty!(f32, D),
7426            }
7427        }
7428
7429        #[inline]
7430        unsafe fn decode(
7431            &mut self,
7432            decoder: &mut fidl::encoding::Decoder<'_, D>,
7433            offset: usize,
7434            _depth: fidl::encoding::Depth,
7435        ) -> fidl::Result<()> {
7436            decoder.debug_check_bounds::<Self>(offset);
7437            // Verify that padding bytes are zero.
7438            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
7439            fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
7440            fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
7441            Ok(())
7442        }
7443    }
7444
7445    impl fidl::encoding::ValueTypeMarker for SetAnchorCmd {
7446        type Borrowed<'a> = &'a Self;
7447        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7448            value
7449        }
7450    }
7451
7452    unsafe impl fidl::encoding::TypeMarker for SetAnchorCmd {
7453        type Owned = Self;
7454
7455        #[inline(always)]
7456        fn inline_align(_context: fidl::encoding::Context) -> usize {
7457            4
7458        }
7459
7460        #[inline(always)]
7461        fn inline_size(_context: fidl::encoding::Context) -> usize {
7462            20
7463        }
7464    }
7465
7466    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetAnchorCmd, D>
7467        for &SetAnchorCmd
7468    {
7469        #[inline]
7470        unsafe fn encode(
7471            self,
7472            encoder: &mut fidl::encoding::Encoder<'_, D>,
7473            offset: usize,
7474            _depth: fidl::encoding::Depth,
7475        ) -> fidl::Result<()> {
7476            encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7477            // Delegate to tuple encoding.
7478            fidl::encoding::Encode::<SetAnchorCmd, D>::encode(
7479                (
7480                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
7481                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
7482                ),
7483                encoder,
7484                offset,
7485                _depth,
7486            )
7487        }
7488    }
7489    unsafe impl<
7490            D: fidl::encoding::ResourceDialect,
7491            T0: fidl::encoding::Encode<u32, D>,
7492            T1: fidl::encoding::Encode<Vector3Value, D>,
7493        > fidl::encoding::Encode<SetAnchorCmd, D> for (T0, T1)
7494    {
7495        #[inline]
7496        unsafe fn encode(
7497            self,
7498            encoder: &mut fidl::encoding::Encoder<'_, D>,
7499            offset: usize,
7500            depth: fidl::encoding::Depth,
7501        ) -> fidl::Result<()> {
7502            encoder.debug_check_bounds::<SetAnchorCmd>(offset);
7503            // Zero out padding regions. There's no need to apply masks
7504            // because the unmasked parts will be overwritten by fields.
7505            // Write the fields.
7506            self.0.encode(encoder, offset + 0, depth)?;
7507            self.1.encode(encoder, offset + 4, depth)?;
7508            Ok(())
7509        }
7510    }
7511
7512    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetAnchorCmd {
7513        #[inline(always)]
7514        fn new_empty() -> Self {
7515            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
7516        }
7517
7518        #[inline]
7519        unsafe fn decode(
7520            &mut self,
7521            decoder: &mut fidl::encoding::Decoder<'_, D>,
7522            offset: usize,
7523            _depth: fidl::encoding::Depth,
7524        ) -> fidl::Result<()> {
7525            decoder.debug_check_bounds::<Self>(offset);
7526            // Verify that padding bytes are zero.
7527            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
7528            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
7529            Ok(())
7530        }
7531    }
7532
7533    impl fidl::encoding::ValueTypeMarker for SetCameraClipSpaceTransformCmd {
7534        type Borrowed<'a> = &'a Self;
7535        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7536            value
7537        }
7538    }
7539
7540    unsafe impl fidl::encoding::TypeMarker for SetCameraClipSpaceTransformCmd {
7541        type Owned = Self;
7542
7543        #[inline(always)]
7544        fn inline_align(_context: fidl::encoding::Context) -> usize {
7545            4
7546        }
7547
7548        #[inline(always)]
7549        fn inline_size(_context: fidl::encoding::Context) -> usize {
7550            16
7551        }
7552    }
7553
7554    unsafe impl<D: fidl::encoding::ResourceDialect>
7555        fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D>
7556        for &SetCameraClipSpaceTransformCmd
7557    {
7558        #[inline]
7559        unsafe fn encode(
7560            self,
7561            encoder: &mut fidl::encoding::Encoder<'_, D>,
7562            offset: usize,
7563            _depth: fidl::encoding::Depth,
7564        ) -> fidl::Result<()> {
7565            encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7566            // Delegate to tuple encoding.
7567            fidl::encoding::Encode::<SetCameraClipSpaceTransformCmd, D>::encode(
7568                (
7569                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7570                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
7571                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
7572                ),
7573                encoder,
7574                offset,
7575                _depth,
7576            )
7577        }
7578    }
7579    unsafe impl<
7580            D: fidl::encoding::ResourceDialect,
7581            T0: fidl::encoding::Encode<u32, D>,
7582            T1: fidl::encoding::Encode<Vec2, D>,
7583            T2: fidl::encoding::Encode<f32, D>,
7584        > fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D> for (T0, T1, T2)
7585    {
7586        #[inline]
7587        unsafe fn encode(
7588            self,
7589            encoder: &mut fidl::encoding::Encoder<'_, D>,
7590            offset: usize,
7591            depth: fidl::encoding::Depth,
7592        ) -> fidl::Result<()> {
7593            encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
7594            // Zero out padding regions. There's no need to apply masks
7595            // because the unmasked parts will be overwritten by fields.
7596            // Write the fields.
7597            self.0.encode(encoder, offset + 0, depth)?;
7598            self.1.encode(encoder, offset + 4, depth)?;
7599            self.2.encode(encoder, offset + 12, depth)?;
7600            Ok(())
7601        }
7602    }
7603
7604    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7605        for SetCameraClipSpaceTransformCmd
7606    {
7607        #[inline(always)]
7608        fn new_empty() -> Self {
7609            Self {
7610                camera_id: fidl::new_empty!(u32, D),
7611                translation: fidl::new_empty!(Vec2, D),
7612                scale: fidl::new_empty!(f32, D),
7613            }
7614        }
7615
7616        #[inline]
7617        unsafe fn decode(
7618            &mut self,
7619            decoder: &mut fidl::encoding::Decoder<'_, D>,
7620            offset: usize,
7621            _depth: fidl::encoding::Depth,
7622        ) -> fidl::Result<()> {
7623            decoder.debug_check_bounds::<Self>(offset);
7624            // Verify that padding bytes are zero.
7625            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7626            fidl::decode!(Vec2, D, &mut self.translation, decoder, offset + 4, _depth)?;
7627            fidl::decode!(f32, D, &mut self.scale, decoder, offset + 12, _depth)?;
7628            Ok(())
7629        }
7630    }
7631
7632    impl fidl::encoding::ValueTypeMarker for SetCameraCmd {
7633        type Borrowed<'a> = &'a Self;
7634        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7635            value
7636        }
7637    }
7638
7639    unsafe impl fidl::encoding::TypeMarker for SetCameraCmd {
7640        type Owned = Self;
7641
7642        #[inline(always)]
7643        fn inline_align(_context: fidl::encoding::Context) -> usize {
7644            4
7645        }
7646
7647        #[inline(always)]
7648        fn inline_size(_context: fidl::encoding::Context) -> usize {
7649            8
7650        }
7651        #[inline(always)]
7652        fn encode_is_copy() -> bool {
7653            true
7654        }
7655
7656        #[inline(always)]
7657        fn decode_is_copy() -> bool {
7658            true
7659        }
7660    }
7661
7662    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraCmd, D>
7663        for &SetCameraCmd
7664    {
7665        #[inline]
7666        unsafe fn encode(
7667            self,
7668            encoder: &mut fidl::encoding::Encoder<'_, D>,
7669            offset: usize,
7670            _depth: fidl::encoding::Depth,
7671        ) -> fidl::Result<()> {
7672            encoder.debug_check_bounds::<SetCameraCmd>(offset);
7673            unsafe {
7674                // Copy the object into the buffer.
7675                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7676                (buf_ptr as *mut SetCameraCmd)
7677                    .write_unaligned((self as *const SetCameraCmd).read());
7678                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7679                // done second because the memcpy will write garbage to these bytes.
7680            }
7681            Ok(())
7682        }
7683    }
7684    unsafe impl<
7685            D: fidl::encoding::ResourceDialect,
7686            T0: fidl::encoding::Encode<u32, D>,
7687            T1: fidl::encoding::Encode<u32, D>,
7688        > fidl::encoding::Encode<SetCameraCmd, D> for (T0, T1)
7689    {
7690        #[inline]
7691        unsafe fn encode(
7692            self,
7693            encoder: &mut fidl::encoding::Encoder<'_, D>,
7694            offset: usize,
7695            depth: fidl::encoding::Depth,
7696        ) -> fidl::Result<()> {
7697            encoder.debug_check_bounds::<SetCameraCmd>(offset);
7698            // Zero out padding regions. There's no need to apply masks
7699            // because the unmasked parts will be overwritten by fields.
7700            // Write the fields.
7701            self.0.encode(encoder, offset + 0, depth)?;
7702            self.1.encode(encoder, offset + 4, depth)?;
7703            Ok(())
7704        }
7705    }
7706
7707    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraCmd {
7708        #[inline(always)]
7709        fn new_empty() -> Self {
7710            Self { renderer_id: fidl::new_empty!(u32, D), camera_id: fidl::new_empty!(u32, D) }
7711        }
7712
7713        #[inline]
7714        unsafe fn decode(
7715            &mut self,
7716            decoder: &mut fidl::encoding::Decoder<'_, D>,
7717            offset: usize,
7718            _depth: fidl::encoding::Depth,
7719        ) -> fidl::Result<()> {
7720            decoder.debug_check_bounds::<Self>(offset);
7721            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7722            // Verify that padding bytes are zero.
7723            // Copy from the buffer into the object.
7724            unsafe {
7725                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7726            }
7727            Ok(())
7728        }
7729    }
7730
7731    impl fidl::encoding::ValueTypeMarker for SetCameraPoseBufferCmd {
7732        type Borrowed<'a> = &'a Self;
7733        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7734            value
7735        }
7736    }
7737
7738    unsafe impl fidl::encoding::TypeMarker for SetCameraPoseBufferCmd {
7739        type Owned = Self;
7740
7741        #[inline(always)]
7742        fn inline_align(_context: fidl::encoding::Context) -> usize {
7743            8
7744        }
7745
7746        #[inline(always)]
7747        fn inline_size(_context: fidl::encoding::Context) -> usize {
7748            32
7749        }
7750    }
7751
7752    unsafe impl<D: fidl::encoding::ResourceDialect>
7753        fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for &SetCameraPoseBufferCmd
7754    {
7755        #[inline]
7756        unsafe fn encode(
7757            self,
7758            encoder: &mut fidl::encoding::Encoder<'_, D>,
7759            offset: usize,
7760            _depth: fidl::encoding::Depth,
7761        ) -> fidl::Result<()> {
7762            encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7763            unsafe {
7764                // Copy the object into the buffer.
7765                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7766                (buf_ptr as *mut SetCameraPoseBufferCmd)
7767                    .write_unaligned((self as *const SetCameraPoseBufferCmd).read());
7768                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7769                // done second because the memcpy will write garbage to these bytes.
7770                let padding_ptr = buf_ptr.offset(8) as *mut u64;
7771                let padding_mask = 0xffffffff00000000u64;
7772                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
7773            }
7774            Ok(())
7775        }
7776    }
7777    unsafe impl<
7778            D: fidl::encoding::ResourceDialect,
7779            T0: fidl::encoding::Encode<u32, D>,
7780            T1: fidl::encoding::Encode<u32, D>,
7781            T2: fidl::encoding::Encode<u32, D>,
7782            T3: fidl::encoding::Encode<i64, D>,
7783            T4: fidl::encoding::Encode<u64, D>,
7784        > fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for (T0, T1, T2, T3, T4)
7785    {
7786        #[inline]
7787        unsafe fn encode(
7788            self,
7789            encoder: &mut fidl::encoding::Encoder<'_, D>,
7790            offset: usize,
7791            depth: fidl::encoding::Depth,
7792        ) -> fidl::Result<()> {
7793            encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
7794            // Zero out padding regions. There's no need to apply masks
7795            // because the unmasked parts will be overwritten by fields.
7796            unsafe {
7797                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
7798                (ptr as *mut u64).write_unaligned(0);
7799            }
7800            // Write the fields.
7801            self.0.encode(encoder, offset + 0, depth)?;
7802            self.1.encode(encoder, offset + 4, depth)?;
7803            self.2.encode(encoder, offset + 8, depth)?;
7804            self.3.encode(encoder, offset + 16, depth)?;
7805            self.4.encode(encoder, offset + 24, depth)?;
7806            Ok(())
7807        }
7808    }
7809
7810    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7811        for SetCameraPoseBufferCmd
7812    {
7813        #[inline(always)]
7814        fn new_empty() -> Self {
7815            Self {
7816                camera_id: fidl::new_empty!(u32, D),
7817                buffer_id: fidl::new_empty!(u32, D),
7818                num_entries: fidl::new_empty!(u32, D),
7819                base_time: fidl::new_empty!(i64, D),
7820                time_interval: fidl::new_empty!(u64, D),
7821            }
7822        }
7823
7824        #[inline]
7825        unsafe fn decode(
7826            &mut self,
7827            decoder: &mut fidl::encoding::Decoder<'_, D>,
7828            offset: usize,
7829            _depth: fidl::encoding::Depth,
7830        ) -> fidl::Result<()> {
7831            decoder.debug_check_bounds::<Self>(offset);
7832            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7833            // Verify that padding bytes are zero.
7834            let ptr = unsafe { buf_ptr.offset(8) };
7835            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7836            let mask = 0xffffffff00000000u64;
7837            let maskedval = padval & mask;
7838            if maskedval != 0 {
7839                return Err(fidl::Error::NonZeroPadding {
7840                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
7841                });
7842            }
7843            // Copy from the buffer into the object.
7844            unsafe {
7845                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
7846            }
7847            Ok(())
7848        }
7849    }
7850
7851    impl fidl::encoding::ValueTypeMarker for SetCameraProjectionCmd {
7852        type Borrowed<'a> = &'a Self;
7853        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7854            value
7855        }
7856    }
7857
7858    unsafe impl fidl::encoding::TypeMarker for SetCameraProjectionCmd {
7859        type Owned = Self;
7860
7861        #[inline(always)]
7862        fn inline_align(_context: fidl::encoding::Context) -> usize {
7863            4
7864        }
7865
7866        #[inline(always)]
7867        fn inline_size(_context: fidl::encoding::Context) -> usize {
7868            12
7869        }
7870    }
7871
7872    unsafe impl<D: fidl::encoding::ResourceDialect>
7873        fidl::encoding::Encode<SetCameraProjectionCmd, D> for &SetCameraProjectionCmd
7874    {
7875        #[inline]
7876        unsafe fn encode(
7877            self,
7878            encoder: &mut fidl::encoding::Encoder<'_, D>,
7879            offset: usize,
7880            _depth: fidl::encoding::Depth,
7881        ) -> fidl::Result<()> {
7882            encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7883            // Delegate to tuple encoding.
7884            fidl::encoding::Encode::<SetCameraProjectionCmd, D>::encode(
7885                (
7886                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7887                    <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.fovy),
7888                ),
7889                encoder,
7890                offset,
7891                _depth,
7892            )
7893        }
7894    }
7895    unsafe impl<
7896            D: fidl::encoding::ResourceDialect,
7897            T0: fidl::encoding::Encode<u32, D>,
7898            T1: fidl::encoding::Encode<FloatValue, D>,
7899        > fidl::encoding::Encode<SetCameraProjectionCmd, D> for (T0, T1)
7900    {
7901        #[inline]
7902        unsafe fn encode(
7903            self,
7904            encoder: &mut fidl::encoding::Encoder<'_, D>,
7905            offset: usize,
7906            depth: fidl::encoding::Depth,
7907        ) -> fidl::Result<()> {
7908            encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
7909            // Zero out padding regions. There's no need to apply masks
7910            // because the unmasked parts will be overwritten by fields.
7911            // Write the fields.
7912            self.0.encode(encoder, offset + 0, depth)?;
7913            self.1.encode(encoder, offset + 4, depth)?;
7914            Ok(())
7915        }
7916    }
7917
7918    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7919        for SetCameraProjectionCmd
7920    {
7921        #[inline(always)]
7922        fn new_empty() -> Self {
7923            Self { camera_id: fidl::new_empty!(u32, D), fovy: fidl::new_empty!(FloatValue, D) }
7924        }
7925
7926        #[inline]
7927        unsafe fn decode(
7928            &mut self,
7929            decoder: &mut fidl::encoding::Decoder<'_, D>,
7930            offset: usize,
7931            _depth: fidl::encoding::Depth,
7932        ) -> fidl::Result<()> {
7933            decoder.debug_check_bounds::<Self>(offset);
7934            // Verify that padding bytes are zero.
7935            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
7936            fidl::decode!(FloatValue, D, &mut self.fovy, decoder, offset + 4, _depth)?;
7937            Ok(())
7938        }
7939    }
7940
7941    impl fidl::encoding::ValueTypeMarker for SetCameraTransformCmd {
7942        type Borrowed<'a> = &'a Self;
7943        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7944            value
7945        }
7946    }
7947
7948    unsafe impl fidl::encoding::TypeMarker for SetCameraTransformCmd {
7949        type Owned = Self;
7950
7951        #[inline(always)]
7952        fn inline_align(_context: fidl::encoding::Context) -> usize {
7953            4
7954        }
7955
7956        #[inline(always)]
7957        fn inline_size(_context: fidl::encoding::Context) -> usize {
7958            52
7959        }
7960    }
7961
7962    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraTransformCmd, D>
7963        for &SetCameraTransformCmd
7964    {
7965        #[inline]
7966        unsafe fn encode(
7967            self,
7968            encoder: &mut fidl::encoding::Encoder<'_, D>,
7969            offset: usize,
7970            _depth: fidl::encoding::Depth,
7971        ) -> fidl::Result<()> {
7972            encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
7973            // Delegate to tuple encoding.
7974            fidl::encoding::Encode::<SetCameraTransformCmd, D>::encode(
7975                (
7976                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
7977                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_position),
7978                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_look_at),
7979                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_up),
7980                ),
7981                encoder,
7982                offset,
7983                _depth,
7984            )
7985        }
7986    }
7987    unsafe impl<
7988            D: fidl::encoding::ResourceDialect,
7989            T0: fidl::encoding::Encode<u32, D>,
7990            T1: fidl::encoding::Encode<Vector3Value, D>,
7991            T2: fidl::encoding::Encode<Vector3Value, D>,
7992            T3: fidl::encoding::Encode<Vector3Value, D>,
7993        > fidl::encoding::Encode<SetCameraTransformCmd, D> for (T0, T1, T2, T3)
7994    {
7995        #[inline]
7996        unsafe fn encode(
7997            self,
7998            encoder: &mut fidl::encoding::Encoder<'_, D>,
7999            offset: usize,
8000            depth: fidl::encoding::Depth,
8001        ) -> fidl::Result<()> {
8002            encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
8003            // Zero out padding regions. There's no need to apply masks
8004            // because the unmasked parts will be overwritten by fields.
8005            // Write the fields.
8006            self.0.encode(encoder, offset + 0, depth)?;
8007            self.1.encode(encoder, offset + 4, depth)?;
8008            self.2.encode(encoder, offset + 20, depth)?;
8009            self.3.encode(encoder, offset + 36, depth)?;
8010            Ok(())
8011        }
8012    }
8013
8014    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraTransformCmd {
8015        #[inline(always)]
8016        fn new_empty() -> Self {
8017            Self {
8018                camera_id: fidl::new_empty!(u32, D),
8019                eye_position: fidl::new_empty!(Vector3Value, D),
8020                eye_look_at: fidl::new_empty!(Vector3Value, D),
8021                eye_up: fidl::new_empty!(Vector3Value, D),
8022            }
8023        }
8024
8025        #[inline]
8026        unsafe fn decode(
8027            &mut self,
8028            decoder: &mut fidl::encoding::Decoder<'_, D>,
8029            offset: usize,
8030            _depth: fidl::encoding::Depth,
8031        ) -> fidl::Result<()> {
8032            decoder.debug_check_bounds::<Self>(offset);
8033            // Verify that padding bytes are zero.
8034            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
8035            fidl::decode!(Vector3Value, D, &mut self.eye_position, decoder, offset + 4, _depth)?;
8036            fidl::decode!(Vector3Value, D, &mut self.eye_look_at, decoder, offset + 20, _depth)?;
8037            fidl::decode!(Vector3Value, D, &mut self.eye_up, decoder, offset + 36, _depth)?;
8038            Ok(())
8039        }
8040    }
8041
8042    impl fidl::encoding::ValueTypeMarker for SetClipCmd {
8043        type Borrowed<'a> = &'a Self;
8044        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8045            value
8046        }
8047    }
8048
8049    unsafe impl fidl::encoding::TypeMarker for SetClipCmd {
8050        type Owned = Self;
8051
8052        #[inline(always)]
8053        fn inline_align(_context: fidl::encoding::Context) -> usize {
8054            4
8055        }
8056
8057        #[inline(always)]
8058        fn inline_size(_context: fidl::encoding::Context) -> usize {
8059            12
8060        }
8061    }
8062
8063    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipCmd, D>
8064        for &SetClipCmd
8065    {
8066        #[inline]
8067        unsafe fn encode(
8068            self,
8069            encoder: &mut fidl::encoding::Encoder<'_, D>,
8070            offset: usize,
8071            _depth: fidl::encoding::Depth,
8072        ) -> fidl::Result<()> {
8073            encoder.debug_check_bounds::<SetClipCmd>(offset);
8074            // Delegate to tuple encoding.
8075            fidl::encoding::Encode::<SetClipCmd, D>::encode(
8076                (
8077                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8078                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_id),
8079                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_to_self),
8080                ),
8081                encoder,
8082                offset,
8083                _depth,
8084            )
8085        }
8086    }
8087    unsafe impl<
8088            D: fidl::encoding::ResourceDialect,
8089            T0: fidl::encoding::Encode<u32, D>,
8090            T1: fidl::encoding::Encode<u32, D>,
8091            T2: fidl::encoding::Encode<bool, D>,
8092        > fidl::encoding::Encode<SetClipCmd, D> for (T0, T1, T2)
8093    {
8094        #[inline]
8095        unsafe fn encode(
8096            self,
8097            encoder: &mut fidl::encoding::Encoder<'_, D>,
8098            offset: usize,
8099            depth: fidl::encoding::Depth,
8100        ) -> fidl::Result<()> {
8101            encoder.debug_check_bounds::<SetClipCmd>(offset);
8102            // Zero out padding regions. There's no need to apply masks
8103            // because the unmasked parts will be overwritten by fields.
8104            unsafe {
8105                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
8106                (ptr as *mut u32).write_unaligned(0);
8107            }
8108            // Write the fields.
8109            self.0.encode(encoder, offset + 0, depth)?;
8110            self.1.encode(encoder, offset + 4, depth)?;
8111            self.2.encode(encoder, offset + 8, depth)?;
8112            Ok(())
8113        }
8114    }
8115
8116    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipCmd {
8117        #[inline(always)]
8118        fn new_empty() -> Self {
8119            Self {
8120                node_id: fidl::new_empty!(u32, D),
8121                clip_id: fidl::new_empty!(u32, D),
8122                clip_to_self: fidl::new_empty!(bool, D),
8123            }
8124        }
8125
8126        #[inline]
8127        unsafe fn decode(
8128            &mut self,
8129            decoder: &mut fidl::encoding::Decoder<'_, D>,
8130            offset: usize,
8131            _depth: fidl::encoding::Depth,
8132        ) -> fidl::Result<()> {
8133            decoder.debug_check_bounds::<Self>(offset);
8134            // Verify that padding bytes are zero.
8135            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
8136            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8137            let mask = 0xffffff00u32;
8138            let maskedval = padval & mask;
8139            if maskedval != 0 {
8140                return Err(fidl::Error::NonZeroPadding {
8141                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
8142                });
8143            }
8144            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8145            fidl::decode!(u32, D, &mut self.clip_id, decoder, offset + 4, _depth)?;
8146            fidl::decode!(bool, D, &mut self.clip_to_self, decoder, offset + 8, _depth)?;
8147            Ok(())
8148        }
8149    }
8150
8151    impl fidl::encoding::ValueTypeMarker for SetClipPlanesCmd {
8152        type Borrowed<'a> = &'a Self;
8153        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8154            value
8155        }
8156    }
8157
8158    unsafe impl fidl::encoding::TypeMarker for SetClipPlanesCmd {
8159        type Owned = Self;
8160
8161        #[inline(always)]
8162        fn inline_align(_context: fidl::encoding::Context) -> usize {
8163            8
8164        }
8165
8166        #[inline(always)]
8167        fn inline_size(_context: fidl::encoding::Context) -> usize {
8168            24
8169        }
8170    }
8171
8172    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipPlanesCmd, D>
8173        for &SetClipPlanesCmd
8174    {
8175        #[inline]
8176        unsafe fn encode(
8177            self,
8178            encoder: &mut fidl::encoding::Encoder<'_, D>,
8179            offset: usize,
8180            _depth: fidl::encoding::Depth,
8181        ) -> fidl::Result<()> {
8182            encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8183            // Delegate to tuple encoding.
8184            fidl::encoding::Encode::<SetClipPlanesCmd, D>::encode(
8185                (
8186                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
8187                    <fidl::encoding::UnboundedVector<Plane3> as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_planes),
8188                ),
8189                encoder, offset, _depth
8190            )
8191        }
8192    }
8193    unsafe impl<
8194            D: fidl::encoding::ResourceDialect,
8195            T0: fidl::encoding::Encode<u32, D>,
8196            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Plane3>, D>,
8197        > fidl::encoding::Encode<SetClipPlanesCmd, D> for (T0, T1)
8198    {
8199        #[inline]
8200        unsafe fn encode(
8201            self,
8202            encoder: &mut fidl::encoding::Encoder<'_, D>,
8203            offset: usize,
8204            depth: fidl::encoding::Depth,
8205        ) -> fidl::Result<()> {
8206            encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
8207            // Zero out padding regions. There's no need to apply masks
8208            // because the unmasked parts will be overwritten by fields.
8209            unsafe {
8210                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8211                (ptr as *mut u64).write_unaligned(0);
8212            }
8213            // Write the fields.
8214            self.0.encode(encoder, offset + 0, depth)?;
8215            self.1.encode(encoder, offset + 8, depth)?;
8216            Ok(())
8217        }
8218    }
8219
8220    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipPlanesCmd {
8221        #[inline(always)]
8222        fn new_empty() -> Self {
8223            Self {
8224                node_id: fidl::new_empty!(u32, D),
8225                clip_planes: fidl::new_empty!(fidl::encoding::UnboundedVector<Plane3>, D),
8226            }
8227        }
8228
8229        #[inline]
8230        unsafe fn decode(
8231            &mut self,
8232            decoder: &mut fidl::encoding::Decoder<'_, D>,
8233            offset: usize,
8234            _depth: fidl::encoding::Depth,
8235        ) -> fidl::Result<()> {
8236            decoder.debug_check_bounds::<Self>(offset);
8237            // Verify that padding bytes are zero.
8238            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8239            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8240            let mask = 0xffffffff00000000u64;
8241            let maskedval = padval & mask;
8242            if maskedval != 0 {
8243                return Err(fidl::Error::NonZeroPadding {
8244                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8245                });
8246            }
8247            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
8248            fidl::decode!(
8249                fidl::encoding::UnboundedVector<Plane3>,
8250                D,
8251                &mut self.clip_planes,
8252                decoder,
8253                offset + 8,
8254                _depth
8255            )?;
8256            Ok(())
8257        }
8258    }
8259
8260    impl fidl::encoding::ValueTypeMarker for SetColorCmd {
8261        type Borrowed<'a> = &'a Self;
8262        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8263            value
8264        }
8265    }
8266
8267    unsafe impl fidl::encoding::TypeMarker for SetColorCmd {
8268        type Owned = Self;
8269
8270        #[inline(always)]
8271        fn inline_align(_context: fidl::encoding::Context) -> usize {
8272            4
8273        }
8274
8275        #[inline(always)]
8276        fn inline_size(_context: fidl::encoding::Context) -> usize {
8277            12
8278        }
8279        #[inline(always)]
8280        fn encode_is_copy() -> bool {
8281            true
8282        }
8283
8284        #[inline(always)]
8285        fn decode_is_copy() -> bool {
8286            true
8287        }
8288    }
8289
8290    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetColorCmd, D>
8291        for &SetColorCmd
8292    {
8293        #[inline]
8294        unsafe fn encode(
8295            self,
8296            encoder: &mut fidl::encoding::Encoder<'_, D>,
8297            offset: usize,
8298            _depth: fidl::encoding::Depth,
8299        ) -> fidl::Result<()> {
8300            encoder.debug_check_bounds::<SetColorCmd>(offset);
8301            unsafe {
8302                // Copy the object into the buffer.
8303                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8304                (buf_ptr as *mut SetColorCmd).write_unaligned((self as *const SetColorCmd).read());
8305                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8306                // done second because the memcpy will write garbage to these bytes.
8307            }
8308            Ok(())
8309        }
8310    }
8311    unsafe impl<
8312            D: fidl::encoding::ResourceDialect,
8313            T0: fidl::encoding::Encode<u32, D>,
8314            T1: fidl::encoding::Encode<ColorRgbaValue, D>,
8315        > fidl::encoding::Encode<SetColorCmd, D> for (T0, T1)
8316    {
8317        #[inline]
8318        unsafe fn encode(
8319            self,
8320            encoder: &mut fidl::encoding::Encoder<'_, D>,
8321            offset: usize,
8322            depth: fidl::encoding::Depth,
8323        ) -> fidl::Result<()> {
8324            encoder.debug_check_bounds::<SetColorCmd>(offset);
8325            // Zero out padding regions. There's no need to apply masks
8326            // because the unmasked parts will be overwritten by fields.
8327            // Write the fields.
8328            self.0.encode(encoder, offset + 0, depth)?;
8329            self.1.encode(encoder, offset + 4, depth)?;
8330            Ok(())
8331        }
8332    }
8333
8334    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetColorCmd {
8335        #[inline(always)]
8336        fn new_empty() -> Self {
8337            Self {
8338                material_id: fidl::new_empty!(u32, D),
8339                color: fidl::new_empty!(ColorRgbaValue, D),
8340            }
8341        }
8342
8343        #[inline]
8344        unsafe fn decode(
8345            &mut self,
8346            decoder: &mut fidl::encoding::Decoder<'_, D>,
8347            offset: usize,
8348            _depth: fidl::encoding::Depth,
8349        ) -> fidl::Result<()> {
8350            decoder.debug_check_bounds::<Self>(offset);
8351            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8352            // Verify that padding bytes are zero.
8353            // Copy from the buffer into the object.
8354            unsafe {
8355                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
8356            }
8357            Ok(())
8358        }
8359    }
8360
8361    impl fidl::encoding::ValueTypeMarker for SetDisableClippingCmd {
8362        type Borrowed<'a> = &'a Self;
8363        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8364            value
8365        }
8366    }
8367
8368    unsafe impl fidl::encoding::TypeMarker for SetDisableClippingCmd {
8369        type Owned = Self;
8370
8371        #[inline(always)]
8372        fn inline_align(_context: fidl::encoding::Context) -> usize {
8373            4
8374        }
8375
8376        #[inline(always)]
8377        fn inline_size(_context: fidl::encoding::Context) -> usize {
8378            8
8379        }
8380    }
8381
8382    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetDisableClippingCmd, D>
8383        for &SetDisableClippingCmd
8384    {
8385        #[inline]
8386        unsafe fn encode(
8387            self,
8388            encoder: &mut fidl::encoding::Encoder<'_, D>,
8389            offset: usize,
8390            _depth: fidl::encoding::Depth,
8391        ) -> fidl::Result<()> {
8392            encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8393            // Delegate to tuple encoding.
8394            fidl::encoding::Encode::<SetDisableClippingCmd, D>::encode(
8395                (
8396                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
8397                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_clipping),
8398                ),
8399                encoder,
8400                offset,
8401                _depth,
8402            )
8403        }
8404    }
8405    unsafe impl<
8406            D: fidl::encoding::ResourceDialect,
8407            T0: fidl::encoding::Encode<u32, D>,
8408            T1: fidl::encoding::Encode<bool, D>,
8409        > fidl::encoding::Encode<SetDisableClippingCmd, D> for (T0, T1)
8410    {
8411        #[inline]
8412        unsafe fn encode(
8413            self,
8414            encoder: &mut fidl::encoding::Encoder<'_, D>,
8415            offset: usize,
8416            depth: fidl::encoding::Depth,
8417        ) -> fidl::Result<()> {
8418            encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
8419            // Zero out padding regions. There's no need to apply masks
8420            // because the unmasked parts will be overwritten by fields.
8421            unsafe {
8422                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8423                (ptr as *mut u32).write_unaligned(0);
8424            }
8425            // Write the fields.
8426            self.0.encode(encoder, offset + 0, depth)?;
8427            self.1.encode(encoder, offset + 4, depth)?;
8428            Ok(())
8429        }
8430    }
8431
8432    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetDisableClippingCmd {
8433        #[inline(always)]
8434        fn new_empty() -> Self {
8435            Self {
8436                renderer_id: fidl::new_empty!(u32, D),
8437                disable_clipping: fidl::new_empty!(bool, D),
8438            }
8439        }
8440
8441        #[inline]
8442        unsafe fn decode(
8443            &mut self,
8444            decoder: &mut fidl::encoding::Decoder<'_, D>,
8445            offset: usize,
8446            _depth: fidl::encoding::Depth,
8447        ) -> fidl::Result<()> {
8448            decoder.debug_check_bounds::<Self>(offset);
8449            // Verify that padding bytes are zero.
8450            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8451            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8452            let mask = 0xffffff00u32;
8453            let maskedval = padval & mask;
8454            if maskedval != 0 {
8455                return Err(fidl::Error::NonZeroPadding {
8456                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8457                });
8458            }
8459            fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
8460            fidl::decode!(bool, D, &mut self.disable_clipping, decoder, offset + 4, _depth)?;
8461            Ok(())
8462        }
8463    }
8464
8465    impl fidl::encoding::ValueTypeMarker for SetDisplayColorConversionCmdHack {
8466        type Borrowed<'a> = &'a Self;
8467        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8468            value
8469        }
8470    }
8471
8472    unsafe impl fidl::encoding::TypeMarker for SetDisplayColorConversionCmdHack {
8473        type Owned = Self;
8474
8475        #[inline(always)]
8476        fn inline_align(_context: fidl::encoding::Context) -> usize {
8477            4
8478        }
8479
8480        #[inline(always)]
8481        fn inline_size(_context: fidl::encoding::Context) -> usize {
8482            64
8483        }
8484    }
8485
8486    unsafe impl<D: fidl::encoding::ResourceDialect>
8487        fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D>
8488        for &SetDisplayColorConversionCmdHack
8489    {
8490        #[inline]
8491        unsafe fn encode(
8492            self,
8493            encoder: &mut fidl::encoding::Encoder<'_, D>,
8494            offset: usize,
8495            _depth: fidl::encoding::Depth,
8496        ) -> fidl::Result<()> {
8497            encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8498            // Delegate to tuple encoding.
8499            fidl::encoding::Encode::<SetDisplayColorConversionCmdHack, D>::encode(
8500                (
8501                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.compositor_id),
8502                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8503                        &self.preoffsets,
8504                    ),
8505                    <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(
8506                        &self.matrix,
8507                    ),
8508                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
8509                        &self.postoffsets,
8510                    ),
8511                ),
8512                encoder,
8513                offset,
8514                _depth,
8515            )
8516        }
8517    }
8518    unsafe impl<
8519            D: fidl::encoding::ResourceDialect,
8520            T0: fidl::encoding::Encode<u32, D>,
8521            T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8522            T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
8523            T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
8524        > fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D> for (T0, T1, T2, T3)
8525    {
8526        #[inline]
8527        unsafe fn encode(
8528            self,
8529            encoder: &mut fidl::encoding::Encoder<'_, D>,
8530            offset: usize,
8531            depth: fidl::encoding::Depth,
8532        ) -> fidl::Result<()> {
8533            encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
8534            // Zero out padding regions. There's no need to apply masks
8535            // because the unmasked parts will be overwritten by fields.
8536            // Write the fields.
8537            self.0.encode(encoder, offset + 0, depth)?;
8538            self.1.encode(encoder, offset + 4, depth)?;
8539            self.2.encode(encoder, offset + 16, depth)?;
8540            self.3.encode(encoder, offset + 52, depth)?;
8541            Ok(())
8542        }
8543    }
8544
8545    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8546        for SetDisplayColorConversionCmdHack
8547    {
8548        #[inline(always)]
8549        fn new_empty() -> Self {
8550            Self {
8551                compositor_id: fidl::new_empty!(u32, D),
8552                preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8553                matrix: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
8554                postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
8555            }
8556        }
8557
8558        #[inline]
8559        unsafe fn decode(
8560            &mut self,
8561            decoder: &mut fidl::encoding::Decoder<'_, D>,
8562            offset: usize,
8563            _depth: fidl::encoding::Depth,
8564        ) -> fidl::Result<()> {
8565            decoder.debug_check_bounds::<Self>(offset);
8566            // Verify that padding bytes are zero.
8567            fidl::decode!(u32, D, &mut self.compositor_id, decoder, offset + 0, _depth)?;
8568            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 4, _depth)?;
8569            fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.matrix, decoder, offset + 16, _depth)?;
8570            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 52, _depth)?;
8571            Ok(())
8572        }
8573    }
8574
8575    impl fidl::encoding::ValueTypeMarker for SetDisplayMinimumRgbCmdHack {
8576        type Borrowed<'a> = &'a Self;
8577        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8578            value
8579        }
8580    }
8581
8582    unsafe impl fidl::encoding::TypeMarker for SetDisplayMinimumRgbCmdHack {
8583        type Owned = Self;
8584
8585        #[inline(always)]
8586        fn inline_align(_context: fidl::encoding::Context) -> usize {
8587            1
8588        }
8589
8590        #[inline(always)]
8591        fn inline_size(_context: fidl::encoding::Context) -> usize {
8592            1
8593        }
8594        #[inline(always)]
8595        fn encode_is_copy() -> bool {
8596            true
8597        }
8598
8599        #[inline(always)]
8600        fn decode_is_copy() -> bool {
8601            true
8602        }
8603    }
8604
8605    unsafe impl<D: fidl::encoding::ResourceDialect>
8606        fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for &SetDisplayMinimumRgbCmdHack
8607    {
8608        #[inline]
8609        unsafe fn encode(
8610            self,
8611            encoder: &mut fidl::encoding::Encoder<'_, D>,
8612            offset: usize,
8613            _depth: fidl::encoding::Depth,
8614        ) -> fidl::Result<()> {
8615            encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8616            unsafe {
8617                // Copy the object into the buffer.
8618                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8619                (buf_ptr as *mut SetDisplayMinimumRgbCmdHack)
8620                    .write_unaligned((self as *const SetDisplayMinimumRgbCmdHack).read());
8621                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8622                // done second because the memcpy will write garbage to these bytes.
8623            }
8624            Ok(())
8625        }
8626    }
8627    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
8628        fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for (T0,)
8629    {
8630        #[inline]
8631        unsafe fn encode(
8632            self,
8633            encoder: &mut fidl::encoding::Encoder<'_, D>,
8634            offset: usize,
8635            depth: fidl::encoding::Depth,
8636        ) -> fidl::Result<()> {
8637            encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
8638            // Zero out padding regions. There's no need to apply masks
8639            // because the unmasked parts will be overwritten by fields.
8640            // Write the fields.
8641            self.0.encode(encoder, offset + 0, depth)?;
8642            Ok(())
8643        }
8644    }
8645
8646    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8647        for SetDisplayMinimumRgbCmdHack
8648    {
8649        #[inline(always)]
8650        fn new_empty() -> Self {
8651            Self { min_value: fidl::new_empty!(u8, D) }
8652        }
8653
8654        #[inline]
8655        unsafe fn decode(
8656            &mut self,
8657            decoder: &mut fidl::encoding::Decoder<'_, D>,
8658            offset: usize,
8659            _depth: fidl::encoding::Depth,
8660        ) -> fidl::Result<()> {
8661            decoder.debug_check_bounds::<Self>(offset);
8662            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8663            // Verify that padding bytes are zero.
8664            // Copy from the buffer into the object.
8665            unsafe {
8666                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
8667            }
8668            Ok(())
8669        }
8670    }
8671
8672    impl fidl::encoding::ValueTypeMarker for SetDisplayRotationCmdHack {
8673        type Borrowed<'a> = &'a Self;
8674        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8675            value
8676        }
8677    }
8678
8679    unsafe impl fidl::encoding::TypeMarker for SetDisplayRotationCmdHack {
8680        type Owned = Self;
8681
8682        #[inline(always)]
8683        fn inline_align(_context: fidl::encoding::Context) -> usize {
8684            4
8685        }
8686
8687        #[inline(always)]
8688        fn inline_size(_context: fidl::encoding::Context) -> usize {
8689            8
8690        }
8691        #[inline(always)]
8692        fn encode_is_copy() -> bool {
8693            true
8694        }
8695
8696        #[inline(always)]
8697        fn decode_is_copy() -> bool {
8698            true
8699        }
8700    }
8701
8702    unsafe impl<D: fidl::encoding::ResourceDialect>
8703        fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for &SetDisplayRotationCmdHack
8704    {
8705        #[inline]
8706        unsafe fn encode(
8707            self,
8708            encoder: &mut fidl::encoding::Encoder<'_, D>,
8709            offset: usize,
8710            _depth: fidl::encoding::Depth,
8711        ) -> fidl::Result<()> {
8712            encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8713            unsafe {
8714                // Copy the object into the buffer.
8715                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8716                (buf_ptr as *mut SetDisplayRotationCmdHack)
8717                    .write_unaligned((self as *const SetDisplayRotationCmdHack).read());
8718                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8719                // done second because the memcpy will write garbage to these bytes.
8720            }
8721            Ok(())
8722        }
8723    }
8724    unsafe impl<
8725            D: fidl::encoding::ResourceDialect,
8726            T0: fidl::encoding::Encode<u32, D>,
8727            T1: fidl::encoding::Encode<u32, D>,
8728        > fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for (T0, T1)
8729    {
8730        #[inline]
8731        unsafe fn encode(
8732            self,
8733            encoder: &mut fidl::encoding::Encoder<'_, D>,
8734            offset: usize,
8735            depth: fidl::encoding::Depth,
8736        ) -> fidl::Result<()> {
8737            encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
8738            // Zero out padding regions. There's no need to apply masks
8739            // because the unmasked parts will be overwritten by fields.
8740            // Write the fields.
8741            self.0.encode(encoder, offset + 0, depth)?;
8742            self.1.encode(encoder, offset + 4, depth)?;
8743            Ok(())
8744        }
8745    }
8746
8747    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8748        for SetDisplayRotationCmdHack
8749    {
8750        #[inline(always)]
8751        fn new_empty() -> Self {
8752            Self {
8753                compositor_id: fidl::new_empty!(u32, D),
8754                rotation_degrees: fidl::new_empty!(u32, D),
8755            }
8756        }
8757
8758        #[inline]
8759        unsafe fn decode(
8760            &mut self,
8761            decoder: &mut fidl::encoding::Decoder<'_, D>,
8762            offset: usize,
8763            _depth: fidl::encoding::Depth,
8764        ) -> fidl::Result<()> {
8765            decoder.debug_check_bounds::<Self>(offset);
8766            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8767            // Verify that padding bytes are zero.
8768            // Copy from the buffer into the object.
8769            unsafe {
8770                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8771            }
8772            Ok(())
8773        }
8774    }
8775
8776    impl fidl::encoding::ValueTypeMarker for SetEnableDebugViewBoundsCmd {
8777        type Borrowed<'a> = &'a Self;
8778        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8779            value
8780        }
8781    }
8782
8783    unsafe impl fidl::encoding::TypeMarker for SetEnableDebugViewBoundsCmd {
8784        type Owned = Self;
8785
8786        #[inline(always)]
8787        fn inline_align(_context: fidl::encoding::Context) -> usize {
8788            4
8789        }
8790
8791        #[inline(always)]
8792        fn inline_size(_context: fidl::encoding::Context) -> usize {
8793            8
8794        }
8795    }
8796
8797    unsafe impl<D: fidl::encoding::ResourceDialect>
8798        fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for &SetEnableDebugViewBoundsCmd
8799    {
8800        #[inline]
8801        unsafe fn encode(
8802            self,
8803            encoder: &mut fidl::encoding::Encoder<'_, D>,
8804            offset: usize,
8805            _depth: fidl::encoding::Depth,
8806        ) -> fidl::Result<()> {
8807            encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8808            // Delegate to tuple encoding.
8809            fidl::encoding::Encode::<SetEnableDebugViewBoundsCmd, D>::encode(
8810                (
8811                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
8812                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable),
8813                ),
8814                encoder,
8815                offset,
8816                _depth,
8817            )
8818        }
8819    }
8820    unsafe impl<
8821            D: fidl::encoding::ResourceDialect,
8822            T0: fidl::encoding::Encode<u32, D>,
8823            T1: fidl::encoding::Encode<bool, D>,
8824        > fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for (T0, T1)
8825    {
8826        #[inline]
8827        unsafe fn encode(
8828            self,
8829            encoder: &mut fidl::encoding::Encoder<'_, D>,
8830            offset: usize,
8831            depth: fidl::encoding::Depth,
8832        ) -> fidl::Result<()> {
8833            encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
8834            // Zero out padding regions. There's no need to apply masks
8835            // because the unmasked parts will be overwritten by fields.
8836            unsafe {
8837                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8838                (ptr as *mut u32).write_unaligned(0);
8839            }
8840            // Write the fields.
8841            self.0.encode(encoder, offset + 0, depth)?;
8842            self.1.encode(encoder, offset + 4, depth)?;
8843            Ok(())
8844        }
8845    }
8846
8847    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8848        for SetEnableDebugViewBoundsCmd
8849    {
8850        #[inline(always)]
8851        fn new_empty() -> Self {
8852            Self { view_id: fidl::new_empty!(u32, D), enable: fidl::new_empty!(bool, D) }
8853        }
8854
8855        #[inline]
8856        unsafe fn decode(
8857            &mut self,
8858            decoder: &mut fidl::encoding::Decoder<'_, D>,
8859            offset: usize,
8860            _depth: fidl::encoding::Depth,
8861        ) -> fidl::Result<()> {
8862            decoder.debug_check_bounds::<Self>(offset);
8863            // Verify that padding bytes are zero.
8864            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8865            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8866            let mask = 0xffffff00u32;
8867            let maskedval = padval & mask;
8868            if maskedval != 0 {
8869                return Err(fidl::Error::NonZeroPadding {
8870                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8871                });
8872            }
8873            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
8874            fidl::decode!(bool, D, &mut self.enable, decoder, offset + 4, _depth)?;
8875            Ok(())
8876        }
8877    }
8878
8879    impl fidl::encoding::ValueTypeMarker for SetEventMaskCmd {
8880        type Borrowed<'a> = &'a Self;
8881        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8882            value
8883        }
8884    }
8885
8886    unsafe impl fidl::encoding::TypeMarker for SetEventMaskCmd {
8887        type Owned = Self;
8888
8889        #[inline(always)]
8890        fn inline_align(_context: fidl::encoding::Context) -> usize {
8891            4
8892        }
8893
8894        #[inline(always)]
8895        fn inline_size(_context: fidl::encoding::Context) -> usize {
8896            8
8897        }
8898        #[inline(always)]
8899        fn encode_is_copy() -> bool {
8900            true
8901        }
8902
8903        #[inline(always)]
8904        fn decode_is_copy() -> bool {
8905            true
8906        }
8907    }
8908
8909    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetEventMaskCmd, D>
8910        for &SetEventMaskCmd
8911    {
8912        #[inline]
8913        unsafe fn encode(
8914            self,
8915            encoder: &mut fidl::encoding::Encoder<'_, D>,
8916            offset: usize,
8917            _depth: fidl::encoding::Depth,
8918        ) -> fidl::Result<()> {
8919            encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
8920            unsafe {
8921                // Copy the object into the buffer.
8922                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8923                (buf_ptr as *mut SetEventMaskCmd)
8924                    .write_unaligned((self as *const SetEventMaskCmd).read());
8925                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8926                // done second because the memcpy will write garbage to these bytes.
8927            }
8928            Ok(())
8929        }
8930    }
8931    unsafe impl<
8932            D: fidl::encoding::ResourceDialect,
8933            T0: fidl::encoding::Encode<u32, D>,
8934            T1: fidl::encoding::Encode<u32, D>,
8935        > fidl::encoding::Encode<SetEventMaskCmd, D> for (T0, T1)
8936    {
8937        #[inline]
8938        unsafe fn encode(
8939            self,
8940            encoder: &mut fidl::encoding::Encoder<'_, D>,
8941            offset: usize,
8942            depth: fidl::encoding::Depth,
8943        ) -> fidl::Result<()> {
8944            encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
8945            // Zero out padding regions. There's no need to apply masks
8946            // because the unmasked parts will be overwritten by fields.
8947            // Write the fields.
8948            self.0.encode(encoder, offset + 0, depth)?;
8949            self.1.encode(encoder, offset + 4, depth)?;
8950            Ok(())
8951        }
8952    }
8953
8954    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetEventMaskCmd {
8955        #[inline(always)]
8956        fn new_empty() -> Self {
8957            Self { id: fidl::new_empty!(u32, D), event_mask: fidl::new_empty!(u32, D) }
8958        }
8959
8960        #[inline]
8961        unsafe fn decode(
8962            &mut self,
8963            decoder: &mut fidl::encoding::Decoder<'_, D>,
8964            offset: usize,
8965            _depth: fidl::encoding::Depth,
8966        ) -> fidl::Result<()> {
8967            decoder.debug_check_bounds::<Self>(offset);
8968            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8969            // Verify that padding bytes are zero.
8970            // Copy from the buffer into the object.
8971            unsafe {
8972                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8973            }
8974            Ok(())
8975        }
8976    }
8977
8978    impl fidl::encoding::ValueTypeMarker for SetHitTestBehaviorCmd {
8979        type Borrowed<'a> = &'a Self;
8980        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8981            value
8982        }
8983    }
8984
8985    unsafe impl fidl::encoding::TypeMarker for SetHitTestBehaviorCmd {
8986        type Owned = Self;
8987
8988        #[inline(always)]
8989        fn inline_align(_context: fidl::encoding::Context) -> usize {
8990            4
8991        }
8992
8993        #[inline(always)]
8994        fn inline_size(_context: fidl::encoding::Context) -> usize {
8995            8
8996        }
8997    }
8998
8999    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetHitTestBehaviorCmd, D>
9000        for &SetHitTestBehaviorCmd
9001    {
9002        #[inline]
9003        unsafe fn encode(
9004            self,
9005            encoder: &mut fidl::encoding::Encoder<'_, D>,
9006            offset: usize,
9007            _depth: fidl::encoding::Depth,
9008        ) -> fidl::Result<()> {
9009            encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9010            // Delegate to tuple encoding.
9011            fidl::encoding::Encode::<SetHitTestBehaviorCmd, D>::encode(
9012                (
9013                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9014                    <HitTestBehavior as fidl::encoding::ValueTypeMarker>::borrow(
9015                        &self.hit_test_behavior,
9016                    ),
9017                ),
9018                encoder,
9019                offset,
9020                _depth,
9021            )
9022        }
9023    }
9024    unsafe impl<
9025            D: fidl::encoding::ResourceDialect,
9026            T0: fidl::encoding::Encode<u32, D>,
9027            T1: fidl::encoding::Encode<HitTestBehavior, D>,
9028        > fidl::encoding::Encode<SetHitTestBehaviorCmd, D> for (T0, T1)
9029    {
9030        #[inline]
9031        unsafe fn encode(
9032            self,
9033            encoder: &mut fidl::encoding::Encoder<'_, D>,
9034            offset: usize,
9035            depth: fidl::encoding::Depth,
9036        ) -> fidl::Result<()> {
9037            encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
9038            // Zero out padding regions. There's no need to apply masks
9039            // because the unmasked parts will be overwritten by fields.
9040            // Write the fields.
9041            self.0.encode(encoder, offset + 0, depth)?;
9042            self.1.encode(encoder, offset + 4, depth)?;
9043            Ok(())
9044        }
9045    }
9046
9047    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetHitTestBehaviorCmd {
9048        #[inline(always)]
9049        fn new_empty() -> Self {
9050            Self {
9051                node_id: fidl::new_empty!(u32, D),
9052                hit_test_behavior: fidl::new_empty!(HitTestBehavior, D),
9053            }
9054        }
9055
9056        #[inline]
9057        unsafe fn decode(
9058            &mut self,
9059            decoder: &mut fidl::encoding::Decoder<'_, D>,
9060            offset: usize,
9061            _depth: fidl::encoding::Depth,
9062        ) -> fidl::Result<()> {
9063            decoder.debug_check_bounds::<Self>(offset);
9064            // Verify that padding bytes are zero.
9065            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9066            fidl::decode!(
9067                HitTestBehavior,
9068                D,
9069                &mut self.hit_test_behavior,
9070                decoder,
9071                offset + 4,
9072                _depth
9073            )?;
9074            Ok(())
9075        }
9076    }
9077
9078    impl fidl::encoding::ValueTypeMarker for SetImportFocusCmdDeprecated {
9079        type Borrowed<'a> = &'a Self;
9080        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9081            value
9082        }
9083    }
9084
9085    unsafe impl fidl::encoding::TypeMarker for SetImportFocusCmdDeprecated {
9086        type Owned = Self;
9087
9088        #[inline(always)]
9089        fn inline_align(_context: fidl::encoding::Context) -> usize {
9090            1
9091        }
9092
9093        #[inline(always)]
9094        fn inline_size(_context: fidl::encoding::Context) -> usize {
9095            1
9096        }
9097    }
9098
9099    unsafe impl<D: fidl::encoding::ResourceDialect>
9100        fidl::encoding::Encode<SetImportFocusCmdDeprecated, D> for &SetImportFocusCmdDeprecated
9101    {
9102        #[inline]
9103        unsafe fn encode(
9104            self,
9105            encoder: &mut fidl::encoding::Encoder<'_, D>,
9106            offset: usize,
9107            _depth: fidl::encoding::Depth,
9108        ) -> fidl::Result<()> {
9109            encoder.debug_check_bounds::<SetImportFocusCmdDeprecated>(offset);
9110            encoder.write_num(0u8, offset);
9111            Ok(())
9112        }
9113    }
9114
9115    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9116        for SetImportFocusCmdDeprecated
9117    {
9118        #[inline(always)]
9119        fn new_empty() -> Self {
9120            Self
9121        }
9122
9123        #[inline]
9124        unsafe fn decode(
9125            &mut self,
9126            decoder: &mut fidl::encoding::Decoder<'_, D>,
9127            offset: usize,
9128            _depth: fidl::encoding::Depth,
9129        ) -> fidl::Result<()> {
9130            decoder.debug_check_bounds::<Self>(offset);
9131            match decoder.read_num::<u8>(offset) {
9132                0 => Ok(()),
9133                _ => Err(fidl::Error::Invalid),
9134            }
9135        }
9136    }
9137
9138    impl fidl::encoding::ValueTypeMarker for SetLabelCmd {
9139        type Borrowed<'a> = &'a Self;
9140        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9141            value
9142        }
9143    }
9144
9145    unsafe impl fidl::encoding::TypeMarker for SetLabelCmd {
9146        type Owned = Self;
9147
9148        #[inline(always)]
9149        fn inline_align(_context: fidl::encoding::Context) -> usize {
9150            8
9151        }
9152
9153        #[inline(always)]
9154        fn inline_size(_context: fidl::encoding::Context) -> usize {
9155            24
9156        }
9157    }
9158
9159    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLabelCmd, D>
9160        for &SetLabelCmd
9161    {
9162        #[inline]
9163        unsafe fn encode(
9164            self,
9165            encoder: &mut fidl::encoding::Encoder<'_, D>,
9166            offset: usize,
9167            _depth: fidl::encoding::Depth,
9168        ) -> fidl::Result<()> {
9169            encoder.debug_check_bounds::<SetLabelCmd>(offset);
9170            // Delegate to tuple encoding.
9171            fidl::encoding::Encode::<SetLabelCmd, D>::encode(
9172                (
9173                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
9174                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9175                        &self.label,
9176                    ),
9177                ),
9178                encoder,
9179                offset,
9180                _depth,
9181            )
9182        }
9183    }
9184    unsafe impl<
9185            D: fidl::encoding::ResourceDialect,
9186            T0: fidl::encoding::Encode<u32, D>,
9187            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9188        > fidl::encoding::Encode<SetLabelCmd, D> for (T0, T1)
9189    {
9190        #[inline]
9191        unsafe fn encode(
9192            self,
9193            encoder: &mut fidl::encoding::Encoder<'_, D>,
9194            offset: usize,
9195            depth: fidl::encoding::Depth,
9196        ) -> fidl::Result<()> {
9197            encoder.debug_check_bounds::<SetLabelCmd>(offset);
9198            // Zero out padding regions. There's no need to apply masks
9199            // because the unmasked parts will be overwritten by fields.
9200            unsafe {
9201                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9202                (ptr as *mut u64).write_unaligned(0);
9203            }
9204            // Write the fields.
9205            self.0.encode(encoder, offset + 0, depth)?;
9206            self.1.encode(encoder, offset + 8, depth)?;
9207            Ok(())
9208        }
9209    }
9210
9211    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLabelCmd {
9212        #[inline(always)]
9213        fn new_empty() -> Self {
9214            Self {
9215                id: fidl::new_empty!(u32, D),
9216                label: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9217            }
9218        }
9219
9220        #[inline]
9221        unsafe fn decode(
9222            &mut self,
9223            decoder: &mut fidl::encoding::Decoder<'_, D>,
9224            offset: usize,
9225            _depth: fidl::encoding::Depth,
9226        ) -> fidl::Result<()> {
9227            decoder.debug_check_bounds::<Self>(offset);
9228            // Verify that padding bytes are zero.
9229            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9230            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9231            let mask = 0xffffffff00000000u64;
9232            let maskedval = padval & mask;
9233            if maskedval != 0 {
9234                return Err(fidl::Error::NonZeroPadding {
9235                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9236                });
9237            }
9238            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
9239            fidl::decode!(
9240                fidl::encoding::UnboundedString,
9241                D,
9242                &mut self.label,
9243                decoder,
9244                offset + 8,
9245                _depth
9246            )?;
9247            Ok(())
9248        }
9249    }
9250
9251    impl fidl::encoding::ValueTypeMarker for SetLayerStackCmd {
9252        type Borrowed<'a> = &'a Self;
9253        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9254            value
9255        }
9256    }
9257
9258    unsafe impl fidl::encoding::TypeMarker for SetLayerStackCmd {
9259        type Owned = Self;
9260
9261        #[inline(always)]
9262        fn inline_align(_context: fidl::encoding::Context) -> usize {
9263            4
9264        }
9265
9266        #[inline(always)]
9267        fn inline_size(_context: fidl::encoding::Context) -> usize {
9268            8
9269        }
9270        #[inline(always)]
9271        fn encode_is_copy() -> bool {
9272            true
9273        }
9274
9275        #[inline(always)]
9276        fn decode_is_copy() -> bool {
9277            true
9278        }
9279    }
9280
9281    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLayerStackCmd, D>
9282        for &SetLayerStackCmd
9283    {
9284        #[inline]
9285        unsafe fn encode(
9286            self,
9287            encoder: &mut fidl::encoding::Encoder<'_, D>,
9288            offset: usize,
9289            _depth: fidl::encoding::Depth,
9290        ) -> fidl::Result<()> {
9291            encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9292            unsafe {
9293                // Copy the object into the buffer.
9294                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9295                (buf_ptr as *mut SetLayerStackCmd)
9296                    .write_unaligned((self as *const SetLayerStackCmd).read());
9297                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9298                // done second because the memcpy will write garbage to these bytes.
9299            }
9300            Ok(())
9301        }
9302    }
9303    unsafe impl<
9304            D: fidl::encoding::ResourceDialect,
9305            T0: fidl::encoding::Encode<u32, D>,
9306            T1: fidl::encoding::Encode<u32, D>,
9307        > fidl::encoding::Encode<SetLayerStackCmd, D> for (T0, T1)
9308    {
9309        #[inline]
9310        unsafe fn encode(
9311            self,
9312            encoder: &mut fidl::encoding::Encoder<'_, D>,
9313            offset: usize,
9314            depth: fidl::encoding::Depth,
9315        ) -> fidl::Result<()> {
9316            encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
9317            // Zero out padding regions. There's no need to apply masks
9318            // because the unmasked parts will be overwritten by fields.
9319            // Write the fields.
9320            self.0.encode(encoder, offset + 0, depth)?;
9321            self.1.encode(encoder, offset + 4, depth)?;
9322            Ok(())
9323        }
9324    }
9325
9326    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLayerStackCmd {
9327        #[inline(always)]
9328        fn new_empty() -> Self {
9329            Self {
9330                compositor_id: fidl::new_empty!(u32, D),
9331                layer_stack_id: fidl::new_empty!(u32, D),
9332            }
9333        }
9334
9335        #[inline]
9336        unsafe fn decode(
9337            &mut self,
9338            decoder: &mut fidl::encoding::Decoder<'_, D>,
9339            offset: usize,
9340            _depth: fidl::encoding::Depth,
9341        ) -> fidl::Result<()> {
9342            decoder.debug_check_bounds::<Self>(offset);
9343            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9344            // Verify that padding bytes are zero.
9345            // Copy from the buffer into the object.
9346            unsafe {
9347                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9348            }
9349            Ok(())
9350        }
9351    }
9352
9353    impl fidl::encoding::ValueTypeMarker for SetLightColorCmd {
9354        type Borrowed<'a> = &'a Self;
9355        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9356            value
9357        }
9358    }
9359
9360    unsafe impl fidl::encoding::TypeMarker for SetLightColorCmd {
9361        type Owned = Self;
9362
9363        #[inline(always)]
9364        fn inline_align(_context: fidl::encoding::Context) -> usize {
9365            4
9366        }
9367
9368        #[inline(always)]
9369        fn inline_size(_context: fidl::encoding::Context) -> usize {
9370            20
9371        }
9372    }
9373
9374    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightColorCmd, D>
9375        for &SetLightColorCmd
9376    {
9377        #[inline]
9378        unsafe fn encode(
9379            self,
9380            encoder: &mut fidl::encoding::Encoder<'_, D>,
9381            offset: usize,
9382            _depth: fidl::encoding::Depth,
9383        ) -> fidl::Result<()> {
9384            encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9385            // Delegate to tuple encoding.
9386            fidl::encoding::Encode::<SetLightColorCmd, D>::encode(
9387                (
9388                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9389                    <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
9390                ),
9391                encoder,
9392                offset,
9393                _depth,
9394            )
9395        }
9396    }
9397    unsafe impl<
9398            D: fidl::encoding::ResourceDialect,
9399            T0: fidl::encoding::Encode<u32, D>,
9400            T1: fidl::encoding::Encode<ColorRgbValue, D>,
9401        > fidl::encoding::Encode<SetLightColorCmd, D> for (T0, T1)
9402    {
9403        #[inline]
9404        unsafe fn encode(
9405            self,
9406            encoder: &mut fidl::encoding::Encoder<'_, D>,
9407            offset: usize,
9408            depth: fidl::encoding::Depth,
9409        ) -> fidl::Result<()> {
9410            encoder.debug_check_bounds::<SetLightColorCmd>(offset);
9411            // Zero out padding regions. There's no need to apply masks
9412            // because the unmasked parts will be overwritten by fields.
9413            // Write the fields.
9414            self.0.encode(encoder, offset + 0, depth)?;
9415            self.1.encode(encoder, offset + 4, depth)?;
9416            Ok(())
9417        }
9418    }
9419
9420    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightColorCmd {
9421        #[inline(always)]
9422        fn new_empty() -> Self {
9423            Self { light_id: fidl::new_empty!(u32, D), color: fidl::new_empty!(ColorRgbValue, D) }
9424        }
9425
9426        #[inline]
9427        unsafe fn decode(
9428            &mut self,
9429            decoder: &mut fidl::encoding::Decoder<'_, D>,
9430            offset: usize,
9431            _depth: fidl::encoding::Depth,
9432        ) -> fidl::Result<()> {
9433            decoder.debug_check_bounds::<Self>(offset);
9434            // Verify that padding bytes are zero.
9435            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9436            fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
9437            Ok(())
9438        }
9439    }
9440
9441    impl fidl::encoding::ValueTypeMarker for SetLightDirectionCmd {
9442        type Borrowed<'a> = &'a Self;
9443        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9444            value
9445        }
9446    }
9447
9448    unsafe impl fidl::encoding::TypeMarker for SetLightDirectionCmd {
9449        type Owned = Self;
9450
9451        #[inline(always)]
9452        fn inline_align(_context: fidl::encoding::Context) -> usize {
9453            4
9454        }
9455
9456        #[inline(always)]
9457        fn inline_size(_context: fidl::encoding::Context) -> usize {
9458            20
9459        }
9460    }
9461
9462    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightDirectionCmd, D>
9463        for &SetLightDirectionCmd
9464    {
9465        #[inline]
9466        unsafe fn encode(
9467            self,
9468            encoder: &mut fidl::encoding::Encoder<'_, D>,
9469            offset: usize,
9470            _depth: fidl::encoding::Depth,
9471        ) -> fidl::Result<()> {
9472            encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9473            // Delegate to tuple encoding.
9474            fidl::encoding::Encode::<SetLightDirectionCmd, D>::encode(
9475                (
9476                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9477                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.direction),
9478                ),
9479                encoder,
9480                offset,
9481                _depth,
9482            )
9483        }
9484    }
9485    unsafe impl<
9486            D: fidl::encoding::ResourceDialect,
9487            T0: fidl::encoding::Encode<u32, D>,
9488            T1: fidl::encoding::Encode<Vector3Value, D>,
9489        > fidl::encoding::Encode<SetLightDirectionCmd, D> for (T0, T1)
9490    {
9491        #[inline]
9492        unsafe fn encode(
9493            self,
9494            encoder: &mut fidl::encoding::Encoder<'_, D>,
9495            offset: usize,
9496            depth: fidl::encoding::Depth,
9497        ) -> fidl::Result<()> {
9498            encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
9499            // Zero out padding regions. There's no need to apply masks
9500            // because the unmasked parts will be overwritten by fields.
9501            // Write the fields.
9502            self.0.encode(encoder, offset + 0, depth)?;
9503            self.1.encode(encoder, offset + 4, depth)?;
9504            Ok(())
9505        }
9506    }
9507
9508    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightDirectionCmd {
9509        #[inline(always)]
9510        fn new_empty() -> Self {
9511            Self {
9512                light_id: fidl::new_empty!(u32, D),
9513                direction: fidl::new_empty!(Vector3Value, D),
9514            }
9515        }
9516
9517        #[inline]
9518        unsafe fn decode(
9519            &mut self,
9520            decoder: &mut fidl::encoding::Decoder<'_, D>,
9521            offset: usize,
9522            _depth: fidl::encoding::Depth,
9523        ) -> fidl::Result<()> {
9524            decoder.debug_check_bounds::<Self>(offset);
9525            // Verify that padding bytes are zero.
9526            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9527            fidl::decode!(Vector3Value, D, &mut self.direction, decoder, offset + 4, _depth)?;
9528            Ok(())
9529        }
9530    }
9531
9532    impl fidl::encoding::ValueTypeMarker for SetMaterialCmd {
9533        type Borrowed<'a> = &'a Self;
9534        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9535            value
9536        }
9537    }
9538
9539    unsafe impl fidl::encoding::TypeMarker for SetMaterialCmd {
9540        type Owned = Self;
9541
9542        #[inline(always)]
9543        fn inline_align(_context: fidl::encoding::Context) -> usize {
9544            4
9545        }
9546
9547        #[inline(always)]
9548        fn inline_size(_context: fidl::encoding::Context) -> usize {
9549            8
9550        }
9551        #[inline(always)]
9552        fn encode_is_copy() -> bool {
9553            true
9554        }
9555
9556        #[inline(always)]
9557        fn decode_is_copy() -> bool {
9558            true
9559        }
9560    }
9561
9562    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetMaterialCmd, D>
9563        for &SetMaterialCmd
9564    {
9565        #[inline]
9566        unsafe fn encode(
9567            self,
9568            encoder: &mut fidl::encoding::Encoder<'_, D>,
9569            offset: usize,
9570            _depth: fidl::encoding::Depth,
9571        ) -> fidl::Result<()> {
9572            encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9573            unsafe {
9574                // Copy the object into the buffer.
9575                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9576                (buf_ptr as *mut SetMaterialCmd)
9577                    .write_unaligned((self as *const SetMaterialCmd).read());
9578                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9579                // done second because the memcpy will write garbage to these bytes.
9580            }
9581            Ok(())
9582        }
9583    }
9584    unsafe impl<
9585            D: fidl::encoding::ResourceDialect,
9586            T0: fidl::encoding::Encode<u32, D>,
9587            T1: fidl::encoding::Encode<u32, D>,
9588        > fidl::encoding::Encode<SetMaterialCmd, D> for (T0, T1)
9589    {
9590        #[inline]
9591        unsafe fn encode(
9592            self,
9593            encoder: &mut fidl::encoding::Encoder<'_, D>,
9594            offset: usize,
9595            depth: fidl::encoding::Depth,
9596        ) -> fidl::Result<()> {
9597            encoder.debug_check_bounds::<SetMaterialCmd>(offset);
9598            // Zero out padding regions. There's no need to apply masks
9599            // because the unmasked parts will be overwritten by fields.
9600            // Write the fields.
9601            self.0.encode(encoder, offset + 0, depth)?;
9602            self.1.encode(encoder, offset + 4, depth)?;
9603            Ok(())
9604        }
9605    }
9606
9607    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetMaterialCmd {
9608        #[inline(always)]
9609        fn new_empty() -> Self {
9610            Self { node_id: fidl::new_empty!(u32, D), material_id: fidl::new_empty!(u32, D) }
9611        }
9612
9613        #[inline]
9614        unsafe fn decode(
9615            &mut self,
9616            decoder: &mut fidl::encoding::Decoder<'_, D>,
9617            offset: usize,
9618            _depth: fidl::encoding::Depth,
9619        ) -> fidl::Result<()> {
9620            decoder.debug_check_bounds::<Self>(offset);
9621            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9622            // Verify that padding bytes are zero.
9623            // Copy from the buffer into the object.
9624            unsafe {
9625                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9626            }
9627            Ok(())
9628        }
9629    }
9630
9631    impl fidl::encoding::ValueTypeMarker for SetOpacityCmd {
9632        type Borrowed<'a> = &'a Self;
9633        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9634            value
9635        }
9636    }
9637
9638    unsafe impl fidl::encoding::TypeMarker for SetOpacityCmd {
9639        type Owned = Self;
9640
9641        #[inline(always)]
9642        fn inline_align(_context: fidl::encoding::Context) -> usize {
9643            4
9644        }
9645
9646        #[inline(always)]
9647        fn inline_size(_context: fidl::encoding::Context) -> usize {
9648            8
9649        }
9650    }
9651
9652    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetOpacityCmd, D>
9653        for &SetOpacityCmd
9654    {
9655        #[inline]
9656        unsafe fn encode(
9657            self,
9658            encoder: &mut fidl::encoding::Encoder<'_, D>,
9659            offset: usize,
9660            _depth: fidl::encoding::Depth,
9661        ) -> fidl::Result<()> {
9662            encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9663            // Delegate to tuple encoding.
9664            fidl::encoding::Encode::<SetOpacityCmd, D>::encode(
9665                (
9666                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
9667                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.opacity),
9668                ),
9669                encoder,
9670                offset,
9671                _depth,
9672            )
9673        }
9674    }
9675    unsafe impl<
9676            D: fidl::encoding::ResourceDialect,
9677            T0: fidl::encoding::Encode<u32, D>,
9678            T1: fidl::encoding::Encode<f32, D>,
9679        > fidl::encoding::Encode<SetOpacityCmd, D> for (T0, T1)
9680    {
9681        #[inline]
9682        unsafe fn encode(
9683            self,
9684            encoder: &mut fidl::encoding::Encoder<'_, D>,
9685            offset: usize,
9686            depth: fidl::encoding::Depth,
9687        ) -> fidl::Result<()> {
9688            encoder.debug_check_bounds::<SetOpacityCmd>(offset);
9689            // Zero out padding regions. There's no need to apply masks
9690            // because the unmasked parts will be overwritten by fields.
9691            // Write the fields.
9692            self.0.encode(encoder, offset + 0, depth)?;
9693            self.1.encode(encoder, offset + 4, depth)?;
9694            Ok(())
9695        }
9696    }
9697
9698    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetOpacityCmd {
9699        #[inline(always)]
9700        fn new_empty() -> Self {
9701            Self { node_id: fidl::new_empty!(u32, D), opacity: fidl::new_empty!(f32, D) }
9702        }
9703
9704        #[inline]
9705        unsafe fn decode(
9706            &mut self,
9707            decoder: &mut fidl::encoding::Decoder<'_, D>,
9708            offset: usize,
9709            _depth: fidl::encoding::Depth,
9710        ) -> fidl::Result<()> {
9711            decoder.debug_check_bounds::<Self>(offset);
9712            // Verify that padding bytes are zero.
9713            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
9714            fidl::decode!(f32, D, &mut self.opacity, decoder, offset + 4, _depth)?;
9715            Ok(())
9716        }
9717    }
9718
9719    impl fidl::encoding::ValueTypeMarker for SetPointLightFalloffCmd {
9720        type Borrowed<'a> = &'a Self;
9721        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9722            value
9723        }
9724    }
9725
9726    unsafe impl fidl::encoding::TypeMarker for SetPointLightFalloffCmd {
9727        type Owned = Self;
9728
9729        #[inline(always)]
9730        fn inline_align(_context: fidl::encoding::Context) -> usize {
9731            4
9732        }
9733
9734        #[inline(always)]
9735        fn inline_size(_context: fidl::encoding::Context) -> usize {
9736            12
9737        }
9738    }
9739
9740    unsafe impl<D: fidl::encoding::ResourceDialect>
9741        fidl::encoding::Encode<SetPointLightFalloffCmd, D> for &SetPointLightFalloffCmd
9742    {
9743        #[inline]
9744        unsafe fn encode(
9745            self,
9746            encoder: &mut fidl::encoding::Encoder<'_, D>,
9747            offset: usize,
9748            _depth: fidl::encoding::Depth,
9749        ) -> fidl::Result<()> {
9750            encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9751            // Delegate to tuple encoding.
9752            fidl::encoding::Encode::<SetPointLightFalloffCmd, D>::encode(
9753                (
9754                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9755                    <FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.falloff),
9756                ),
9757                encoder,
9758                offset,
9759                _depth,
9760            )
9761        }
9762    }
9763    unsafe impl<
9764            D: fidl::encoding::ResourceDialect,
9765            T0: fidl::encoding::Encode<u32, D>,
9766            T1: fidl::encoding::Encode<FloatValue, D>,
9767        > fidl::encoding::Encode<SetPointLightFalloffCmd, D> for (T0, T1)
9768    {
9769        #[inline]
9770        unsafe fn encode(
9771            self,
9772            encoder: &mut fidl::encoding::Encoder<'_, D>,
9773            offset: usize,
9774            depth: fidl::encoding::Depth,
9775        ) -> fidl::Result<()> {
9776            encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
9777            // Zero out padding regions. There's no need to apply masks
9778            // because the unmasked parts will be overwritten by fields.
9779            // Write the fields.
9780            self.0.encode(encoder, offset + 0, depth)?;
9781            self.1.encode(encoder, offset + 4, depth)?;
9782            Ok(())
9783        }
9784    }
9785
9786    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9787        for SetPointLightFalloffCmd
9788    {
9789        #[inline(always)]
9790        fn new_empty() -> Self {
9791            Self { light_id: fidl::new_empty!(u32, D), falloff: fidl::new_empty!(FloatValue, D) }
9792        }
9793
9794        #[inline]
9795        unsafe fn decode(
9796            &mut self,
9797            decoder: &mut fidl::encoding::Decoder<'_, D>,
9798            offset: usize,
9799            _depth: fidl::encoding::Depth,
9800        ) -> fidl::Result<()> {
9801            decoder.debug_check_bounds::<Self>(offset);
9802            // Verify that padding bytes are zero.
9803            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9804            fidl::decode!(FloatValue, D, &mut self.falloff, decoder, offset + 4, _depth)?;
9805            Ok(())
9806        }
9807    }
9808
9809    impl fidl::encoding::ValueTypeMarker for SetPointLightPositionCmd {
9810        type Borrowed<'a> = &'a Self;
9811        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9812            value
9813        }
9814    }
9815
9816    unsafe impl fidl::encoding::TypeMarker for SetPointLightPositionCmd {
9817        type Owned = Self;
9818
9819        #[inline(always)]
9820        fn inline_align(_context: fidl::encoding::Context) -> usize {
9821            4
9822        }
9823
9824        #[inline(always)]
9825        fn inline_size(_context: fidl::encoding::Context) -> usize {
9826            20
9827        }
9828    }
9829
9830    unsafe impl<D: fidl::encoding::ResourceDialect>
9831        fidl::encoding::Encode<SetPointLightPositionCmd, D> for &SetPointLightPositionCmd
9832    {
9833        #[inline]
9834        unsafe fn encode(
9835            self,
9836            encoder: &mut fidl::encoding::Encoder<'_, D>,
9837            offset: usize,
9838            _depth: fidl::encoding::Depth,
9839        ) -> fidl::Result<()> {
9840            encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9841            // Delegate to tuple encoding.
9842            fidl::encoding::Encode::<SetPointLightPositionCmd, D>::encode(
9843                (
9844                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
9845                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.position),
9846                ),
9847                encoder,
9848                offset,
9849                _depth,
9850            )
9851        }
9852    }
9853    unsafe impl<
9854            D: fidl::encoding::ResourceDialect,
9855            T0: fidl::encoding::Encode<u32, D>,
9856            T1: fidl::encoding::Encode<Vector3Value, D>,
9857        > fidl::encoding::Encode<SetPointLightPositionCmd, D> for (T0, T1)
9858    {
9859        #[inline]
9860        unsafe fn encode(
9861            self,
9862            encoder: &mut fidl::encoding::Encoder<'_, D>,
9863            offset: usize,
9864            depth: fidl::encoding::Depth,
9865        ) -> fidl::Result<()> {
9866            encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
9867            // Zero out padding regions. There's no need to apply masks
9868            // because the unmasked parts will be overwritten by fields.
9869            // Write the fields.
9870            self.0.encode(encoder, offset + 0, depth)?;
9871            self.1.encode(encoder, offset + 4, depth)?;
9872            Ok(())
9873        }
9874    }
9875
9876    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9877        for SetPointLightPositionCmd
9878    {
9879        #[inline(always)]
9880        fn new_empty() -> Self {
9881            Self { light_id: fidl::new_empty!(u32, D), position: fidl::new_empty!(Vector3Value, D) }
9882        }
9883
9884        #[inline]
9885        unsafe fn decode(
9886            &mut self,
9887            decoder: &mut fidl::encoding::Decoder<'_, D>,
9888            offset: usize,
9889            _depth: fidl::encoding::Depth,
9890        ) -> fidl::Result<()> {
9891            decoder.debug_check_bounds::<Self>(offset);
9892            // Verify that padding bytes are zero.
9893            fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
9894            fidl::decode!(Vector3Value, D, &mut self.position, decoder, offset + 4, _depth)?;
9895            Ok(())
9896        }
9897    }
9898
9899    impl fidl::encoding::ValueTypeMarker for SetRendererCmd {
9900        type Borrowed<'a> = &'a Self;
9901        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9902            value
9903        }
9904    }
9905
9906    unsafe impl fidl::encoding::TypeMarker for SetRendererCmd {
9907        type Owned = Self;
9908
9909        #[inline(always)]
9910        fn inline_align(_context: fidl::encoding::Context) -> usize {
9911            4
9912        }
9913
9914        #[inline(always)]
9915        fn inline_size(_context: fidl::encoding::Context) -> usize {
9916            8
9917        }
9918        #[inline(always)]
9919        fn encode_is_copy() -> bool {
9920            true
9921        }
9922
9923        #[inline(always)]
9924        fn decode_is_copy() -> bool {
9925            true
9926        }
9927    }
9928
9929    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererCmd, D>
9930        for &SetRendererCmd
9931    {
9932        #[inline]
9933        unsafe fn encode(
9934            self,
9935            encoder: &mut fidl::encoding::Encoder<'_, D>,
9936            offset: usize,
9937            _depth: fidl::encoding::Depth,
9938        ) -> fidl::Result<()> {
9939            encoder.debug_check_bounds::<SetRendererCmd>(offset);
9940            unsafe {
9941                // Copy the object into the buffer.
9942                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9943                (buf_ptr as *mut SetRendererCmd)
9944                    .write_unaligned((self as *const SetRendererCmd).read());
9945                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
9946                // done second because the memcpy will write garbage to these bytes.
9947            }
9948            Ok(())
9949        }
9950    }
9951    unsafe impl<
9952            D: fidl::encoding::ResourceDialect,
9953            T0: fidl::encoding::Encode<u32, D>,
9954            T1: fidl::encoding::Encode<u32, D>,
9955        > fidl::encoding::Encode<SetRendererCmd, D> for (T0, T1)
9956    {
9957        #[inline]
9958        unsafe fn encode(
9959            self,
9960            encoder: &mut fidl::encoding::Encoder<'_, D>,
9961            offset: usize,
9962            depth: fidl::encoding::Depth,
9963        ) -> fidl::Result<()> {
9964            encoder.debug_check_bounds::<SetRendererCmd>(offset);
9965            // Zero out padding regions. There's no need to apply masks
9966            // because the unmasked parts will be overwritten by fields.
9967            // Write the fields.
9968            self.0.encode(encoder, offset + 0, depth)?;
9969            self.1.encode(encoder, offset + 4, depth)?;
9970            Ok(())
9971        }
9972    }
9973
9974    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererCmd {
9975        #[inline(always)]
9976        fn new_empty() -> Self {
9977            Self { layer_id: fidl::new_empty!(u32, D), renderer_id: fidl::new_empty!(u32, D) }
9978        }
9979
9980        #[inline]
9981        unsafe fn decode(
9982            &mut self,
9983            decoder: &mut fidl::encoding::Decoder<'_, D>,
9984            offset: usize,
9985            _depth: fidl::encoding::Depth,
9986        ) -> fidl::Result<()> {
9987            decoder.debug_check_bounds::<Self>(offset);
9988            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9989            // Verify that padding bytes are zero.
9990            // Copy from the buffer into the object.
9991            unsafe {
9992                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9993            }
9994            Ok(())
9995        }
9996    }
9997
9998    impl fidl::encoding::ValueTypeMarker for SetRendererParamCmd {
9999        type Borrowed<'a> = &'a Self;
10000        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10001            value
10002        }
10003    }
10004
10005    unsafe impl fidl::encoding::TypeMarker for SetRendererParamCmd {
10006        type Owned = Self;
10007
10008        #[inline(always)]
10009        fn inline_align(_context: fidl::encoding::Context) -> usize {
10010            8
10011        }
10012
10013        #[inline(always)]
10014        fn inline_size(_context: fidl::encoding::Context) -> usize {
10015            24
10016        }
10017    }
10018
10019    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererParamCmd, D>
10020        for &SetRendererParamCmd
10021    {
10022        #[inline]
10023        unsafe fn encode(
10024            self,
10025            encoder: &mut fidl::encoding::Encoder<'_, D>,
10026            offset: usize,
10027            _depth: fidl::encoding::Depth,
10028        ) -> fidl::Result<()> {
10029            encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10030            // Delegate to tuple encoding.
10031            fidl::encoding::Encode::<SetRendererParamCmd, D>::encode(
10032                (
10033                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
10034                    <RendererParam as fidl::encoding::ValueTypeMarker>::borrow(&self.param),
10035                ),
10036                encoder,
10037                offset,
10038                _depth,
10039            )
10040        }
10041    }
10042    unsafe impl<
10043            D: fidl::encoding::ResourceDialect,
10044            T0: fidl::encoding::Encode<u32, D>,
10045            T1: fidl::encoding::Encode<RendererParam, D>,
10046        > fidl::encoding::Encode<SetRendererParamCmd, D> for (T0, T1)
10047    {
10048        #[inline]
10049        unsafe fn encode(
10050            self,
10051            encoder: &mut fidl::encoding::Encoder<'_, D>,
10052            offset: usize,
10053            depth: fidl::encoding::Depth,
10054        ) -> fidl::Result<()> {
10055            encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
10056            // Zero out padding regions. There's no need to apply masks
10057            // because the unmasked parts will be overwritten by fields.
10058            unsafe {
10059                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10060                (ptr as *mut u64).write_unaligned(0);
10061            }
10062            // Write the fields.
10063            self.0.encode(encoder, offset + 0, depth)?;
10064            self.1.encode(encoder, offset + 8, depth)?;
10065            Ok(())
10066        }
10067    }
10068
10069    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererParamCmd {
10070        #[inline(always)]
10071        fn new_empty() -> Self {
10072            Self {
10073                renderer_id: fidl::new_empty!(u32, D),
10074                param: fidl::new_empty!(RendererParam, D),
10075            }
10076        }
10077
10078        #[inline]
10079        unsafe fn decode(
10080            &mut self,
10081            decoder: &mut fidl::encoding::Decoder<'_, D>,
10082            offset: usize,
10083            _depth: fidl::encoding::Depth,
10084        ) -> fidl::Result<()> {
10085            decoder.debug_check_bounds::<Self>(offset);
10086            // Verify that padding bytes are zero.
10087            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10088            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10089            let mask = 0xffffffff00000000u64;
10090            let maskedval = padval & mask;
10091            if maskedval != 0 {
10092                return Err(fidl::Error::NonZeroPadding {
10093                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10094                });
10095            }
10096            fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
10097            fidl::decode!(RendererParam, D, &mut self.param, decoder, offset + 8, _depth)?;
10098            Ok(())
10099        }
10100    }
10101
10102    impl fidl::encoding::ValueTypeMarker for SetRotationCmd {
10103        type Borrowed<'a> = &'a Self;
10104        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10105            value
10106        }
10107    }
10108
10109    unsafe impl fidl::encoding::TypeMarker for SetRotationCmd {
10110        type Owned = Self;
10111
10112        #[inline(always)]
10113        fn inline_align(_context: fidl::encoding::Context) -> usize {
10114            4
10115        }
10116
10117        #[inline(always)]
10118        fn inline_size(_context: fidl::encoding::Context) -> usize {
10119            24
10120        }
10121    }
10122
10123    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRotationCmd, D>
10124        for &SetRotationCmd
10125    {
10126        #[inline]
10127        unsafe fn encode(
10128            self,
10129            encoder: &mut fidl::encoding::Encoder<'_, D>,
10130            offset: usize,
10131            _depth: fidl::encoding::Depth,
10132        ) -> fidl::Result<()> {
10133            encoder.debug_check_bounds::<SetRotationCmd>(offset);
10134            // Delegate to tuple encoding.
10135            fidl::encoding::Encode::<SetRotationCmd, D>::encode(
10136                (
10137                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10138                    <QuaternionValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10139                ),
10140                encoder,
10141                offset,
10142                _depth,
10143            )
10144        }
10145    }
10146    unsafe impl<
10147            D: fidl::encoding::ResourceDialect,
10148            T0: fidl::encoding::Encode<u32, D>,
10149            T1: fidl::encoding::Encode<QuaternionValue, D>,
10150        > fidl::encoding::Encode<SetRotationCmd, D> for (T0, T1)
10151    {
10152        #[inline]
10153        unsafe fn encode(
10154            self,
10155            encoder: &mut fidl::encoding::Encoder<'_, D>,
10156            offset: usize,
10157            depth: fidl::encoding::Depth,
10158        ) -> fidl::Result<()> {
10159            encoder.debug_check_bounds::<SetRotationCmd>(offset);
10160            // Zero out padding regions. There's no need to apply masks
10161            // because the unmasked parts will be overwritten by fields.
10162            // Write the fields.
10163            self.0.encode(encoder, offset + 0, depth)?;
10164            self.1.encode(encoder, offset + 4, depth)?;
10165            Ok(())
10166        }
10167    }
10168
10169    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRotationCmd {
10170        #[inline(always)]
10171        fn new_empty() -> Self {
10172            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(QuaternionValue, D) }
10173        }
10174
10175        #[inline]
10176        unsafe fn decode(
10177            &mut self,
10178            decoder: &mut fidl::encoding::Decoder<'_, D>,
10179            offset: usize,
10180            _depth: fidl::encoding::Depth,
10181        ) -> fidl::Result<()> {
10182            decoder.debug_check_bounds::<Self>(offset);
10183            // Verify that padding bytes are zero.
10184            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10185            fidl::decode!(QuaternionValue, D, &mut self.value, decoder, offset + 4, _depth)?;
10186            Ok(())
10187        }
10188    }
10189
10190    impl fidl::encoding::ValueTypeMarker for SetScaleCmd {
10191        type Borrowed<'a> = &'a Self;
10192        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10193            value
10194        }
10195    }
10196
10197    unsafe impl fidl::encoding::TypeMarker for SetScaleCmd {
10198        type Owned = Self;
10199
10200        #[inline(always)]
10201        fn inline_align(_context: fidl::encoding::Context) -> usize {
10202            4
10203        }
10204
10205        #[inline(always)]
10206        fn inline_size(_context: fidl::encoding::Context) -> usize {
10207            20
10208        }
10209    }
10210
10211    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetScaleCmd, D>
10212        for &SetScaleCmd
10213    {
10214        #[inline]
10215        unsafe fn encode(
10216            self,
10217            encoder: &mut fidl::encoding::Encoder<'_, D>,
10218            offset: usize,
10219            _depth: fidl::encoding::Depth,
10220        ) -> fidl::Result<()> {
10221            encoder.debug_check_bounds::<SetScaleCmd>(offset);
10222            // Delegate to tuple encoding.
10223            fidl::encoding::Encode::<SetScaleCmd, D>::encode(
10224                (
10225                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10226                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10227                ),
10228                encoder,
10229                offset,
10230                _depth,
10231            )
10232        }
10233    }
10234    unsafe impl<
10235            D: fidl::encoding::ResourceDialect,
10236            T0: fidl::encoding::Encode<u32, D>,
10237            T1: fidl::encoding::Encode<Vector3Value, D>,
10238        > fidl::encoding::Encode<SetScaleCmd, D> for (T0, T1)
10239    {
10240        #[inline]
10241        unsafe fn encode(
10242            self,
10243            encoder: &mut fidl::encoding::Encoder<'_, D>,
10244            offset: usize,
10245            depth: fidl::encoding::Depth,
10246        ) -> fidl::Result<()> {
10247            encoder.debug_check_bounds::<SetScaleCmd>(offset);
10248            // Zero out padding regions. There's no need to apply masks
10249            // because the unmasked parts will be overwritten by fields.
10250            // Write the fields.
10251            self.0.encode(encoder, offset + 0, depth)?;
10252            self.1.encode(encoder, offset + 4, depth)?;
10253            Ok(())
10254        }
10255    }
10256
10257    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetScaleCmd {
10258        #[inline(always)]
10259        fn new_empty() -> Self {
10260            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
10261        }
10262
10263        #[inline]
10264        unsafe fn decode(
10265            &mut self,
10266            decoder: &mut fidl::encoding::Decoder<'_, D>,
10267            offset: usize,
10268            _depth: fidl::encoding::Depth,
10269        ) -> fidl::Result<()> {
10270            decoder.debug_check_bounds::<Self>(offset);
10271            // Verify that padding bytes are zero.
10272            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10273            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10274            Ok(())
10275        }
10276    }
10277
10278    impl fidl::encoding::ValueTypeMarker for SetSemanticVisibilityCmd {
10279        type Borrowed<'a> = &'a Self;
10280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10281            value
10282        }
10283    }
10284
10285    unsafe impl fidl::encoding::TypeMarker for SetSemanticVisibilityCmd {
10286        type Owned = Self;
10287
10288        #[inline(always)]
10289        fn inline_align(_context: fidl::encoding::Context) -> usize {
10290            4
10291        }
10292
10293        #[inline(always)]
10294        fn inline_size(_context: fidl::encoding::Context) -> usize {
10295            8
10296        }
10297    }
10298
10299    unsafe impl<D: fidl::encoding::ResourceDialect>
10300        fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for &SetSemanticVisibilityCmd
10301    {
10302        #[inline]
10303        unsafe fn encode(
10304            self,
10305            encoder: &mut fidl::encoding::Encoder<'_, D>,
10306            offset: usize,
10307            _depth: fidl::encoding::Depth,
10308        ) -> fidl::Result<()> {
10309            encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10310            // Delegate to tuple encoding.
10311            fidl::encoding::Encode::<SetSemanticVisibilityCmd, D>::encode(
10312                (
10313                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
10314                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.visible),
10315                ),
10316                encoder,
10317                offset,
10318                _depth,
10319            )
10320        }
10321    }
10322    unsafe impl<
10323            D: fidl::encoding::ResourceDialect,
10324            T0: fidl::encoding::Encode<u32, D>,
10325            T1: fidl::encoding::Encode<bool, D>,
10326        > fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for (T0, T1)
10327    {
10328        #[inline]
10329        unsafe fn encode(
10330            self,
10331            encoder: &mut fidl::encoding::Encoder<'_, D>,
10332            offset: usize,
10333            depth: fidl::encoding::Depth,
10334        ) -> fidl::Result<()> {
10335            encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
10336            // Zero out padding regions. There's no need to apply masks
10337            // because the unmasked parts will be overwritten by fields.
10338            unsafe {
10339                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
10340                (ptr as *mut u32).write_unaligned(0);
10341            }
10342            // Write the fields.
10343            self.0.encode(encoder, offset + 0, depth)?;
10344            self.1.encode(encoder, offset + 4, depth)?;
10345            Ok(())
10346        }
10347    }
10348
10349    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10350        for SetSemanticVisibilityCmd
10351    {
10352        #[inline(always)]
10353        fn new_empty() -> Self {
10354            Self { node_id: fidl::new_empty!(u32, D), visible: fidl::new_empty!(bool, D) }
10355        }
10356
10357        #[inline]
10358        unsafe fn decode(
10359            &mut self,
10360            decoder: &mut fidl::encoding::Decoder<'_, D>,
10361            offset: usize,
10362            _depth: fidl::encoding::Depth,
10363        ) -> fidl::Result<()> {
10364            decoder.debug_check_bounds::<Self>(offset);
10365            // Verify that padding bytes are zero.
10366            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
10367            let padval = unsafe { (ptr as *const u32).read_unaligned() };
10368            let mask = 0xffffff00u32;
10369            let maskedval = padval & mask;
10370            if maskedval != 0 {
10371                return Err(fidl::Error::NonZeroPadding {
10372                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
10373                });
10374            }
10375            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
10376            fidl::decode!(bool, D, &mut self.visible, decoder, offset + 4, _depth)?;
10377            Ok(())
10378        }
10379    }
10380
10381    impl fidl::encoding::ValueTypeMarker for SetShapeCmd {
10382        type Borrowed<'a> = &'a Self;
10383        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10384            value
10385        }
10386    }
10387
10388    unsafe impl fidl::encoding::TypeMarker for SetShapeCmd {
10389        type Owned = Self;
10390
10391        #[inline(always)]
10392        fn inline_align(_context: fidl::encoding::Context) -> usize {
10393            4
10394        }
10395
10396        #[inline(always)]
10397        fn inline_size(_context: fidl::encoding::Context) -> usize {
10398            8
10399        }
10400        #[inline(always)]
10401        fn encode_is_copy() -> bool {
10402            true
10403        }
10404
10405        #[inline(always)]
10406        fn decode_is_copy() -> bool {
10407            true
10408        }
10409    }
10410
10411    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetShapeCmd, D>
10412        for &SetShapeCmd
10413    {
10414        #[inline]
10415        unsafe fn encode(
10416            self,
10417            encoder: &mut fidl::encoding::Encoder<'_, D>,
10418            offset: usize,
10419            _depth: fidl::encoding::Depth,
10420        ) -> fidl::Result<()> {
10421            encoder.debug_check_bounds::<SetShapeCmd>(offset);
10422            unsafe {
10423                // Copy the object into the buffer.
10424                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10425                (buf_ptr as *mut SetShapeCmd).write_unaligned((self as *const SetShapeCmd).read());
10426                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10427                // done second because the memcpy will write garbage to these bytes.
10428            }
10429            Ok(())
10430        }
10431    }
10432    unsafe impl<
10433            D: fidl::encoding::ResourceDialect,
10434            T0: fidl::encoding::Encode<u32, D>,
10435            T1: fidl::encoding::Encode<u32, D>,
10436        > fidl::encoding::Encode<SetShapeCmd, D> for (T0, T1)
10437    {
10438        #[inline]
10439        unsafe fn encode(
10440            self,
10441            encoder: &mut fidl::encoding::Encoder<'_, D>,
10442            offset: usize,
10443            depth: fidl::encoding::Depth,
10444        ) -> fidl::Result<()> {
10445            encoder.debug_check_bounds::<SetShapeCmd>(offset);
10446            // Zero out padding regions. There's no need to apply masks
10447            // because the unmasked parts will be overwritten by fields.
10448            // Write the fields.
10449            self.0.encode(encoder, offset + 0, depth)?;
10450            self.1.encode(encoder, offset + 4, depth)?;
10451            Ok(())
10452        }
10453    }
10454
10455    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetShapeCmd {
10456        #[inline(always)]
10457        fn new_empty() -> Self {
10458            Self { node_id: fidl::new_empty!(u32, D), shape_id: fidl::new_empty!(u32, D) }
10459        }
10460
10461        #[inline]
10462        unsafe fn decode(
10463            &mut self,
10464            decoder: &mut fidl::encoding::Decoder<'_, D>,
10465            offset: usize,
10466            _depth: fidl::encoding::Depth,
10467        ) -> fidl::Result<()> {
10468            decoder.debug_check_bounds::<Self>(offset);
10469            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10470            // Verify that padding bytes are zero.
10471            // Copy from the buffer into the object.
10472            unsafe {
10473                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10474            }
10475            Ok(())
10476        }
10477    }
10478
10479    impl fidl::encoding::ValueTypeMarker for SetSizeCmd {
10480        type Borrowed<'a> = &'a Self;
10481        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10482            value
10483        }
10484    }
10485
10486    unsafe impl fidl::encoding::TypeMarker for SetSizeCmd {
10487        type Owned = Self;
10488
10489        #[inline(always)]
10490        fn inline_align(_context: fidl::encoding::Context) -> usize {
10491            4
10492        }
10493
10494        #[inline(always)]
10495        fn inline_size(_context: fidl::encoding::Context) -> usize {
10496            16
10497        }
10498    }
10499
10500    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetSizeCmd, D>
10501        for &SetSizeCmd
10502    {
10503        #[inline]
10504        unsafe fn encode(
10505            self,
10506            encoder: &mut fidl::encoding::Encoder<'_, D>,
10507            offset: usize,
10508            _depth: fidl::encoding::Depth,
10509        ) -> fidl::Result<()> {
10510            encoder.debug_check_bounds::<SetSizeCmd>(offset);
10511            // Delegate to tuple encoding.
10512            fidl::encoding::Encode::<SetSizeCmd, D>::encode(
10513                (
10514                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10515                    <Vector2Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10516                ),
10517                encoder,
10518                offset,
10519                _depth,
10520            )
10521        }
10522    }
10523    unsafe impl<
10524            D: fidl::encoding::ResourceDialect,
10525            T0: fidl::encoding::Encode<u32, D>,
10526            T1: fidl::encoding::Encode<Vector2Value, D>,
10527        > fidl::encoding::Encode<SetSizeCmd, D> for (T0, T1)
10528    {
10529        #[inline]
10530        unsafe fn encode(
10531            self,
10532            encoder: &mut fidl::encoding::Encoder<'_, D>,
10533            offset: usize,
10534            depth: fidl::encoding::Depth,
10535        ) -> fidl::Result<()> {
10536            encoder.debug_check_bounds::<SetSizeCmd>(offset);
10537            // Zero out padding regions. There's no need to apply masks
10538            // because the unmasked parts will be overwritten by fields.
10539            // Write the fields.
10540            self.0.encode(encoder, offset + 0, depth)?;
10541            self.1.encode(encoder, offset + 4, depth)?;
10542            Ok(())
10543        }
10544    }
10545
10546    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetSizeCmd {
10547        #[inline(always)]
10548        fn new_empty() -> Self {
10549            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector2Value, D) }
10550        }
10551
10552        #[inline]
10553        unsafe fn decode(
10554            &mut self,
10555            decoder: &mut fidl::encoding::Decoder<'_, D>,
10556            offset: usize,
10557            _depth: fidl::encoding::Depth,
10558        ) -> fidl::Result<()> {
10559            decoder.debug_check_bounds::<Self>(offset);
10560            // Verify that padding bytes are zero.
10561            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10562            fidl::decode!(Vector2Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10563            Ok(())
10564        }
10565    }
10566
10567    impl fidl::encoding::ValueTypeMarker for SetStereoCameraProjectionCmd {
10568        type Borrowed<'a> = &'a Self;
10569        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10570            value
10571        }
10572    }
10573
10574    unsafe impl fidl::encoding::TypeMarker for SetStereoCameraProjectionCmd {
10575        type Owned = Self;
10576
10577        #[inline(always)]
10578        fn inline_align(_context: fidl::encoding::Context) -> usize {
10579            4
10580        }
10581
10582        #[inline(always)]
10583        fn inline_size(_context: fidl::encoding::Context) -> usize {
10584            140
10585        }
10586    }
10587
10588    unsafe impl<D: fidl::encoding::ResourceDialect>
10589        fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for &SetStereoCameraProjectionCmd
10590    {
10591        #[inline]
10592        unsafe fn encode(
10593            self,
10594            encoder: &mut fidl::encoding::Encoder<'_, D>,
10595            offset: usize,
10596            _depth: fidl::encoding::Depth,
10597        ) -> fidl::Result<()> {
10598            encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10599            // Delegate to tuple encoding.
10600            fidl::encoding::Encode::<SetStereoCameraProjectionCmd, D>::encode(
10601                (
10602                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
10603                    <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10604                        &self.left_projection,
10605                    ),
10606                    <Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
10607                        &self.right_projection,
10608                    ),
10609                ),
10610                encoder,
10611                offset,
10612                _depth,
10613            )
10614        }
10615    }
10616    unsafe impl<
10617            D: fidl::encoding::ResourceDialect,
10618            T0: fidl::encoding::Encode<u32, D>,
10619            T1: fidl::encoding::Encode<Matrix4Value, D>,
10620            T2: fidl::encoding::Encode<Matrix4Value, D>,
10621        > fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for (T0, T1, T2)
10622    {
10623        #[inline]
10624        unsafe fn encode(
10625            self,
10626            encoder: &mut fidl::encoding::Encoder<'_, D>,
10627            offset: usize,
10628            depth: fidl::encoding::Depth,
10629        ) -> fidl::Result<()> {
10630            encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
10631            // Zero out padding regions. There's no need to apply masks
10632            // because the unmasked parts will be overwritten by fields.
10633            // Write the fields.
10634            self.0.encode(encoder, offset + 0, depth)?;
10635            self.1.encode(encoder, offset + 4, depth)?;
10636            self.2.encode(encoder, offset + 72, depth)?;
10637            Ok(())
10638        }
10639    }
10640
10641    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10642        for SetStereoCameraProjectionCmd
10643    {
10644        #[inline(always)]
10645        fn new_empty() -> Self {
10646            Self {
10647                camera_id: fidl::new_empty!(u32, D),
10648                left_projection: fidl::new_empty!(Matrix4Value, D),
10649                right_projection: fidl::new_empty!(Matrix4Value, D),
10650            }
10651        }
10652
10653        #[inline]
10654        unsafe fn decode(
10655            &mut self,
10656            decoder: &mut fidl::encoding::Decoder<'_, D>,
10657            offset: usize,
10658            _depth: fidl::encoding::Depth,
10659        ) -> fidl::Result<()> {
10660            decoder.debug_check_bounds::<Self>(offset);
10661            // Verify that padding bytes are zero.
10662            fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
10663            fidl::decode!(Matrix4Value, D, &mut self.left_projection, decoder, offset + 4, _depth)?;
10664            fidl::decode!(
10665                Matrix4Value,
10666                D,
10667                &mut self.right_projection,
10668                decoder,
10669                offset + 72,
10670                _depth
10671            )?;
10672            Ok(())
10673        }
10674    }
10675
10676    impl fidl::encoding::ValueTypeMarker for SetTagCmd {
10677        type Borrowed<'a> = &'a Self;
10678        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10679            value
10680        }
10681    }
10682
10683    unsafe impl fidl::encoding::TypeMarker for SetTagCmd {
10684        type Owned = Self;
10685
10686        #[inline(always)]
10687        fn inline_align(_context: fidl::encoding::Context) -> usize {
10688            4
10689        }
10690
10691        #[inline(always)]
10692        fn inline_size(_context: fidl::encoding::Context) -> usize {
10693            8
10694        }
10695        #[inline(always)]
10696        fn encode_is_copy() -> bool {
10697            true
10698        }
10699
10700        #[inline(always)]
10701        fn decode_is_copy() -> bool {
10702            true
10703        }
10704    }
10705
10706    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTagCmd, D>
10707        for &SetTagCmd
10708    {
10709        #[inline]
10710        unsafe fn encode(
10711            self,
10712            encoder: &mut fidl::encoding::Encoder<'_, D>,
10713            offset: usize,
10714            _depth: fidl::encoding::Depth,
10715        ) -> fidl::Result<()> {
10716            encoder.debug_check_bounds::<SetTagCmd>(offset);
10717            unsafe {
10718                // Copy the object into the buffer.
10719                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10720                (buf_ptr as *mut SetTagCmd).write_unaligned((self as *const SetTagCmd).read());
10721                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10722                // done second because the memcpy will write garbage to these bytes.
10723            }
10724            Ok(())
10725        }
10726    }
10727    unsafe impl<
10728            D: fidl::encoding::ResourceDialect,
10729            T0: fidl::encoding::Encode<u32, D>,
10730            T1: fidl::encoding::Encode<u32, D>,
10731        > fidl::encoding::Encode<SetTagCmd, D> for (T0, T1)
10732    {
10733        #[inline]
10734        unsafe fn encode(
10735            self,
10736            encoder: &mut fidl::encoding::Encoder<'_, D>,
10737            offset: usize,
10738            depth: fidl::encoding::Depth,
10739        ) -> fidl::Result<()> {
10740            encoder.debug_check_bounds::<SetTagCmd>(offset);
10741            // Zero out padding regions. There's no need to apply masks
10742            // because the unmasked parts will be overwritten by fields.
10743            // Write the fields.
10744            self.0.encode(encoder, offset + 0, depth)?;
10745            self.1.encode(encoder, offset + 4, depth)?;
10746            Ok(())
10747        }
10748    }
10749
10750    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTagCmd {
10751        #[inline(always)]
10752        fn new_empty() -> Self {
10753            Self { node_id: fidl::new_empty!(u32, D), tag_value: fidl::new_empty!(u32, D) }
10754        }
10755
10756        #[inline]
10757        unsafe fn decode(
10758            &mut self,
10759            decoder: &mut fidl::encoding::Decoder<'_, D>,
10760            offset: usize,
10761            _depth: fidl::encoding::Depth,
10762        ) -> fidl::Result<()> {
10763            decoder.debug_check_bounds::<Self>(offset);
10764            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10765            // Verify that padding bytes are zero.
10766            // Copy from the buffer into the object.
10767            unsafe {
10768                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10769            }
10770            Ok(())
10771        }
10772    }
10773
10774    impl fidl::encoding::ValueTypeMarker for SetTextureCmd {
10775        type Borrowed<'a> = &'a Self;
10776        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10777            value
10778        }
10779    }
10780
10781    unsafe impl fidl::encoding::TypeMarker for SetTextureCmd {
10782        type Owned = Self;
10783
10784        #[inline(always)]
10785        fn inline_align(_context: fidl::encoding::Context) -> usize {
10786            4
10787        }
10788
10789        #[inline(always)]
10790        fn inline_size(_context: fidl::encoding::Context) -> usize {
10791            8
10792        }
10793        #[inline(always)]
10794        fn encode_is_copy() -> bool {
10795            true
10796        }
10797
10798        #[inline(always)]
10799        fn decode_is_copy() -> bool {
10800            true
10801        }
10802    }
10803
10804    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTextureCmd, D>
10805        for &SetTextureCmd
10806    {
10807        #[inline]
10808        unsafe fn encode(
10809            self,
10810            encoder: &mut fidl::encoding::Encoder<'_, D>,
10811            offset: usize,
10812            _depth: fidl::encoding::Depth,
10813        ) -> fidl::Result<()> {
10814            encoder.debug_check_bounds::<SetTextureCmd>(offset);
10815            unsafe {
10816                // Copy the object into the buffer.
10817                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10818                (buf_ptr as *mut SetTextureCmd)
10819                    .write_unaligned((self as *const SetTextureCmd).read());
10820                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
10821                // done second because the memcpy will write garbage to these bytes.
10822            }
10823            Ok(())
10824        }
10825    }
10826    unsafe impl<
10827            D: fidl::encoding::ResourceDialect,
10828            T0: fidl::encoding::Encode<u32, D>,
10829            T1: fidl::encoding::Encode<u32, D>,
10830        > fidl::encoding::Encode<SetTextureCmd, D> for (T0, T1)
10831    {
10832        #[inline]
10833        unsafe fn encode(
10834            self,
10835            encoder: &mut fidl::encoding::Encoder<'_, D>,
10836            offset: usize,
10837            depth: fidl::encoding::Depth,
10838        ) -> fidl::Result<()> {
10839            encoder.debug_check_bounds::<SetTextureCmd>(offset);
10840            // Zero out padding regions. There's no need to apply masks
10841            // because the unmasked parts will be overwritten by fields.
10842            // Write the fields.
10843            self.0.encode(encoder, offset + 0, depth)?;
10844            self.1.encode(encoder, offset + 4, depth)?;
10845            Ok(())
10846        }
10847    }
10848
10849    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTextureCmd {
10850        #[inline(always)]
10851        fn new_empty() -> Self {
10852            Self { material_id: fidl::new_empty!(u32, D), texture_id: fidl::new_empty!(u32, D) }
10853        }
10854
10855        #[inline]
10856        unsafe fn decode(
10857            &mut self,
10858            decoder: &mut fidl::encoding::Decoder<'_, D>,
10859            offset: usize,
10860            _depth: fidl::encoding::Depth,
10861        ) -> fidl::Result<()> {
10862            decoder.debug_check_bounds::<Self>(offset);
10863            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10864            // Verify that padding bytes are zero.
10865            // Copy from the buffer into the object.
10866            unsafe {
10867                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10868            }
10869            Ok(())
10870        }
10871    }
10872
10873    impl fidl::encoding::ValueTypeMarker for SetTranslationCmd {
10874        type Borrowed<'a> = &'a Self;
10875        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10876            value
10877        }
10878    }
10879
10880    unsafe impl fidl::encoding::TypeMarker for SetTranslationCmd {
10881        type Owned = Self;
10882
10883        #[inline(always)]
10884        fn inline_align(_context: fidl::encoding::Context) -> usize {
10885            4
10886        }
10887
10888        #[inline(always)]
10889        fn inline_size(_context: fidl::encoding::Context) -> usize {
10890            20
10891        }
10892    }
10893
10894    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTranslationCmd, D>
10895        for &SetTranslationCmd
10896    {
10897        #[inline]
10898        unsafe fn encode(
10899            self,
10900            encoder: &mut fidl::encoding::Encoder<'_, D>,
10901            offset: usize,
10902            _depth: fidl::encoding::Depth,
10903        ) -> fidl::Result<()> {
10904            encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10905            // Delegate to tuple encoding.
10906            fidl::encoding::Encode::<SetTranslationCmd, D>::encode(
10907                (
10908                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10909                    <Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
10910                ),
10911                encoder,
10912                offset,
10913                _depth,
10914            )
10915        }
10916    }
10917    unsafe impl<
10918            D: fidl::encoding::ResourceDialect,
10919            T0: fidl::encoding::Encode<u32, D>,
10920            T1: fidl::encoding::Encode<Vector3Value, D>,
10921        > fidl::encoding::Encode<SetTranslationCmd, D> for (T0, T1)
10922    {
10923        #[inline]
10924        unsafe fn encode(
10925            self,
10926            encoder: &mut fidl::encoding::Encoder<'_, D>,
10927            offset: usize,
10928            depth: fidl::encoding::Depth,
10929        ) -> fidl::Result<()> {
10930            encoder.debug_check_bounds::<SetTranslationCmd>(offset);
10931            // Zero out padding regions. There's no need to apply masks
10932            // because the unmasked parts will be overwritten by fields.
10933            // Write the fields.
10934            self.0.encode(encoder, offset + 0, depth)?;
10935            self.1.encode(encoder, offset + 4, depth)?;
10936            Ok(())
10937        }
10938    }
10939
10940    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTranslationCmd {
10941        #[inline(always)]
10942        fn new_empty() -> Self {
10943            Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
10944        }
10945
10946        #[inline]
10947        unsafe fn decode(
10948            &mut self,
10949            decoder: &mut fidl::encoding::Decoder<'_, D>,
10950            offset: usize,
10951            _depth: fidl::encoding::Depth,
10952        ) -> fidl::Result<()> {
10953            decoder.debug_check_bounds::<Self>(offset);
10954            // Verify that padding bytes are zero.
10955            fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
10956            fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
10957            Ok(())
10958        }
10959    }
10960
10961    impl fidl::encoding::ValueTypeMarker for SetViewHolderBoundsColorCmd {
10962        type Borrowed<'a> = &'a Self;
10963        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10964            value
10965        }
10966    }
10967
10968    unsafe impl fidl::encoding::TypeMarker for SetViewHolderBoundsColorCmd {
10969        type Owned = Self;
10970
10971        #[inline(always)]
10972        fn inline_align(_context: fidl::encoding::Context) -> usize {
10973            4
10974        }
10975
10976        #[inline(always)]
10977        fn inline_size(_context: fidl::encoding::Context) -> usize {
10978            20
10979        }
10980    }
10981
10982    unsafe impl<D: fidl::encoding::ResourceDialect>
10983        fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for &SetViewHolderBoundsColorCmd
10984    {
10985        #[inline]
10986        unsafe fn encode(
10987            self,
10988            encoder: &mut fidl::encoding::Encoder<'_, D>,
10989            offset: usize,
10990            _depth: fidl::encoding::Depth,
10991        ) -> fidl::Result<()> {
10992            encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
10993            // Delegate to tuple encoding.
10994            fidl::encoding::Encode::<SetViewHolderBoundsColorCmd, D>::encode(
10995                (
10996                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
10997                    <ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
10998                ),
10999                encoder,
11000                offset,
11001                _depth,
11002            )
11003        }
11004    }
11005    unsafe impl<
11006            D: fidl::encoding::ResourceDialect,
11007            T0: fidl::encoding::Encode<u32, D>,
11008            T1: fidl::encoding::Encode<ColorRgbValue, D>,
11009        > fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for (T0, T1)
11010    {
11011        #[inline]
11012        unsafe fn encode(
11013            self,
11014            encoder: &mut fidl::encoding::Encoder<'_, D>,
11015            offset: usize,
11016            depth: fidl::encoding::Depth,
11017        ) -> fidl::Result<()> {
11018            encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
11019            // Zero out padding regions. There's no need to apply masks
11020            // because the unmasked parts will be overwritten by fields.
11021            // Write the fields.
11022            self.0.encode(encoder, offset + 0, depth)?;
11023            self.1.encode(encoder, offset + 4, depth)?;
11024            Ok(())
11025        }
11026    }
11027
11028    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11029        for SetViewHolderBoundsColorCmd
11030    {
11031        #[inline(always)]
11032        fn new_empty() -> Self {
11033            Self {
11034                view_holder_id: fidl::new_empty!(u32, D),
11035                color: fidl::new_empty!(ColorRgbValue, D),
11036            }
11037        }
11038
11039        #[inline]
11040        unsafe fn decode(
11041            &mut self,
11042            decoder: &mut fidl::encoding::Decoder<'_, D>,
11043            offset: usize,
11044            _depth: fidl::encoding::Depth,
11045        ) -> fidl::Result<()> {
11046            decoder.debug_check_bounds::<Self>(offset);
11047            // Verify that padding bytes are zero.
11048            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11049            fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
11050            Ok(())
11051        }
11052    }
11053
11054    impl fidl::encoding::ValueTypeMarker for SetViewPropertiesCmd {
11055        type Borrowed<'a> = &'a Self;
11056        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11057            value
11058        }
11059    }
11060
11061    unsafe impl fidl::encoding::TypeMarker for SetViewPropertiesCmd {
11062        type Owned = Self;
11063
11064        #[inline(always)]
11065        fn inline_align(_context: fidl::encoding::Context) -> usize {
11066            4
11067        }
11068
11069        #[inline(always)]
11070        fn inline_size(_context: fidl::encoding::Context) -> usize {
11071            56
11072        }
11073    }
11074
11075    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetViewPropertiesCmd, D>
11076        for &SetViewPropertiesCmd
11077    {
11078        #[inline]
11079        unsafe fn encode(
11080            self,
11081            encoder: &mut fidl::encoding::Encoder<'_, D>,
11082            offset: usize,
11083            _depth: fidl::encoding::Depth,
11084        ) -> fidl::Result<()> {
11085            encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11086            // Delegate to tuple encoding.
11087            fidl::encoding::Encode::<SetViewPropertiesCmd, D>::encode(
11088                (
11089                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
11090                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11091                ),
11092                encoder,
11093                offset,
11094                _depth,
11095            )
11096        }
11097    }
11098    unsafe impl<
11099            D: fidl::encoding::ResourceDialect,
11100            T0: fidl::encoding::Encode<u32, D>,
11101            T1: fidl::encoding::Encode<ViewProperties, D>,
11102        > fidl::encoding::Encode<SetViewPropertiesCmd, D> for (T0, T1)
11103    {
11104        #[inline]
11105        unsafe fn encode(
11106            self,
11107            encoder: &mut fidl::encoding::Encoder<'_, D>,
11108            offset: usize,
11109            depth: fidl::encoding::Depth,
11110        ) -> fidl::Result<()> {
11111            encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
11112            // Zero out padding regions. There's no need to apply masks
11113            // because the unmasked parts will be overwritten by fields.
11114            // Write the fields.
11115            self.0.encode(encoder, offset + 0, depth)?;
11116            self.1.encode(encoder, offset + 4, depth)?;
11117            Ok(())
11118        }
11119    }
11120
11121    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetViewPropertiesCmd {
11122        #[inline(always)]
11123        fn new_empty() -> Self {
11124            Self {
11125                view_holder_id: fidl::new_empty!(u32, D),
11126                properties: fidl::new_empty!(ViewProperties, D),
11127            }
11128        }
11129
11130        #[inline]
11131        unsafe fn decode(
11132            &mut self,
11133            decoder: &mut fidl::encoding::Decoder<'_, D>,
11134            offset: usize,
11135            _depth: fidl::encoding::Depth,
11136        ) -> fidl::Result<()> {
11137            decoder.debug_check_bounds::<Self>(offset);
11138            // Verify that padding bytes are zero.
11139            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
11140            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11141            Ok(())
11142        }
11143    }
11144
11145    impl fidl::encoding::ValueTypeMarker for ShapeNodeArgs {
11146        type Borrowed<'a> = &'a Self;
11147        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11148            value
11149        }
11150    }
11151
11152    unsafe impl fidl::encoding::TypeMarker for ShapeNodeArgs {
11153        type Owned = Self;
11154
11155        #[inline(always)]
11156        fn inline_align(_context: fidl::encoding::Context) -> usize {
11157            4
11158        }
11159
11160        #[inline(always)]
11161        fn inline_size(_context: fidl::encoding::Context) -> usize {
11162            4
11163        }
11164        #[inline(always)]
11165        fn encode_is_copy() -> bool {
11166            true
11167        }
11168
11169        #[inline(always)]
11170        fn decode_is_copy() -> bool {
11171            true
11172        }
11173    }
11174
11175    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ShapeNodeArgs, D>
11176        for &ShapeNodeArgs
11177    {
11178        #[inline]
11179        unsafe fn encode(
11180            self,
11181            encoder: &mut fidl::encoding::Encoder<'_, D>,
11182            offset: usize,
11183            _depth: fidl::encoding::Depth,
11184        ) -> fidl::Result<()> {
11185            encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11186            unsafe {
11187                // Copy the object into the buffer.
11188                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11189                (buf_ptr as *mut ShapeNodeArgs)
11190                    .write_unaligned((self as *const ShapeNodeArgs).read());
11191                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11192                // done second because the memcpy will write garbage to these bytes.
11193            }
11194            Ok(())
11195        }
11196    }
11197    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11198        fidl::encoding::Encode<ShapeNodeArgs, D> for (T0,)
11199    {
11200        #[inline]
11201        unsafe fn encode(
11202            self,
11203            encoder: &mut fidl::encoding::Encoder<'_, D>,
11204            offset: usize,
11205            depth: fidl::encoding::Depth,
11206        ) -> fidl::Result<()> {
11207            encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
11208            // Zero out padding regions. There's no need to apply masks
11209            // because the unmasked parts will be overwritten by fields.
11210            // Write the fields.
11211            self.0.encode(encoder, offset + 0, depth)?;
11212            Ok(())
11213        }
11214    }
11215
11216    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShapeNodeArgs {
11217        #[inline(always)]
11218        fn new_empty() -> Self {
11219            Self { unused: fidl::new_empty!(u32, D) }
11220        }
11221
11222        #[inline]
11223        unsafe fn decode(
11224            &mut self,
11225            decoder: &mut fidl::encoding::Decoder<'_, D>,
11226            offset: usize,
11227            _depth: fidl::encoding::Depth,
11228        ) -> fidl::Result<()> {
11229            decoder.debug_check_bounds::<Self>(offset);
11230            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11231            // Verify that padding bytes are zero.
11232            // Copy from the buffer into the object.
11233            unsafe {
11234                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11235            }
11236            Ok(())
11237        }
11238    }
11239
11240    impl fidl::encoding::ValueTypeMarker for SizeChangeHintEvent {
11241        type Borrowed<'a> = &'a Self;
11242        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11243            value
11244        }
11245    }
11246
11247    unsafe impl fidl::encoding::TypeMarker for SizeChangeHintEvent {
11248        type Owned = Self;
11249
11250        #[inline(always)]
11251        fn inline_align(_context: fidl::encoding::Context) -> usize {
11252            4
11253        }
11254
11255        #[inline(always)]
11256        fn inline_size(_context: fidl::encoding::Context) -> usize {
11257            12
11258        }
11259    }
11260
11261    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SizeChangeHintEvent, D>
11262        for &SizeChangeHintEvent
11263    {
11264        #[inline]
11265        unsafe fn encode(
11266            self,
11267            encoder: &mut fidl::encoding::Encoder<'_, D>,
11268            offset: usize,
11269            _depth: fidl::encoding::Depth,
11270        ) -> fidl::Result<()> {
11271            encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11272            // Delegate to tuple encoding.
11273            fidl::encoding::Encode::<SizeChangeHintEvent, D>::encode(
11274                (
11275                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
11276                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
11277                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
11278                ),
11279                encoder,
11280                offset,
11281                _depth,
11282            )
11283        }
11284    }
11285    unsafe impl<
11286            D: fidl::encoding::ResourceDialect,
11287            T0: fidl::encoding::Encode<u32, D>,
11288            T1: fidl::encoding::Encode<f32, D>,
11289            T2: fidl::encoding::Encode<f32, D>,
11290        > fidl::encoding::Encode<SizeChangeHintEvent, D> for (T0, T1, T2)
11291    {
11292        #[inline]
11293        unsafe fn encode(
11294            self,
11295            encoder: &mut fidl::encoding::Encoder<'_, D>,
11296            offset: usize,
11297            depth: fidl::encoding::Depth,
11298        ) -> fidl::Result<()> {
11299            encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
11300            // Zero out padding regions. There's no need to apply masks
11301            // because the unmasked parts will be overwritten by fields.
11302            // Write the fields.
11303            self.0.encode(encoder, offset + 0, depth)?;
11304            self.1.encode(encoder, offset + 4, depth)?;
11305            self.2.encode(encoder, offset + 8, depth)?;
11306            Ok(())
11307        }
11308    }
11309
11310    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SizeChangeHintEvent {
11311        #[inline(always)]
11312        fn new_empty() -> Self {
11313            Self {
11314                node_id: fidl::new_empty!(u32, D),
11315                width_change_factor: fidl::new_empty!(f32, D),
11316                height_change_factor: fidl::new_empty!(f32, D),
11317            }
11318        }
11319
11320        #[inline]
11321        unsafe fn decode(
11322            &mut self,
11323            decoder: &mut fidl::encoding::Decoder<'_, D>,
11324            offset: usize,
11325            _depth: fidl::encoding::Depth,
11326        ) -> fidl::Result<()> {
11327            decoder.debug_check_bounds::<Self>(offset);
11328            // Verify that padding bytes are zero.
11329            fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
11330            fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
11331            fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
11332            Ok(())
11333        }
11334    }
11335
11336    impl fidl::encoding::ValueTypeMarker for StereoCameraArgs {
11337        type Borrowed<'a> = &'a Self;
11338        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11339            value
11340        }
11341    }
11342
11343    unsafe impl fidl::encoding::TypeMarker for StereoCameraArgs {
11344        type Owned = Self;
11345
11346        #[inline(always)]
11347        fn inline_align(_context: fidl::encoding::Context) -> usize {
11348            4
11349        }
11350
11351        #[inline(always)]
11352        fn inline_size(_context: fidl::encoding::Context) -> usize {
11353            4
11354        }
11355        #[inline(always)]
11356        fn encode_is_copy() -> bool {
11357            true
11358        }
11359
11360        #[inline(always)]
11361        fn decode_is_copy() -> bool {
11362            true
11363        }
11364    }
11365
11366    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StereoCameraArgs, D>
11367        for &StereoCameraArgs
11368    {
11369        #[inline]
11370        unsafe fn encode(
11371            self,
11372            encoder: &mut fidl::encoding::Encoder<'_, D>,
11373            offset: usize,
11374            _depth: fidl::encoding::Depth,
11375        ) -> fidl::Result<()> {
11376            encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11377            unsafe {
11378                // Copy the object into the buffer.
11379                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11380                (buf_ptr as *mut StereoCameraArgs)
11381                    .write_unaligned((self as *const StereoCameraArgs).read());
11382                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11383                // done second because the memcpy will write garbage to these bytes.
11384            }
11385            Ok(())
11386        }
11387    }
11388    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11389        fidl::encoding::Encode<StereoCameraArgs, D> for (T0,)
11390    {
11391        #[inline]
11392        unsafe fn encode(
11393            self,
11394            encoder: &mut fidl::encoding::Encoder<'_, D>,
11395            offset: usize,
11396            depth: fidl::encoding::Depth,
11397        ) -> fidl::Result<()> {
11398            encoder.debug_check_bounds::<StereoCameraArgs>(offset);
11399            // Zero out padding regions. There's no need to apply masks
11400            // because the unmasked parts will be overwritten by fields.
11401            // Write the fields.
11402            self.0.encode(encoder, offset + 0, depth)?;
11403            Ok(())
11404        }
11405    }
11406
11407    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StereoCameraArgs {
11408        #[inline(always)]
11409        fn new_empty() -> Self {
11410            Self { scene_id: fidl::new_empty!(u32, D) }
11411        }
11412
11413        #[inline]
11414        unsafe fn decode(
11415            &mut self,
11416            decoder: &mut fidl::encoding::Decoder<'_, D>,
11417            offset: usize,
11418            _depth: fidl::encoding::Depth,
11419        ) -> fidl::Result<()> {
11420            decoder.debug_check_bounds::<Self>(offset);
11421            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11422            // Verify that padding bytes are zero.
11423            // Copy from the buffer into the object.
11424            unsafe {
11425                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11426            }
11427            Ok(())
11428        }
11429    }
11430
11431    impl fidl::encoding::ValueTypeMarker for VariableArgs {
11432        type Borrowed<'a> = &'a Self;
11433        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11434            value
11435        }
11436    }
11437
11438    unsafe impl fidl::encoding::TypeMarker for VariableArgs {
11439        type Owned = Self;
11440
11441        #[inline(always)]
11442        fn inline_align(_context: fidl::encoding::Context) -> usize {
11443            8
11444        }
11445
11446        #[inline(always)]
11447        fn inline_size(_context: fidl::encoding::Context) -> usize {
11448            24
11449        }
11450    }
11451
11452    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VariableArgs, D>
11453        for &VariableArgs
11454    {
11455        #[inline]
11456        unsafe fn encode(
11457            self,
11458            encoder: &mut fidl::encoding::Encoder<'_, D>,
11459            offset: usize,
11460            _depth: fidl::encoding::Depth,
11461        ) -> fidl::Result<()> {
11462            encoder.debug_check_bounds::<VariableArgs>(offset);
11463            // Delegate to tuple encoding.
11464            fidl::encoding::Encode::<VariableArgs, D>::encode(
11465                (
11466                    <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
11467                    <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.initial_value),
11468                ),
11469                encoder,
11470                offset,
11471                _depth,
11472            )
11473        }
11474    }
11475    unsafe impl<
11476            D: fidl::encoding::ResourceDialect,
11477            T0: fidl::encoding::Encode<ValueType, D>,
11478            T1: fidl::encoding::Encode<Value, D>,
11479        > fidl::encoding::Encode<VariableArgs, D> for (T0, T1)
11480    {
11481        #[inline]
11482        unsafe fn encode(
11483            self,
11484            encoder: &mut fidl::encoding::Encoder<'_, D>,
11485            offset: usize,
11486            depth: fidl::encoding::Depth,
11487        ) -> fidl::Result<()> {
11488            encoder.debug_check_bounds::<VariableArgs>(offset);
11489            // Zero out padding regions. There's no need to apply masks
11490            // because the unmasked parts will be overwritten by fields.
11491            unsafe {
11492                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11493                (ptr as *mut u64).write_unaligned(0);
11494            }
11495            // Write the fields.
11496            self.0.encode(encoder, offset + 0, depth)?;
11497            self.1.encode(encoder, offset + 8, depth)?;
11498            Ok(())
11499        }
11500    }
11501
11502    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VariableArgs {
11503        #[inline(always)]
11504        fn new_empty() -> Self {
11505            Self {
11506                type_: fidl::new_empty!(ValueType, D),
11507                initial_value: fidl::new_empty!(Value, D),
11508            }
11509        }
11510
11511        #[inline]
11512        unsafe fn decode(
11513            &mut self,
11514            decoder: &mut fidl::encoding::Decoder<'_, D>,
11515            offset: usize,
11516            _depth: fidl::encoding::Depth,
11517        ) -> fidl::Result<()> {
11518            decoder.debug_check_bounds::<Self>(offset);
11519            // Verify that padding bytes are zero.
11520            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11521            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11522            let mask = 0xffffffff00000000u64;
11523            let maskedval = padval & mask;
11524            if maskedval != 0 {
11525                return Err(fidl::Error::NonZeroPadding {
11526                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11527                });
11528            }
11529            fidl::decode!(ValueType, D, &mut self.type_, decoder, offset + 0, _depth)?;
11530            fidl::decode!(Value, D, &mut self.initial_value, decoder, offset + 8, _depth)?;
11531            Ok(())
11532        }
11533    }
11534
11535    impl fidl::encoding::ValueTypeMarker for Vector2Value {
11536        type Borrowed<'a> = &'a Self;
11537        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11538            value
11539        }
11540    }
11541
11542    unsafe impl fidl::encoding::TypeMarker for Vector2Value {
11543        type Owned = Self;
11544
11545        #[inline(always)]
11546        fn inline_align(_context: fidl::encoding::Context) -> usize {
11547            4
11548        }
11549
11550        #[inline(always)]
11551        fn inline_size(_context: fidl::encoding::Context) -> usize {
11552            12
11553        }
11554    }
11555
11556    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector2Value, D>
11557        for &Vector2Value
11558    {
11559        #[inline]
11560        unsafe fn encode(
11561            self,
11562            encoder: &mut fidl::encoding::Encoder<'_, D>,
11563            offset: usize,
11564            _depth: fidl::encoding::Depth,
11565        ) -> fidl::Result<()> {
11566            encoder.debug_check_bounds::<Vector2Value>(offset);
11567            // Delegate to tuple encoding.
11568            fidl::encoding::Encode::<Vector2Value, D>::encode(
11569                (
11570                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11571                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11572                ),
11573                encoder,
11574                offset,
11575                _depth,
11576            )
11577        }
11578    }
11579    unsafe impl<
11580            D: fidl::encoding::ResourceDialect,
11581            T0: fidl::encoding::Encode<Vec2, D>,
11582            T1: fidl::encoding::Encode<u32, D>,
11583        > fidl::encoding::Encode<Vector2Value, D> for (T0, T1)
11584    {
11585        #[inline]
11586        unsafe fn encode(
11587            self,
11588            encoder: &mut fidl::encoding::Encoder<'_, D>,
11589            offset: usize,
11590            depth: fidl::encoding::Depth,
11591        ) -> fidl::Result<()> {
11592            encoder.debug_check_bounds::<Vector2Value>(offset);
11593            // Zero out padding regions. There's no need to apply masks
11594            // because the unmasked parts will be overwritten by fields.
11595            // Write the fields.
11596            self.0.encode(encoder, offset + 0, depth)?;
11597            self.1.encode(encoder, offset + 8, depth)?;
11598            Ok(())
11599        }
11600    }
11601
11602    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector2Value {
11603        #[inline(always)]
11604        fn new_empty() -> Self {
11605            Self { value: fidl::new_empty!(Vec2, D), variable_id: fidl::new_empty!(u32, D) }
11606        }
11607
11608        #[inline]
11609        unsafe fn decode(
11610            &mut self,
11611            decoder: &mut fidl::encoding::Decoder<'_, D>,
11612            offset: usize,
11613            _depth: fidl::encoding::Depth,
11614        ) -> fidl::Result<()> {
11615            decoder.debug_check_bounds::<Self>(offset);
11616            // Verify that padding bytes are zero.
11617            fidl::decode!(Vec2, D, &mut self.value, decoder, offset + 0, _depth)?;
11618            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 8, _depth)?;
11619            Ok(())
11620        }
11621    }
11622
11623    impl fidl::encoding::ValueTypeMarker for Vector3Value {
11624        type Borrowed<'a> = &'a Self;
11625        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11626            value
11627        }
11628    }
11629
11630    unsafe impl fidl::encoding::TypeMarker for Vector3Value {
11631        type Owned = Self;
11632
11633        #[inline(always)]
11634        fn inline_align(_context: fidl::encoding::Context) -> usize {
11635            4
11636        }
11637
11638        #[inline(always)]
11639        fn inline_size(_context: fidl::encoding::Context) -> usize {
11640            16
11641        }
11642    }
11643
11644    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector3Value, D>
11645        for &Vector3Value
11646    {
11647        #[inline]
11648        unsafe fn encode(
11649            self,
11650            encoder: &mut fidl::encoding::Encoder<'_, D>,
11651            offset: usize,
11652            _depth: fidl::encoding::Depth,
11653        ) -> fidl::Result<()> {
11654            encoder.debug_check_bounds::<Vector3Value>(offset);
11655            // Delegate to tuple encoding.
11656            fidl::encoding::Encode::<Vector3Value, D>::encode(
11657                (
11658                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11659                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11660                ),
11661                encoder,
11662                offset,
11663                _depth,
11664            )
11665        }
11666    }
11667    unsafe impl<
11668            D: fidl::encoding::ResourceDialect,
11669            T0: fidl::encoding::Encode<Vec3, D>,
11670            T1: fidl::encoding::Encode<u32, D>,
11671        > fidl::encoding::Encode<Vector3Value, D> for (T0, T1)
11672    {
11673        #[inline]
11674        unsafe fn encode(
11675            self,
11676            encoder: &mut fidl::encoding::Encoder<'_, D>,
11677            offset: usize,
11678            depth: fidl::encoding::Depth,
11679        ) -> fidl::Result<()> {
11680            encoder.debug_check_bounds::<Vector3Value>(offset);
11681            // Zero out padding regions. There's no need to apply masks
11682            // because the unmasked parts will be overwritten by fields.
11683            // Write the fields.
11684            self.0.encode(encoder, offset + 0, depth)?;
11685            self.1.encode(encoder, offset + 12, depth)?;
11686            Ok(())
11687        }
11688    }
11689
11690    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector3Value {
11691        #[inline(always)]
11692        fn new_empty() -> Self {
11693            Self { value: fidl::new_empty!(Vec3, D), variable_id: fidl::new_empty!(u32, D) }
11694        }
11695
11696        #[inline]
11697        unsafe fn decode(
11698            &mut self,
11699            decoder: &mut fidl::encoding::Decoder<'_, D>,
11700            offset: usize,
11701            _depth: fidl::encoding::Depth,
11702        ) -> fidl::Result<()> {
11703            decoder.debug_check_bounds::<Self>(offset);
11704            // Verify that padding bytes are zero.
11705            fidl::decode!(Vec3, D, &mut self.value, decoder, offset + 0, _depth)?;
11706            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
11707            Ok(())
11708        }
11709    }
11710
11711    impl fidl::encoding::ValueTypeMarker for Vector4Value {
11712        type Borrowed<'a> = &'a Self;
11713        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11714            value
11715        }
11716    }
11717
11718    unsafe impl fidl::encoding::TypeMarker for Vector4Value {
11719        type Owned = Self;
11720
11721        #[inline(always)]
11722        fn inline_align(_context: fidl::encoding::Context) -> usize {
11723            4
11724        }
11725
11726        #[inline(always)]
11727        fn inline_size(_context: fidl::encoding::Context) -> usize {
11728            20
11729        }
11730    }
11731
11732    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector4Value, D>
11733        for &Vector4Value
11734    {
11735        #[inline]
11736        unsafe fn encode(
11737            self,
11738            encoder: &mut fidl::encoding::Encoder<'_, D>,
11739            offset: usize,
11740            _depth: fidl::encoding::Depth,
11741        ) -> fidl::Result<()> {
11742            encoder.debug_check_bounds::<Vector4Value>(offset);
11743            // Delegate to tuple encoding.
11744            fidl::encoding::Encode::<Vector4Value, D>::encode(
11745                (
11746                    <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11747                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
11748                ),
11749                encoder,
11750                offset,
11751                _depth,
11752            )
11753        }
11754    }
11755    unsafe impl<
11756            D: fidl::encoding::ResourceDialect,
11757            T0: fidl::encoding::Encode<Vec4, D>,
11758            T1: fidl::encoding::Encode<u32, D>,
11759        > fidl::encoding::Encode<Vector4Value, D> for (T0, T1)
11760    {
11761        #[inline]
11762        unsafe fn encode(
11763            self,
11764            encoder: &mut fidl::encoding::Encoder<'_, D>,
11765            offset: usize,
11766            depth: fidl::encoding::Depth,
11767        ) -> fidl::Result<()> {
11768            encoder.debug_check_bounds::<Vector4Value>(offset);
11769            // Zero out padding regions. There's no need to apply masks
11770            // because the unmasked parts will be overwritten by fields.
11771            // Write the fields.
11772            self.0.encode(encoder, offset + 0, depth)?;
11773            self.1.encode(encoder, offset + 16, depth)?;
11774            Ok(())
11775        }
11776    }
11777
11778    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector4Value {
11779        #[inline(always)]
11780        fn new_empty() -> Self {
11781            Self { value: fidl::new_empty!(Vec4, D), variable_id: fidl::new_empty!(u32, D) }
11782        }
11783
11784        #[inline]
11785        unsafe fn decode(
11786            &mut self,
11787            decoder: &mut fidl::encoding::Decoder<'_, D>,
11788            offset: usize,
11789            _depth: fidl::encoding::Depth,
11790        ) -> fidl::Result<()> {
11791            decoder.debug_check_bounds::<Self>(offset);
11792            // Verify that padding bytes are zero.
11793            fidl::decode!(Vec4, D, &mut self.value, decoder, offset + 0, _depth)?;
11794            fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
11795            Ok(())
11796        }
11797    }
11798
11799    impl fidl::encoding::ValueTypeMarker for ViewAttachedToSceneEvent {
11800        type Borrowed<'a> = &'a Self;
11801        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11802            value
11803        }
11804    }
11805
11806    unsafe impl fidl::encoding::TypeMarker for ViewAttachedToSceneEvent {
11807        type Owned = Self;
11808
11809        #[inline(always)]
11810        fn inline_align(_context: fidl::encoding::Context) -> usize {
11811            4
11812        }
11813
11814        #[inline(always)]
11815        fn inline_size(_context: fidl::encoding::Context) -> usize {
11816            56
11817        }
11818    }
11819
11820    unsafe impl<D: fidl::encoding::ResourceDialect>
11821        fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for &ViewAttachedToSceneEvent
11822    {
11823        #[inline]
11824        unsafe fn encode(
11825            self,
11826            encoder: &mut fidl::encoding::Encoder<'_, D>,
11827            offset: usize,
11828            _depth: fidl::encoding::Depth,
11829        ) -> fidl::Result<()> {
11830            encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11831            // Delegate to tuple encoding.
11832            fidl::encoding::Encode::<ViewAttachedToSceneEvent, D>::encode(
11833                (
11834                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
11835                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11836                ),
11837                encoder,
11838                offset,
11839                _depth,
11840            )
11841        }
11842    }
11843    unsafe impl<
11844            D: fidl::encoding::ResourceDialect,
11845            T0: fidl::encoding::Encode<u32, D>,
11846            T1: fidl::encoding::Encode<ViewProperties, D>,
11847        > fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for (T0, T1)
11848    {
11849        #[inline]
11850        unsafe fn encode(
11851            self,
11852            encoder: &mut fidl::encoding::Encoder<'_, D>,
11853            offset: usize,
11854            depth: fidl::encoding::Depth,
11855        ) -> fidl::Result<()> {
11856            encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
11857            // Zero out padding regions. There's no need to apply masks
11858            // because the unmasked parts will be overwritten by fields.
11859            // Write the fields.
11860            self.0.encode(encoder, offset + 0, depth)?;
11861            self.1.encode(encoder, offset + 4, depth)?;
11862            Ok(())
11863        }
11864    }
11865
11866    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11867        for ViewAttachedToSceneEvent
11868    {
11869        #[inline(always)]
11870        fn new_empty() -> Self {
11871            Self {
11872                view_id: fidl::new_empty!(u32, D),
11873                properties: fidl::new_empty!(ViewProperties, D),
11874            }
11875        }
11876
11877        #[inline]
11878        unsafe fn decode(
11879            &mut self,
11880            decoder: &mut fidl::encoding::Decoder<'_, D>,
11881            offset: usize,
11882            _depth: fidl::encoding::Depth,
11883        ) -> fidl::Result<()> {
11884            decoder.debug_check_bounds::<Self>(offset);
11885            // Verify that padding bytes are zero.
11886            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
11887            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
11888            Ok(())
11889        }
11890    }
11891
11892    impl fidl::encoding::ValueTypeMarker for ViewConnectedEvent {
11893        type Borrowed<'a> = &'a Self;
11894        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11895            value
11896        }
11897    }
11898
11899    unsafe impl fidl::encoding::TypeMarker for ViewConnectedEvent {
11900        type Owned = Self;
11901
11902        #[inline(always)]
11903        fn inline_align(_context: fidl::encoding::Context) -> usize {
11904            4
11905        }
11906
11907        #[inline(always)]
11908        fn inline_size(_context: fidl::encoding::Context) -> usize {
11909            4
11910        }
11911        #[inline(always)]
11912        fn encode_is_copy() -> bool {
11913            true
11914        }
11915
11916        #[inline(always)]
11917        fn decode_is_copy() -> bool {
11918            true
11919        }
11920    }
11921
11922    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewConnectedEvent, D>
11923        for &ViewConnectedEvent
11924    {
11925        #[inline]
11926        unsafe fn encode(
11927            self,
11928            encoder: &mut fidl::encoding::Encoder<'_, D>,
11929            offset: usize,
11930            _depth: fidl::encoding::Depth,
11931        ) -> fidl::Result<()> {
11932            encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
11933            unsafe {
11934                // Copy the object into the buffer.
11935                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11936                (buf_ptr as *mut ViewConnectedEvent)
11937                    .write_unaligned((self as *const ViewConnectedEvent).read());
11938                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11939                // done second because the memcpy will write garbage to these bytes.
11940            }
11941            Ok(())
11942        }
11943    }
11944    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11945        fidl::encoding::Encode<ViewConnectedEvent, D> for (T0,)
11946    {
11947        #[inline]
11948        unsafe fn encode(
11949            self,
11950            encoder: &mut fidl::encoding::Encoder<'_, D>,
11951            offset: usize,
11952            depth: fidl::encoding::Depth,
11953        ) -> fidl::Result<()> {
11954            encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
11955            // Zero out padding regions. There's no need to apply masks
11956            // because the unmasked parts will be overwritten by fields.
11957            // Write the fields.
11958            self.0.encode(encoder, offset + 0, depth)?;
11959            Ok(())
11960        }
11961    }
11962
11963    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewConnectedEvent {
11964        #[inline(always)]
11965        fn new_empty() -> Self {
11966            Self { view_holder_id: fidl::new_empty!(u32, D) }
11967        }
11968
11969        #[inline]
11970        unsafe fn decode(
11971            &mut self,
11972            decoder: &mut fidl::encoding::Decoder<'_, D>,
11973            offset: usize,
11974            _depth: fidl::encoding::Depth,
11975        ) -> fidl::Result<()> {
11976            decoder.debug_check_bounds::<Self>(offset);
11977            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11978            // Verify that padding bytes are zero.
11979            // Copy from the buffer into the object.
11980            unsafe {
11981                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11982            }
11983            Ok(())
11984        }
11985    }
11986
11987    impl fidl::encoding::ValueTypeMarker for ViewDetachedFromSceneEvent {
11988        type Borrowed<'a> = &'a Self;
11989        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11990            value
11991        }
11992    }
11993
11994    unsafe impl fidl::encoding::TypeMarker for ViewDetachedFromSceneEvent {
11995        type Owned = Self;
11996
11997        #[inline(always)]
11998        fn inline_align(_context: fidl::encoding::Context) -> usize {
11999            4
12000        }
12001
12002        #[inline(always)]
12003        fn inline_size(_context: fidl::encoding::Context) -> usize {
12004            4
12005        }
12006        #[inline(always)]
12007        fn encode_is_copy() -> bool {
12008            true
12009        }
12010
12011        #[inline(always)]
12012        fn decode_is_copy() -> bool {
12013            true
12014        }
12015    }
12016
12017    unsafe impl<D: fidl::encoding::ResourceDialect>
12018        fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for &ViewDetachedFromSceneEvent
12019    {
12020        #[inline]
12021        unsafe fn encode(
12022            self,
12023            encoder: &mut fidl::encoding::Encoder<'_, D>,
12024            offset: usize,
12025            _depth: fidl::encoding::Depth,
12026        ) -> fidl::Result<()> {
12027            encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12028            unsafe {
12029                // Copy the object into the buffer.
12030                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12031                (buf_ptr as *mut ViewDetachedFromSceneEvent)
12032                    .write_unaligned((self as *const ViewDetachedFromSceneEvent).read());
12033                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12034                // done second because the memcpy will write garbage to these bytes.
12035            }
12036            Ok(())
12037        }
12038    }
12039    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12040        fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for (T0,)
12041    {
12042        #[inline]
12043        unsafe fn encode(
12044            self,
12045            encoder: &mut fidl::encoding::Encoder<'_, D>,
12046            offset: usize,
12047            depth: fidl::encoding::Depth,
12048        ) -> fidl::Result<()> {
12049            encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
12050            // Zero out padding regions. There's no need to apply masks
12051            // because the unmasked parts will be overwritten by fields.
12052            // Write the fields.
12053            self.0.encode(encoder, offset + 0, depth)?;
12054            Ok(())
12055        }
12056    }
12057
12058    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12059        for ViewDetachedFromSceneEvent
12060    {
12061        #[inline(always)]
12062        fn new_empty() -> Self {
12063            Self { view_id: fidl::new_empty!(u32, D) }
12064        }
12065
12066        #[inline]
12067        unsafe fn decode(
12068            &mut self,
12069            decoder: &mut fidl::encoding::Decoder<'_, D>,
12070            offset: usize,
12071            _depth: fidl::encoding::Depth,
12072        ) -> fidl::Result<()> {
12073            decoder.debug_check_bounds::<Self>(offset);
12074            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12075            // Verify that padding bytes are zero.
12076            // Copy from the buffer into the object.
12077            unsafe {
12078                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12079            }
12080            Ok(())
12081        }
12082    }
12083
12084    impl fidl::encoding::ValueTypeMarker for ViewDisconnectedEvent {
12085        type Borrowed<'a> = &'a Self;
12086        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12087            value
12088        }
12089    }
12090
12091    unsafe impl fidl::encoding::TypeMarker for ViewDisconnectedEvent {
12092        type Owned = Self;
12093
12094        #[inline(always)]
12095        fn inline_align(_context: fidl::encoding::Context) -> usize {
12096            4
12097        }
12098
12099        #[inline(always)]
12100        fn inline_size(_context: fidl::encoding::Context) -> usize {
12101            4
12102        }
12103        #[inline(always)]
12104        fn encode_is_copy() -> bool {
12105            true
12106        }
12107
12108        #[inline(always)]
12109        fn decode_is_copy() -> bool {
12110            true
12111        }
12112    }
12113
12114    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewDisconnectedEvent, D>
12115        for &ViewDisconnectedEvent
12116    {
12117        #[inline]
12118        unsafe fn encode(
12119            self,
12120            encoder: &mut fidl::encoding::Encoder<'_, D>,
12121            offset: usize,
12122            _depth: fidl::encoding::Depth,
12123        ) -> fidl::Result<()> {
12124            encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12125            unsafe {
12126                // Copy the object into the buffer.
12127                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12128                (buf_ptr as *mut ViewDisconnectedEvent)
12129                    .write_unaligned((self as *const ViewDisconnectedEvent).read());
12130                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12131                // done second because the memcpy will write garbage to these bytes.
12132            }
12133            Ok(())
12134        }
12135    }
12136    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12137        fidl::encoding::Encode<ViewDisconnectedEvent, D> for (T0,)
12138    {
12139        #[inline]
12140        unsafe fn encode(
12141            self,
12142            encoder: &mut fidl::encoding::Encoder<'_, D>,
12143            offset: usize,
12144            depth: fidl::encoding::Depth,
12145        ) -> fidl::Result<()> {
12146            encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
12147            // Zero out padding regions. There's no need to apply masks
12148            // because the unmasked parts will be overwritten by fields.
12149            // Write the fields.
12150            self.0.encode(encoder, offset + 0, depth)?;
12151            Ok(())
12152        }
12153    }
12154
12155    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewDisconnectedEvent {
12156        #[inline(always)]
12157        fn new_empty() -> Self {
12158            Self { view_holder_id: fidl::new_empty!(u32, D) }
12159        }
12160
12161        #[inline]
12162        unsafe fn decode(
12163            &mut self,
12164            decoder: &mut fidl::encoding::Decoder<'_, D>,
12165            offset: usize,
12166            _depth: fidl::encoding::Depth,
12167        ) -> fidl::Result<()> {
12168            decoder.debug_check_bounds::<Self>(offset);
12169            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12170            // Verify that padding bytes are zero.
12171            // Copy from the buffer into the object.
12172            unsafe {
12173                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12174            }
12175            Ok(())
12176        }
12177    }
12178
12179    impl fidl::encoding::ValueTypeMarker for ViewHolderConnectedEvent {
12180        type Borrowed<'a> = &'a Self;
12181        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12182            value
12183        }
12184    }
12185
12186    unsafe impl fidl::encoding::TypeMarker for ViewHolderConnectedEvent {
12187        type Owned = Self;
12188
12189        #[inline(always)]
12190        fn inline_align(_context: fidl::encoding::Context) -> usize {
12191            4
12192        }
12193
12194        #[inline(always)]
12195        fn inline_size(_context: fidl::encoding::Context) -> usize {
12196            4
12197        }
12198        #[inline(always)]
12199        fn encode_is_copy() -> bool {
12200            true
12201        }
12202
12203        #[inline(always)]
12204        fn decode_is_copy() -> bool {
12205            true
12206        }
12207    }
12208
12209    unsafe impl<D: fidl::encoding::ResourceDialect>
12210        fidl::encoding::Encode<ViewHolderConnectedEvent, D> for &ViewHolderConnectedEvent
12211    {
12212        #[inline]
12213        unsafe fn encode(
12214            self,
12215            encoder: &mut fidl::encoding::Encoder<'_, D>,
12216            offset: usize,
12217            _depth: fidl::encoding::Depth,
12218        ) -> fidl::Result<()> {
12219            encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12220            unsafe {
12221                // Copy the object into the buffer.
12222                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12223                (buf_ptr as *mut ViewHolderConnectedEvent)
12224                    .write_unaligned((self as *const ViewHolderConnectedEvent).read());
12225                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12226                // done second because the memcpy will write garbage to these bytes.
12227            }
12228            Ok(())
12229        }
12230    }
12231    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12232        fidl::encoding::Encode<ViewHolderConnectedEvent, D> for (T0,)
12233    {
12234        #[inline]
12235        unsafe fn encode(
12236            self,
12237            encoder: &mut fidl::encoding::Encoder<'_, D>,
12238            offset: usize,
12239            depth: fidl::encoding::Depth,
12240        ) -> fidl::Result<()> {
12241            encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
12242            // Zero out padding regions. There's no need to apply masks
12243            // because the unmasked parts will be overwritten by fields.
12244            // Write the fields.
12245            self.0.encode(encoder, offset + 0, depth)?;
12246            Ok(())
12247        }
12248    }
12249
12250    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12251        for ViewHolderConnectedEvent
12252    {
12253        #[inline(always)]
12254        fn new_empty() -> Self {
12255            Self { view_id: fidl::new_empty!(u32, D) }
12256        }
12257
12258        #[inline]
12259        unsafe fn decode(
12260            &mut self,
12261            decoder: &mut fidl::encoding::Decoder<'_, D>,
12262            offset: usize,
12263            _depth: fidl::encoding::Depth,
12264        ) -> fidl::Result<()> {
12265            decoder.debug_check_bounds::<Self>(offset);
12266            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12267            // Verify that padding bytes are zero.
12268            // Copy from the buffer into the object.
12269            unsafe {
12270                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12271            }
12272            Ok(())
12273        }
12274    }
12275
12276    impl fidl::encoding::ValueTypeMarker for ViewHolderDisconnectedEvent {
12277        type Borrowed<'a> = &'a Self;
12278        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12279            value
12280        }
12281    }
12282
12283    unsafe impl fidl::encoding::TypeMarker for ViewHolderDisconnectedEvent {
12284        type Owned = Self;
12285
12286        #[inline(always)]
12287        fn inline_align(_context: fidl::encoding::Context) -> usize {
12288            4
12289        }
12290
12291        #[inline(always)]
12292        fn inline_size(_context: fidl::encoding::Context) -> usize {
12293            4
12294        }
12295        #[inline(always)]
12296        fn encode_is_copy() -> bool {
12297            true
12298        }
12299
12300        #[inline(always)]
12301        fn decode_is_copy() -> bool {
12302            true
12303        }
12304    }
12305
12306    unsafe impl<D: fidl::encoding::ResourceDialect>
12307        fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for &ViewHolderDisconnectedEvent
12308    {
12309        #[inline]
12310        unsafe fn encode(
12311            self,
12312            encoder: &mut fidl::encoding::Encoder<'_, D>,
12313            offset: usize,
12314            _depth: fidl::encoding::Depth,
12315        ) -> fidl::Result<()> {
12316            encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12317            unsafe {
12318                // Copy the object into the buffer.
12319                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12320                (buf_ptr as *mut ViewHolderDisconnectedEvent)
12321                    .write_unaligned((self as *const ViewHolderDisconnectedEvent).read());
12322                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12323                // done second because the memcpy will write garbage to these bytes.
12324            }
12325            Ok(())
12326        }
12327    }
12328    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12329        fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for (T0,)
12330    {
12331        #[inline]
12332        unsafe fn encode(
12333            self,
12334            encoder: &mut fidl::encoding::Encoder<'_, D>,
12335            offset: usize,
12336            depth: fidl::encoding::Depth,
12337        ) -> fidl::Result<()> {
12338            encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
12339            // Zero out padding regions. There's no need to apply masks
12340            // because the unmasked parts will be overwritten by fields.
12341            // Write the fields.
12342            self.0.encode(encoder, offset + 0, depth)?;
12343            Ok(())
12344        }
12345    }
12346
12347    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12348        for ViewHolderDisconnectedEvent
12349    {
12350        #[inline(always)]
12351        fn new_empty() -> Self {
12352            Self { view_id: fidl::new_empty!(u32, D) }
12353        }
12354
12355        #[inline]
12356        unsafe fn decode(
12357            &mut self,
12358            decoder: &mut fidl::encoding::Decoder<'_, D>,
12359            offset: usize,
12360            _depth: fidl::encoding::Depth,
12361        ) -> fidl::Result<()> {
12362            decoder.debug_check_bounds::<Self>(offset);
12363            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12364            // Verify that padding bytes are zero.
12365            // Copy from the buffer into the object.
12366            unsafe {
12367                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12368            }
12369            Ok(())
12370        }
12371    }
12372
12373    impl fidl::encoding::ValueTypeMarker for ViewProperties {
12374        type Borrowed<'a> = &'a Self;
12375        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12376            value
12377        }
12378    }
12379
12380    unsafe impl fidl::encoding::TypeMarker for ViewProperties {
12381        type Owned = Self;
12382
12383        #[inline(always)]
12384        fn inline_align(_context: fidl::encoding::Context) -> usize {
12385            4
12386        }
12387
12388        #[inline(always)]
12389        fn inline_size(_context: fidl::encoding::Context) -> usize {
12390            52
12391        }
12392    }
12393
12394    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewProperties, D>
12395        for &ViewProperties
12396    {
12397        #[inline]
12398        unsafe fn encode(
12399            self,
12400            encoder: &mut fidl::encoding::Encoder<'_, D>,
12401            offset: usize,
12402            _depth: fidl::encoding::Depth,
12403        ) -> fidl::Result<()> {
12404            encoder.debug_check_bounds::<ViewProperties>(offset);
12405            // Delegate to tuple encoding.
12406            fidl::encoding::Encode::<ViewProperties, D>::encode(
12407                (
12408                    <BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
12409                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_min),
12410                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_max),
12411                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.focus_change),
12412                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.downward_input),
12413                ),
12414                encoder,
12415                offset,
12416                _depth,
12417            )
12418        }
12419    }
12420    unsafe impl<
12421            D: fidl::encoding::ResourceDialect,
12422            T0: fidl::encoding::Encode<BoundingBox, D>,
12423            T1: fidl::encoding::Encode<Vec3, D>,
12424            T2: fidl::encoding::Encode<Vec3, D>,
12425            T3: fidl::encoding::Encode<bool, D>,
12426            T4: fidl::encoding::Encode<bool, D>,
12427        > fidl::encoding::Encode<ViewProperties, D> for (T0, T1, T2, T3, T4)
12428    {
12429        #[inline]
12430        unsafe fn encode(
12431            self,
12432            encoder: &mut fidl::encoding::Encoder<'_, D>,
12433            offset: usize,
12434            depth: fidl::encoding::Depth,
12435        ) -> fidl::Result<()> {
12436            encoder.debug_check_bounds::<ViewProperties>(offset);
12437            // Zero out padding regions. There's no need to apply masks
12438            // because the unmasked parts will be overwritten by fields.
12439            unsafe {
12440                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
12441                (ptr as *mut u32).write_unaligned(0);
12442            }
12443            // Write the fields.
12444            self.0.encode(encoder, offset + 0, depth)?;
12445            self.1.encode(encoder, offset + 24, depth)?;
12446            self.2.encode(encoder, offset + 36, depth)?;
12447            self.3.encode(encoder, offset + 48, depth)?;
12448            self.4.encode(encoder, offset + 49, depth)?;
12449            Ok(())
12450        }
12451    }
12452
12453    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewProperties {
12454        #[inline(always)]
12455        fn new_empty() -> Self {
12456            Self {
12457                bounding_box: fidl::new_empty!(BoundingBox, D),
12458                inset_from_min: fidl::new_empty!(Vec3, D),
12459                inset_from_max: fidl::new_empty!(Vec3, D),
12460                focus_change: fidl::new_empty!(bool, D),
12461                downward_input: fidl::new_empty!(bool, D),
12462            }
12463        }
12464
12465        #[inline]
12466        unsafe fn decode(
12467            &mut self,
12468            decoder: &mut fidl::encoding::Decoder<'_, D>,
12469            offset: usize,
12470            _depth: fidl::encoding::Depth,
12471        ) -> fidl::Result<()> {
12472            decoder.debug_check_bounds::<Self>(offset);
12473            // Verify that padding bytes are zero.
12474            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
12475            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12476            let mask = 0xffff0000u32;
12477            let maskedval = padval & mask;
12478            if maskedval != 0 {
12479                return Err(fidl::Error::NonZeroPadding {
12480                    padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
12481                });
12482            }
12483            fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 0, _depth)?;
12484            fidl::decode!(Vec3, D, &mut self.inset_from_min, decoder, offset + 24, _depth)?;
12485            fidl::decode!(Vec3, D, &mut self.inset_from_max, decoder, offset + 36, _depth)?;
12486            fidl::decode!(bool, D, &mut self.focus_change, decoder, offset + 48, _depth)?;
12487            fidl::decode!(bool, D, &mut self.downward_input, decoder, offset + 49, _depth)?;
12488            Ok(())
12489        }
12490    }
12491
12492    impl fidl::encoding::ValueTypeMarker for ViewPropertiesChangedEvent {
12493        type Borrowed<'a> = &'a Self;
12494        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12495            value
12496        }
12497    }
12498
12499    unsafe impl fidl::encoding::TypeMarker for ViewPropertiesChangedEvent {
12500        type Owned = Self;
12501
12502        #[inline(always)]
12503        fn inline_align(_context: fidl::encoding::Context) -> usize {
12504            4
12505        }
12506
12507        #[inline(always)]
12508        fn inline_size(_context: fidl::encoding::Context) -> usize {
12509            56
12510        }
12511    }
12512
12513    unsafe impl<D: fidl::encoding::ResourceDialect>
12514        fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for &ViewPropertiesChangedEvent
12515    {
12516        #[inline]
12517        unsafe fn encode(
12518            self,
12519            encoder: &mut fidl::encoding::Encoder<'_, D>,
12520            offset: usize,
12521            _depth: fidl::encoding::Depth,
12522        ) -> fidl::Result<()> {
12523            encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12524            // Delegate to tuple encoding.
12525            fidl::encoding::Encode::<ViewPropertiesChangedEvent, D>::encode(
12526                (
12527                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
12528                    <ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
12529                ),
12530                encoder,
12531                offset,
12532                _depth,
12533            )
12534        }
12535    }
12536    unsafe impl<
12537            D: fidl::encoding::ResourceDialect,
12538            T0: fidl::encoding::Encode<u32, D>,
12539            T1: fidl::encoding::Encode<ViewProperties, D>,
12540        > fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for (T0, T1)
12541    {
12542        #[inline]
12543        unsafe fn encode(
12544            self,
12545            encoder: &mut fidl::encoding::Encoder<'_, D>,
12546            offset: usize,
12547            depth: fidl::encoding::Depth,
12548        ) -> fidl::Result<()> {
12549            encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
12550            // Zero out padding regions. There's no need to apply masks
12551            // because the unmasked parts will be overwritten by fields.
12552            // Write the fields.
12553            self.0.encode(encoder, offset + 0, depth)?;
12554            self.1.encode(encoder, offset + 4, depth)?;
12555            Ok(())
12556        }
12557    }
12558
12559    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12560        for ViewPropertiesChangedEvent
12561    {
12562        #[inline(always)]
12563        fn new_empty() -> Self {
12564            Self {
12565                view_id: fidl::new_empty!(u32, D),
12566                properties: fidl::new_empty!(ViewProperties, D),
12567            }
12568        }
12569
12570        #[inline]
12571        unsafe fn decode(
12572            &mut self,
12573            decoder: &mut fidl::encoding::Decoder<'_, D>,
12574            offset: usize,
12575            _depth: fidl::encoding::Depth,
12576        ) -> fidl::Result<()> {
12577            decoder.debug_check_bounds::<Self>(offset);
12578            // Verify that padding bytes are zero.
12579            fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
12580            fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
12581            Ok(())
12582        }
12583    }
12584
12585    impl fidl::encoding::ValueTypeMarker for ViewState {
12586        type Borrowed<'a> = &'a Self;
12587        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12588            value
12589        }
12590    }
12591
12592    unsafe impl fidl::encoding::TypeMarker for ViewState {
12593        type Owned = Self;
12594
12595        #[inline(always)]
12596        fn inline_align(_context: fidl::encoding::Context) -> usize {
12597            1
12598        }
12599
12600        #[inline(always)]
12601        fn inline_size(_context: fidl::encoding::Context) -> usize {
12602            1
12603        }
12604    }
12605
12606    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewState, D>
12607        for &ViewState
12608    {
12609        #[inline]
12610        unsafe fn encode(
12611            self,
12612            encoder: &mut fidl::encoding::Encoder<'_, D>,
12613            offset: usize,
12614            _depth: fidl::encoding::Depth,
12615        ) -> fidl::Result<()> {
12616            encoder.debug_check_bounds::<ViewState>(offset);
12617            // Delegate to tuple encoding.
12618            fidl::encoding::Encode::<ViewState, D>::encode(
12619                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_rendering),),
12620                encoder,
12621                offset,
12622                _depth,
12623            )
12624        }
12625    }
12626    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
12627        fidl::encoding::Encode<ViewState, D> for (T0,)
12628    {
12629        #[inline]
12630        unsafe fn encode(
12631            self,
12632            encoder: &mut fidl::encoding::Encoder<'_, D>,
12633            offset: usize,
12634            depth: fidl::encoding::Depth,
12635        ) -> fidl::Result<()> {
12636            encoder.debug_check_bounds::<ViewState>(offset);
12637            // Zero out padding regions. There's no need to apply masks
12638            // because the unmasked parts will be overwritten by fields.
12639            // Write the fields.
12640            self.0.encode(encoder, offset + 0, depth)?;
12641            Ok(())
12642        }
12643    }
12644
12645    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewState {
12646        #[inline(always)]
12647        fn new_empty() -> Self {
12648            Self { is_rendering: fidl::new_empty!(bool, D) }
12649        }
12650
12651        #[inline]
12652        unsafe fn decode(
12653            &mut self,
12654            decoder: &mut fidl::encoding::Decoder<'_, D>,
12655            offset: usize,
12656            _depth: fidl::encoding::Depth,
12657        ) -> fidl::Result<()> {
12658            decoder.debug_check_bounds::<Self>(offset);
12659            // Verify that padding bytes are zero.
12660            fidl::decode!(bool, D, &mut self.is_rendering, decoder, offset + 0, _depth)?;
12661            Ok(())
12662        }
12663    }
12664
12665    impl fidl::encoding::ValueTypeMarker for ViewStateChangedEvent {
12666        type Borrowed<'a> = &'a Self;
12667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12668            value
12669        }
12670    }
12671
12672    unsafe impl fidl::encoding::TypeMarker for ViewStateChangedEvent {
12673        type Owned = Self;
12674
12675        #[inline(always)]
12676        fn inline_align(_context: fidl::encoding::Context) -> usize {
12677            4
12678        }
12679
12680        #[inline(always)]
12681        fn inline_size(_context: fidl::encoding::Context) -> usize {
12682            8
12683        }
12684    }
12685
12686    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewStateChangedEvent, D>
12687        for &ViewStateChangedEvent
12688    {
12689        #[inline]
12690        unsafe fn encode(
12691            self,
12692            encoder: &mut fidl::encoding::Encoder<'_, D>,
12693            offset: usize,
12694            _depth: fidl::encoding::Depth,
12695        ) -> fidl::Result<()> {
12696            encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12697            // Delegate to tuple encoding.
12698            fidl::encoding::Encode::<ViewStateChangedEvent, D>::encode(
12699                (
12700                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
12701                    <ViewState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
12702                ),
12703                encoder,
12704                offset,
12705                _depth,
12706            )
12707        }
12708    }
12709    unsafe impl<
12710            D: fidl::encoding::ResourceDialect,
12711            T0: fidl::encoding::Encode<u32, D>,
12712            T1: fidl::encoding::Encode<ViewState, D>,
12713        > fidl::encoding::Encode<ViewStateChangedEvent, D> for (T0, T1)
12714    {
12715        #[inline]
12716        unsafe fn encode(
12717            self,
12718            encoder: &mut fidl::encoding::Encoder<'_, D>,
12719            offset: usize,
12720            depth: fidl::encoding::Depth,
12721        ) -> fidl::Result<()> {
12722            encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
12723            // Zero out padding regions. There's no need to apply masks
12724            // because the unmasked parts will be overwritten by fields.
12725            unsafe {
12726                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
12727                (ptr as *mut u32).write_unaligned(0);
12728            }
12729            // Write the fields.
12730            self.0.encode(encoder, offset + 0, depth)?;
12731            self.1.encode(encoder, offset + 4, depth)?;
12732            Ok(())
12733        }
12734    }
12735
12736    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewStateChangedEvent {
12737        #[inline(always)]
12738        fn new_empty() -> Self {
12739            Self { view_holder_id: fidl::new_empty!(u32, D), state: fidl::new_empty!(ViewState, D) }
12740        }
12741
12742        #[inline]
12743        unsafe fn decode(
12744            &mut self,
12745            decoder: &mut fidl::encoding::Decoder<'_, D>,
12746            offset: usize,
12747            _depth: fidl::encoding::Depth,
12748        ) -> fidl::Result<()> {
12749            decoder.debug_check_bounds::<Self>(offset);
12750            // Verify that padding bytes are zero.
12751            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
12752            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12753            let mask = 0xffffff00u32;
12754            let maskedval = padval & mask;
12755            if maskedval != 0 {
12756                return Err(fidl::Error::NonZeroPadding {
12757                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
12758                });
12759            }
12760            fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
12761            fidl::decode!(ViewState, D, &mut self.state, decoder, offset + 4, _depth)?;
12762            Ok(())
12763        }
12764    }
12765
12766    impl fidl::encoding::ValueTypeMarker for Mat4 {
12767        type Borrowed<'a> = &'a Self;
12768        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12769            value
12770        }
12771    }
12772
12773    unsafe impl fidl::encoding::TypeMarker for Mat4 {
12774        type Owned = Self;
12775
12776        #[inline(always)]
12777        fn inline_align(_context: fidl::encoding::Context) -> usize {
12778            4
12779        }
12780
12781        #[inline(always)]
12782        fn inline_size(_context: fidl::encoding::Context) -> usize {
12783            64
12784        }
12785    }
12786
12787    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Mat4, D> for &Mat4 {
12788        #[inline]
12789        unsafe fn encode(
12790            self,
12791            encoder: &mut fidl::encoding::Encoder<'_, D>,
12792            offset: usize,
12793            _depth: fidl::encoding::Depth,
12794        ) -> fidl::Result<()> {
12795            encoder.debug_check_bounds::<Mat4>(offset);
12796            // Delegate to tuple encoding.
12797            fidl::encoding::Encode::<Mat4, D>::encode(
12798                (<fidl::encoding::Array<f32, 16> as fidl::encoding::ValueTypeMarker>::borrow(
12799                    &self.matrix,
12800                ),),
12801                encoder,
12802                offset,
12803                _depth,
12804            )
12805        }
12806    }
12807    unsafe impl<
12808            D: fidl::encoding::ResourceDialect,
12809            T0: fidl::encoding::Encode<fidl::encoding::Array<f32, 16>, D>,
12810        > fidl::encoding::Encode<Mat4, D> for (T0,)
12811    {
12812        #[inline]
12813        unsafe fn encode(
12814            self,
12815            encoder: &mut fidl::encoding::Encoder<'_, D>,
12816            offset: usize,
12817            depth: fidl::encoding::Depth,
12818        ) -> fidl::Result<()> {
12819            encoder.debug_check_bounds::<Mat4>(offset);
12820            // Zero out padding regions. There's no need to apply masks
12821            // because the unmasked parts will be overwritten by fields.
12822            // Write the fields.
12823            self.0.encode(encoder, offset + 0, depth)?;
12824            Ok(())
12825        }
12826    }
12827
12828    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Mat4 {
12829        #[inline(always)]
12830        fn new_empty() -> Self {
12831            Self { matrix: fidl::new_empty!(fidl::encoding::Array<f32, 16>, D) }
12832        }
12833
12834        #[inline]
12835        unsafe fn decode(
12836            &mut self,
12837            decoder: &mut fidl::encoding::Decoder<'_, D>,
12838            offset: usize,
12839            _depth: fidl::encoding::Depth,
12840        ) -> fidl::Result<()> {
12841            decoder.debug_check_bounds::<Self>(offset);
12842            // Verify that padding bytes are zero.
12843            fidl::decode!(fidl::encoding::Array<f32, 16>, D, &mut self.matrix, decoder, offset + 0, _depth)?;
12844            Ok(())
12845        }
12846    }
12847
12848    impl fidl::encoding::ValueTypeMarker for Vec2 {
12849        type Borrowed<'a> = &'a Self;
12850        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12851            value
12852        }
12853    }
12854
12855    unsafe impl fidl::encoding::TypeMarker for Vec2 {
12856        type Owned = Self;
12857
12858        #[inline(always)]
12859        fn inline_align(_context: fidl::encoding::Context) -> usize {
12860            4
12861        }
12862
12863        #[inline(always)]
12864        fn inline_size(_context: fidl::encoding::Context) -> usize {
12865            8
12866        }
12867    }
12868
12869    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec2, D> for &Vec2 {
12870        #[inline]
12871        unsafe fn encode(
12872            self,
12873            encoder: &mut fidl::encoding::Encoder<'_, D>,
12874            offset: usize,
12875            _depth: fidl::encoding::Depth,
12876        ) -> fidl::Result<()> {
12877            encoder.debug_check_bounds::<Vec2>(offset);
12878            // Delegate to tuple encoding.
12879            fidl::encoding::Encode::<Vec2, D>::encode(
12880                (
12881                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
12882                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
12883                ),
12884                encoder,
12885                offset,
12886                _depth,
12887            )
12888        }
12889    }
12890    unsafe impl<
12891            D: fidl::encoding::ResourceDialect,
12892            T0: fidl::encoding::Encode<f32, D>,
12893            T1: fidl::encoding::Encode<f32, D>,
12894        > fidl::encoding::Encode<Vec2, D> for (T0, T1)
12895    {
12896        #[inline]
12897        unsafe fn encode(
12898            self,
12899            encoder: &mut fidl::encoding::Encoder<'_, D>,
12900            offset: usize,
12901            depth: fidl::encoding::Depth,
12902        ) -> fidl::Result<()> {
12903            encoder.debug_check_bounds::<Vec2>(offset);
12904            // Zero out padding regions. There's no need to apply masks
12905            // because the unmasked parts will be overwritten by fields.
12906            // Write the fields.
12907            self.0.encode(encoder, offset + 0, depth)?;
12908            self.1.encode(encoder, offset + 4, depth)?;
12909            Ok(())
12910        }
12911    }
12912
12913    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec2 {
12914        #[inline(always)]
12915        fn new_empty() -> Self {
12916            Self { x: fidl::new_empty!(f32, D), y: fidl::new_empty!(f32, D) }
12917        }
12918
12919        #[inline]
12920        unsafe fn decode(
12921            &mut self,
12922            decoder: &mut fidl::encoding::Decoder<'_, D>,
12923            offset: usize,
12924            _depth: fidl::encoding::Depth,
12925        ) -> fidl::Result<()> {
12926            decoder.debug_check_bounds::<Self>(offset);
12927            // Verify that padding bytes are zero.
12928            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
12929            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
12930            Ok(())
12931        }
12932    }
12933
12934    impl fidl::encoding::ValueTypeMarker for Vec3 {
12935        type Borrowed<'a> = &'a Self;
12936        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12937            value
12938        }
12939    }
12940
12941    unsafe impl fidl::encoding::TypeMarker for Vec3 {
12942        type Owned = Self;
12943
12944        #[inline(always)]
12945        fn inline_align(_context: fidl::encoding::Context) -> usize {
12946            4
12947        }
12948
12949        #[inline(always)]
12950        fn inline_size(_context: fidl::encoding::Context) -> usize {
12951            12
12952        }
12953    }
12954
12955    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec3, D> for &Vec3 {
12956        #[inline]
12957        unsafe fn encode(
12958            self,
12959            encoder: &mut fidl::encoding::Encoder<'_, D>,
12960            offset: usize,
12961            _depth: fidl::encoding::Depth,
12962        ) -> fidl::Result<()> {
12963            encoder.debug_check_bounds::<Vec3>(offset);
12964            // Delegate to tuple encoding.
12965            fidl::encoding::Encode::<Vec3, D>::encode(
12966                (
12967                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
12968                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
12969                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
12970                ),
12971                encoder,
12972                offset,
12973                _depth,
12974            )
12975        }
12976    }
12977    unsafe impl<
12978            D: fidl::encoding::ResourceDialect,
12979            T0: fidl::encoding::Encode<f32, D>,
12980            T1: fidl::encoding::Encode<f32, D>,
12981            T2: fidl::encoding::Encode<f32, D>,
12982        > fidl::encoding::Encode<Vec3, D> for (T0, T1, T2)
12983    {
12984        #[inline]
12985        unsafe fn encode(
12986            self,
12987            encoder: &mut fidl::encoding::Encoder<'_, D>,
12988            offset: usize,
12989            depth: fidl::encoding::Depth,
12990        ) -> fidl::Result<()> {
12991            encoder.debug_check_bounds::<Vec3>(offset);
12992            // Zero out padding regions. There's no need to apply masks
12993            // because the unmasked parts will be overwritten by fields.
12994            // Write the fields.
12995            self.0.encode(encoder, offset + 0, depth)?;
12996            self.1.encode(encoder, offset + 4, depth)?;
12997            self.2.encode(encoder, offset + 8, depth)?;
12998            Ok(())
12999        }
13000    }
13001
13002    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec3 {
13003        #[inline(always)]
13004        fn new_empty() -> Self {
13005            Self {
13006                x: fidl::new_empty!(f32, D),
13007                y: fidl::new_empty!(f32, D),
13008                z: fidl::new_empty!(f32, D),
13009            }
13010        }
13011
13012        #[inline]
13013        unsafe fn decode(
13014            &mut self,
13015            decoder: &mut fidl::encoding::Decoder<'_, D>,
13016            offset: usize,
13017            _depth: fidl::encoding::Depth,
13018        ) -> fidl::Result<()> {
13019            decoder.debug_check_bounds::<Self>(offset);
13020            // Verify that padding bytes are zero.
13021            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13022            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13023            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13024            Ok(())
13025        }
13026    }
13027
13028    impl fidl::encoding::ValueTypeMarker for Vec4 {
13029        type Borrowed<'a> = &'a Self;
13030        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13031            value
13032        }
13033    }
13034
13035    unsafe impl fidl::encoding::TypeMarker for Vec4 {
13036        type Owned = Self;
13037
13038        #[inline(always)]
13039        fn inline_align(_context: fidl::encoding::Context) -> usize {
13040            4
13041        }
13042
13043        #[inline(always)]
13044        fn inline_size(_context: fidl::encoding::Context) -> usize {
13045            16
13046        }
13047    }
13048
13049    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec4, D> for &Vec4 {
13050        #[inline]
13051        unsafe fn encode(
13052            self,
13053            encoder: &mut fidl::encoding::Encoder<'_, D>,
13054            offset: usize,
13055            _depth: fidl::encoding::Depth,
13056        ) -> fidl::Result<()> {
13057            encoder.debug_check_bounds::<Vec4>(offset);
13058            // Delegate to tuple encoding.
13059            fidl::encoding::Encode::<Vec4, D>::encode(
13060                (
13061                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
13062                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
13063                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
13064                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
13065                ),
13066                encoder,
13067                offset,
13068                _depth,
13069            )
13070        }
13071    }
13072    unsafe impl<
13073            D: fidl::encoding::ResourceDialect,
13074            T0: fidl::encoding::Encode<f32, D>,
13075            T1: fidl::encoding::Encode<f32, D>,
13076            T2: fidl::encoding::Encode<f32, D>,
13077            T3: fidl::encoding::Encode<f32, D>,
13078        > fidl::encoding::Encode<Vec4, D> for (T0, T1, T2, T3)
13079    {
13080        #[inline]
13081        unsafe fn encode(
13082            self,
13083            encoder: &mut fidl::encoding::Encoder<'_, D>,
13084            offset: usize,
13085            depth: fidl::encoding::Depth,
13086        ) -> fidl::Result<()> {
13087            encoder.debug_check_bounds::<Vec4>(offset);
13088            // Zero out padding regions. There's no need to apply masks
13089            // because the unmasked parts will be overwritten by fields.
13090            // Write the fields.
13091            self.0.encode(encoder, offset + 0, depth)?;
13092            self.1.encode(encoder, offset + 4, depth)?;
13093            self.2.encode(encoder, offset + 8, depth)?;
13094            self.3.encode(encoder, offset + 12, depth)?;
13095            Ok(())
13096        }
13097    }
13098
13099    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec4 {
13100        #[inline(always)]
13101        fn new_empty() -> Self {
13102            Self {
13103                x: fidl::new_empty!(f32, D),
13104                y: fidl::new_empty!(f32, D),
13105                z: fidl::new_empty!(f32, D),
13106                w: fidl::new_empty!(f32, D),
13107            }
13108        }
13109
13110        #[inline]
13111        unsafe fn decode(
13112            &mut self,
13113            decoder: &mut fidl::encoding::Decoder<'_, D>,
13114            offset: usize,
13115            _depth: fidl::encoding::Depth,
13116        ) -> fidl::Result<()> {
13117            decoder.debug_check_bounds::<Self>(offset);
13118            // Verify that padding bytes are zero.
13119            fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
13120            fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
13121            fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
13122            fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
13123            Ok(())
13124        }
13125    }
13126
13127    impl fidl::encoding::ValueTypeMarker for Event {
13128        type Borrowed<'a> = &'a Self;
13129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13130            value
13131        }
13132    }
13133
13134    unsafe impl fidl::encoding::TypeMarker for Event {
13135        type Owned = Self;
13136
13137        #[inline(always)]
13138        fn inline_align(_context: fidl::encoding::Context) -> usize {
13139            8
13140        }
13141
13142        #[inline(always)]
13143        fn inline_size(_context: fidl::encoding::Context) -> usize {
13144            16
13145        }
13146    }
13147
13148    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Event, D> for &Event {
13149        #[inline]
13150        unsafe fn encode(
13151            self,
13152            encoder: &mut fidl::encoding::Encoder<'_, D>,
13153            offset: usize,
13154            _depth: fidl::encoding::Depth,
13155        ) -> fidl::Result<()> {
13156            encoder.debug_check_bounds::<Event>(offset);
13157            encoder.write_num::<u64>(self.ordinal(), offset);
13158            match self {
13159                Event::Metrics(ref val) => fidl::encoding::encode_in_envelope::<MetricsEvent, D>(
13160                    <MetricsEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13161                    encoder,
13162                    offset + 8,
13163                    _depth,
13164                ),
13165                Event::SizeChangeHint(ref val) => {
13166                    fidl::encoding::encode_in_envelope::<SizeChangeHintEvent, D>(
13167                        <SizeChangeHintEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13168                        encoder,
13169                        offset + 8,
13170                        _depth,
13171                    )
13172                }
13173                Event::ImportUnbound(ref val) => {
13174                    fidl::encoding::encode_in_envelope::<ImportUnboundEvent, D>(
13175                        <ImportUnboundEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13176                        encoder,
13177                        offset + 8,
13178                        _depth,
13179                    )
13180                }
13181                Event::ViewConnected(ref val) => {
13182                    fidl::encoding::encode_in_envelope::<ViewConnectedEvent, D>(
13183                        <ViewConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13184                        encoder,
13185                        offset + 8,
13186                        _depth,
13187                    )
13188                }
13189                Event::ViewDisconnected(ref val) => {
13190                    fidl::encoding::encode_in_envelope::<ViewDisconnectedEvent, D>(
13191                        <ViewDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13192                        encoder,
13193                        offset + 8,
13194                        _depth,
13195                    )
13196                }
13197                Event::ViewHolderDisconnected(ref val) => fidl::encoding::encode_in_envelope::<
13198                    ViewHolderDisconnectedEvent,
13199                    D,
13200                >(
13201                    <ViewHolderDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13202                    encoder,
13203                    offset + 8,
13204                    _depth,
13205                ),
13206                Event::ViewAttachedToScene(ref val) => {
13207                    fidl::encoding::encode_in_envelope::<ViewAttachedToSceneEvent, D>(
13208                        <ViewAttachedToSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13209                        encoder,
13210                        offset + 8,
13211                        _depth,
13212                    )
13213                }
13214                Event::ViewDetachedFromScene(ref val) => fidl::encoding::encode_in_envelope::<
13215                    ViewDetachedFromSceneEvent,
13216                    D,
13217                >(
13218                    <ViewDetachedFromSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13219                    encoder,
13220                    offset + 8,
13221                    _depth,
13222                ),
13223                Event::ViewPropertiesChanged(ref val) => fidl::encoding::encode_in_envelope::<
13224                    ViewPropertiesChangedEvent,
13225                    D,
13226                >(
13227                    <ViewPropertiesChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13228                    encoder,
13229                    offset + 8,
13230                    _depth,
13231                ),
13232                Event::ViewStateChanged(ref val) => {
13233                    fidl::encoding::encode_in_envelope::<ViewStateChangedEvent, D>(
13234                        <ViewStateChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13235                        encoder,
13236                        offset + 8,
13237                        _depth,
13238                    )
13239                }
13240                Event::ViewHolderConnected(ref val) => {
13241                    fidl::encoding::encode_in_envelope::<ViewHolderConnectedEvent, D>(
13242                        <ViewHolderConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
13243                        encoder,
13244                        offset + 8,
13245                        _depth,
13246                    )
13247                }
13248            }
13249        }
13250    }
13251
13252    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Event {
13253        #[inline(always)]
13254        fn new_empty() -> Self {
13255            Self::Metrics(fidl::new_empty!(MetricsEvent, D))
13256        }
13257
13258        #[inline]
13259        unsafe fn decode(
13260            &mut self,
13261            decoder: &mut fidl::encoding::Decoder<'_, D>,
13262            offset: usize,
13263            mut depth: fidl::encoding::Depth,
13264        ) -> fidl::Result<()> {
13265            decoder.debug_check_bounds::<Self>(offset);
13266            #[allow(unused_variables)]
13267            let next_out_of_line = decoder.next_out_of_line();
13268            let handles_before = decoder.remaining_handles();
13269            let (ordinal, inlined, num_bytes, num_handles) =
13270                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13271
13272            let member_inline_size = match ordinal {
13273                1 => <MetricsEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13274                2 => <SizeChangeHintEvent as fidl::encoding::TypeMarker>::inline_size(
13275                    decoder.context,
13276                ),
13277                3 => {
13278                    <ImportUnboundEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13279                }
13280                4 => {
13281                    <ViewConnectedEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13282                }
13283                5 => <ViewDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13284                    decoder.context,
13285                ),
13286                6 => <ViewHolderDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13287                    decoder.context,
13288                ),
13289                7 => <ViewAttachedToSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13290                    decoder.context,
13291                ),
13292                8 => <ViewDetachedFromSceneEvent as fidl::encoding::TypeMarker>::inline_size(
13293                    decoder.context,
13294                ),
13295                9 => <ViewPropertiesChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13296                    decoder.context,
13297                ),
13298                10 => <ViewStateChangedEvent as fidl::encoding::TypeMarker>::inline_size(
13299                    decoder.context,
13300                ),
13301                11 => <ViewHolderConnectedEvent as fidl::encoding::TypeMarker>::inline_size(
13302                    decoder.context,
13303                ),
13304                _ => return Err(fidl::Error::UnknownUnionTag),
13305            };
13306
13307            if inlined != (member_inline_size <= 4) {
13308                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13309            }
13310            let _inner_offset;
13311            if inlined {
13312                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13313                _inner_offset = offset + 8;
13314            } else {
13315                depth.increment()?;
13316                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13317            }
13318            match ordinal {
13319                1 => {
13320                    #[allow(irrefutable_let_patterns)]
13321                    if let Event::Metrics(_) = self {
13322                        // Do nothing, read the value into the object
13323                    } else {
13324                        // Initialize `self` to the right variant
13325                        *self = Event::Metrics(fidl::new_empty!(MetricsEvent, D));
13326                    }
13327                    #[allow(irrefutable_let_patterns)]
13328                    if let Event::Metrics(ref mut val) = self {
13329                        fidl::decode!(MetricsEvent, D, val, decoder, _inner_offset, depth)?;
13330                    } else {
13331                        unreachable!()
13332                    }
13333                }
13334                2 => {
13335                    #[allow(irrefutable_let_patterns)]
13336                    if let Event::SizeChangeHint(_) = self {
13337                        // Do nothing, read the value into the object
13338                    } else {
13339                        // Initialize `self` to the right variant
13340                        *self = Event::SizeChangeHint(fidl::new_empty!(SizeChangeHintEvent, D));
13341                    }
13342                    #[allow(irrefutable_let_patterns)]
13343                    if let Event::SizeChangeHint(ref mut val) = self {
13344                        fidl::decode!(SizeChangeHintEvent, D, val, decoder, _inner_offset, depth)?;
13345                    } else {
13346                        unreachable!()
13347                    }
13348                }
13349                3 => {
13350                    #[allow(irrefutable_let_patterns)]
13351                    if let Event::ImportUnbound(_) = self {
13352                        // Do nothing, read the value into the object
13353                    } else {
13354                        // Initialize `self` to the right variant
13355                        *self = Event::ImportUnbound(fidl::new_empty!(ImportUnboundEvent, D));
13356                    }
13357                    #[allow(irrefutable_let_patterns)]
13358                    if let Event::ImportUnbound(ref mut val) = self {
13359                        fidl::decode!(ImportUnboundEvent, D, val, decoder, _inner_offset, depth)?;
13360                    } else {
13361                        unreachable!()
13362                    }
13363                }
13364                4 => {
13365                    #[allow(irrefutable_let_patterns)]
13366                    if let Event::ViewConnected(_) = self {
13367                        // Do nothing, read the value into the object
13368                    } else {
13369                        // Initialize `self` to the right variant
13370                        *self = Event::ViewConnected(fidl::new_empty!(ViewConnectedEvent, D));
13371                    }
13372                    #[allow(irrefutable_let_patterns)]
13373                    if let Event::ViewConnected(ref mut val) = self {
13374                        fidl::decode!(ViewConnectedEvent, D, val, decoder, _inner_offset, depth)?;
13375                    } else {
13376                        unreachable!()
13377                    }
13378                }
13379                5 => {
13380                    #[allow(irrefutable_let_patterns)]
13381                    if let Event::ViewDisconnected(_) = self {
13382                        // Do nothing, read the value into the object
13383                    } else {
13384                        // Initialize `self` to the right variant
13385                        *self = Event::ViewDisconnected(fidl::new_empty!(ViewDisconnectedEvent, D));
13386                    }
13387                    #[allow(irrefutable_let_patterns)]
13388                    if let Event::ViewDisconnected(ref mut val) = self {
13389                        fidl::decode!(
13390                            ViewDisconnectedEvent,
13391                            D,
13392                            val,
13393                            decoder,
13394                            _inner_offset,
13395                            depth
13396                        )?;
13397                    } else {
13398                        unreachable!()
13399                    }
13400                }
13401                6 => {
13402                    #[allow(irrefutable_let_patterns)]
13403                    if let Event::ViewHolderDisconnected(_) = self {
13404                        // Do nothing, read the value into the object
13405                    } else {
13406                        // Initialize `self` to the right variant
13407                        *self = Event::ViewHolderDisconnected(fidl::new_empty!(
13408                            ViewHolderDisconnectedEvent,
13409                            D
13410                        ));
13411                    }
13412                    #[allow(irrefutable_let_patterns)]
13413                    if let Event::ViewHolderDisconnected(ref mut val) = self {
13414                        fidl::decode!(
13415                            ViewHolderDisconnectedEvent,
13416                            D,
13417                            val,
13418                            decoder,
13419                            _inner_offset,
13420                            depth
13421                        )?;
13422                    } else {
13423                        unreachable!()
13424                    }
13425                }
13426                7 => {
13427                    #[allow(irrefutable_let_patterns)]
13428                    if let Event::ViewAttachedToScene(_) = self {
13429                        // Do nothing, read the value into the object
13430                    } else {
13431                        // Initialize `self` to the right variant
13432                        *self = Event::ViewAttachedToScene(fidl::new_empty!(
13433                            ViewAttachedToSceneEvent,
13434                            D
13435                        ));
13436                    }
13437                    #[allow(irrefutable_let_patterns)]
13438                    if let Event::ViewAttachedToScene(ref mut val) = self {
13439                        fidl::decode!(
13440                            ViewAttachedToSceneEvent,
13441                            D,
13442                            val,
13443                            decoder,
13444                            _inner_offset,
13445                            depth
13446                        )?;
13447                    } else {
13448                        unreachable!()
13449                    }
13450                }
13451                8 => {
13452                    #[allow(irrefutable_let_patterns)]
13453                    if let Event::ViewDetachedFromScene(_) = self {
13454                        // Do nothing, read the value into the object
13455                    } else {
13456                        // Initialize `self` to the right variant
13457                        *self = Event::ViewDetachedFromScene(fidl::new_empty!(
13458                            ViewDetachedFromSceneEvent,
13459                            D
13460                        ));
13461                    }
13462                    #[allow(irrefutable_let_patterns)]
13463                    if let Event::ViewDetachedFromScene(ref mut val) = self {
13464                        fidl::decode!(
13465                            ViewDetachedFromSceneEvent,
13466                            D,
13467                            val,
13468                            decoder,
13469                            _inner_offset,
13470                            depth
13471                        )?;
13472                    } else {
13473                        unreachable!()
13474                    }
13475                }
13476                9 => {
13477                    #[allow(irrefutable_let_patterns)]
13478                    if let Event::ViewPropertiesChanged(_) = self {
13479                        // Do nothing, read the value into the object
13480                    } else {
13481                        // Initialize `self` to the right variant
13482                        *self = Event::ViewPropertiesChanged(fidl::new_empty!(
13483                            ViewPropertiesChangedEvent,
13484                            D
13485                        ));
13486                    }
13487                    #[allow(irrefutable_let_patterns)]
13488                    if let Event::ViewPropertiesChanged(ref mut val) = self {
13489                        fidl::decode!(
13490                            ViewPropertiesChangedEvent,
13491                            D,
13492                            val,
13493                            decoder,
13494                            _inner_offset,
13495                            depth
13496                        )?;
13497                    } else {
13498                        unreachable!()
13499                    }
13500                }
13501                10 => {
13502                    #[allow(irrefutable_let_patterns)]
13503                    if let Event::ViewStateChanged(_) = self {
13504                        // Do nothing, read the value into the object
13505                    } else {
13506                        // Initialize `self` to the right variant
13507                        *self = Event::ViewStateChanged(fidl::new_empty!(ViewStateChangedEvent, D));
13508                    }
13509                    #[allow(irrefutable_let_patterns)]
13510                    if let Event::ViewStateChanged(ref mut val) = self {
13511                        fidl::decode!(
13512                            ViewStateChangedEvent,
13513                            D,
13514                            val,
13515                            decoder,
13516                            _inner_offset,
13517                            depth
13518                        )?;
13519                    } else {
13520                        unreachable!()
13521                    }
13522                }
13523                11 => {
13524                    #[allow(irrefutable_let_patterns)]
13525                    if let Event::ViewHolderConnected(_) = self {
13526                        // Do nothing, read the value into the object
13527                    } else {
13528                        // Initialize `self` to the right variant
13529                        *self = Event::ViewHolderConnected(fidl::new_empty!(
13530                            ViewHolderConnectedEvent,
13531                            D
13532                        ));
13533                    }
13534                    #[allow(irrefutable_let_patterns)]
13535                    if let Event::ViewHolderConnected(ref mut val) = self {
13536                        fidl::decode!(
13537                            ViewHolderConnectedEvent,
13538                            D,
13539                            val,
13540                            decoder,
13541                            _inner_offset,
13542                            depth
13543                        )?;
13544                    } else {
13545                        unreachable!()
13546                    }
13547                }
13548                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13549            }
13550            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13551                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13552            }
13553            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13554                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13555            }
13556            Ok(())
13557        }
13558    }
13559
13560    impl fidl::encoding::ValueTypeMarker for RendererParam {
13561        type Borrowed<'a> = &'a Self;
13562        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13563            value
13564        }
13565    }
13566
13567    unsafe impl fidl::encoding::TypeMarker for RendererParam {
13568        type Owned = Self;
13569
13570        #[inline(always)]
13571        fn inline_align(_context: fidl::encoding::Context) -> usize {
13572            8
13573        }
13574
13575        #[inline(always)]
13576        fn inline_size(_context: fidl::encoding::Context) -> usize {
13577            16
13578        }
13579    }
13580
13581    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererParam, D>
13582        for &RendererParam
13583    {
13584        #[inline]
13585        unsafe fn encode(
13586            self,
13587            encoder: &mut fidl::encoding::Encoder<'_, D>,
13588            offset: usize,
13589            _depth: fidl::encoding::Depth,
13590        ) -> fidl::Result<()> {
13591            encoder.debug_check_bounds::<RendererParam>(offset);
13592            encoder.write_num::<u64>(self.ordinal(), offset);
13593            match self {
13594                RendererParam::ShadowTechnique(ref val) => {
13595                    fidl::encoding::encode_in_envelope::<ShadowTechnique, D>(
13596                        <ShadowTechnique as fidl::encoding::ValueTypeMarker>::borrow(val),
13597                        encoder,
13598                        offset + 8,
13599                        _depth,
13600                    )
13601                }
13602                RendererParam::Reserved(ref val) => {
13603                    fidl::encoding::encode_in_envelope::<RenderFrequency, D>(
13604                        <RenderFrequency as fidl::encoding::ValueTypeMarker>::borrow(val),
13605                        encoder,
13606                        offset + 8,
13607                        _depth,
13608                    )
13609                }
13610                RendererParam::EnableDebugging(ref val) => {
13611                    fidl::encoding::encode_in_envelope::<bool, D>(
13612                        <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
13613                        encoder,
13614                        offset + 8,
13615                        _depth,
13616                    )
13617                }
13618            }
13619        }
13620    }
13621
13622    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererParam {
13623        #[inline(always)]
13624        fn new_empty() -> Self {
13625            Self::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D))
13626        }
13627
13628        #[inline]
13629        unsafe fn decode(
13630            &mut self,
13631            decoder: &mut fidl::encoding::Decoder<'_, D>,
13632            offset: usize,
13633            mut depth: fidl::encoding::Depth,
13634        ) -> fidl::Result<()> {
13635            decoder.debug_check_bounds::<Self>(offset);
13636            #[allow(unused_variables)]
13637            let next_out_of_line = decoder.next_out_of_line();
13638            let handles_before = decoder.remaining_handles();
13639            let (ordinal, inlined, num_bytes, num_handles) =
13640                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13641
13642            let member_inline_size = match ordinal {
13643                1 => <ShadowTechnique as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13644                2 => <RenderFrequency as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13645                3 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13646                _ => return Err(fidl::Error::UnknownUnionTag),
13647            };
13648
13649            if inlined != (member_inline_size <= 4) {
13650                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13651            }
13652            let _inner_offset;
13653            if inlined {
13654                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13655                _inner_offset = offset + 8;
13656            } else {
13657                depth.increment()?;
13658                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13659            }
13660            match ordinal {
13661                1 => {
13662                    #[allow(irrefutable_let_patterns)]
13663                    if let RendererParam::ShadowTechnique(_) = self {
13664                        // Do nothing, read the value into the object
13665                    } else {
13666                        // Initialize `self` to the right variant
13667                        *self =
13668                            RendererParam::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D));
13669                    }
13670                    #[allow(irrefutable_let_patterns)]
13671                    if let RendererParam::ShadowTechnique(ref mut val) = self {
13672                        fidl::decode!(ShadowTechnique, D, val, decoder, _inner_offset, depth)?;
13673                    } else {
13674                        unreachable!()
13675                    }
13676                }
13677                2 => {
13678                    #[allow(irrefutable_let_patterns)]
13679                    if let RendererParam::Reserved(_) = self {
13680                        // Do nothing, read the value into the object
13681                    } else {
13682                        // Initialize `self` to the right variant
13683                        *self = RendererParam::Reserved(fidl::new_empty!(RenderFrequency, D));
13684                    }
13685                    #[allow(irrefutable_let_patterns)]
13686                    if let RendererParam::Reserved(ref mut val) = self {
13687                        fidl::decode!(RenderFrequency, D, val, decoder, _inner_offset, depth)?;
13688                    } else {
13689                        unreachable!()
13690                    }
13691                }
13692                3 => {
13693                    #[allow(irrefutable_let_patterns)]
13694                    if let RendererParam::EnableDebugging(_) = self {
13695                        // Do nothing, read the value into the object
13696                    } else {
13697                        // Initialize `self` to the right variant
13698                        *self = RendererParam::EnableDebugging(fidl::new_empty!(bool, D));
13699                    }
13700                    #[allow(irrefutable_let_patterns)]
13701                    if let RendererParam::EnableDebugging(ref mut val) = self {
13702                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
13703                    } else {
13704                        unreachable!()
13705                    }
13706                }
13707                ordinal => panic!("unexpected ordinal {:?}", ordinal),
13708            }
13709            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13710                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13711            }
13712            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13713                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13714            }
13715            Ok(())
13716        }
13717    }
13718
13719    impl fidl::encoding::ValueTypeMarker for Value {
13720        type Borrowed<'a> = &'a Self;
13721        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13722            value
13723        }
13724    }
13725
13726    unsafe impl fidl::encoding::TypeMarker for Value {
13727        type Owned = Self;
13728
13729        #[inline(always)]
13730        fn inline_align(_context: fidl::encoding::Context) -> usize {
13731            8
13732        }
13733
13734        #[inline(always)]
13735        fn inline_size(_context: fidl::encoding::Context) -> usize {
13736            16
13737        }
13738    }
13739
13740    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
13741        #[inline]
13742        unsafe fn encode(
13743            self,
13744            encoder: &mut fidl::encoding::Encoder<'_, D>,
13745            offset: usize,
13746            _depth: fidl::encoding::Depth,
13747        ) -> fidl::Result<()> {
13748            encoder.debug_check_bounds::<Value>(offset);
13749            encoder.write_num::<u64>(self.ordinal(), offset);
13750            match self {
13751                Value::Vector1(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13752                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13753                    encoder,
13754                    offset + 8,
13755                    _depth,
13756                ),
13757                Value::Vector2(ref val) => fidl::encoding::encode_in_envelope::<Vec2, D>(
13758                    <Vec2 as fidl::encoding::ValueTypeMarker>::borrow(val),
13759                    encoder,
13760                    offset + 8,
13761                    _depth,
13762                ),
13763                Value::Vector3(ref val) => fidl::encoding::encode_in_envelope::<Vec3, D>(
13764                    <Vec3 as fidl::encoding::ValueTypeMarker>::borrow(val),
13765                    encoder,
13766                    offset + 8,
13767                    _depth,
13768                ),
13769                Value::Vector4(ref val) => fidl::encoding::encode_in_envelope::<Vec4, D>(
13770                    <Vec4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13771                    encoder,
13772                    offset + 8,
13773                    _depth,
13774                ),
13775                Value::Matrix4x4(ref val) => fidl::encoding::encode_in_envelope::<Mat4, D>(
13776                    <Mat4 as fidl::encoding::ValueTypeMarker>::borrow(val),
13777                    encoder,
13778                    offset + 8,
13779                    _depth,
13780                ),
13781                Value::ColorRgba(ref val) => fidl::encoding::encode_in_envelope::<ColorRgba, D>(
13782                    <ColorRgba as fidl::encoding::ValueTypeMarker>::borrow(val),
13783                    encoder,
13784                    offset + 8,
13785                    _depth,
13786                ),
13787                Value::ColorRgb(ref val) => fidl::encoding::encode_in_envelope::<ColorRgb, D>(
13788                    <ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(val),
13789                    encoder,
13790                    offset + 8,
13791                    _depth,
13792                ),
13793                Value::Degrees(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
13794                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13795                    encoder,
13796                    offset + 8,
13797                    _depth,
13798                ),
13799                Value::Quaternion(ref val) => fidl::encoding::encode_in_envelope::<Quaternion, D>(
13800                    <Quaternion as fidl::encoding::ValueTypeMarker>::borrow(val),
13801                    encoder,
13802                    offset + 8,
13803                    _depth,
13804                ),
13805                Value::Transform(ref val) => {
13806                    fidl::encoding::encode_in_envelope::<FactoredTransform, D>(
13807                        <FactoredTransform as fidl::encoding::ValueTypeMarker>::borrow(val),
13808                        encoder,
13809                        offset + 8,
13810                        _depth,
13811                    )
13812                }
13813                Value::VariableId(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
13814                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13815                    encoder,
13816                    offset + 8,
13817                    _depth,
13818                ),
13819            }
13820        }
13821    }
13822
13823    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
13824        #[inline(always)]
13825        fn new_empty() -> Self {
13826            Self::Vector1(fidl::new_empty!(f32, D))
13827        }
13828
13829        #[inline]
13830        unsafe fn decode(
13831            &mut self,
13832            decoder: &mut fidl::encoding::Decoder<'_, D>,
13833            offset: usize,
13834            mut depth: fidl::encoding::Depth,
13835        ) -> fidl::Result<()> {
13836            decoder.debug_check_bounds::<Self>(offset);
13837            #[allow(unused_variables)]
13838            let next_out_of_line = decoder.next_out_of_line();
13839            let handles_before = decoder.remaining_handles();
13840            let (ordinal, inlined, num_bytes, num_handles) =
13841                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13842
13843            let member_inline_size = match ordinal {
13844                1 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13845                2 => <Vec2 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13846                3 => <Vec3 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13847                4 => <Vec4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13848                5 => <Mat4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13849                6 => <ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13850                7 => <ColorRgb as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13851                8 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13852                9 => <Quaternion as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13853                10 => {
13854                    <FactoredTransform as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13855                }
13856                11 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13857                _ => return Err(fidl::Error::UnknownUnionTag),
13858            };
13859
13860            if inlined != (member_inline_size <= 4) {
13861                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13862            }
13863            let _inner_offset;
13864            if inlined {
13865                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13866                _inner_offset = offset + 8;
13867            } else {
13868                depth.increment()?;
13869                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13870            }
13871            match ordinal {
13872                1 => {
13873                    #[allow(irrefutable_let_patterns)]
13874                    if let Value::Vector1(_) = self {
13875                        // Do nothing, read the value into the object
13876                    } else {
13877                        // Initialize `self` to the right variant
13878                        *self = Value::Vector1(fidl::new_empty!(f32, D));
13879                    }
13880                    #[allow(irrefutable_let_patterns)]
13881                    if let Value::Vector1(ref mut val) = self {
13882                        fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
13883                    } else {
13884                        unreachable!()
13885                    }
13886                }
13887                2 => {
13888                    #[allow(irrefutable_let_patterns)]
13889                    if let Value::Vector2(_) = self {
13890                        // Do nothing, read the value into the object
13891                    } else {
13892                        // Initialize `self` to the right variant
13893                        *self = Value::Vector2(fidl::new_empty!(Vec2, D));
13894                    }
13895                    #[allow(irrefutable_let_patterns)]
13896                    if let Value::Vector2(ref mut val) = self {
13897                        fidl::decode!(Vec2, D, val, decoder, _inner_offset, depth)?;
13898                    } else {
13899                        unreachable!()
13900                    }
13901                }
13902                3 => {
13903                    #[allow(irrefutable_let_patterns)]
13904                    if let Value::Vector3(_) = self {
13905                        // Do nothing, read the value into the object
13906                    } else {
13907                        // Initialize `self` to the right variant
13908                        *self = Value::Vector3(fidl::new_empty!(Vec3, D));
13909                    }
13910                    #[allow(irrefutable_let_patterns)]
13911                    if let Value::Vector3(ref mut val) = self {
13912                        fidl::decode!(Vec3, D, val, decoder, _inner_offset, depth)?;
13913                    } else {
13914                        unreachable!()
13915                    }
13916                }
13917                4 => {
13918                    #[allow(irrefutable_let_patterns)]
13919                    if let Value::Vector4(_) = self {
13920                        // Do nothing, read the value into the object
13921                    } else {
13922                        // Initialize `self` to the right variant
13923                        *self = Value::Vector4(fidl::new_empty!(Vec4, D));
13924                    }
13925                    #[allow(irrefutable_let_patterns)]
13926                    if let Value::Vector4(ref mut val) = self {
13927                        fidl::decode!(Vec4, D, val, decoder, _inner_offset, depth)?;
13928                    } else {
13929                        unreachable!()
13930                    }
13931                }
13932                5 => {
13933                    #[allow(irrefutable_let_patterns)]
13934                    if let Value::Matrix4x4(_) = self {
13935                        // Do nothing, read the value into the object
13936                    } else {
13937                        // Initialize `self` to the right variant
13938                        *self = Value::Matrix4x4(fidl::new_empty!(Mat4, D));
13939                    }
13940                    #[allow(irrefutable_let_patterns)]
13941                    if let Value::Matrix4x4(ref mut val) = self {
13942                        fidl::decode!(Mat4, D, val, decoder, _inner_offset, depth)?;
13943                    } else {
13944                        unreachable!()
13945                    }
13946                }
13947                6 => {
13948                    #[allow(irrefutable_let_patterns)]
13949                    if let Value::ColorRgba(_) = self {
13950                        // Do nothing, read the value into the object
13951                    } else {
13952                        // Initialize `self` to the right variant
13953                        *self = Value::ColorRgba(fidl::new_empty!(ColorRgba, D));
13954                    }
13955                    #[allow(irrefutable_let_patterns)]
13956                    if let Value::ColorRgba(ref mut val) = self {
13957                        fidl::decode!(ColorRgba, D, val, decoder, _inner_offset, depth)?;
13958                    } else {
13959                        unreachable!()
13960                    }
13961                }
13962                7 => {
13963                    #[allow(irrefutable_let_patterns)]
13964                    if let Value::ColorRgb(_) = self {
13965                        // Do nothing, read the value into the object
13966                    } else {
13967                        // Initialize `self` to the right variant
13968                        *self = Value::ColorRgb(fidl::new_empty!(ColorRgb, D));
13969                    }
13970                    #[allow(irrefutable_let_patterns)]
13971                    if let Value::ColorRgb(ref mut val) = self {
13972                        fidl::decode!(ColorRgb, D, val, decoder, _inner_offset, depth)?;
13973                    } else {
13974                        unreachable!()
13975                    }
13976                }
13977                8 => {
13978                    #[allow(irrefutable_let_patterns)]
13979                    if let Value::Degrees(_) = self {
13980                        // Do nothing, read the value into the object
13981                    } else {
13982                        // Initialize `self` to the right variant
13983                        *self = Value::Degrees(fidl::new_empty!(f32, D));
13984                    }
13985                    #[allow(irrefutable_let_patterns)]
13986                    if let Value::Degrees(ref mut val) = self {
13987                        fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
13988                    } else {
13989                        unreachable!()
13990                    }
13991                }
13992                9 => {
13993                    #[allow(irrefutable_let_patterns)]
13994                    if let Value::Quaternion(_) = self {
13995                        // Do nothing, read the value into the object
13996                    } else {
13997                        // Initialize `self` to the right variant
13998                        *self = Value::Quaternion(fidl::new_empty!(Quaternion, D));
13999                    }
14000                    #[allow(irrefutable_let_patterns)]
14001                    if let Value::Quaternion(ref mut val) = self {
14002                        fidl::decode!(Quaternion, D, val, decoder, _inner_offset, depth)?;
14003                    } else {
14004                        unreachable!()
14005                    }
14006                }
14007                10 => {
14008                    #[allow(irrefutable_let_patterns)]
14009                    if let Value::Transform(_) = self {
14010                        // Do nothing, read the value into the object
14011                    } else {
14012                        // Initialize `self` to the right variant
14013                        *self = Value::Transform(fidl::new_empty!(FactoredTransform, D));
14014                    }
14015                    #[allow(irrefutable_let_patterns)]
14016                    if let Value::Transform(ref mut val) = self {
14017                        fidl::decode!(FactoredTransform, D, val, decoder, _inner_offset, depth)?;
14018                    } else {
14019                        unreachable!()
14020                    }
14021                }
14022                11 => {
14023                    #[allow(irrefutable_let_patterns)]
14024                    if let Value::VariableId(_) = self {
14025                        // Do nothing, read the value into the object
14026                    } else {
14027                        // Initialize `self` to the right variant
14028                        *self = Value::VariableId(fidl::new_empty!(u32, D));
14029                    }
14030                    #[allow(irrefutable_let_patterns)]
14031                    if let Value::VariableId(ref mut val) = self {
14032                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
14033                    } else {
14034                        unreachable!()
14035                    }
14036                }
14037                ordinal => panic!("unexpected ordinal {:?}", ordinal),
14038            }
14039            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14040                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14041            }
14042            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14043                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14044            }
14045            Ok(())
14046        }
14047    }
14048}