pub struct HashMapStorage<T>(/* private fields */);
Expand description
HashMap
-based storage. Best suited for rare components.
This uses the hashbrown::HashMap internally.
Trait Implementations§
Source§impl<T> Default for HashMapStorage<T>
impl<T> Default for HashMapStorage<T>
Source§impl<T> Storage<T> for HashMapStorage<T>
impl<T> Storage<T> for HashMapStorage<T>
Source§unsafe fn get(&self, id: Index) -> &T
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 moreSource§unsafe fn get_mut(&mut self, id: Index) -> &mut T
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 moreSource§unsafe fn remove(&mut self, index: Index) -> T
unsafe fn remove(&mut self, index: Index) -> T
Removes the data associated with an
Index
. Read moreSource§unsafe fn clean<B>(&mut self, _has: B)where
B: BitSetLike,
unsafe fn clean<B>(&mut self, _has: B)where
B: BitSetLike,
Clean the storage given a bitset with bits set for valid indices.
Allows us to safely drop the storage. Read more
impl<T> DistinctStorage for HashMapStorage<T>
Auto Trait Implementations§
impl<T> Freeze for HashMapStorage<T>
impl<T> RefUnwindSafe for HashMapStorage<T>where
T: RefUnwindSafe,
impl<T> Send for HashMapStorage<T>where
T: Send,
impl<T> Sync for HashMapStorage<T>where
T: Sync,
impl<T> Unpin for HashMapStorage<T>where
T: Unpin,
impl<T> UnwindSafe for HashMapStorage<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more