Struct specs::VecStorage [] [src]

pub struct VecStorage<T> {
    // some fields omitted
}

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> Drop for VecStorage<T>
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more

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

fn del(&mut self, e: Entity)

Delete a particular entity from the storage.

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

type UnprotectedStorage = InnerVec<T>

Used during iterator

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, e: Entity) -> Option<&T>

Try reading the data associated with an entity.

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

Try mutating the data associated with an entity.

fn insert(&mut self, e: Entity, v: T)

Insert a new data for a given entity.

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

Remove the data associated with an entity.

fn open(&self) -> (&BitSet, &InnerVec<T>)

splits the bitset from the storage for use by the join iterator. Read more

fn open_mut(&mut self) -> (&BitSet, &mut InnerVec<T>)

splits the bitset from the storage for use by the join iterator. Read more