#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const LABEL_MAX_LENGTH: u32 = 32;
pub const METRICS_EVENT_MASK: u32 = 1;
pub const SIZE_CHANGE_HINT_EVENT_MASK: u32 = 2;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum HitTestBehavior {
KDefault = 0,
KSuppress = 1,
}
impl HitTestBehavior {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::KDefault),
1 => Some(Self::KSuppress),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ImportSpec {
Node = 0,
}
impl ImportSpec {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Node),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum MeshIndexFormat {
KUint16 = 1,
KUint32 = 2,
}
impl MeshIndexFormat {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::KUint16),
2 => Some(Self::KUint32),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum RenderFrequency {
WhenRequested = 0,
Continuously = 1,
}
impl RenderFrequency {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::WhenRequested),
1 => Some(Self::Continuously),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ShadowTechnique {
Unshadowed = 0,
ScreenSpace = 1,
ShadowMap = 2,
MomentShadowMap = 3,
StencilShadowVolume = 4,
}
impl ShadowTechnique {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Unshadowed),
1 => Some(Self::ScreenSpace),
2 => Some(Self::ShadowMap),
3 => Some(Self::MomentShadowMap),
4 => Some(Self::StencilShadowVolume),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ValueType {
KNone = 0,
KVector1 = 1,
KVector2 = 2,
KVector3 = 3,
KVector4 = 4,
KMatrix4 = 5,
KColorRgb = 6,
KColorRgba = 7,
KQuaternion = 8,
KFactoredTransform = 9,
}
impl ValueType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::KNone),
1 => Some(Self::KVector1),
2 => Some(Self::KVector2),
3 => Some(Self::KVector3),
4 => Some(Self::KVector4),
5 => Some(Self::KMatrix4),
6 => Some(Self::KColorRgb),
7 => Some(Self::KColorRgba),
8 => Some(Self::KQuaternion),
9 => Some(Self::KFactoredTransform),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AddChildCmd {
pub node_id: u32,
pub child_id: u32,
}
impl fidl::Persistable for AddChildCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AddLayerCmd {
pub layer_stack_id: u32,
pub layer_id: u32,
}
impl fidl::Persistable for AddLayerCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AddLightCmd {
pub scene_id: u32,
pub light_id: u32,
}
impl fidl::Persistable for AddLightCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AddPartCmd {
pub node_id: u32,
pub part_id: u32,
}
impl fidl::Persistable for AddPartCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AmbientLightArgs {
pub dummy: u32,
}
impl fidl::Persistable for AmbientLightArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct BindMeshBuffersCmd {
pub mesh_id: u32,
pub index_buffer_id: u32,
pub index_format: MeshIndexFormat,
pub index_offset: u64,
pub index_count: u32,
pub vertex_buffer_id: u32,
pub vertex_format: MeshVertexFormat,
pub vertex_offset: u64,
pub vertex_count: u32,
pub bounding_box: BoundingBox,
}
impl fidl::Persistable for BindMeshBuffersCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct BoundingBox {
pub min: Vec3,
pub max: Vec3,
}
impl fidl::Persistable for BoundingBox {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BufferArgs {
pub memory_id: u32,
pub memory_offset: u32,
pub num_bytes: u32,
}
impl fidl::Persistable for BufferArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CameraArgs {
pub scene_id: u32,
}
impl fidl::Persistable for CameraArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct CircleArgs {
pub radius: Value,
}
impl fidl::Persistable for CircleArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClipNodeArgs {
pub unused: u32,
}
impl fidl::Persistable for ClipNodeArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct ColorRgb {
pub red: f32,
pub green: f32,
pub blue: f32,
}
impl fidl::Persistable for ColorRgb {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct ColorRgbValue {
pub value: ColorRgb,
pub variable_id: u32,
}
impl fidl::Persistable for ColorRgbValue {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ColorRgba {
pub red: u8,
pub green: u8,
pub blue: u8,
pub alpha: u8,
}
impl fidl::Persistable for ColorRgba {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ColorRgbaValue {
pub value: ColorRgba,
pub variable_id: u32,
}
impl fidl::Persistable for ColorRgbaValue {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CompositorArgs {
pub dummy: u32,
}
impl fidl::Persistable for CompositorArgs {}
#[derive(Debug, PartialEq)]
pub struct CreateResourceCmd {
pub id: u32,
pub resource: ResourceArgs,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateResourceCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DetachChildrenCmd {
pub node_id: u32,
}
impl fidl::Persistable for DetachChildrenCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DetachCmd {
pub id: u32,
}
impl fidl::Persistable for DetachCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DetachLightCmd {
pub light_id: u32,
}
impl fidl::Persistable for DetachLightCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DetachLightsCmd {
pub scene_id: u32,
}
impl fidl::Persistable for DetachLightsCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DirectionalLightArgs {
pub dummy: u32,
}
impl fidl::Persistable for DirectionalLightArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DisplayCompositorArgs {
pub dummy: u32,
}
impl fidl::Persistable for DisplayCompositorArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DisplayInfo {
pub width_in_px: u32,
pub height_in_px: u32,
}
impl fidl::Persistable for DisplayInfo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct EntityNodeArgs {
pub unused: u32,
}
impl fidl::Persistable for EntityNodeArgs {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ExportResourceCmdDeprecated {
pub id: u32,
pub token: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ExportResourceCmdDeprecated
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ExportToken {
pub value: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ExportToken {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct FactoredTransform {
pub translation: Vec3,
pub scale: Vec3,
pub anchor: Vec3,
pub rotation: Quaternion,
}
impl fidl::Persistable for FactoredTransform {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct FloatValue {
pub value: f32,
pub variable_id: u32,
}
impl fidl::Persistable for FloatValue {}
#[derive(Clone, Debug, PartialEq)]
pub struct ImageArgs {
pub info: fidl_fuchsia_images::ImageInfo,
pub memory_id: u32,
pub memory_offset: u32,
}
impl fidl::Persistable for ImageArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ImageArgs2 {
pub width: u32,
pub height: u32,
pub buffer_collection_id: u32,
pub buffer_collection_index: u32,
}
impl fidl::Persistable for ImageArgs2 {}
#[derive(Debug, PartialEq)]
pub struct ImageArgs3 {
pub width: u32,
pub height: u32,
pub import_token: fidl_fuchsia_ui_composition::BufferCollectionImportToken,
pub buffer_collection_index: u32,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ImageArgs3 {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ImagePipe2Args {
pub image_pipe_request: fidl::endpoints::ServerEnd<fidl_fuchsia_images::ImagePipe2Marker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ImagePipe2Args {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ImportResourceCmdDeprecated {
pub id: u32,
pub token: fidl::EventPair,
pub spec: ImportSpec,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ImportResourceCmdDeprecated
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ImportToken {
pub value: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ImportToken {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ImportUnboundEvent {
pub resource_id: u32,
}
impl fidl::Persistable for ImportUnboundEvent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LayerArgs {
pub dummy: u32,
}
impl fidl::Persistable for LayerArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LayerStackArgs {
pub dummy: u32,
}
impl fidl::Persistable for LayerStackArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct MaterialArgs {
pub dummy: u32,
}
impl fidl::Persistable for MaterialArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Matrix4Value {
pub value: Mat4,
pub variable_id: u32,
}
impl fidl::Persistable for Matrix4Value {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MemoryArgs {
pub vmo: fidl::Vmo,
pub allocation_size: u64,
pub memory_type: fidl_fuchsia_images::MemoryType,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MemoryArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MeshArgs;
impl fidl::Persistable for MeshArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MeshVertexFormat {
pub position_type: ValueType,
pub normal_type: ValueType,
pub tex_coord_type: ValueType,
}
impl fidl::Persistable for MeshVertexFormat {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Metrics {
pub scale_x: f32,
pub scale_y: f32,
pub scale_z: f32,
}
impl fidl::Persistable for Metrics {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct MetricsEvent {
pub node_id: u32,
pub metrics: Metrics,
}
impl fidl::Persistable for MetricsEvent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct OpacityNodeArgsHack {
pub unused: u32,
}
impl fidl::Persistable for OpacityNodeArgsHack {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Plane3 {
pub dir: Vec3,
pub dist: f32,
}
impl fidl::Persistable for Plane3 {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct PointLightArgs {
pub dummy: u32,
}
impl fidl::Persistable for PointLightArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Quaternion {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
impl fidl::Persistable for Quaternion {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct QuaternionValue {
pub value: Quaternion,
pub variable_id: u32,
}
impl fidl::Persistable for QuaternionValue {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct RectangleArgs {
pub width: Value,
pub height: Value,
}
impl fidl::Persistable for RectangleArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ReleaseResourceCmd {
pub id: u32,
}
impl fidl::Persistable for ReleaseResourceCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RemoveAllLayersCmd {
pub layer_stack_id: u32,
}
impl fidl::Persistable for RemoveAllLayersCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RemoveLayerCmd {
pub layer_stack_id: u32,
pub layer_id: u32,
}
impl fidl::Persistable for RemoveLayerCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RendererArgs {
pub dummy: u32,
}
impl fidl::Persistable for RendererArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct RoundedRectangleArgs {
pub width: Value,
pub height: Value,
pub top_left_radius: Value,
pub top_right_radius: Value,
pub bottom_right_radius: Value,
pub bottom_left_radius: Value,
}
impl fidl::Persistable for RoundedRectangleArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SceneAddAmbientLightCmd {
pub scene_id: u32,
pub light_id: u32,
}
impl fidl::Persistable for SceneAddAmbientLightCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SceneAddDirectionalLightCmd {
pub scene_id: u32,
pub light_id: u32,
}
impl fidl::Persistable for SceneAddDirectionalLightCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SceneAddPointLightCmd {
pub scene_id: u32,
pub light_id: u32,
}
impl fidl::Persistable for SceneAddPointLightCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SceneArgs {
pub dummy: u32,
}
impl fidl::Persistable for SceneArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SendSizeChangeHintCmdHack {
pub node_id: u32,
pub width_change_factor: f32,
pub height_change_factor: f32,
}
impl fidl::Persistable for SendSizeChangeHintCmdHack {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetAnchorCmd {
pub id: u32,
pub value: Vector3Value,
}
impl fidl::Persistable for SetAnchorCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetCameraClipSpaceTransformCmd {
pub camera_id: u32,
pub translation: Vec2,
pub scale: f32,
}
impl fidl::Persistable for SetCameraClipSpaceTransformCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetCameraCmd {
pub renderer_id: u32,
pub camera_id: u32,
}
impl fidl::Persistable for SetCameraCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetCameraPoseBufferCmd {
pub camera_id: u32,
pub buffer_id: u32,
pub num_entries: u32,
pub base_time: i64,
pub time_interval: u64,
}
impl fidl::Persistable for SetCameraPoseBufferCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetCameraProjectionCmd {
pub camera_id: u32,
pub fovy: FloatValue,
}
impl fidl::Persistable for SetCameraProjectionCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetCameraTransformCmd {
pub camera_id: u32,
pub eye_position: Vector3Value,
pub eye_look_at: Vector3Value,
pub eye_up: Vector3Value,
}
impl fidl::Persistable for SetCameraTransformCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetClipCmd {
pub node_id: u32,
pub clip_id: u32,
pub clip_to_self: bool,
}
impl fidl::Persistable for SetClipCmd {}
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct SetClipPlanesCmd {
pub node_id: u32,
pub clip_planes: Vec<Plane3>,
}
impl fidl::Persistable for SetClipPlanesCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetColorCmd {
pub material_id: u32,
pub color: ColorRgbaValue,
}
impl fidl::Persistable for SetColorCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetDisableClippingCmd {
pub renderer_id: u32,
pub disable_clipping: bool,
}
impl fidl::Persistable for SetDisableClippingCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetDisplayColorConversionCmdHack {
pub compositor_id: u32,
pub preoffsets: [f32; 3],
pub matrix: [f32; 9],
pub postoffsets: [f32; 3],
}
impl fidl::Persistable for SetDisplayColorConversionCmdHack {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetDisplayMinimumRgbCmdHack {
pub min_value: u8,
}
impl fidl::Persistable for SetDisplayMinimumRgbCmdHack {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetDisplayRotationCmdHack {
pub compositor_id: u32,
pub rotation_degrees: u32,
}
impl fidl::Persistable for SetDisplayRotationCmdHack {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetEnableDebugViewBoundsCmd {
pub view_id: u32,
pub enable: bool,
}
impl fidl::Persistable for SetEnableDebugViewBoundsCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetEventMaskCmd {
pub id: u32,
pub event_mask: u32,
}
impl fidl::Persistable for SetEventMaskCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetHitTestBehaviorCmd {
pub node_id: u32,
pub hit_test_behavior: HitTestBehavior,
}
impl fidl::Persistable for SetHitTestBehaviorCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetImportFocusCmdDeprecated;
impl fidl::Persistable for SetImportFocusCmdDeprecated {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetLabelCmd {
pub id: u32,
pub label: String,
}
impl fidl::Persistable for SetLabelCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetLayerStackCmd {
pub compositor_id: u32,
pub layer_stack_id: u32,
}
impl fidl::Persistable for SetLayerStackCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetLightColorCmd {
pub light_id: u32,
pub color: ColorRgbValue,
}
impl fidl::Persistable for SetLightColorCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetLightDirectionCmd {
pub light_id: u32,
pub direction: Vector3Value,
}
impl fidl::Persistable for SetLightDirectionCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetMaterialCmd {
pub node_id: u32,
pub material_id: u32,
}
impl fidl::Persistable for SetMaterialCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetOpacityCmd {
pub node_id: u32,
pub opacity: f32,
}
impl fidl::Persistable for SetOpacityCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetPointLightFalloffCmd {
pub light_id: u32,
pub falloff: FloatValue,
}
impl fidl::Persistable for SetPointLightFalloffCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetPointLightPositionCmd {
pub light_id: u32,
pub position: Vector3Value,
}
impl fidl::Persistable for SetPointLightPositionCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetRendererCmd {
pub layer_id: u32,
pub renderer_id: u32,
}
impl fidl::Persistable for SetRendererCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetRendererParamCmd {
pub renderer_id: u32,
pub param: RendererParam,
}
impl fidl::Persistable for SetRendererParamCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetRotationCmd {
pub id: u32,
pub value: QuaternionValue,
}
impl fidl::Persistable for SetRotationCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetScaleCmd {
pub id: u32,
pub value: Vector3Value,
}
impl fidl::Persistable for SetScaleCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetSemanticVisibilityCmd {
pub node_id: u32,
pub visible: bool,
}
impl fidl::Persistable for SetSemanticVisibilityCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetShapeCmd {
pub node_id: u32,
pub shape_id: u32,
}
impl fidl::Persistable for SetShapeCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetSizeCmd {
pub id: u32,
pub value: Vector2Value,
}
impl fidl::Persistable for SetSizeCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetStereoCameraProjectionCmd {
pub camera_id: u32,
pub left_projection: Matrix4Value,
pub right_projection: Matrix4Value,
}
impl fidl::Persistable for SetStereoCameraProjectionCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetTagCmd {
pub node_id: u32,
pub tag_value: u32,
}
impl fidl::Persistable for SetTagCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetTextureCmd {
pub material_id: u32,
pub texture_id: u32,
}
impl fidl::Persistable for SetTextureCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetTranslationCmd {
pub id: u32,
pub value: Vector3Value,
}
impl fidl::Persistable for SetTranslationCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetViewHolderBoundsColorCmd {
pub view_holder_id: u32,
pub color: ColorRgbValue,
}
impl fidl::Persistable for SetViewHolderBoundsColorCmd {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SetViewPropertiesCmd {
pub view_holder_id: u32,
pub properties: ViewProperties,
}
impl fidl::Persistable for SetViewPropertiesCmd {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ShapeNodeArgs {
pub unused: u32,
}
impl fidl::Persistable for ShapeNodeArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct SizeChangeHintEvent {
pub node_id: u32,
pub width_change_factor: f32,
pub height_change_factor: f32,
}
impl fidl::Persistable for SizeChangeHintEvent {}
#[derive(Debug, PartialEq)]
pub struct SnapshotCallbackDeprecatedOnDataRequest {
pub data: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for SnapshotCallbackDeprecatedOnDataRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct StereoCameraArgs {
pub scene_id: u32,
}
impl fidl::Persistable for StereoCameraArgs {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TakeSnapshotCmdDeprecated {
pub node_id: u32,
pub callback: fidl::endpoints::ClientEnd<SnapshotCallbackDeprecatedMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for TakeSnapshotCmdDeprecated {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct VariableArgs {
pub type_: ValueType,
pub initial_value: Value,
}
impl fidl::Persistable for VariableArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Vector2Value {
pub value: Vec2,
pub variable_id: u32,
}
impl fidl::Persistable for Vector2Value {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Vector3Value {
pub value: Vec3,
pub variable_id: u32,
}
impl fidl::Persistable for Vector3Value {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Vector4Value {
pub value: Vec4,
pub variable_id: u32,
}
impl fidl::Persistable for Vector4Value {}
#[derive(Debug, PartialEq)]
pub struct ViewArgs {
pub token: fidl_fuchsia_ui_views::ViewToken,
pub debug_name: Option<String>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewArgs {}
#[derive(Debug, PartialEq)]
pub struct ViewArgs3 {
pub token: fidl_fuchsia_ui_views::ViewToken,
pub control_ref: fidl_fuchsia_ui_views::ViewRefControl,
pub view_ref: fidl_fuchsia_ui_views::ViewRef,
pub debug_name: Option<String>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewArgs3 {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct ViewAttachedToSceneEvent {
pub view_id: u32,
pub properties: ViewProperties,
}
impl fidl::Persistable for ViewAttachedToSceneEvent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ViewConnectedEvent {
pub view_holder_id: u32,
}
impl fidl::Persistable for ViewConnectedEvent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ViewDetachedFromSceneEvent {
pub view_id: u32,
}
impl fidl::Persistable for ViewDetachedFromSceneEvent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ViewDisconnectedEvent {
pub view_holder_id: u32,
}
impl fidl::Persistable for ViewDisconnectedEvent {}
#[derive(Debug, PartialEq)]
pub struct ViewHolderArgs {
pub token: fidl_fuchsia_ui_views::ViewHolderToken,
pub debug_name: Option<String>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewHolderArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ViewHolderConnectedEvent {
pub view_id: u32,
}
impl fidl::Persistable for ViewHolderConnectedEvent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ViewHolderDisconnectedEvent {
pub view_id: u32,
}
impl fidl::Persistable for ViewHolderDisconnectedEvent {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct ViewProperties {
pub bounding_box: BoundingBox,
pub inset_from_min: Vec3,
pub inset_from_max: Vec3,
pub focus_change: bool,
pub downward_input: bool,
}
impl fidl::Persistable for ViewProperties {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct ViewPropertiesChangedEvent {
pub view_id: u32,
pub properties: ViewProperties,
}
impl fidl::Persistable for ViewPropertiesChangedEvent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ViewState {
pub is_rendering: bool,
}
impl fidl::Persistable for ViewState {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ViewStateChangedEvent {
pub view_holder_id: u32,
pub state: ViewState,
}
impl fidl::Persistable for ViewStateChangedEvent {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Mat4 {
pub matrix: [f32; 16],
}
impl fidl::Persistable for Mat4 {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Vec2 {
pub x: f32,
pub y: f32,
}
impl fidl::Persistable for Vec2 {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Vec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
impl fidl::Persistable for Vec3 {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct Vec4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
impl fidl::Persistable for Vec4 {}
#[derive(Debug, PartialEq)]
pub enum Command {
CreateResource(CreateResourceCmd),
ReleaseResource(ReleaseResourceCmd),
ExportResource(ExportResourceCmdDeprecated),
ImportResource(ImportResourceCmdDeprecated),
SetTag(SetTagCmd),
Detach(DetachCmd),
SetTranslation(SetTranslationCmd),
SetScale(SetScaleCmd),
SetRotation(SetRotationCmd),
SetAnchor(SetAnchorCmd),
SetSize(SetSizeCmd),
SetOpacity(SetOpacityCmd),
SendSizeChangeHintHack(SendSizeChangeHintCmdHack),
AddChild(AddChildCmd),
AddPart(AddPartCmd),
DetachChildren(DetachChildrenCmd),
SetShape(SetShapeCmd),
SetMaterial(SetMaterialCmd),
SetClip(SetClipCmd),
SetHitTestBehavior(SetHitTestBehaviorCmd),
SetViewProperties(SetViewPropertiesCmd),
TakeSnapshotCmd(TakeSnapshotCmdDeprecated),
SetCamera(SetCameraCmd),
SetCameraTransform(SetCameraTransformCmd),
SetCameraProjection(SetCameraProjectionCmd),
SetStereoCameraProjection(SetStereoCameraProjectionCmd),
SetCameraPoseBuffer(SetCameraPoseBufferCmd),
SetLightColor(SetLightColorCmd),
SetLightDirection(SetLightDirectionCmd),
AddLight(AddLightCmd),
DetachLight(DetachLightCmd),
DetachLights(DetachLightsCmd),
SetTexture(SetTextureCmd),
SetColor(SetColorCmd),
BindMeshBuffers(BindMeshBuffersCmd),
AddLayer(AddLayerCmd),
RemoveLayer(RemoveLayerCmd),
RemoveAllLayers(RemoveAllLayersCmd),
SetLayerStack(SetLayerStackCmd),
SetRenderer(SetRendererCmd),
SetRendererParam(SetRendererParamCmd),
SetEventMask(SetEventMaskCmd),
SetLabel(SetLabelCmd),
SetDisableClipping(SetDisableClippingCmd),
SetImportFocus(SetImportFocusCmdDeprecated),
SetClipPlanes(SetClipPlanesCmd),
SetPointLightPosition(SetPointLightPositionCmd),
SetPointLightFalloff(SetPointLightFalloffCmd),
Scene_AddAmbientLight(SceneAddAmbientLightCmd),
Scene_AddDirectionalLight(SceneAddDirectionalLightCmd),
Scene_AddPointLight(SceneAddPointLightCmd),
SetDisplayColorConversion(SetDisplayColorConversionCmdHack),
SetDisplayRotation(SetDisplayRotationCmdHack),
SetEnableViewDebugBounds(SetEnableDebugViewBoundsCmd),
SetViewHolderBoundsColor(SetViewHolderBoundsColorCmd),
SetCameraClipSpaceTransform(SetCameraClipSpaceTransformCmd),
SetDisplayMinimumRgb(SetDisplayMinimumRgbCmdHack),
SetSemanticVisibility(SetSemanticVisibilityCmd),
}
impl Command {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::CreateResource(_) => 1,
Self::ReleaseResource(_) => 2,
Self::ExportResource(_) => 3,
Self::ImportResource(_) => 4,
Self::SetTag(_) => 5,
Self::Detach(_) => 6,
Self::SetTranslation(_) => 7,
Self::SetScale(_) => 8,
Self::SetRotation(_) => 9,
Self::SetAnchor(_) => 10,
Self::SetSize(_) => 11,
Self::SetOpacity(_) => 12,
Self::SendSizeChangeHintHack(_) => 13,
Self::AddChild(_) => 14,
Self::AddPart(_) => 15,
Self::DetachChildren(_) => 16,
Self::SetShape(_) => 17,
Self::SetMaterial(_) => 18,
Self::SetClip(_) => 19,
Self::SetHitTestBehavior(_) => 20,
Self::SetViewProperties(_) => 21,
Self::TakeSnapshotCmd(_) => 22,
Self::SetCamera(_) => 23,
Self::SetCameraTransform(_) => 24,
Self::SetCameraProjection(_) => 25,
Self::SetStereoCameraProjection(_) => 26,
Self::SetCameraPoseBuffer(_) => 27,
Self::SetLightColor(_) => 28,
Self::SetLightDirection(_) => 29,
Self::AddLight(_) => 30,
Self::DetachLight(_) => 31,
Self::DetachLights(_) => 32,
Self::SetTexture(_) => 33,
Self::SetColor(_) => 34,
Self::BindMeshBuffers(_) => 35,
Self::AddLayer(_) => 36,
Self::RemoveLayer(_) => 37,
Self::RemoveAllLayers(_) => 38,
Self::SetLayerStack(_) => 39,
Self::SetRenderer(_) => 40,
Self::SetRendererParam(_) => 41,
Self::SetEventMask(_) => 42,
Self::SetLabel(_) => 43,
Self::SetDisableClipping(_) => 44,
Self::SetImportFocus(_) => 45,
Self::SetClipPlanes(_) => 46,
Self::SetPointLightPosition(_) => 47,
Self::SetPointLightFalloff(_) => 48,
Self::Scene_AddAmbientLight(_) => 49,
Self::Scene_AddDirectionalLight(_) => 50,
Self::Scene_AddPointLight(_) => 51,
Self::SetDisplayColorConversion(_) => 52,
Self::SetDisplayRotation(_) => 53,
Self::SetEnableViewDebugBounds(_) => 54,
Self::SetViewHolderBoundsColor(_) => 55,
Self::SetCameraClipSpaceTransform(_) => 56,
Self::SetDisplayMinimumRgb(_) => 57,
Self::SetSemanticVisibility(_) => 58,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Command {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub enum Event {
Metrics(MetricsEvent),
SizeChangeHint(SizeChangeHintEvent),
ImportUnbound(ImportUnboundEvent),
ViewConnected(ViewConnectedEvent),
ViewDisconnected(ViewDisconnectedEvent),
ViewHolderDisconnected(ViewHolderDisconnectedEvent),
ViewAttachedToScene(ViewAttachedToSceneEvent),
ViewDetachedFromScene(ViewDetachedFromSceneEvent),
ViewPropertiesChanged(ViewPropertiesChangedEvent),
ViewStateChanged(ViewStateChangedEvent),
ViewHolderConnected(ViewHolderConnectedEvent),
}
impl Event {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Metrics(_) => 1,
Self::SizeChangeHint(_) => 2,
Self::ImportUnbound(_) => 3,
Self::ViewConnected(_) => 4,
Self::ViewDisconnected(_) => 5,
Self::ViewHolderDisconnected(_) => 6,
Self::ViewAttachedToScene(_) => 7,
Self::ViewDetachedFromScene(_) => 8,
Self::ViewPropertiesChanged(_) => 9,
Self::ViewStateChanged(_) => 10,
Self::ViewHolderConnected(_) => 11,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for Event {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum RendererParam {
ShadowTechnique(ShadowTechnique),
Reserved(RenderFrequency),
EnableDebugging(bool),
}
impl RendererParam {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::ShadowTechnique(_) => 1,
Self::Reserved(_) => 2,
Self::EnableDebugging(_) => 3,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for RendererParam {}
#[derive(Debug, PartialEq)]
pub enum ResourceArgs {
Memory(MemoryArgs),
Image(ImageArgs),
Buffer(BufferArgs),
View(ViewArgs),
ViewHolder(ViewHolderArgs),
Rectangle(RectangleArgs),
RoundedRectangle(RoundedRectangleArgs),
Circle(CircleArgs),
Mesh(MeshArgs),
ShapeNode(ShapeNodeArgs),
ClipNode(ClipNodeArgs),
EntityNode(EntityNodeArgs),
OpacityNode(OpacityNodeArgsHack),
Material(MaterialArgs),
Compositor(CompositorArgs),
DisplayCompositor(DisplayCompositorArgs),
LayerStack(LayerStackArgs),
Layer(LayerArgs),
Scene(SceneArgs),
Camera(CameraArgs),
StereoCamera(StereoCameraArgs),
Renderer(RendererArgs),
AmbientLight(AmbientLightArgs),
DirectionalLight(DirectionalLightArgs),
Variable(VariableArgs),
PointLight(PointLightArgs),
View3(ViewArgs3),
ImagePipe2(ImagePipe2Args),
Image2(ImageArgs2),
Image3(ImageArgs3),
}
impl ResourceArgs {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Memory(_) => 1,
Self::Image(_) => 2,
Self::Buffer(_) => 4,
Self::View(_) => 5,
Self::ViewHolder(_) => 6,
Self::Rectangle(_) => 7,
Self::RoundedRectangle(_) => 8,
Self::Circle(_) => 9,
Self::Mesh(_) => 10,
Self::ShapeNode(_) => 11,
Self::ClipNode(_) => 12,
Self::EntityNode(_) => 13,
Self::OpacityNode(_) => 14,
Self::Material(_) => 15,
Self::Compositor(_) => 16,
Self::DisplayCompositor(_) => 17,
Self::LayerStack(_) => 19,
Self::Layer(_) => 20,
Self::Scene(_) => 21,
Self::Camera(_) => 22,
Self::StereoCamera(_) => 23,
Self::Renderer(_) => 24,
Self::AmbientLight(_) => 25,
Self::DirectionalLight(_) => 26,
Self::Variable(_) => 27,
Self::PointLight(_) => 28,
Self::View3(_) => 31,
Self::ImagePipe2(_) => 32,
Self::Image2(_) => 33,
Self::Image3(_) => 34,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ResourceArgs {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub enum Value {
Vector1(f32),
Vector2(Vec2),
Vector3(Vec3),
Vector4(Vec4),
Matrix4x4(Mat4),
ColorRgba(ColorRgba),
ColorRgb(ColorRgb),
Degrees(f32),
Quaternion(Quaternion),
Transform(FactoredTransform),
VariableId(u32),
}
impl Value {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Vector1(_) => 1,
Self::Vector2(_) => 2,
Self::Vector3(_) => 3,
Self::Vector4(_) => 4,
Self::Matrix4x4(_) => 5,
Self::ColorRgba(_) => 6,
Self::ColorRgb(_) => 7,
Self::Degrees(_) => 8,
Self::Quaternion(_) => 9,
Self::Transform(_) => 10,
Self::VariableId(_) => 11,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for Value {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SnapshotCallbackDeprecatedMarker;
impl fidl::endpoints::ProtocolMarker for SnapshotCallbackDeprecatedMarker {
type Proxy = SnapshotCallbackDeprecatedProxy;
type RequestStream = SnapshotCallbackDeprecatedRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SnapshotCallbackDeprecatedSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) SnapshotCallbackDeprecated";
}
pub trait SnapshotCallbackDeprecatedProxyInterface: Send + Sync {
fn r#on_data(&self, data: fidl_fuchsia_mem::Buffer) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SnapshotCallbackDeprecatedSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SnapshotCallbackDeprecatedSynchronousProxy {
type Proxy = SnapshotCallbackDeprecatedProxy;
type Protocol = SnapshotCallbackDeprecatedMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl SnapshotCallbackDeprecatedSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<SnapshotCallbackDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<SnapshotCallbackDeprecatedEvent, fidl::Error> {
SnapshotCallbackDeprecatedEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#on_data(&self, mut data: fidl_fuchsia_mem::Buffer) -> Result<(), fidl::Error> {
self.client.send::<SnapshotCallbackDeprecatedOnDataRequest>(
(&mut data,),
0x11d1a93b419b7d9f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct SnapshotCallbackDeprecatedProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SnapshotCallbackDeprecatedProxy {
type Protocol = SnapshotCallbackDeprecatedMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl SnapshotCallbackDeprecatedProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<SnapshotCallbackDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SnapshotCallbackDeprecatedEventStream {
SnapshotCallbackDeprecatedEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#on_data(&self, mut data: fidl_fuchsia_mem::Buffer) -> Result<(), fidl::Error> {
SnapshotCallbackDeprecatedProxyInterface::r#on_data(self, data)
}
}
impl SnapshotCallbackDeprecatedProxyInterface for SnapshotCallbackDeprecatedProxy {
fn r#on_data(&self, mut data: fidl_fuchsia_mem::Buffer) -> Result<(), fidl::Error> {
self.client.send::<SnapshotCallbackDeprecatedOnDataRequest>(
(&mut data,),
0x11d1a93b419b7d9f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct SnapshotCallbackDeprecatedEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SnapshotCallbackDeprecatedEventStream {}
impl futures::stream::FusedStream for SnapshotCallbackDeprecatedEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SnapshotCallbackDeprecatedEventStream {
type Item = Result<SnapshotCallbackDeprecatedEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(SnapshotCallbackDeprecatedEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SnapshotCallbackDeprecatedEvent {}
impl SnapshotCallbackDeprecatedEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SnapshotCallbackDeprecatedEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <SnapshotCallbackDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
})
}
}
}
pub struct SnapshotCallbackDeprecatedRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SnapshotCallbackDeprecatedRequestStream {}
impl futures::stream::FusedStream for SnapshotCallbackDeprecatedRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SnapshotCallbackDeprecatedRequestStream {
type Protocol = SnapshotCallbackDeprecatedMarker;
type ControlHandle = SnapshotCallbackDeprecatedControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
SnapshotCallbackDeprecatedControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for SnapshotCallbackDeprecatedRequestStream {
type Item = Result<SnapshotCallbackDeprecatedRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled SnapshotCallbackDeprecatedRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x11d1a93b419b7d9f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(SnapshotCallbackDeprecatedOnDataRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SnapshotCallbackDeprecatedOnDataRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SnapshotCallbackDeprecatedControlHandle {
inner: this.inner.clone(),
};
Ok(SnapshotCallbackDeprecatedRequest::OnData {data: req.data,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <SnapshotCallbackDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SnapshotCallbackDeprecatedRequest {
OnData {
data: fidl_fuchsia_mem::Buffer,
control_handle: SnapshotCallbackDeprecatedControlHandle,
},
}
impl SnapshotCallbackDeprecatedRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_on_data(
self,
) -> Option<(fidl_fuchsia_mem::Buffer, SnapshotCallbackDeprecatedControlHandle)> {
if let SnapshotCallbackDeprecatedRequest::OnData { data, control_handle } = self {
Some((data, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SnapshotCallbackDeprecatedRequest::OnData { .. } => "on_data",
}
}
}
#[derive(Debug, Clone)]
pub struct SnapshotCallbackDeprecatedControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SnapshotCallbackDeprecatedControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl SnapshotCallbackDeprecatedControlHandle {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for HitTestBehavior {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for HitTestBehavior {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for HitTestBehavior
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitTestBehavior {
#[inline(always)]
fn new_empty() -> Self {
Self::KDefault
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ImportSpec {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ImportSpec {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImportSpec {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportSpec {
#[inline(always)]
fn new_empty() -> Self {
Self::Node
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MeshIndexFormat {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for MeshIndexFormat {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for MeshIndexFormat
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshIndexFormat {
#[inline(always)]
fn new_empty() -> Self {
Self::KUint16
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RenderFrequency {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for RenderFrequency {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for RenderFrequency
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RenderFrequency {
#[inline(always)]
fn new_empty() -> Self {
Self::WhenRequested
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ShadowTechnique {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ShadowTechnique {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ShadowTechnique
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShadowTechnique {
#[inline(always)]
fn new_empty() -> Self {
Self::Unshadowed
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ValueType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ValueType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ValueType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValueType {
#[inline(always)]
fn new_empty() -> Self {
Self::KNone
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddChildCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddChildCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddChildCmd, D>
for &AddChildCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddChildCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AddChildCmd).write_unaligned((self as *const AddChildCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<AddChildCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddChildCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddChildCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), child_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddLayerCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddLayerCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLayerCmd, D>
for &AddLayerCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddLayerCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AddLayerCmd).write_unaligned((self as *const AddLayerCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<AddLayerCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddLayerCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLayerCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddLightCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddLightCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddLightCmd, D>
for &AddLightCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddLightCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AddLightCmd).write_unaligned((self as *const AddLightCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<AddLightCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddLightCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddLightCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddPartCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddPartCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddPartCmd, D>
for &AddPartCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddPartCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AddPartCmd).write_unaligned((self as *const AddPartCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<AddPartCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddPartCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddPartCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), part_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AmbientLightArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AmbientLightArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AmbientLightArgs, D>
for &AmbientLightArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AmbientLightArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AmbientLightArgs)
.write_unaligned((self as *const AmbientLightArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<AmbientLightArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AmbientLightArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AmbientLightArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BindMeshBuffersCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BindMeshBuffersCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
88
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BindMeshBuffersCmd, D>
for &BindMeshBuffersCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
fidl::encoding::Encode::<BindMeshBuffersCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.mesh_id),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_buffer_id),
<MeshIndexFormat as fidl::encoding::ValueTypeMarker>::borrow(
&self.index_format,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_offset),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index_count),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_buffer_id),
<MeshVertexFormat as fidl::encoding::ValueTypeMarker>::borrow(
&self.vertex_format,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_offset),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertex_count),
<BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<MeshIndexFormat, D>,
T3: fidl::encoding::Encode<u64, D>,
T4: fidl::encoding::Encode<u32, D>,
T5: fidl::encoding::Encode<u32, D>,
T6: fidl::encoding::Encode<MeshVertexFormat, D>,
T7: fidl::encoding::Encode<u64, D>,
T8: fidl::encoding::Encode<u32, D>,
T9: fidl::encoding::Encode<BoundingBox, D>,
> fidl::encoding::Encode<BindMeshBuffersCmd, D>
for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BindMeshBuffersCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(80);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 16, depth)?;
self.4.encode(encoder, offset + 24, depth)?;
self.5.encode(encoder, offset + 28, depth)?;
self.6.encode(encoder, offset + 32, depth)?;
self.7.encode(encoder, offset + 48, depth)?;
self.8.encode(encoder, offset + 56, depth)?;
self.9.encode(encoder, offset + 60, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BindMeshBuffersCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
mesh_id: fidl::new_empty!(u32, D),
index_buffer_id: fidl::new_empty!(u32, D),
index_format: fidl::new_empty!(MeshIndexFormat, D),
index_offset: fidl::new_empty!(u64, D),
index_count: fidl::new_empty!(u32, D),
vertex_buffer_id: fidl::new_empty!(u32, D),
vertex_format: fidl::new_empty!(MeshVertexFormat, D),
vertex_offset: fidl::new_empty!(u64, D),
vertex_count: fidl::new_empty!(u32, D),
bounding_box: fidl::new_empty!(BoundingBox, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.mesh_id, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.index_buffer_id, decoder, offset + 4, _depth)?;
fidl::decode!(MeshIndexFormat, D, &mut self.index_format, decoder, offset + 8, _depth)?;
fidl::decode!(u64, D, &mut self.index_offset, decoder, offset + 16, _depth)?;
fidl::decode!(u32, D, &mut self.index_count, decoder, offset + 24, _depth)?;
fidl::decode!(u32, D, &mut self.vertex_buffer_id, decoder, offset + 28, _depth)?;
fidl::decode!(
MeshVertexFormat,
D,
&mut self.vertex_format,
decoder,
offset + 32,
_depth
)?;
fidl::decode!(u64, D, &mut self.vertex_offset, decoder, offset + 48, _depth)?;
fidl::decode!(u32, D, &mut self.vertex_count, decoder, offset + 56, _depth)?;
fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 60, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BoundingBox {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BoundingBox {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BoundingBox, D>
for &BoundingBox
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BoundingBox>(offset);
fidl::encoding::Encode::<BoundingBox, D>::encode(
(
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.min),
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.max),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Vec3, D>,
T1: fidl::encoding::Encode<Vec3, D>,
> fidl::encoding::Encode<BoundingBox, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BoundingBox>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoundingBox {
#[inline(always)]
fn new_empty() -> Self {
Self { min: fidl::new_empty!(Vec3, D), max: fidl::new_empty!(Vec3, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Vec3, D, &mut self.min, decoder, offset + 0, _depth)?;
fidl::decode!(Vec3, D, &mut self.max, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BufferArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BufferArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferArgs, D>
for &BufferArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BufferArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BufferArgs).write_unaligned((self as *const BufferArgs).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<BufferArgs, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BufferArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
memory_id: fidl::new_empty!(u32, D),
memory_offset: fidl::new_empty!(u32, D),
num_bytes: fidl::new_empty!(u32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CameraArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CameraArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CameraArgs, D>
for &CameraArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CameraArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CameraArgs).write_unaligned((self as *const CameraArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<CameraArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CameraArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CameraArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { scene_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CircleArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CircleArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CircleArgs, D>
for &CircleArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CircleArgs>(offset);
fidl::encoding::Encode::<CircleArgs, D>::encode(
(<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.radius),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Value, D>>
fidl::encoding::Encode<CircleArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CircleArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CircleArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { radius: fidl::new_empty!(Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Value, D, &mut self.radius, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClipNodeArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClipNodeArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClipNodeArgs, D>
for &ClipNodeArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClipNodeArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClipNodeArgs)
.write_unaligned((self as *const ClipNodeArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ClipNodeArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClipNodeArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClipNodeArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { unused: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ColorRgb {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ColorRgb {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgb, D> for &ColorRgb {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgb>(offset);
fidl::encoding::Encode::<ColorRgb, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<ColorRgb, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgb>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgb {
#[inline(always)]
fn new_empty() -> Self {
Self {
red: fidl::new_empty!(f32, D),
green: fidl::new_empty!(f32, D),
blue: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(f32, D, &mut self.red, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.green, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.blue, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ColorRgbValue {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ColorRgbValue {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbValue, D>
for &ColorRgbValue
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgbValue>(offset);
fidl::encoding::Encode::<ColorRgbValue, D>::encode(
(
<ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<ColorRgb, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<ColorRgbValue, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgbValue>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbValue {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(ColorRgb, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(ColorRgb, D, &mut self.value, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ColorRgba {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ColorRgba {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgba, D>
for &ColorRgba
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgba>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ColorRgba).write_unaligned((self as *const ColorRgba).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u8, D>,
T1: fidl::encoding::Encode<u8, D>,
T2: fidl::encoding::Encode<u8, D>,
T3: fidl::encoding::Encode<u8, D>,
> fidl::encoding::Encode<ColorRgba, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgba>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
self.2.encode(encoder, offset + 2, depth)?;
self.3.encode(encoder, offset + 3, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgba {
#[inline(always)]
fn new_empty() -> Self {
Self {
red: fidl::new_empty!(u8, D),
green: fidl::new_empty!(u8, D),
blue: fidl::new_empty!(u8, D),
alpha: fidl::new_empty!(u8, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ColorRgbaValue {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ColorRgbaValue {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgbaValue, D>
for &ColorRgbaValue
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgbaValue>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ColorRgbaValue)
.write_unaligned((self as *const ColorRgbaValue).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<ColorRgba, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<ColorRgbaValue, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ColorRgbaValue>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgbaValue {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(ColorRgba, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositorArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositorArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompositorArgs, D>
for &CompositorArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositorArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CompositorArgs)
.write_unaligned((self as *const CompositorArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<CompositorArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositorArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositorArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CreateResourceCmd {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateResourceCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<CreateResourceCmd, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut CreateResourceCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateResourceCmd>(offset);
fidl::encoding::Encode::<CreateResourceCmd, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<ResourceArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resource),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<ResourceArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<CreateResourceCmd, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateResourceCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CreateResourceCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
resource: fidl::new_empty!(
ResourceArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
ResourceArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.resource,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DetachChildrenCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DetachChildrenCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachChildrenCmd, D>
for &DetachChildrenCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DetachChildrenCmd)
.write_unaligned((self as *const DetachChildrenCmd).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DetachChildrenCmd, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachChildrenCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachChildrenCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DetachCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DetachCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachCmd, D>
for &DetachCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DetachCmd).write_unaligned((self as *const DetachCmd).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DetachCmd, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DetachLightCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DetachLightCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightCmd, D>
for &DetachLightCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachLightCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DetachLightCmd)
.write_unaligned((self as *const DetachLightCmd).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DetachLightCmd, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachLightCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { light_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DetachLightsCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DetachLightsCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DetachLightsCmd, D>
for &DetachLightsCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachLightsCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DetachLightsCmd)
.write_unaligned((self as *const DetachLightsCmd).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DetachLightsCmd, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DetachLightsCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetachLightsCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { scene_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectionalLightArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectionalLightArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectionalLightArgs, D>
for &DirectionalLightArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DirectionalLightArgs)
.write_unaligned((self as *const DirectionalLightArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DirectionalLightArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectionalLightArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectionalLightArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DisplayCompositorArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DisplayCompositorArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayCompositorArgs, D>
for &DisplayCompositorArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DisplayCompositorArgs)
.write_unaligned((self as *const DisplayCompositorArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DisplayCompositorArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DisplayCompositorArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayCompositorArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DisplayInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DisplayInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayInfo, D>
for &DisplayInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DisplayInfo>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DisplayInfo).write_unaligned((self as *const DisplayInfo).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<DisplayInfo, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DisplayInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayInfo {
#[inline(always)]
fn new_empty() -> Self {
Self { width_in_px: fidl::new_empty!(u32, D), height_in_px: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for EntityNodeArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EntityNodeArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EntityNodeArgs, D>
for &EntityNodeArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EntityNodeArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut EntityNodeArgs)
.write_unaligned((self as *const EntityNodeArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<EntityNodeArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EntityNodeArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EntityNodeArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { unused: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ExportResourceCmdDeprecated {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ExportResourceCmdDeprecated {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
ExportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ExportResourceCmdDeprecated
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExportResourceCmdDeprecated>(offset);
fidl::encoding::Encode::<
ExportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ExportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExportResourceCmdDeprecated>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ExportResourceCmdDeprecated
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ExportToken {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ExportToken {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl fidl::encoding::Encode<ExportToken, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ExportToken
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExportToken>(offset);
fidl::encoding::Encode::<ExportToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ExportToken, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExportToken>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ExportToken {
#[inline(always)]
fn new_empty() -> Self {
Self {
value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FactoredTransform {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FactoredTransform {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
52
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FactoredTransform, D>
for &FactoredTransform
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FactoredTransform>(offset);
fidl::encoding::Encode::<FactoredTransform, D>::encode(
(
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.anchor),
<Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.rotation),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Vec3, D>,
T1: fidl::encoding::Encode<Vec3, D>,
T2: fidl::encoding::Encode<Vec3, D>,
T3: fidl::encoding::Encode<Quaternion, D>,
> fidl::encoding::Encode<FactoredTransform, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FactoredTransform>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 12, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 36, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FactoredTransform {
#[inline(always)]
fn new_empty() -> Self {
Self {
translation: fidl::new_empty!(Vec3, D),
scale: fidl::new_empty!(Vec3, D),
anchor: fidl::new_empty!(Vec3, D),
rotation: fidl::new_empty!(Quaternion, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Vec3, D, &mut self.translation, decoder, offset + 0, _depth)?;
fidl::decode!(Vec3, D, &mut self.scale, decoder, offset + 12, _depth)?;
fidl::decode!(Vec3, D, &mut self.anchor, decoder, offset + 24, _depth)?;
fidl::decode!(Quaternion, D, &mut self.rotation, decoder, offset + 36, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FloatValue {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FloatValue {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FloatValue, D>
for &FloatValue
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FloatValue>(offset);
fidl::encoding::Encode::<FloatValue, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<FloatValue, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FloatValue>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FloatValue {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(f32, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ImageArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImageArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs, D>
for &ImageArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImageArgs>(offset);
fidl::encoding::Encode::<ImageArgs, D>::encode(
(
<fidl_fuchsia_images::ImageInfo as fidl::encoding::ValueTypeMarker>::borrow(
&self.info,
),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_id),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_offset),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_images::ImageInfo, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<ImageArgs, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImageArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 32, depth)?;
self.2.encode(encoder, offset + 36, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
info: fidl::new_empty!(fidl_fuchsia_images::ImageInfo, D),
memory_id: fidl::new_empty!(u32, D),
memory_offset: fidl::new_empty!(u32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_images::ImageInfo,
D,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u32, D, &mut self.memory_id, decoder, offset + 32, _depth)?;
fidl::decode!(u32, D, &mut self.memory_offset, decoder, offset + 36, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ImageArgs2 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImageArgs2 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageArgs2, D>
for &ImageArgs2
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImageArgs2>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ImageArgs2).write_unaligned((self as *const ImageArgs2).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<u32, D>,
T3: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<ImageArgs2, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImageArgs2>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageArgs2 {
#[inline(always)]
fn new_empty() -> Self {
Self {
width: fidl::new_empty!(u32, D),
height: fidl::new_empty!(u32, D),
buffer_collection_id: fidl::new_empty!(u32, D),
buffer_collection_index: fidl::new_empty!(u32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ImageArgs3 {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImageArgs3 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl fidl::encoding::Encode<ImageArgs3, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ImageArgs3
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImageArgs3>(offset);
fidl::encoding::Encode::<ImageArgs3, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
<fidl_fuchsia_ui_composition::BufferCollectionImportToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.import_token),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_index),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl_fuchsia_ui_composition::BufferCollectionImportToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
> fidl::encoding::Encode<ImageArgs3, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImageArgs3>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ImageArgs3 {
#[inline(always)]
fn new_empty() -> Self {
Self {
width: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
height: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
import_token: fidl::new_empty!(
fidl_fuchsia_ui_composition::BufferCollectionImportToken,
fidl::encoding::DefaultFuchsiaResourceDialect
),
buffer_collection_index: fidl::new_empty!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.width,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.height,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl_fuchsia_ui_composition::BufferCollectionImportToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.import_token,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.buffer_collection_index,
decoder,
offset + 12,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ImagePipe2Args {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImagePipe2Args {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<ImagePipe2Args, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ImagePipe2Args
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImagePipe2Args>(offset);
fidl::encoding::Encode::<ImagePipe2Args, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_images::ImagePipe2Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.image_pipe_request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_images::ImagePipe2Marker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ImagePipe2Args, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImagePipe2Args>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ImagePipe2Args
{
#[inline(always)]
fn new_empty() -> Self {
Self {
image_pipe_request: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_images::ImagePipe2Marker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_images::ImagePipe2Marker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.image_pipe_request,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ImportResourceCmdDeprecated {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImportResourceCmdDeprecated {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl
fidl::encoding::Encode<
ImportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ImportResourceCmdDeprecated
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImportResourceCmdDeprecated>(offset);
fidl::encoding::Encode::<
ImportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),
<ImportSpec as fidl::encoding::ValueTypeMarker>::borrow(&self.spec),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<ImportSpec, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
ImportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImportResourceCmdDeprecated>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ImportResourceCmdDeprecated
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
spec: fidl::new_empty!(ImportSpec, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
fidl::decode!(
ImportSpec,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.spec,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ImportToken {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImportToken {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl fidl::encoding::Encode<ImportToken, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ImportToken
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImportToken>(offset);
fidl::encoding::Encode::<ImportToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ImportToken, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImportToken>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ImportToken {
#[inline(always)]
fn new_empty() -> Self {
Self {
value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ImportUnboundEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImportUnboundEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImportUnboundEvent, D>
for &ImportUnboundEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ImportUnboundEvent)
.write_unaligned((self as *const ImportUnboundEvent).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ImportUnboundEvent, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImportUnboundEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImportUnboundEvent {
#[inline(always)]
fn new_empty() -> Self {
Self { resource_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LayerArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LayerArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerArgs, D>
for &LayerArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LayerArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LayerArgs).write_unaligned((self as *const LayerArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LayerArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LayerArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LayerStackArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LayerStackArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerStackArgs, D>
for &LayerStackArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LayerStackArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LayerStackArgs)
.write_unaligned((self as *const LayerStackArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LayerStackArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LayerStackArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerStackArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for MaterialArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MaterialArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MaterialArgs, D>
for &MaterialArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MaterialArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut MaterialArgs)
.write_unaligned((self as *const MaterialArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<MaterialArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MaterialArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MaterialArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Matrix4Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Matrix4Value {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
68
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Matrix4Value, D>
for &Matrix4Value
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Matrix4Value>(offset);
fidl::encoding::Encode::<Matrix4Value, D>::encode(
(
<Mat4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Mat4, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<Matrix4Value, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Matrix4Value>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 64, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Matrix4Value {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Mat4, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Mat4, D, &mut self.value, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 64, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for MemoryArgs {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MemoryArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl fidl::encoding::Encode<MemoryArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut MemoryArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MemoryArgs>(offset);
fidl::encoding::Encode::<MemoryArgs, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.vmo),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.allocation_size),
<fidl_fuchsia_images::MemoryType as fidl::encoding::ValueTypeMarker>::borrow(&self.memory_type),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl_fuchsia_images::MemoryType,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<MemoryArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MemoryArgs>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for MemoryArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
allocation_size: fidl::new_empty!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect
),
memory_type: fidl::new_empty!(
fidl_fuchsia_images::MemoryType,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.allocation_size,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl_fuchsia_images::MemoryType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.memory_type,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for MeshArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MeshArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshArgs, D> for &MeshArgs {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MeshArgs>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshArgs {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for MeshVertexFormat {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MeshVertexFormat {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MeshVertexFormat, D>
for &MeshVertexFormat
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MeshVertexFormat>(offset);
fidl::encoding::Encode::<MeshVertexFormat, D>::encode(
(
<ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.position_type),
<ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.normal_type),
<ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.tex_coord_type),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<ValueType, D>,
T1: fidl::encoding::Encode<ValueType, D>,
T2: fidl::encoding::Encode<ValueType, D>,
> fidl::encoding::Encode<MeshVertexFormat, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MeshVertexFormat>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MeshVertexFormat {
#[inline(always)]
fn new_empty() -> Self {
Self {
position_type: fidl::new_empty!(ValueType, D),
normal_type: fidl::new_empty!(ValueType, D),
tex_coord_type: fidl::new_empty!(ValueType, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(ValueType, D, &mut self.position_type, decoder, offset + 0, _depth)?;
fidl::decode!(ValueType, D, &mut self.normal_type, decoder, offset + 4, _depth)?;
fidl::decode!(ValueType, D, &mut self.tex_coord_type, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Metrics {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Metrics {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metrics, D> for &Metrics {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Metrics>(offset);
fidl::encoding::Encode::<Metrics, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_x),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_y),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale_z),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<Metrics, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Metrics>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metrics {
#[inline(always)]
fn new_empty() -> Self {
Self {
scale_x: fidl::new_empty!(f32, D),
scale_y: fidl::new_empty!(f32, D),
scale_z: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(f32, D, &mut self.scale_x, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.scale_y, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.scale_z, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for MetricsEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MetricsEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MetricsEvent, D>
for &MetricsEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MetricsEvent>(offset);
fidl::encoding::Encode::<MetricsEvent, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<Metrics as fidl::encoding::ValueTypeMarker>::borrow(&self.metrics),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Metrics, D>,
> fidl::encoding::Encode<MetricsEvent, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MetricsEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MetricsEvent {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), metrics: fidl::new_empty!(Metrics, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(Metrics, D, &mut self.metrics, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpacityNodeArgsHack {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpacityNodeArgsHack {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OpacityNodeArgsHack, D>
for &OpacityNodeArgsHack
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut OpacityNodeArgsHack)
.write_unaligned((self as *const OpacityNodeArgsHack).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<OpacityNodeArgsHack, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpacityNodeArgsHack>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpacityNodeArgsHack {
#[inline(always)]
fn new_empty() -> Self {
Self { unused: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Plane3 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Plane3 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Plane3, D> for &Plane3 {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Plane3>(offset);
fidl::encoding::Encode::<Plane3, D>::encode(
(
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.dir),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dist),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Vec3, D>,
T1: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<Plane3, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Plane3>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Plane3 {
#[inline(always)]
fn new_empty() -> Self {
Self { dir: fidl::new_empty!(Vec3, D), dist: fidl::new_empty!(f32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Vec3, D, &mut self.dir, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.dist, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PointLightArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PointLightArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PointLightArgs, D>
for &PointLightArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PointLightArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut PointLightArgs)
.write_unaligned((self as *const PointLightArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<PointLightArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PointLightArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PointLightArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Quaternion {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Quaternion {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Quaternion, D>
for &Quaternion
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Quaternion>(offset);
fidl::encoding::Encode::<Quaternion, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
T3: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<Quaternion, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Quaternion>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Quaternion {
#[inline(always)]
fn new_empty() -> Self {
Self {
x: fidl::new_empty!(f32, D),
y: fidl::new_empty!(f32, D),
z: fidl::new_empty!(f32, D),
w: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for QuaternionValue {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for QuaternionValue {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QuaternionValue, D>
for &QuaternionValue
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<QuaternionValue>(offset);
fidl::encoding::Encode::<QuaternionValue, D>::encode(
(
<Quaternion as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Quaternion, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<QuaternionValue, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<QuaternionValue>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QuaternionValue {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Quaternion, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Quaternion, D, &mut self.value, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RectangleArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RectangleArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RectangleArgs, D>
for &RectangleArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RectangleArgs>(offset);
fidl::encoding::Encode::<RectangleArgs, D>::encode(
(
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Value, D>,
T1: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<RectangleArgs, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RectangleArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RectangleArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { width: fidl::new_empty!(Value, D), height: fidl::new_empty!(Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ReleaseResourceCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ReleaseResourceCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReleaseResourceCmd, D>
for &ReleaseResourceCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ReleaseResourceCmd)
.write_unaligned((self as *const ReleaseResourceCmd).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ReleaseResourceCmd, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReleaseResourceCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReleaseResourceCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RemoveAllLayersCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoveAllLayersCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveAllLayersCmd, D>
for &RemoveAllLayersCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RemoveAllLayersCmd)
.write_unaligned((self as *const RemoveAllLayersCmd).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<RemoveAllLayersCmd, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoveAllLayersCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveAllLayersCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { layer_stack_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RemoveLayerCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoveLayerCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RemoveLayerCmd, D>
for &RemoveLayerCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RemoveLayerCmd)
.write_unaligned((self as *const RemoveLayerCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<RemoveLayerCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoveLayerCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RemoveLayerCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { layer_stack_id: fidl::new_empty!(u32, D), layer_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RendererArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RendererArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererArgs, D>
for &RendererArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RendererArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RendererArgs)
.write_unaligned((self as *const RendererArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<RendererArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RendererArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RoundedRectangleArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RoundedRectangleArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
96
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RoundedRectangleArgs, D>
for &RoundedRectangleArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
fidl::encoding::Encode::<RoundedRectangleArgs, D>::encode(
(
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_left_radius),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.top_right_radius),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_right_radius),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_left_radius),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Value, D>,
T1: fidl::encoding::Encode<Value, D>,
T2: fidl::encoding::Encode<Value, D>,
T3: fidl::encoding::Encode<Value, D>,
T4: fidl::encoding::Encode<Value, D>,
T5: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<RoundedRectangleArgs, D> for (T0, T1, T2, T3, T4, T5)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RoundedRectangleArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
self.3.encode(encoder, offset + 48, depth)?;
self.4.encode(encoder, offset + 64, depth)?;
self.5.encode(encoder, offset + 80, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RoundedRectangleArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
width: fidl::new_empty!(Value, D),
height: fidl::new_empty!(Value, D),
top_left_radius: fidl::new_empty!(Value, D),
top_right_radius: fidl::new_empty!(Value, D),
bottom_right_radius: fidl::new_empty!(Value, D),
bottom_left_radius: fidl::new_empty!(Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Value, D, &mut self.width, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.height, decoder, offset + 16, _depth)?;
fidl::decode!(Value, D, &mut self.top_left_radius, decoder, offset + 32, _depth)?;
fidl::decode!(Value, D, &mut self.top_right_radius, decoder, offset + 48, _depth)?;
fidl::decode!(Value, D, &mut self.bottom_right_radius, decoder, offset + 64, _depth)?;
fidl::decode!(Value, D, &mut self.bottom_left_radius, decoder, offset + 80, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SceneAddAmbientLightCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SceneAddAmbientLightCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for &SceneAddAmbientLightCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SceneAddAmbientLightCmd)
.write_unaligned((self as *const SceneAddAmbientLightCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SceneAddAmbientLightCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneAddAmbientLightCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SceneAddAmbientLightCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SceneAddDirectionalLightCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SceneAddDirectionalLightCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for &SceneAddDirectionalLightCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SceneAddDirectionalLightCmd)
.write_unaligned((self as *const SceneAddDirectionalLightCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SceneAddDirectionalLightCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneAddDirectionalLightCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SceneAddDirectionalLightCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SceneAddPointLightCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SceneAddPointLightCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneAddPointLightCmd, D>
for &SceneAddPointLightCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SceneAddPointLightCmd)
.write_unaligned((self as *const SceneAddPointLightCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SceneAddPointLightCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneAddPointLightCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneAddPointLightCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { scene_id: fidl::new_empty!(u32, D), light_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SceneArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SceneArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SceneArgs, D>
for &SceneArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SceneArgs).write_unaligned((self as *const SceneArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<SceneArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SceneArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SceneArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { dummy: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SendSizeChangeHintCmdHack {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SendSizeChangeHintCmdHack {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for &SendSizeChangeHintCmdHack
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
fidl::encoding::Encode::<SendSizeChangeHintCmdHack, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<SendSizeChangeHintCmdHack, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SendSizeChangeHintCmdHack>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SendSizeChangeHintCmdHack
{
#[inline(always)]
fn new_empty() -> Self {
Self {
node_id: fidl::new_empty!(u32, D),
width_change_factor: fidl::new_empty!(f32, D),
height_change_factor: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetAnchorCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetAnchorCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetAnchorCmd, D>
for &SetAnchorCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetAnchorCmd>(offset);
fidl::encoding::Encode::<SetAnchorCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vector3Value, D>,
> fidl::encoding::Encode<SetAnchorCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetAnchorCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetAnchorCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetCameraClipSpaceTransformCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetCameraClipSpaceTransformCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D>
for &SetCameraClipSpaceTransformCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
fidl::encoding::Encode::<SetCameraClipSpaceTransformCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
<Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.translation),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.scale),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vec2, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<SetCameraClipSpaceTransformCmd, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraClipSpaceTransformCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetCameraClipSpaceTransformCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self {
camera_id: fidl::new_empty!(u32, D),
translation: fidl::new_empty!(Vec2, D),
scale: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
fidl::decode!(Vec2, D, &mut self.translation, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.scale, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetCameraCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetCameraCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraCmd, D>
for &SetCameraCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetCameraCmd)
.write_unaligned((self as *const SetCameraCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetCameraCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { renderer_id: fidl::new_empty!(u32, D), camera_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetCameraPoseBufferCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetCameraPoseBufferCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for &SetCameraPoseBufferCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetCameraPoseBufferCmd)
.write_unaligned((self as *const SetCameraPoseBufferCmd).read());
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<u32, D>,
T3: fidl::encoding::Encode<i64, D>,
T4: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<SetCameraPoseBufferCmd, D> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraPoseBufferCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 16, depth)?;
self.4.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetCameraPoseBufferCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self {
camera_id: fidl::new_empty!(u32, D),
buffer_id: fidl::new_empty!(u32, D),
num_entries: fidl::new_empty!(u32, D),
base_time: fidl::new_empty!(i64, D),
time_interval: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetCameraProjectionCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetCameraProjectionCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetCameraProjectionCmd, D> for &SetCameraProjectionCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
fidl::encoding::Encode::<SetCameraProjectionCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
<FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.fovy),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<FloatValue, D>,
> fidl::encoding::Encode<SetCameraProjectionCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraProjectionCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetCameraProjectionCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self { camera_id: fidl::new_empty!(u32, D), fovy: fidl::new_empty!(FloatValue, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
fidl::decode!(FloatValue, D, &mut self.fovy, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetCameraTransformCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetCameraTransformCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
52
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCameraTransformCmd, D>
for &SetCameraTransformCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
fidl::encoding::Encode::<SetCameraTransformCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_position),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_look_at),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.eye_up),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vector3Value, D>,
T2: fidl::encoding::Encode<Vector3Value, D>,
T3: fidl::encoding::Encode<Vector3Value, D>,
> fidl::encoding::Encode<SetCameraTransformCmd, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCameraTransformCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 20, depth)?;
self.3.encode(encoder, offset + 36, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCameraTransformCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
camera_id: fidl::new_empty!(u32, D),
eye_position: fidl::new_empty!(Vector3Value, D),
eye_look_at: fidl::new_empty!(Vector3Value, D),
eye_up: fidl::new_empty!(Vector3Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.eye_position, decoder, offset + 4, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.eye_look_at, decoder, offset + 20, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.eye_up, decoder, offset + 36, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetClipCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetClipCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipCmd, D>
for &SetClipCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetClipCmd>(offset);
fidl::encoding::Encode::<SetClipCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_id),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_to_self),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<SetClipCmd, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetClipCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
node_id: fidl::new_empty!(u32, D),
clip_id: fidl::new_empty!(u32, D),
clip_to_self: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.clip_id, decoder, offset + 4, _depth)?;
fidl::decode!(bool, D, &mut self.clip_to_self, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetClipPlanesCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetClipPlanesCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetClipPlanesCmd, D>
for &SetClipPlanesCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
fidl::encoding::Encode::<SetClipPlanesCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<fidl::encoding::UnboundedVector<Plane3> as fidl::encoding::ValueTypeMarker>::borrow(&self.clip_planes),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Plane3>, D>,
> fidl::encoding::Encode<SetClipPlanesCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetClipPlanesCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetClipPlanesCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
node_id: fidl::new_empty!(u32, D),
clip_planes: fidl::new_empty!(fidl::encoding::UnboundedVector<Plane3>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<Plane3>,
D,
&mut self.clip_planes,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetColorCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetColorCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetColorCmd, D>
for &SetColorCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetColorCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetColorCmd).write_unaligned((self as *const SetColorCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<ColorRgbaValue, D>,
> fidl::encoding::Encode<SetColorCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetColorCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetColorCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
material_id: fidl::new_empty!(u32, D),
color: fidl::new_empty!(ColorRgbaValue, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetDisableClippingCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetDisableClippingCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetDisableClippingCmd, D>
for &SetDisableClippingCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
fidl::encoding::Encode::<SetDisableClippingCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_clipping),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<SetDisableClippingCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisableClippingCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetDisableClippingCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
renderer_id: fidl::new_empty!(u32, D),
disable_clipping: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.disable_clipping, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetDisplayColorConversionCmdHack {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetDisplayColorConversionCmdHack {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D>
for &SetDisplayColorConversionCmdHack
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
fidl::encoding::Encode::<SetDisplayColorConversionCmdHack, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.compositor_id),
<fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
&self.preoffsets,
),
<fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(
&self.matrix,
),
<fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(
&self.postoffsets,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
> fidl::encoding::Encode<SetDisplayColorConversionCmdHack, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisplayColorConversionCmdHack>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 52, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetDisplayColorConversionCmdHack
{
#[inline(always)]
fn new_empty() -> Self {
Self {
compositor_id: fidl::new_empty!(u32, D),
preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
matrix: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.compositor_id, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 4, _depth)?;
fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.matrix, decoder, offset + 16, _depth)?;
fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 52, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetDisplayMinimumRgbCmdHack {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetDisplayMinimumRgbCmdHack {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for &SetDisplayMinimumRgbCmdHack
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetDisplayMinimumRgbCmdHack)
.write_unaligned((self as *const SetDisplayMinimumRgbCmdHack).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<SetDisplayMinimumRgbCmdHack, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisplayMinimumRgbCmdHack>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetDisplayMinimumRgbCmdHack
{
#[inline(always)]
fn new_empty() -> Self {
Self { min_value: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetDisplayRotationCmdHack {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetDisplayRotationCmdHack {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for &SetDisplayRotationCmdHack
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetDisplayRotationCmdHack)
.write_unaligned((self as *const SetDisplayRotationCmdHack).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetDisplayRotationCmdHack, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetDisplayRotationCmdHack>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetDisplayRotationCmdHack
{
#[inline(always)]
fn new_empty() -> Self {
Self {
compositor_id: fidl::new_empty!(u32, D),
rotation_degrees: fidl::new_empty!(u32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetEnableDebugViewBoundsCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetEnableDebugViewBoundsCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for &SetEnableDebugViewBoundsCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
fidl::encoding::Encode::<SetEnableDebugViewBoundsCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<SetEnableDebugViewBoundsCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetEnableDebugViewBoundsCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetEnableDebugViewBoundsCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self { view_id: fidl::new_empty!(u32, D), enable: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.enable, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetEventMaskCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetEventMaskCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetEventMaskCmd, D>
for &SetEventMaskCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetEventMaskCmd)
.write_unaligned((self as *const SetEventMaskCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetEventMaskCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetEventMaskCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetEventMaskCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), event_mask: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetHitTestBehaviorCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetHitTestBehaviorCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetHitTestBehaviorCmd, D>
for &SetHitTestBehaviorCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
fidl::encoding::Encode::<SetHitTestBehaviorCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<HitTestBehavior as fidl::encoding::ValueTypeMarker>::borrow(
&self.hit_test_behavior,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<HitTestBehavior, D>,
> fidl::encoding::Encode<SetHitTestBehaviorCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetHitTestBehaviorCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetHitTestBehaviorCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
node_id: fidl::new_empty!(u32, D),
hit_test_behavior: fidl::new_empty!(HitTestBehavior, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(
HitTestBehavior,
D,
&mut self.hit_test_behavior,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetImportFocusCmdDeprecated {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetImportFocusCmdDeprecated {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetImportFocusCmdDeprecated, D> for &SetImportFocusCmdDeprecated
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetImportFocusCmdDeprecated>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetImportFocusCmdDeprecated
{
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for SetLabelCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetLabelCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLabelCmd, D>
for &SetLabelCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLabelCmd>(offset);
fidl::encoding::Encode::<SetLabelCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.label,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<SetLabelCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLabelCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLabelCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, D),
label: fidl::new_empty!(fidl::encoding::UnboundedString, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.label,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetLayerStackCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetLayerStackCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLayerStackCmd, D>
for &SetLayerStackCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetLayerStackCmd)
.write_unaligned((self as *const SetLayerStackCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetLayerStackCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLayerStackCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLayerStackCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
compositor_id: fidl::new_empty!(u32, D),
layer_stack_id: fidl::new_empty!(u32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetLightColorCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetLightColorCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightColorCmd, D>
for &SetLightColorCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLightColorCmd>(offset);
fidl::encoding::Encode::<SetLightColorCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
<ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<ColorRgbValue, D>,
> fidl::encoding::Encode<SetLightColorCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLightColorCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightColorCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { light_id: fidl::new_empty!(u32, D), color: fidl::new_empty!(ColorRgbValue, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetLightDirectionCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetLightDirectionCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetLightDirectionCmd, D>
for &SetLightDirectionCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
fidl::encoding::Encode::<SetLightDirectionCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.direction),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vector3Value, D>,
> fidl::encoding::Encode<SetLightDirectionCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetLightDirectionCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetLightDirectionCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
light_id: fidl::new_empty!(u32, D),
direction: fidl::new_empty!(Vector3Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.direction, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetMaterialCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetMaterialCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetMaterialCmd, D>
for &SetMaterialCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetMaterialCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetMaterialCmd)
.write_unaligned((self as *const SetMaterialCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetMaterialCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetMaterialCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetMaterialCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), material_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetOpacityCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetOpacityCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetOpacityCmd, D>
for &SetOpacityCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetOpacityCmd>(offset);
fidl::encoding::Encode::<SetOpacityCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.opacity),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<SetOpacityCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetOpacityCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetOpacityCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), opacity: fidl::new_empty!(f32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.opacity, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetPointLightFalloffCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetPointLightFalloffCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetPointLightFalloffCmd, D> for &SetPointLightFalloffCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
fidl::encoding::Encode::<SetPointLightFalloffCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
<FloatValue as fidl::encoding::ValueTypeMarker>::borrow(&self.falloff),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<FloatValue, D>,
> fidl::encoding::Encode<SetPointLightFalloffCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetPointLightFalloffCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetPointLightFalloffCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self { light_id: fidl::new_empty!(u32, D), falloff: fidl::new_empty!(FloatValue, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
fidl::decode!(FloatValue, D, &mut self.falloff, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetPointLightPositionCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetPointLightPositionCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetPointLightPositionCmd, D> for &SetPointLightPositionCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
fidl::encoding::Encode::<SetPointLightPositionCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.light_id),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.position),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vector3Value, D>,
> fidl::encoding::Encode<SetPointLightPositionCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetPointLightPositionCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetPointLightPositionCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self { light_id: fidl::new_empty!(u32, D), position: fidl::new_empty!(Vector3Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.light_id, decoder, offset + 0, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.position, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetRendererCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetRendererCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererCmd, D>
for &SetRendererCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetRendererCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetRendererCmd)
.write_unaligned((self as *const SetRendererCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetRendererCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetRendererCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { layer_id: fidl::new_empty!(u32, D), renderer_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetRendererParamCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetRendererParamCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRendererParamCmd, D>
for &SetRendererParamCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
fidl::encoding::Encode::<SetRendererParamCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.renderer_id),
<RendererParam as fidl::encoding::ValueTypeMarker>::borrow(&self.param),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<RendererParam, D>,
> fidl::encoding::Encode<SetRendererParamCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetRendererParamCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRendererParamCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
renderer_id: fidl::new_empty!(u32, D),
param: fidl::new_empty!(RendererParam, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.renderer_id, decoder, offset + 0, _depth)?;
fidl::decode!(RendererParam, D, &mut self.param, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetRotationCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetRotationCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetRotationCmd, D>
for &SetRotationCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetRotationCmd>(offset);
fidl::encoding::Encode::<SetRotationCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<QuaternionValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<QuaternionValue, D>,
> fidl::encoding::Encode<SetRotationCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetRotationCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetRotationCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(QuaternionValue, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(QuaternionValue, D, &mut self.value, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetScaleCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetScaleCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetScaleCmd, D>
for &SetScaleCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetScaleCmd>(offset);
fidl::encoding::Encode::<SetScaleCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vector3Value, D>,
> fidl::encoding::Encode<SetScaleCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetScaleCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetScaleCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetSemanticVisibilityCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetSemanticVisibilityCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for &SetSemanticVisibilityCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
fidl::encoding::Encode::<SetSemanticVisibilityCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.visible),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<SetSemanticVisibilityCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetSemanticVisibilityCmd>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetSemanticVisibilityCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), visible: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.visible, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetShapeCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetShapeCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetShapeCmd, D>
for &SetShapeCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetShapeCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetShapeCmd).write_unaligned((self as *const SetShapeCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetShapeCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetShapeCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetShapeCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), shape_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetSizeCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetSizeCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetSizeCmd, D>
for &SetSizeCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetSizeCmd>(offset);
fidl::encoding::Encode::<SetSizeCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Vector2Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vector2Value, D>,
> fidl::encoding::Encode<SetSizeCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetSizeCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetSizeCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector2Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Vector2Value, D, &mut self.value, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetStereoCameraProjectionCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetStereoCameraProjectionCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
140
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for &SetStereoCameraProjectionCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
fidl::encoding::Encode::<SetStereoCameraProjectionCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.camera_id),
<Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
&self.left_projection,
),
<Matrix4Value as fidl::encoding::ValueTypeMarker>::borrow(
&self.right_projection,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Matrix4Value, D>,
T2: fidl::encoding::Encode<Matrix4Value, D>,
> fidl::encoding::Encode<SetStereoCameraProjectionCmd, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetStereoCameraProjectionCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 72, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetStereoCameraProjectionCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self {
camera_id: fidl::new_empty!(u32, D),
left_projection: fidl::new_empty!(Matrix4Value, D),
right_projection: fidl::new_empty!(Matrix4Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.camera_id, decoder, offset + 0, _depth)?;
fidl::decode!(Matrix4Value, D, &mut self.left_projection, decoder, offset + 4, _depth)?;
fidl::decode!(
Matrix4Value,
D,
&mut self.right_projection,
decoder,
offset + 72,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetTagCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetTagCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTagCmd, D>
for &SetTagCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetTagCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetTagCmd).write_unaligned((self as *const SetTagCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetTagCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetTagCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTagCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { node_id: fidl::new_empty!(u32, D), tag_value: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetTextureCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetTextureCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTextureCmd, D>
for &SetTextureCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetTextureCmd>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetTextureCmd)
.write_unaligned((self as *const SetTextureCmd).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SetTextureCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetTextureCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTextureCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { material_id: fidl::new_empty!(u32, D), texture_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetTranslationCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetTranslationCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetTranslationCmd, D>
for &SetTranslationCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetTranslationCmd>(offset);
fidl::encoding::Encode::<SetTranslationCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Vector3Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Vector3Value, D>,
> fidl::encoding::Encode<SetTranslationCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetTranslationCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetTranslationCmd {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Vector3Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Vector3Value, D, &mut self.value, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetViewHolderBoundsColorCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetViewHolderBoundsColorCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for &SetViewHolderBoundsColorCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
fidl::encoding::Encode::<SetViewHolderBoundsColorCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
<ColorRgbValue as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<ColorRgbValue, D>,
> fidl::encoding::Encode<SetViewHolderBoundsColorCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetViewHolderBoundsColorCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetViewHolderBoundsColorCmd
{
#[inline(always)]
fn new_empty() -> Self {
Self {
view_holder_id: fidl::new_empty!(u32, D),
color: fidl::new_empty!(ColorRgbValue, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
fidl::decode!(ColorRgbValue, D, &mut self.color, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetViewPropertiesCmd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetViewPropertiesCmd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetViewPropertiesCmd, D>
for &SetViewPropertiesCmd
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
fidl::encoding::Encode::<SetViewPropertiesCmd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
<ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<ViewProperties, D>,
> fidl::encoding::Encode<SetViewPropertiesCmd, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetViewPropertiesCmd>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetViewPropertiesCmd {
#[inline(always)]
fn new_empty() -> Self {
Self {
view_holder_id: fidl::new_empty!(u32, D),
properties: fidl::new_empty!(ViewProperties, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ShapeNodeArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ShapeNodeArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ShapeNodeArgs, D>
for &ShapeNodeArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ShapeNodeArgs)
.write_unaligned((self as *const ShapeNodeArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ShapeNodeArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ShapeNodeArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShapeNodeArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { unused: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SizeChangeHintEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SizeChangeHintEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SizeChangeHintEvent, D>
for &SizeChangeHintEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
fidl::encoding::Encode::<SizeChangeHintEvent, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width_change_factor),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height_change_factor),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<SizeChangeHintEvent, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SizeChangeHintEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SizeChangeHintEvent {
#[inline(always)]
fn new_empty() -> Self {
Self {
node_id: fidl::new_empty!(u32, D),
width_change_factor: fidl::new_empty!(f32, D),
height_change_factor: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.node_id, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.width_change_factor, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.height_change_factor, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SnapshotCallbackDeprecatedOnDataRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SnapshotCallbackDeprecatedOnDataRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
SnapshotCallbackDeprecatedOnDataRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SnapshotCallbackDeprecatedOnDataRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SnapshotCallbackDeprecatedOnDataRequest>(offset);
fidl::encoding::Encode::<
SnapshotCallbackDeprecatedOnDataRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.data,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
SnapshotCallbackDeprecatedOnDataRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SnapshotCallbackDeprecatedOnDataRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SnapshotCallbackDeprecatedOnDataRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
data: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.data,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StereoCameraArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StereoCameraArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StereoCameraArgs, D>
for &StereoCameraArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StereoCameraArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut StereoCameraArgs)
.write_unaligned((self as *const StereoCameraArgs).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<StereoCameraArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StereoCameraArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StereoCameraArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { scene_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for TakeSnapshotCmdDeprecated {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TakeSnapshotCmdDeprecated {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
TakeSnapshotCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut TakeSnapshotCmdDeprecated
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TakeSnapshotCmdDeprecated>(offset);
fidl::encoding::Encode::<
TakeSnapshotCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.node_id),
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<SnapshotCallbackDeprecatedMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.callback
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<SnapshotCallbackDeprecatedMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
TakeSnapshotCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TakeSnapshotCmdDeprecated>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for TakeSnapshotCmdDeprecated
{
#[inline(always)]
fn new_empty() -> Self {
Self {
node_id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
callback: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<SnapshotCallbackDeprecatedMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.node_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<SnapshotCallbackDeprecatedMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.callback,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VariableArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VariableArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VariableArgs, D>
for &VariableArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VariableArgs>(offset);
fidl::encoding::Encode::<VariableArgs, D>::encode(
(
<ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.initial_value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<ValueType, D>,
T1: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<VariableArgs, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VariableArgs>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VariableArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
type_: fidl::new_empty!(ValueType, D),
initial_value: fidl::new_empty!(Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(ValueType, D, &mut self.type_, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.initial_value, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Vector2Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Vector2Value {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector2Value, D>
for &Vector2Value
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vector2Value>(offset);
fidl::encoding::Encode::<Vector2Value, D>::encode(
(
<Vec2 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Vec2, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<Vector2Value, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vector2Value>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector2Value {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Vec2, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Vec2, D, &mut self.value, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Vector3Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Vector3Value {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector3Value, D>
for &Vector3Value
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vector3Value>(offset);
fidl::encoding::Encode::<Vector3Value, D>::encode(
(
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Vec3, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<Vector3Value, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vector3Value>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector3Value {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Vec3, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Vec3, D, &mut self.value, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Vector4Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Vector4Value {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vector4Value, D>
for &Vector4Value
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vector4Value>(offset);
fidl::encoding::Encode::<Vector4Value, D>::encode(
(
<Vec4 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.variable_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Vec4, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<Vector4Value, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vector4Value>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vector4Value {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Vec4, D), variable_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Vec4, D, &mut self.value, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.variable_id, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ViewArgs {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl fidl::encoding::Encode<ViewArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ViewArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewArgs>(offset);
fidl::encoding::Encode::<ViewArgs, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_ui_views::ViewToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.debug_name),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ViewArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewArgs>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ViewArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewToken,
fidl::encoding::DefaultFuchsiaResourceDialect
),
debug_name: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_ui_views::ViewToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.debug_name,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ViewArgs3 {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewArgs3 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl fidl::encoding::Encode<ViewArgs3, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ViewArgs3
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewArgs3>(offset);
fidl::encoding::Encode::<ViewArgs3, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_ui_views::ViewToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
<fidl_fuchsia_ui_views::ViewRefControl as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.control_ref),
<fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_ref),
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.debug_name),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewRefControl,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ViewArgs3, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewArgs3>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ViewArgs3 {
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewToken,
fidl::encoding::DefaultFuchsiaResourceDialect
),
control_ref: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewRefControl,
fidl::encoding::DefaultFuchsiaResourceDialect
),
view_ref: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewRef,
fidl::encoding::DefaultFuchsiaResourceDialect
),
debug_name: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_ui_views::ViewToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_ui_views::ViewRefControl,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.control_ref,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl_fuchsia_ui_views::ViewRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.view_ref,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.debug_name,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewAttachedToSceneEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewAttachedToSceneEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for &ViewAttachedToSceneEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
fidl::encoding::Encode::<ViewAttachedToSceneEvent, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
<ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<ViewProperties, D>,
> fidl::encoding::Encode<ViewAttachedToSceneEvent, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewAttachedToSceneEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ViewAttachedToSceneEvent
{
#[inline(always)]
fn new_empty() -> Self {
Self {
view_id: fidl::new_empty!(u32, D),
properties: fidl::new_empty!(ViewProperties, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewConnectedEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewConnectedEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewConnectedEvent, D>
for &ViewConnectedEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ViewConnectedEvent)
.write_unaligned((self as *const ViewConnectedEvent).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ViewConnectedEvent, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewConnectedEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewConnectedEvent {
#[inline(always)]
fn new_empty() -> Self {
Self { view_holder_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewDetachedFromSceneEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewDetachedFromSceneEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for &ViewDetachedFromSceneEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ViewDetachedFromSceneEvent)
.write_unaligned((self as *const ViewDetachedFromSceneEvent).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ViewDetachedFromSceneEvent, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewDetachedFromSceneEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ViewDetachedFromSceneEvent
{
#[inline(always)]
fn new_empty() -> Self {
Self { view_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewDisconnectedEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewDisconnectedEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewDisconnectedEvent, D>
for &ViewDisconnectedEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ViewDisconnectedEvent)
.write_unaligned((self as *const ViewDisconnectedEvent).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ViewDisconnectedEvent, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewDisconnectedEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewDisconnectedEvent {
#[inline(always)]
fn new_empty() -> Self {
Self { view_holder_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ViewHolderArgs {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewHolderArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<ViewHolderArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ViewHolderArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewHolderArgs>(offset);
fidl::encoding::Encode::<ViewHolderArgs, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_ui_views::ViewHolderToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.debug_name),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_ui_views::ViewHolderToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ViewHolderArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewHolderArgs>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ViewHolderArgs
{
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(
fidl_fuchsia_ui_views::ViewHolderToken,
fidl::encoding::DefaultFuchsiaResourceDialect
),
debug_name: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_ui_views::ViewHolderToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.debug_name,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewHolderConnectedEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewHolderConnectedEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ViewHolderConnectedEvent, D> for &ViewHolderConnectedEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ViewHolderConnectedEvent)
.write_unaligned((self as *const ViewHolderConnectedEvent).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ViewHolderConnectedEvent, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewHolderConnectedEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ViewHolderConnectedEvent
{
#[inline(always)]
fn new_empty() -> Self {
Self { view_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewHolderDisconnectedEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewHolderDisconnectedEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for &ViewHolderDisconnectedEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ViewHolderDisconnectedEvent)
.write_unaligned((self as *const ViewHolderDisconnectedEvent).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ViewHolderDisconnectedEvent, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewHolderDisconnectedEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ViewHolderDisconnectedEvent
{
#[inline(always)]
fn new_empty() -> Self {
Self { view_id: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewProperties {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
52
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewProperties, D>
for &ViewProperties
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewProperties>(offset);
fidl::encoding::Encode::<ViewProperties, D>::encode(
(
<BoundingBox as fidl::encoding::ValueTypeMarker>::borrow(&self.bounding_box),
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_min),
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(&self.inset_from_max),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.focus_change),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.downward_input),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<BoundingBox, D>,
T1: fidl::encoding::Encode<Vec3, D>,
T2: fidl::encoding::Encode<Vec3, D>,
T3: fidl::encoding::Encode<bool, D>,
T4: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<ViewProperties, D> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewProperties>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 24, depth)?;
self.2.encode(encoder, offset + 36, depth)?;
self.3.encode(encoder, offset + 48, depth)?;
self.4.encode(encoder, offset + 49, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewProperties {
#[inline(always)]
fn new_empty() -> Self {
Self {
bounding_box: fidl::new_empty!(BoundingBox, D),
inset_from_min: fidl::new_empty!(Vec3, D),
inset_from_max: fidl::new_empty!(Vec3, D),
focus_change: fidl::new_empty!(bool, D),
downward_input: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffff0000u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(BoundingBox, D, &mut self.bounding_box, decoder, offset + 0, _depth)?;
fidl::decode!(Vec3, D, &mut self.inset_from_min, decoder, offset + 24, _depth)?;
fidl::decode!(Vec3, D, &mut self.inset_from_max, decoder, offset + 36, _depth)?;
fidl::decode!(bool, D, &mut self.focus_change, decoder, offset + 48, _depth)?;
fidl::decode!(bool, D, &mut self.downward_input, decoder, offset + 49, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewPropertiesChangedEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewPropertiesChangedEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for &ViewPropertiesChangedEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
fidl::encoding::Encode::<ViewPropertiesChangedEvent, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_id),
<ViewProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<ViewProperties, D>,
> fidl::encoding::Encode<ViewPropertiesChangedEvent, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewPropertiesChangedEvent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ViewPropertiesChangedEvent
{
#[inline(always)]
fn new_empty() -> Self {
Self {
view_id: fidl::new_empty!(u32, D),
properties: fidl::new_empty!(ViewProperties, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.view_id, decoder, offset + 0, _depth)?;
fidl::decode!(ViewProperties, D, &mut self.properties, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewState {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewState {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewState, D>
for &ViewState
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewState>(offset);
fidl::encoding::Encode::<ViewState, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_rendering),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ViewState, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewState>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewState {
#[inline(always)]
fn new_empty() -> Self {
Self { is_rendering: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.is_rendering, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ViewStateChangedEvent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ViewStateChangedEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewStateChangedEvent, D>
for &ViewStateChangedEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
fidl::encoding::Encode::<ViewStateChangedEvent, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.view_holder_id),
<ViewState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<ViewState, D>,
> fidl::encoding::Encode<ViewStateChangedEvent, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ViewStateChangedEvent>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewStateChangedEvent {
#[inline(always)]
fn new_empty() -> Self {
Self { view_holder_id: fidl::new_empty!(u32, D), state: fidl::new_empty!(ViewState, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.view_holder_id, decoder, offset + 0, _depth)?;
fidl::decode!(ViewState, D, &mut self.state, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Mat4 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Mat4 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Mat4, D> for &Mat4 {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Mat4>(offset);
fidl::encoding::Encode::<Mat4, D>::encode(
(<fidl::encoding::Array<f32, 16> as fidl::encoding::ValueTypeMarker>::borrow(
&self.matrix,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<f32, 16>, D>,
> fidl::encoding::Encode<Mat4, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Mat4>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Mat4 {
#[inline(always)]
fn new_empty() -> Self {
Self { matrix: fidl::new_empty!(fidl::encoding::Array<f32, 16>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Array<f32, 16>, D, &mut self.matrix, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Vec2 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Vec2 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec2, D> for &Vec2 {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vec2>(offset);
fidl::encoding::Encode::<Vec2, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<Vec2, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vec2>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec2 {
#[inline(always)]
fn new_empty() -> Self {
Self { x: fidl::new_empty!(f32, D), y: fidl::new_empty!(f32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Vec3 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Vec3 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec3, D> for &Vec3 {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vec3>(offset);
fidl::encoding::Encode::<Vec3, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<Vec3, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vec3>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec3 {
#[inline(always)]
fn new_empty() -> Self {
Self {
x: fidl::new_empty!(f32, D),
y: fidl::new_empty!(f32, D),
z: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Vec4 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Vec4 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec4, D> for &Vec4 {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vec4>(offset);
fidl::encoding::Encode::<Vec4, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<f32, D>,
T2: fidl::encoding::Encode<f32, D>,
T3: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<Vec4, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Vec4>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec4 {
#[inline(always)]
fn new_empty() -> Self {
Self {
x: fidl::new_empty!(f32, D),
y: fidl::new_empty!(f32, D),
z: fidl::new_empty!(f32, D),
w: fidl::new_empty!(f32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for Command {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Command {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl fidl::encoding::Encode<Command, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Command
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Command>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Command::CreateResource(ref mut val) => {
fidl::encoding::encode_in_envelope::<CreateResourceCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<CreateResourceCmd as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Command::ReleaseResource(ref val) => {
fidl::encoding::encode_in_envelope::<ReleaseResourceCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<ReleaseResourceCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::ExportResource(ref mut val) => {
fidl::encoding::encode_in_envelope::<ExportResourceCmdDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>(
<ExportResourceCmdDeprecated as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Command::ImportResource(ref mut val) => {
fidl::encoding::encode_in_envelope::<ImportResourceCmdDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>(
<ImportResourceCmdDeprecated as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetTag(ref val) => {
fidl::encoding::encode_in_envelope::<SetTagCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetTagCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::Detach(ref val) => {
fidl::encoding::encode_in_envelope::<DetachCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<DetachCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetTranslation(ref val) => {
fidl::encoding::encode_in_envelope::<SetTranslationCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetTranslationCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetScale(ref val) => {
fidl::encoding::encode_in_envelope::<SetScaleCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetScaleCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetRotation(ref val) => {
fidl::encoding::encode_in_envelope::<SetRotationCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetRotationCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetAnchor(ref val) => {
fidl::encoding::encode_in_envelope::<SetAnchorCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetAnchorCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetSize(ref val) => {
fidl::encoding::encode_in_envelope::<SetSizeCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetSizeCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetOpacity(ref val) => {
fidl::encoding::encode_in_envelope::<SetOpacityCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetOpacityCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SendSizeChangeHintHack(ref val) => {
fidl::encoding::encode_in_envelope::<SendSizeChangeHintCmdHack, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SendSizeChangeHintCmdHack as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::AddChild(ref val) => {
fidl::encoding::encode_in_envelope::<AddChildCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<AddChildCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::AddPart(ref val) => {
fidl::encoding::encode_in_envelope::<AddPartCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<AddPartCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::DetachChildren(ref val) => {
fidl::encoding::encode_in_envelope::<DetachChildrenCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<DetachChildrenCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetShape(ref val) => {
fidl::encoding::encode_in_envelope::<SetShapeCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetShapeCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetMaterial(ref val) => {
fidl::encoding::encode_in_envelope::<SetMaterialCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetMaterialCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetClip(ref val) => {
fidl::encoding::encode_in_envelope::<SetClipCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetClipCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetHitTestBehavior(ref val) => {
fidl::encoding::encode_in_envelope::<SetHitTestBehaviorCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetHitTestBehaviorCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetViewProperties(ref val) => {
fidl::encoding::encode_in_envelope::<SetViewPropertiesCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetViewPropertiesCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::TakeSnapshotCmd(ref mut val) => {
fidl::encoding::encode_in_envelope::<TakeSnapshotCmdDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>(
<TakeSnapshotCmdDeprecated as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetCamera(ref val) => {
fidl::encoding::encode_in_envelope::<SetCameraCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetCameraCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetCameraTransform(ref val) => {
fidl::encoding::encode_in_envelope::<SetCameraTransformCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetCameraTransformCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetCameraProjection(ref val) => {
fidl::encoding::encode_in_envelope::<SetCameraProjectionCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetCameraProjectionCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetStereoCameraProjection(ref val) => {
fidl::encoding::encode_in_envelope::<SetStereoCameraProjectionCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetStereoCameraProjectionCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetCameraPoseBuffer(ref val) => {
fidl::encoding::encode_in_envelope::<SetCameraPoseBufferCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetCameraPoseBufferCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetLightColor(ref val) => {
fidl::encoding::encode_in_envelope::<SetLightColorCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetLightColorCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetLightDirection(ref val) => {
fidl::encoding::encode_in_envelope::<SetLightDirectionCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetLightDirectionCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::AddLight(ref val) => {
fidl::encoding::encode_in_envelope::<AddLightCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<AddLightCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::DetachLight(ref val) => {
fidl::encoding::encode_in_envelope::<DetachLightCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<DetachLightCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::DetachLights(ref val) => {
fidl::encoding::encode_in_envelope::<DetachLightsCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<DetachLightsCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetTexture(ref val) => {
fidl::encoding::encode_in_envelope::<SetTextureCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetTextureCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetColor(ref val) => {
fidl::encoding::encode_in_envelope::<SetColorCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetColorCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::BindMeshBuffers(ref val) => {
fidl::encoding::encode_in_envelope::<BindMeshBuffersCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<BindMeshBuffersCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::AddLayer(ref val) => {
fidl::encoding::encode_in_envelope::<AddLayerCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<AddLayerCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::RemoveLayer(ref val) => {
fidl::encoding::encode_in_envelope::<RemoveLayerCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<RemoveLayerCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::RemoveAllLayers(ref val) => {
fidl::encoding::encode_in_envelope::<RemoveAllLayersCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<RemoveAllLayersCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetLayerStack(ref val) => {
fidl::encoding::encode_in_envelope::<SetLayerStackCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetLayerStackCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetRenderer(ref val) => {
fidl::encoding::encode_in_envelope::<SetRendererCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetRendererCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetRendererParam(ref val) => {
fidl::encoding::encode_in_envelope::<SetRendererParamCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetRendererParamCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetEventMask(ref val) => {
fidl::encoding::encode_in_envelope::<SetEventMaskCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetEventMaskCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetLabel(ref val) => {
fidl::encoding::encode_in_envelope::<SetLabelCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetLabelCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetDisableClipping(ref val) => {
fidl::encoding::encode_in_envelope::<SetDisableClippingCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetDisableClippingCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetImportFocus(ref val) => {
fidl::encoding::encode_in_envelope::<SetImportFocusCmdDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetImportFocusCmdDeprecated as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetClipPlanes(ref val) => {
fidl::encoding::encode_in_envelope::<SetClipPlanesCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetClipPlanesCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetPointLightPosition(ref val) => {
fidl::encoding::encode_in_envelope::<SetPointLightPositionCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetPointLightPositionCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetPointLightFalloff(ref val) => {
fidl::encoding::encode_in_envelope::<SetPointLightFalloffCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetPointLightFalloffCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::Scene_AddAmbientLight(ref val) => {
fidl::encoding::encode_in_envelope::<SceneAddAmbientLightCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SceneAddAmbientLightCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::Scene_AddDirectionalLight(ref val) => {
fidl::encoding::encode_in_envelope::<SceneAddDirectionalLightCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SceneAddDirectionalLightCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::Scene_AddPointLight(ref val) => {
fidl::encoding::encode_in_envelope::<SceneAddPointLightCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SceneAddPointLightCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetDisplayColorConversion(ref val) => {
fidl::encoding::encode_in_envelope::<SetDisplayColorConversionCmdHack, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetDisplayColorConversionCmdHack as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetDisplayRotation(ref val) => {
fidl::encoding::encode_in_envelope::<SetDisplayRotationCmdHack, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetDisplayRotationCmdHack as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetEnableViewDebugBounds(ref val) => {
fidl::encoding::encode_in_envelope::<SetEnableDebugViewBoundsCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetEnableDebugViewBoundsCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetViewHolderBoundsColor(ref val) => {
fidl::encoding::encode_in_envelope::<SetViewHolderBoundsColorCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetViewHolderBoundsColorCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetCameraClipSpaceTransform(ref val) => {
fidl::encoding::encode_in_envelope::<SetCameraClipSpaceTransformCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetCameraClipSpaceTransformCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetDisplayMinimumRgb(ref val) => {
fidl::encoding::encode_in_envelope::<SetDisplayMinimumRgbCmdHack, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetDisplayMinimumRgbCmdHack as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Command::SetSemanticVisibility(ref val) => {
fidl::encoding::encode_in_envelope::<SetSemanticVisibilityCmd, fidl::encoding::DefaultFuchsiaResourceDialect>(
<SetSemanticVisibilityCmd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Command {
#[inline(always)]
fn new_empty() -> Self {
Self::CreateResource(fidl::new_empty!(
CreateResourceCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => {
<CreateResourceCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
2 => {
<ReleaseResourceCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
3 => <ExportResourceCmdDeprecated as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
4 => <ImportResourceCmdDeprecated as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
5 => <SetTagCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6 => <DetachCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => {
<SetTranslationCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
8 => <SetScaleCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9 => <SetRotationCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10 => <SetAnchorCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11 => <SetSizeCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12 => <SetOpacityCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13 => <SendSizeChangeHintCmdHack as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
14 => <AddChildCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15 => <AddPartCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16 => {
<DetachChildrenCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
17 => <SetShapeCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18 => <SetMaterialCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19 => <SetClipCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20 => <SetHitTestBehaviorCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
21 => <SetViewPropertiesCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
22 => <TakeSnapshotCmdDeprecated as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
23 => <SetCameraCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24 => <SetCameraTransformCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
25 => <SetCameraProjectionCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
26 => <SetStereoCameraProjectionCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
27 => <SetCameraPoseBufferCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
28 => {
<SetLightColorCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
29 => <SetLightDirectionCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
30 => <AddLightCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
31 => <DetachLightCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
32 => <DetachLightsCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
33 => <SetTextureCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
34 => <SetColorCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
35 => {
<BindMeshBuffersCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
36 => <AddLayerCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
37 => <RemoveLayerCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
38 => {
<RemoveAllLayersCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
39 => {
<SetLayerStackCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
40 => <SetRendererCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
41 => <SetRendererParamCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
42 => <SetEventMaskCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
43 => <SetLabelCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
44 => <SetDisableClippingCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
45 => <SetImportFocusCmdDeprecated as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
46 => {
<SetClipPlanesCmd as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
47 => <SetPointLightPositionCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
48 => <SetPointLightFalloffCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
49 => <SceneAddAmbientLightCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
50 => <SceneAddDirectionalLightCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
51 => <SceneAddPointLightCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
52 => {
<SetDisplayColorConversionCmdHack as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
)
}
53 => <SetDisplayRotationCmdHack as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
54 => <SetEnableDebugViewBoundsCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
55 => <SetViewHolderBoundsColorCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
56 => <SetCameraClipSpaceTransformCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
57 => <SetDisplayMinimumRgbCmdHack as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
58 => <SetSemanticVisibilityCmd as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Command::CreateResource(_) = self {
} else {
*self = Command::CreateResource(fidl::new_empty!(
CreateResourceCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::CreateResource(ref mut val) = self {
fidl::decode!(
CreateResourceCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Command::ReleaseResource(_) = self {
} else {
*self = Command::ReleaseResource(fidl::new_empty!(
ReleaseResourceCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::ReleaseResource(ref mut val) = self {
fidl::decode!(
ReleaseResourceCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Command::ExportResource(_) = self {
} else {
*self = Command::ExportResource(fidl::new_empty!(
ExportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::ExportResource(ref mut val) = self {
fidl::decode!(
ExportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Command::ImportResource(_) = self {
} else {
*self = Command::ImportResource(fidl::new_empty!(
ImportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::ImportResource(ref mut val) = self {
fidl::decode!(
ImportResourceCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetTag(_) = self {
} else {
*self = Command::SetTag(fidl::new_empty!(
SetTagCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetTag(ref mut val) = self {
fidl::decode!(
SetTagCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let Command::Detach(_) = self {
} else {
*self = Command::Detach(fidl::new_empty!(
DetachCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::Detach(ref mut val) = self {
fidl::decode!(
DetachCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetTranslation(_) = self {
} else {
*self = Command::SetTranslation(fidl::new_empty!(
SetTranslationCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetTranslation(ref mut val) = self {
fidl::decode!(
SetTranslationCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetScale(_) = self {
} else {
*self = Command::SetScale(fidl::new_empty!(
SetScaleCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetScale(ref mut val) = self {
fidl::decode!(
SetScaleCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetRotation(_) = self {
} else {
*self = Command::SetRotation(fidl::new_empty!(
SetRotationCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetRotation(ref mut val) = self {
fidl::decode!(
SetRotationCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetAnchor(_) = self {
} else {
*self = Command::SetAnchor(fidl::new_empty!(
SetAnchorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetAnchor(ref mut val) = self {
fidl::decode!(
SetAnchorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetSize(_) = self {
} else {
*self = Command::SetSize(fidl::new_empty!(
SetSizeCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetSize(ref mut val) = self {
fidl::decode!(
SetSizeCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
12 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetOpacity(_) = self {
} else {
*self = Command::SetOpacity(fidl::new_empty!(
SetOpacityCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetOpacity(ref mut val) = self {
fidl::decode!(
SetOpacityCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
13 => {
#[allow(irrefutable_let_patterns)]
if let Command::SendSizeChangeHintHack(_) = self {
} else {
*self = Command::SendSizeChangeHintHack(fidl::new_empty!(
SendSizeChangeHintCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SendSizeChangeHintHack(ref mut val) = self {
fidl::decode!(
SendSizeChangeHintCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
14 => {
#[allow(irrefutable_let_patterns)]
if let Command::AddChild(_) = self {
} else {
*self = Command::AddChild(fidl::new_empty!(
AddChildCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::AddChild(ref mut val) = self {
fidl::decode!(
AddChildCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
15 => {
#[allow(irrefutable_let_patterns)]
if let Command::AddPart(_) = self {
} else {
*self = Command::AddPart(fidl::new_empty!(
AddPartCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::AddPart(ref mut val) = self {
fidl::decode!(
AddPartCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
16 => {
#[allow(irrefutable_let_patterns)]
if let Command::DetachChildren(_) = self {
} else {
*self = Command::DetachChildren(fidl::new_empty!(
DetachChildrenCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::DetachChildren(ref mut val) = self {
fidl::decode!(
DetachChildrenCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
17 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetShape(_) = self {
} else {
*self = Command::SetShape(fidl::new_empty!(
SetShapeCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetShape(ref mut val) = self {
fidl::decode!(
SetShapeCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
18 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetMaterial(_) = self {
} else {
*self = Command::SetMaterial(fidl::new_empty!(
SetMaterialCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetMaterial(ref mut val) = self {
fidl::decode!(
SetMaterialCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
19 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetClip(_) = self {
} else {
*self = Command::SetClip(fidl::new_empty!(
SetClipCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetClip(ref mut val) = self {
fidl::decode!(
SetClipCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
20 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetHitTestBehavior(_) = self {
} else {
*self = Command::SetHitTestBehavior(fidl::new_empty!(
SetHitTestBehaviorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetHitTestBehavior(ref mut val) = self {
fidl::decode!(
SetHitTestBehaviorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
21 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetViewProperties(_) = self {
} else {
*self = Command::SetViewProperties(fidl::new_empty!(
SetViewPropertiesCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetViewProperties(ref mut val) = self {
fidl::decode!(
SetViewPropertiesCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
22 => {
#[allow(irrefutable_let_patterns)]
if let Command::TakeSnapshotCmd(_) = self {
} else {
*self = Command::TakeSnapshotCmd(fidl::new_empty!(
TakeSnapshotCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::TakeSnapshotCmd(ref mut val) = self {
fidl::decode!(
TakeSnapshotCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
23 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetCamera(_) = self {
} else {
*self = Command::SetCamera(fidl::new_empty!(
SetCameraCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetCamera(ref mut val) = self {
fidl::decode!(
SetCameraCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
24 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraTransform(_) = self {
} else {
*self = Command::SetCameraTransform(fidl::new_empty!(
SetCameraTransformCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraTransform(ref mut val) = self {
fidl::decode!(
SetCameraTransformCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
25 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraProjection(_) = self {
} else {
*self = Command::SetCameraProjection(fidl::new_empty!(
SetCameraProjectionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraProjection(ref mut val) = self {
fidl::decode!(
SetCameraProjectionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
26 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetStereoCameraProjection(_) = self {
} else {
*self = Command::SetStereoCameraProjection(fidl::new_empty!(
SetStereoCameraProjectionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetStereoCameraProjection(ref mut val) = self {
fidl::decode!(
SetStereoCameraProjectionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
27 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraPoseBuffer(_) = self {
} else {
*self = Command::SetCameraPoseBuffer(fidl::new_empty!(
SetCameraPoseBufferCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraPoseBuffer(ref mut val) = self {
fidl::decode!(
SetCameraPoseBufferCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
28 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetLightColor(_) = self {
} else {
*self = Command::SetLightColor(fidl::new_empty!(
SetLightColorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetLightColor(ref mut val) = self {
fidl::decode!(
SetLightColorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
29 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetLightDirection(_) = self {
} else {
*self = Command::SetLightDirection(fidl::new_empty!(
SetLightDirectionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetLightDirection(ref mut val) = self {
fidl::decode!(
SetLightDirectionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
30 => {
#[allow(irrefutable_let_patterns)]
if let Command::AddLight(_) = self {
} else {
*self = Command::AddLight(fidl::new_empty!(
AddLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::AddLight(ref mut val) = self {
fidl::decode!(
AddLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
31 => {
#[allow(irrefutable_let_patterns)]
if let Command::DetachLight(_) = self {
} else {
*self = Command::DetachLight(fidl::new_empty!(
DetachLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::DetachLight(ref mut val) = self {
fidl::decode!(
DetachLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
32 => {
#[allow(irrefutable_let_patterns)]
if let Command::DetachLights(_) = self {
} else {
*self = Command::DetachLights(fidl::new_empty!(
DetachLightsCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::DetachLights(ref mut val) = self {
fidl::decode!(
DetachLightsCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
33 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetTexture(_) = self {
} else {
*self = Command::SetTexture(fidl::new_empty!(
SetTextureCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetTexture(ref mut val) = self {
fidl::decode!(
SetTextureCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
34 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetColor(_) = self {
} else {
*self = Command::SetColor(fidl::new_empty!(
SetColorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetColor(ref mut val) = self {
fidl::decode!(
SetColorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
35 => {
#[allow(irrefutable_let_patterns)]
if let Command::BindMeshBuffers(_) = self {
} else {
*self = Command::BindMeshBuffers(fidl::new_empty!(
BindMeshBuffersCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::BindMeshBuffers(ref mut val) = self {
fidl::decode!(
BindMeshBuffersCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
36 => {
#[allow(irrefutable_let_patterns)]
if let Command::AddLayer(_) = self {
} else {
*self = Command::AddLayer(fidl::new_empty!(
AddLayerCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::AddLayer(ref mut val) = self {
fidl::decode!(
AddLayerCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
37 => {
#[allow(irrefutable_let_patterns)]
if let Command::RemoveLayer(_) = self {
} else {
*self = Command::RemoveLayer(fidl::new_empty!(
RemoveLayerCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::RemoveLayer(ref mut val) = self {
fidl::decode!(
RemoveLayerCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
38 => {
#[allow(irrefutable_let_patterns)]
if let Command::RemoveAllLayers(_) = self {
} else {
*self = Command::RemoveAllLayers(fidl::new_empty!(
RemoveAllLayersCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::RemoveAllLayers(ref mut val) = self {
fidl::decode!(
RemoveAllLayersCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
39 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetLayerStack(_) = self {
} else {
*self = Command::SetLayerStack(fidl::new_empty!(
SetLayerStackCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetLayerStack(ref mut val) = self {
fidl::decode!(
SetLayerStackCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
40 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetRenderer(_) = self {
} else {
*self = Command::SetRenderer(fidl::new_empty!(
SetRendererCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetRenderer(ref mut val) = self {
fidl::decode!(
SetRendererCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
41 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetRendererParam(_) = self {
} else {
*self = Command::SetRendererParam(fidl::new_empty!(
SetRendererParamCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetRendererParam(ref mut val) = self {
fidl::decode!(
SetRendererParamCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
42 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetEventMask(_) = self {
} else {
*self = Command::SetEventMask(fidl::new_empty!(
SetEventMaskCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetEventMask(ref mut val) = self {
fidl::decode!(
SetEventMaskCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
43 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetLabel(_) = self {
} else {
*self = Command::SetLabel(fidl::new_empty!(
SetLabelCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetLabel(ref mut val) = self {
fidl::decode!(
SetLabelCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
44 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetDisableClipping(_) = self {
} else {
*self = Command::SetDisableClipping(fidl::new_empty!(
SetDisableClippingCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetDisableClipping(ref mut val) = self {
fidl::decode!(
SetDisableClippingCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
45 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetImportFocus(_) = self {
} else {
*self = Command::SetImportFocus(fidl::new_empty!(
SetImportFocusCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetImportFocus(ref mut val) = self {
fidl::decode!(
SetImportFocusCmdDeprecated,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
46 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetClipPlanes(_) = self {
} else {
*self = Command::SetClipPlanes(fidl::new_empty!(
SetClipPlanesCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetClipPlanes(ref mut val) = self {
fidl::decode!(
SetClipPlanesCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
47 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetPointLightPosition(_) = self {
} else {
*self = Command::SetPointLightPosition(fidl::new_empty!(
SetPointLightPositionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetPointLightPosition(ref mut val) = self {
fidl::decode!(
SetPointLightPositionCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
48 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetPointLightFalloff(_) = self {
} else {
*self = Command::SetPointLightFalloff(fidl::new_empty!(
SetPointLightFalloffCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetPointLightFalloff(ref mut val) = self {
fidl::decode!(
SetPointLightFalloffCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
49 => {
#[allow(irrefutable_let_patterns)]
if let Command::Scene_AddAmbientLight(_) = self {
} else {
*self = Command::Scene_AddAmbientLight(fidl::new_empty!(
SceneAddAmbientLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::Scene_AddAmbientLight(ref mut val) = self {
fidl::decode!(
SceneAddAmbientLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
50 => {
#[allow(irrefutable_let_patterns)]
if let Command::Scene_AddDirectionalLight(_) = self {
} else {
*self = Command::Scene_AddDirectionalLight(fidl::new_empty!(
SceneAddDirectionalLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::Scene_AddDirectionalLight(ref mut val) = self {
fidl::decode!(
SceneAddDirectionalLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
51 => {
#[allow(irrefutable_let_patterns)]
if let Command::Scene_AddPointLight(_) = self {
} else {
*self = Command::Scene_AddPointLight(fidl::new_empty!(
SceneAddPointLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::Scene_AddPointLight(ref mut val) = self {
fidl::decode!(
SceneAddPointLightCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
52 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetDisplayColorConversion(_) = self {
} else {
*self = Command::SetDisplayColorConversion(fidl::new_empty!(
SetDisplayColorConversionCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetDisplayColorConversion(ref mut val) = self {
fidl::decode!(
SetDisplayColorConversionCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
53 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetDisplayRotation(_) = self {
} else {
*self = Command::SetDisplayRotation(fidl::new_empty!(
SetDisplayRotationCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetDisplayRotation(ref mut val) = self {
fidl::decode!(
SetDisplayRotationCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
54 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetEnableViewDebugBounds(_) = self {
} else {
*self = Command::SetEnableViewDebugBounds(fidl::new_empty!(
SetEnableDebugViewBoundsCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetEnableViewDebugBounds(ref mut val) = self {
fidl::decode!(
SetEnableDebugViewBoundsCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
55 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetViewHolderBoundsColor(_) = self {
} else {
*self = Command::SetViewHolderBoundsColor(fidl::new_empty!(
SetViewHolderBoundsColorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetViewHolderBoundsColor(ref mut val) = self {
fidl::decode!(
SetViewHolderBoundsColorCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
56 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraClipSpaceTransform(_) = self {
} else {
*self = Command::SetCameraClipSpaceTransform(fidl::new_empty!(
SetCameraClipSpaceTransformCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetCameraClipSpaceTransform(ref mut val) = self {
fidl::decode!(
SetCameraClipSpaceTransformCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
57 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetDisplayMinimumRgb(_) = self {
} else {
*self = Command::SetDisplayMinimumRgb(fidl::new_empty!(
SetDisplayMinimumRgbCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetDisplayMinimumRgb(ref mut val) = self {
fidl::decode!(
SetDisplayMinimumRgbCmdHack,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
58 => {
#[allow(irrefutable_let_patterns)]
if let Command::SetSemanticVisibility(_) = self {
} else {
*self = Command::SetSemanticVisibility(fidl::new_empty!(
SetSemanticVisibilityCmd,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Command::SetSemanticVisibility(ref mut val) = self {
fidl::decode!(
SetSemanticVisibilityCmd,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Event {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Event {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Event, D> for &Event {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Event>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Event::Metrics(ref val) => fidl::encoding::encode_in_envelope::<MetricsEvent, D>(
<MetricsEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Event::SizeChangeHint(ref val) => {
fidl::encoding::encode_in_envelope::<SizeChangeHintEvent, D>(
<SizeChangeHintEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Event::ImportUnbound(ref val) => {
fidl::encoding::encode_in_envelope::<ImportUnboundEvent, D>(
<ImportUnboundEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Event::ViewConnected(ref val) => {
fidl::encoding::encode_in_envelope::<ViewConnectedEvent, D>(
<ViewConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Event::ViewDisconnected(ref val) => {
fidl::encoding::encode_in_envelope::<ViewDisconnectedEvent, D>(
<ViewDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Event::ViewHolderDisconnected(ref val) => fidl::encoding::encode_in_envelope::<
ViewHolderDisconnectedEvent,
D,
>(
<ViewHolderDisconnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Event::ViewAttachedToScene(ref val) => {
fidl::encoding::encode_in_envelope::<ViewAttachedToSceneEvent, D>(
<ViewAttachedToSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Event::ViewDetachedFromScene(ref val) => fidl::encoding::encode_in_envelope::<
ViewDetachedFromSceneEvent,
D,
>(
<ViewDetachedFromSceneEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Event::ViewPropertiesChanged(ref val) => fidl::encoding::encode_in_envelope::<
ViewPropertiesChangedEvent,
D,
>(
<ViewPropertiesChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Event::ViewStateChanged(ref val) => {
fidl::encoding::encode_in_envelope::<ViewStateChangedEvent, D>(
<ViewStateChangedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Event::ViewHolderConnected(ref val) => {
fidl::encoding::encode_in_envelope::<ViewHolderConnectedEvent, D>(
<ViewHolderConnectedEvent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Event {
#[inline(always)]
fn new_empty() -> Self {
Self::Metrics(fidl::new_empty!(MetricsEvent, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <MetricsEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <SizeChangeHintEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
3 => {
<ImportUnboundEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
4 => {
<ViewConnectedEvent as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
5 => <ViewDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
6 => <ViewHolderDisconnectedEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
7 => <ViewAttachedToSceneEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
8 => <ViewDetachedFromSceneEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
9 => <ViewPropertiesChangedEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
10 => <ViewStateChangedEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
11 => <ViewHolderConnectedEvent as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Event::Metrics(_) = self {
} else {
*self = Event::Metrics(fidl::new_empty!(MetricsEvent, D));
}
#[allow(irrefutable_let_patterns)]
if let Event::Metrics(ref mut val) = self {
fidl::decode!(MetricsEvent, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Event::SizeChangeHint(_) = self {
} else {
*self = Event::SizeChangeHint(fidl::new_empty!(SizeChangeHintEvent, D));
}
#[allow(irrefutable_let_patterns)]
if let Event::SizeChangeHint(ref mut val) = self {
fidl::decode!(SizeChangeHintEvent, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Event::ImportUnbound(_) = self {
} else {
*self = Event::ImportUnbound(fidl::new_empty!(ImportUnboundEvent, D));
}
#[allow(irrefutable_let_patterns)]
if let Event::ImportUnbound(ref mut val) = self {
fidl::decode!(ImportUnboundEvent, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewConnected(_) = self {
} else {
*self = Event::ViewConnected(fidl::new_empty!(ViewConnectedEvent, D));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewConnected(ref mut val) = self {
fidl::decode!(ViewConnectedEvent, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewDisconnected(_) = self {
} else {
*self = Event::ViewDisconnected(fidl::new_empty!(ViewDisconnectedEvent, D));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewDisconnected(ref mut val) = self {
fidl::decode!(
ViewDisconnectedEvent,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewHolderDisconnected(_) = self {
} else {
*self = Event::ViewHolderDisconnected(fidl::new_empty!(
ViewHolderDisconnectedEvent,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewHolderDisconnected(ref mut val) = self {
fidl::decode!(
ViewHolderDisconnectedEvent,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewAttachedToScene(_) = self {
} else {
*self = Event::ViewAttachedToScene(fidl::new_empty!(
ViewAttachedToSceneEvent,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewAttachedToScene(ref mut val) = self {
fidl::decode!(
ViewAttachedToSceneEvent,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewDetachedFromScene(_) = self {
} else {
*self = Event::ViewDetachedFromScene(fidl::new_empty!(
ViewDetachedFromSceneEvent,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewDetachedFromScene(ref mut val) = self {
fidl::decode!(
ViewDetachedFromSceneEvent,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewPropertiesChanged(_) = self {
} else {
*self = Event::ViewPropertiesChanged(fidl::new_empty!(
ViewPropertiesChangedEvent,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewPropertiesChanged(ref mut val) = self {
fidl::decode!(
ViewPropertiesChangedEvent,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewStateChanged(_) = self {
} else {
*self = Event::ViewStateChanged(fidl::new_empty!(ViewStateChangedEvent, D));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewStateChanged(ref mut val) = self {
fidl::decode!(
ViewStateChangedEvent,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let Event::ViewHolderConnected(_) = self {
} else {
*self = Event::ViewHolderConnected(fidl::new_empty!(
ViewHolderConnectedEvent,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Event::ViewHolderConnected(ref mut val) = self {
fidl::decode!(
ViewHolderConnectedEvent,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RendererParam {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RendererParam {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RendererParam, D>
for &RendererParam
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RendererParam>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
RendererParam::ShadowTechnique(ref val) => {
fidl::encoding::encode_in_envelope::<ShadowTechnique, D>(
<ShadowTechnique as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
RendererParam::Reserved(ref val) => {
fidl::encoding::encode_in_envelope::<RenderFrequency, D>(
<RenderFrequency as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
RendererParam::EnableDebugging(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RendererParam {
#[inline(always)]
fn new_empty() -> Self {
Self::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <ShadowTechnique as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <RenderFrequency as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let RendererParam::ShadowTechnique(_) = self {
} else {
*self =
RendererParam::ShadowTechnique(fidl::new_empty!(ShadowTechnique, D));
}
#[allow(irrefutable_let_patterns)]
if let RendererParam::ShadowTechnique(ref mut val) = self {
fidl::decode!(ShadowTechnique, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let RendererParam::Reserved(_) = self {
} else {
*self = RendererParam::Reserved(fidl::new_empty!(RenderFrequency, D));
}
#[allow(irrefutable_let_patterns)]
if let RendererParam::Reserved(ref mut val) = self {
fidl::decode!(RenderFrequency, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let RendererParam::EnableDebugging(_) = self {
} else {
*self = RendererParam::EnableDebugging(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let RendererParam::EnableDebugging(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ResourceArgs {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ResourceArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl fidl::encoding::Encode<ResourceArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ResourceArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ResourceArgs>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ResourceArgs::Memory(ref mut val) => fidl::encoding::encode_in_envelope::<
MemoryArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<MemoryArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Image(ref val) => fidl::encoding::encode_in_envelope::<
ImageArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ImageArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Buffer(ref val) => fidl::encoding::encode_in_envelope::<
BufferArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<BufferArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::View(ref mut val) => fidl::encoding::encode_in_envelope::<
ViewArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ViewArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::ViewHolder(ref mut val) => fidl::encoding::encode_in_envelope::<
ViewHolderArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ViewHolderArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Rectangle(ref val) => fidl::encoding::encode_in_envelope::<
RectangleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<RectangleArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::RoundedRectangle(ref val) => fidl::encoding::encode_in_envelope::<
RoundedRectangleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<RoundedRectangleArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Circle(ref val) => fidl::encoding::encode_in_envelope::<
CircleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<CircleArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Mesh(ref val) => fidl::encoding::encode_in_envelope::<
MeshArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<MeshArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::ShapeNode(ref val) => fidl::encoding::encode_in_envelope::<
ShapeNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ShapeNodeArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::ClipNode(ref val) => fidl::encoding::encode_in_envelope::<
ClipNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ClipNodeArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::EntityNode(ref val) => fidl::encoding::encode_in_envelope::<
EntityNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<EntityNodeArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::OpacityNode(ref val) => fidl::encoding::encode_in_envelope::<
OpacityNodeArgsHack,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<OpacityNodeArgsHack as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Material(ref val) => fidl::encoding::encode_in_envelope::<
MaterialArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<MaterialArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Compositor(ref val) => fidl::encoding::encode_in_envelope::<
CompositorArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<CompositorArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::DisplayCompositor(ref val) => fidl::encoding::encode_in_envelope::<
DisplayCompositorArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<DisplayCompositorArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::LayerStack(ref val) => fidl::encoding::encode_in_envelope::<
LayerStackArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<LayerStackArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Layer(ref val) => fidl::encoding::encode_in_envelope::<
LayerArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<LayerArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Scene(ref val) => fidl::encoding::encode_in_envelope::<
SceneArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<SceneArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Camera(ref val) => fidl::encoding::encode_in_envelope::<
CameraArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<CameraArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::StereoCamera(ref val) => fidl::encoding::encode_in_envelope::<
StereoCameraArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<StereoCameraArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Renderer(ref val) => fidl::encoding::encode_in_envelope::<
RendererArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<RendererArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::AmbientLight(ref val) => fidl::encoding::encode_in_envelope::<
AmbientLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<AmbientLightArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::DirectionalLight(ref val) => fidl::encoding::encode_in_envelope::<
DirectionalLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<DirectionalLightArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Variable(ref val) => fidl::encoding::encode_in_envelope::<
VariableArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<VariableArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::PointLight(ref val) => fidl::encoding::encode_in_envelope::<
PointLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<PointLightArgs as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::View3(ref mut val) => fidl::encoding::encode_in_envelope::<
ViewArgs3,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ViewArgs3 as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::ImagePipe2(ref mut val) => fidl::encoding::encode_in_envelope::<
ImagePipe2Args,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ImagePipe2Args as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Image2(ref val) => fidl::encoding::encode_in_envelope::<
ImageArgs2,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ImageArgs2 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ResourceArgs::Image3(ref mut val) => fidl::encoding::encode_in_envelope::<
ImageArgs3,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ImageArgs3 as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ResourceArgs {
#[inline(always)]
fn new_empty() -> Self {
Self::Memory(fidl::new_empty!(
MemoryArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <MemoryArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <ImageArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <BufferArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5 => <ViewArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6 => <ViewHolderArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => <RectangleArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8 => <RoundedRectangleArgs as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
9 => <CircleArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10 => <MeshArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11 => <ShapeNodeArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12 => <ClipNodeArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13 => <EntityNodeArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14 => <OpacityNodeArgsHack as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
15 => <MaterialArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16 => <CompositorArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
17 => <DisplayCompositorArgs as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
19 => <LayerStackArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20 => <LayerArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21 => <SceneArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22 => <CameraArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23 => {
<StereoCameraArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
24 => <RendererArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25 => {
<AmbientLightArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
26 => <DirectionalLightArgs as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
27 => <VariableArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28 => <PointLightArgs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
31 => <ViewArgs3 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
32 => <ImagePipe2Args as fidl::encoding::TypeMarker>::inline_size(decoder.context),
33 => <ImageArgs2 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
34 => <ImageArgs3 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Memory(_) = self {
} else {
*self = ResourceArgs::Memory(fidl::new_empty!(
MemoryArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Memory(ref mut val) = self {
fidl::decode!(
MemoryArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Image(_) = self {
} else {
*self = ResourceArgs::Image(fidl::new_empty!(
ImageArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Image(ref mut val) = self {
fidl::decode!(
ImageArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Buffer(_) = self {
} else {
*self = ResourceArgs::Buffer(fidl::new_empty!(
BufferArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Buffer(ref mut val) = self {
fidl::decode!(
BufferArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::View(_) = self {
} else {
*self = ResourceArgs::View(fidl::new_empty!(
ViewArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::View(ref mut val) = self {
fidl::decode!(
ViewArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ViewHolder(_) = self {
} else {
*self = ResourceArgs::ViewHolder(fidl::new_empty!(
ViewHolderArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ViewHolder(ref mut val) = self {
fidl::decode!(
ViewHolderArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Rectangle(_) = self {
} else {
*self = ResourceArgs::Rectangle(fidl::new_empty!(
RectangleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Rectangle(ref mut val) = self {
fidl::decode!(
RectangleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::RoundedRectangle(_) = self {
} else {
*self = ResourceArgs::RoundedRectangle(fidl::new_empty!(
RoundedRectangleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::RoundedRectangle(ref mut val) = self {
fidl::decode!(
RoundedRectangleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Circle(_) = self {
} else {
*self = ResourceArgs::Circle(fidl::new_empty!(
CircleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Circle(ref mut val) = self {
fidl::decode!(
CircleArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Mesh(_) = self {
} else {
*self = ResourceArgs::Mesh(fidl::new_empty!(
MeshArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Mesh(ref mut val) = self {
fidl::decode!(
MeshArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ShapeNode(_) = self {
} else {
*self = ResourceArgs::ShapeNode(fidl::new_empty!(
ShapeNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ShapeNode(ref mut val) = self {
fidl::decode!(
ShapeNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
12 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ClipNode(_) = self {
} else {
*self = ResourceArgs::ClipNode(fidl::new_empty!(
ClipNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ClipNode(ref mut val) = self {
fidl::decode!(
ClipNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
13 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::EntityNode(_) = self {
} else {
*self = ResourceArgs::EntityNode(fidl::new_empty!(
EntityNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::EntityNode(ref mut val) = self {
fidl::decode!(
EntityNodeArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
14 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::OpacityNode(_) = self {
} else {
*self = ResourceArgs::OpacityNode(fidl::new_empty!(
OpacityNodeArgsHack,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::OpacityNode(ref mut val) = self {
fidl::decode!(
OpacityNodeArgsHack,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
15 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Material(_) = self {
} else {
*self = ResourceArgs::Material(fidl::new_empty!(
MaterialArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Material(ref mut val) = self {
fidl::decode!(
MaterialArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
16 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Compositor(_) = self {
} else {
*self = ResourceArgs::Compositor(fidl::new_empty!(
CompositorArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Compositor(ref mut val) = self {
fidl::decode!(
CompositorArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
17 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::DisplayCompositor(_) = self {
} else {
*self = ResourceArgs::DisplayCompositor(fidl::new_empty!(
DisplayCompositorArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::DisplayCompositor(ref mut val) = self {
fidl::decode!(
DisplayCompositorArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
19 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::LayerStack(_) = self {
} else {
*self = ResourceArgs::LayerStack(fidl::new_empty!(
LayerStackArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::LayerStack(ref mut val) = self {
fidl::decode!(
LayerStackArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
20 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Layer(_) = self {
} else {
*self = ResourceArgs::Layer(fidl::new_empty!(
LayerArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Layer(ref mut val) = self {
fidl::decode!(
LayerArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
21 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Scene(_) = self {
} else {
*self = ResourceArgs::Scene(fidl::new_empty!(
SceneArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Scene(ref mut val) = self {
fidl::decode!(
SceneArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
22 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Camera(_) = self {
} else {
*self = ResourceArgs::Camera(fidl::new_empty!(
CameraArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Camera(ref mut val) = self {
fidl::decode!(
CameraArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
23 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::StereoCamera(_) = self {
} else {
*self = ResourceArgs::StereoCamera(fidl::new_empty!(
StereoCameraArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::StereoCamera(ref mut val) = self {
fidl::decode!(
StereoCameraArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
24 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Renderer(_) = self {
} else {
*self = ResourceArgs::Renderer(fidl::new_empty!(
RendererArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Renderer(ref mut val) = self {
fidl::decode!(
RendererArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
25 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::AmbientLight(_) = self {
} else {
*self = ResourceArgs::AmbientLight(fidl::new_empty!(
AmbientLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::AmbientLight(ref mut val) = self {
fidl::decode!(
AmbientLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
26 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::DirectionalLight(_) = self {
} else {
*self = ResourceArgs::DirectionalLight(fidl::new_empty!(
DirectionalLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::DirectionalLight(ref mut val) = self {
fidl::decode!(
DirectionalLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
27 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Variable(_) = self {
} else {
*self = ResourceArgs::Variable(fidl::new_empty!(
VariableArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Variable(ref mut val) = self {
fidl::decode!(
VariableArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
28 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::PointLight(_) = self {
} else {
*self = ResourceArgs::PointLight(fidl::new_empty!(
PointLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::PointLight(ref mut val) = self {
fidl::decode!(
PointLightArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
31 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::View3(_) = self {
} else {
*self = ResourceArgs::View3(fidl::new_empty!(
ViewArgs3,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::View3(ref mut val) = self {
fidl::decode!(
ViewArgs3,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
32 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ImagePipe2(_) = self {
} else {
*self = ResourceArgs::ImagePipe2(fidl::new_empty!(
ImagePipe2Args,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::ImagePipe2(ref mut val) = self {
fidl::decode!(
ImagePipe2Args,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
33 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Image2(_) = self {
} else {
*self = ResourceArgs::Image2(fidl::new_empty!(
ImageArgs2,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Image2(ref mut val) = self {
fidl::decode!(
ImageArgs2,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
34 => {
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Image3(_) = self {
} else {
*self = ResourceArgs::Image3(fidl::new_empty!(
ImageArgs3,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ResourceArgs::Image3(ref mut val) = self {
fidl::decode!(
ImageArgs3,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Value {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Value>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Value::Vector1(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::Vector2(ref val) => fidl::encoding::encode_in_envelope::<Vec2, D>(
<Vec2 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::Vector3(ref val) => fidl::encoding::encode_in_envelope::<Vec3, D>(
<Vec3 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::Vector4(ref val) => fidl::encoding::encode_in_envelope::<Vec4, D>(
<Vec4 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::Matrix4x4(ref val) => fidl::encoding::encode_in_envelope::<Mat4, D>(
<Mat4 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::ColorRgba(ref val) => fidl::encoding::encode_in_envelope::<ColorRgba, D>(
<ColorRgba as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::ColorRgb(ref val) => fidl::encoding::encode_in_envelope::<ColorRgb, D>(
<ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::Degrees(ref val) => fidl::encoding::encode_in_envelope::<f32, D>(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::Quaternion(ref val) => fidl::encoding::encode_in_envelope::<Quaternion, D>(
<Quaternion as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::Transform(ref val) => {
fidl::encoding::encode_in_envelope::<FactoredTransform, D>(
<FactoredTransform as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Value::VariableId(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
#[inline(always)]
fn new_empty() -> Self {
Self::Vector1(fidl::new_empty!(f32, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <Vec2 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <Vec3 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <Vec4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5 => <Mat4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6 => <ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => <ColorRgb as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8 => <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9 => <Quaternion as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10 => {
<FactoredTransform as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
11 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Value::Vector1(_) = self {
} else {
*self = Value::Vector1(fidl::new_empty!(f32, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Vector1(ref mut val) = self {
fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Value::Vector2(_) = self {
} else {
*self = Value::Vector2(fidl::new_empty!(Vec2, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Vector2(ref mut val) = self {
fidl::decode!(Vec2, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Value::Vector3(_) = self {
} else {
*self = Value::Vector3(fidl::new_empty!(Vec3, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Vector3(ref mut val) = self {
fidl::decode!(Vec3, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Value::Vector4(_) = self {
} else {
*self = Value::Vector4(fidl::new_empty!(Vec4, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Vector4(ref mut val) = self {
fidl::decode!(Vec4, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Value::Matrix4x4(_) = self {
} else {
*self = Value::Matrix4x4(fidl::new_empty!(Mat4, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Matrix4x4(ref mut val) = self {
fidl::decode!(Mat4, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let Value::ColorRgba(_) = self {
} else {
*self = Value::ColorRgba(fidl::new_empty!(ColorRgba, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::ColorRgba(ref mut val) = self {
fidl::decode!(ColorRgba, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let Value::ColorRgb(_) = self {
} else {
*self = Value::ColorRgb(fidl::new_empty!(ColorRgb, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::ColorRgb(ref mut val) = self {
fidl::decode!(ColorRgb, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let Value::Degrees(_) = self {
} else {
*self = Value::Degrees(fidl::new_empty!(f32, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Degrees(ref mut val) = self {
fidl::decode!(f32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let Value::Quaternion(_) = self {
} else {
*self = Value::Quaternion(fidl::new_empty!(Quaternion, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Quaternion(ref mut val) = self {
fidl::decode!(Quaternion, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let Value::Transform(_) = self {
} else {
*self = Value::Transform(fidl::new_empty!(FactoredTransform, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Transform(ref mut val) = self {
fidl::decode!(FactoredTransform, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let Value::VariableId(_) = self {
} else {
*self = Value::VariableId(fidl::new_empty!(u32, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::VariableId(ref mut val) = self {
fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}