Struct specs::HashMapStorage [] [src]

pub struct HashMapStorage<T>(pub HashMap<Entity, T, BuildHasherDefault<FnvHasher>>);

HashMap-based storage. Best suited for rare components.

Trait Implementations

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

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

Formats the value using the given formatter.

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

fn del(&mut self, entity: Entity)

Delete a particular entity from the storage.

impl<T> Storage<T> for HashMapStorage<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.