Trait shard_ecs::Component[][src]

pub trait Component: Sized + 'static {
    type Allocator: for<'s> ComponentAllocator<'s, Self>;

    const NAME: &'static str;
    const ID: ComponentId;
    const POOLS_PER_ALLOCATION: usize;
}
Expand description

Trait implemented for all types to be used as components.

Associated Types

Allocator associated type trait for allocating instances of this component.

Associated Constants

ID used for identifying components. MUST be unique across the program.

Amount of pools per allocation. MUST be respected by the allocator. Amount of components per allocation is therefore POOLS_PER_ALLOCATION * COMPONENTS_PER_POOL.

Implementors