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
Creates a new Storage<T>
. This is called when you register a new component type within the world. Read more
fn get(&self, entity: Entity) -> Option<&T>
Tries to read the data associated with an Entity
.
fn get_mut(&mut self, entity: Entity) -> Option<&mut T>
Tries to mutate the data associated with an Entity
.
fn insert(&mut self, entity: Entity, value: T)
Inserts new data for a given Entity
.
fn remove(&mut self, entity: Entity) -> Option<T>
Removes 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
mutably from the storage for use by the Join
iterator. Read more