Struct specs::HashMapStorage
[−]
[src]
pub struct HashMapStorage<T> { // some fields omitted }
HashMap-based storage. Best suited for rare components.
Trait Implementations
impl<T> StorageBase for HashMapStorage<T>
[src]
impl<T> Storage<T> for HashMapStorage<T>
[src]
type UnprotectedStorage = InnerHashMap<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, 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.
fn open(&self) -> (&BitSet, &Self::UnprotectedStorage)
splits the bitset from the storage for use by the join iterator. Read more
fn open_mut(&mut self) -> (&BitSet, &mut Self::UnprotectedStorage)
splits the bitset from the storage for use by the join iterator. Read more