pub trait Component:
Clone
+ 'static
+ Send
+ Sync { }Expand description
A marker trait for types that can be used as components in the ECS.
This trait must be implemented for any struct you wish to attach to an entity.
The 'static lifetime ensures that the component type does not contain any
non-static references, and Send + Sync are required to allow the component
data to be safely accessed from multiple threads.
Clone is required to allow component data to be moved between pages
during structural changes (like adding or removing components).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl Component for AudioListener
impl Component for AudioSource
impl Component for Camera
impl Component for Children
impl Component for GlobalTransform
impl Component for Light
impl Component for MaterialComponent
impl Component for Parent
impl Component for Transform
impl<T: Asset> Component for HandleComponent<T>
Implement the Component trait to make HandleComponent usable by the ECS.