Component

Trait Component 

Source
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§