Trait specs::storage::UnprotectedStorage [−][src]
pub trait UnprotectedStorage<T>: TryDefault { unsafe fn clean<B>(&mut self, has: B)
where
B: BitSetLike; unsafe fn get(&self, id: Index) -> &T; unsafe fn get_mut(&mut self, id: Index) -> &mut T; unsafe fn insert(&mut self, id: Index, value: T); unsafe fn remove(&mut self, id: Index) -> T; unsafe fn drop(&mut self, id: Index) { ... } }
Used by the framework to quickly join components.
Required Methods
unsafe fn clean<B>(&mut self, has: B) where
B: BitSetLike,
B: BitSetLike,
Clean the storage given a bitset with bits set for valid indices. Allows us to safely drop the storage.
ⓘImportant traits for &'a mut R
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.
ⓘImportant traits for &'a mut R
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.
unsafe fn insert(&mut self, id: Index, value: T)
Inserts new data for a given Index
.
unsafe fn remove(&mut self, id: Index) -> T
Removes the data associated with an Index
.
Provided Methods
Implementors
impl<C: Component, T: UnprotectedStorage<C>> UnprotectedStorage<C> for FlaggedStorage<C, T>
impl<T> UnprotectedStorage<T> for BTreeStorage<T>
impl<T> UnprotectedStorage<T> for HashMapStorage<T>
impl<T> UnprotectedStorage<T> for DenseVecStorage<T>
impl<T> UnprotectedStorage<T> for NullStorage<T> where
T: Default,impl<T> UnprotectedStorage<T> for VecStorage<T>