Struct specs::HashMapStorage
[−]
[src]
pub struct HashMapStorage<T>(_);
HashMap-based storage. Best suited for rare components.
Trait Implementations
impl<T> UnprotectedStorage<T> for HashMapStorage<T>
[src]
fn new() -> Self
Creates a new Storage<T>
. This is called when you register a new component type within the world. Read more
unsafe fn clean<F>(&mut self, _: F) where F: Fn(Index) -> bool
Clean the storage given a check to figure out if an index is valid or not. Allows us to safely drop the storage. Read more
unsafe fn get(&self, id: Index) -> &T
Tries reading the data associated with an Index
. This is unsafe because the external set used to protect this storage is absent. Read more
unsafe fn get_mut(&mut self, id: Index) -> &mut T
Tries mutating the data associated with an Index
. This is unsafe because the external set used to protect this storage is absent. Read more
unsafe fn insert(&mut self, id: Index, v: T)
Inserts new data for a given Index
.
unsafe fn remove(&mut self, id: Index) -> T
Removes the data associated with an Index
.