Struct parsec::VecStorage [] [src]

pub struct VecStorage<T>(pub Vec<Option<(Generation, T)>>);

Vec-based storage, actually wraps data into options and stores the generations of the data in order to match with given entities. Supposed to have maximum performance for the components mostly present in entities.

Trait Implementations

impl<T: Debug> Debug for VecStorage<T>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T> StorageBase for VecStorage<T>
[src]

fn del(&mut self, entity: Entity)

Delete a particular entity from the storage.

impl<T> Storage<T> for VecStorage<T>
[src]

fn new() -> Self

Create a new storage. This is called when you register a new component type within the world. Read more

fn get(&self, entity: Entity) -> Option<&T>

Try reading the data associated with an entity.

fn get_mut(&mut self, entity: Entity) -> Option<&mut T>

Try mutating the data associated with an entity.

fn insert(&mut self, entity: Entity, value: T)

Insert a new data for a given entity.

fn remove(&mut self, entity: Entity) -> Option<T>

Remove the data associated with an entity.