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
type Allocator: for<'s> ComponentAllocator<'s, Self>
type Allocator: for<'s> ComponentAllocator<'s, Self>
Allocator associated type trait for allocating instances of this component.
Associated Constants
const ID: ComponentId
const ID: ComponentId
ID used for identifying components. MUST be unique across the program.
const POOLS_PER_ALLOCATION: usize
const POOLS_PER_ALLOCATION: usize
Amount of pools per allocation. MUST be respected by the allocator. Amount of components per allocation is therefore POOLS_PER_ALLOCATION * COMPONENTS_PER_POOL.