Skip to main content

Component

Trait Component 

Source
pub trait Component:
    Sized
    + Send
    + Debug
    + 'static {
    const NAME: &'static str;

    // Provided methods
    fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult> { ... }
    fn inject_locator(&mut self, _locator: PayloadLocator) { ... }
    fn inject_name(&mut self, _id: AssetId) { ... }
}
Expand description

Component – pure serializable data, no behavior. The runtime-facing surface only: a component loads from its baked blob bytes and receives its injected identity/payload hooks. All authoring metadata (origin, payload kind, reference fields, args schema, validators) lives in the build-side registry (concinnity-world), derived from the for_each_component! metadata blocks.

Required Associated Constants§

Source

const NAME: &'static str

The registry name a world authors this component under.

Provided Methods§

Source

fn from_baked(_bytes: &[u8]) -> Result<Self, CnResult>

Reconstruct this component from a blob record, whose bytes are the serialized runtime component (cook already ran the asset -> component translation). The default rejects: runtime-only components are never stored in a blob, so only loadable types provide an implementation.

Source

fn inject_locator(&mut self, _locator: PayloadLocator)

Called after construction to inject the payload locator from the blob def. Only meaningful for components with a compiled payload. The default implementation does nothing (correct for most components).

Source

fn inject_name(&mut self, _id: AssetId)

Called after construction to inject the asset’s identity from the blob def. Only meaningful for components that look themselves up by id at runtime. The default implementation does nothing.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Component for Animation

Source§

const NAME: &'static str = "Animation"

Source§

impl Component for AnimationGraph

Source§

const NAME: &'static str = "AnimationGraph"

Source§

impl Component for AnimationParams

Source§

const NAME: &'static str = "AnimationParams"

Source§

impl Component for AppConfig

Source§

const NAME: &'static str = "AppConfig"

Source§

impl Component for AudioCue

Source§

const NAME: &'static str = "AudioCue"

Source§

impl Component for AudioEmitter

Source§

const NAME: &'static str = "AudioEmitter"

Source§

impl Component for AudioOcclusionProbe

Source§

const NAME: &'static str = "AudioOcclusionProbe"

Source§

impl Component for Behavior

Source§

const NAME: &'static str = "Behavior"

Source§

impl Component for BlockType

Source§

const NAME: &'static str = "BlockType"

Source§

impl Component for BodyDynamics

Source§

const NAME: &'static str = "BodyDynamics"

Source§

impl Component for Camera3D

Source§

const NAME: &'static str = "Camera3D"

Source§

impl Component for CameraProbe

Source§

const NAME: &'static str = "CameraProbe"

Source§

impl Component for CharacterRig

Source§

const NAME: &'static str = "CharacterRig"

Source§

impl Component for CharacterShape

Source§

const NAME: &'static str = "CharacterShape"

Source§

impl Component for Children

Source§

const NAME: &'static str = "Children"

Source§

impl Component for Collider

Source§

const NAME: &'static str = "Collider"

Source§

impl Component for DebugHud

Source§

const NAME: &'static str = "DebugHud"

Source§

impl Component for Decal

Source§

const NAME: &'static str = "Decal"

Source§

impl Component for DirectionalLight

Source§

const NAME: &'static str = "DirectionalLight"

Source§

impl Component for File

Source§

const NAME: &'static str = "File"

Source§

impl Component for FpsCounter

Source§

const NAME: &'static str = "FpsCounter"

Source§

impl Component for FrameInput

Source§

const NAME: &'static str = "FrameInput"

Source§

impl Component for GlassPanel

Source§

const NAME: &'static str = "GlassPanel"

Source§

impl Component for GlobalTransform

Source§

const NAME: &'static str = "GlobalTransform"

Source§

impl Component for GraphicsConfig

Source§

const NAME: &'static str = "GraphicsConfig"

Source§

impl Component for GroundProbes

Source§

const NAME: &'static str = "GroundProbes"

Source§

impl Component for Held

Source§

const NAME: &'static str = "Held"

Source§

impl Component for Hidden

Source§

const NAME: &'static str = "Hidden"

Source§

impl Component for HitRegion

Source§

const NAME: &'static str = "HitRegion"

Source§

impl Component for InstancedProp

Source§

const NAME: &'static str = "InstancedProp"

Source§

impl Component for Interactable

Source§

const NAME: &'static str = "Interactable"

Source§

impl Component for KeyBinding

Source§

const NAME: &'static str = "KeyBinding"

Source§

impl Component for LayoutContainer

Source§

const NAME: &'static str = "LayoutContainer"

Source§

impl Component for Lifetime

Source§

const NAME: &'static str = "Lifetime"

Source§

impl Component for LoadingOverlay

Source§

const NAME: &'static str = "LoadingOverlay"

Source§

impl Component for MeshRenderer

Source§

const NAME: &'static str = "MeshRenderer"

Source§

impl Component for Model

Source§

const NAME: &'static str = "Model"

Source§

impl Component for ModelRenderer

Source§

const NAME: &'static str = "ModelRenderer"

Source§

impl Component for Parent

Source§

const NAME: &'static str = "Parent"

Source§

impl Component for ParticleEmitter

Source§

const NAME: &'static str = "ParticleEmitter"

Source§

impl Component for PhysicsConfig

Source§

const NAME: &'static str = "PhysicsConfig"

Source§

impl Component for PhysicsJoint

Source§

const NAME: &'static str = "PhysicsJoint"

Source§

impl Component for Pickup

Source§

const NAME: &'static str = "Pickup"

Source§

impl Component for PointLight

Source§

const NAME: &'static str = "PointLight"

Source§

impl Component for PostProcessConfig

Source§

const NAME: &'static str = "PostProcessConfig"

Source§

impl Component for ProceduralMesh

Source§

const NAME: &'static str = "ProceduralMesh"

Source§

impl Component for Prop

Source§

const NAME: &'static str = "Prop"

Source§

impl Component for PropBody

Source§

const NAME: &'static str = "PropBody"

Source§

impl Component for PropInstance

Source§

const NAME: &'static str = "PropInstance"

Source§

impl Component for RectAreaLight

Source§

const NAME: &'static str = "RectAreaLight"

Source§

impl Component for ReflectionProbe

Source§

const NAME: &'static str = "ReflectionProbe"

Source§

impl Component for RenderHandle

Source§

const NAME: &'static str = "RenderHandle"

Source§

impl Component for RigidBody

Source§

const NAME: &'static str = "RigidBody"

Source§

impl Component for Room

Source§

const NAME: &'static str = "Room"

Source§

impl Component for Scene

Source§

const NAME: &'static str = "Scene"

Source§

impl Component for SceneMember

Source§

const NAME: &'static str = "SceneMember"

Source§

impl Component for Screen

Source§

const NAME: &'static str = "Screen"

Source§

impl Component for ScrollPanel

Source§

const NAME: &'static str = "ScrollPanel"

Source§

impl Component for SdfVolume

Source§

const NAME: &'static str = "SdfVolume"

Source§

impl Component for Shader

Source§

const NAME: &'static str = "Shader"

Source§

impl Component for SkeletonPose

Source§

const NAME: &'static str = "SkeletonPose"

Source§

impl Component for Spawner

Source§

const NAME: &'static str = "Spawner"

Source§

impl Component for SpotLight

Source§

const NAME: &'static str = "SpotLight"

Source§

impl Component for Sprite

Source§

const NAME: &'static str = "Sprite"

Source§

impl Component for StatHud

Source§

const NAME: &'static str = "StatHud"

Source§

impl Component for Story

Source§

const NAME: &'static str = "Story"

Source§

impl Component for StreamingConfig

Source§

const NAME: &'static str = "StreamingConfig"

Source§

impl Component for TextInput

Source§

const NAME: &'static str = "TextInput"

Source§

impl Component for TextLabel

Source§

const NAME: &'static str = "TextLabel"

Source§

impl Component for Transform

Source§

const NAME: &'static str = "Transform"

Source§

impl Component for TriggerVolume

Source§

const NAME: &'static str = "TriggerVolume"

Source§

impl Component for Variables

Source§

const NAME: &'static str = "Variables"

Source§

impl Component for VolumetricFog

Source§

const NAME: &'static str = "VolumetricFog"

Source§

impl Component for VoxelChunk

Source§

const NAME: &'static str = "VoxelChunk"

Source§

impl Component for VoxelWorld

Source§

const NAME: &'static str = "VoxelWorld"

Source§

impl Component for WaterSurface

Source§

const NAME: &'static str = "WaterSurface"

Source§

impl Component for Window

Source§

const NAME: &'static str = "Window"