Struct specs::NullStorage [−][src]
pub struct NullStorage<T>(_);
A null storage type, used for cases where the component doesn't contain any data and instead works as a simple flag.
Trait Implementations
impl<T> UnprotectedStorage<T> for NullStorage<T> where
T: Default,
[src]
impl<T> UnprotectedStorage<T> for NullStorage<T> where
T: Default,
unsafe fn clean<B>(&mut self, _has: B) where
B: BitSetLike,
[src]
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
ⓘImportant traits for &'a mut Runsafe fn get(&self, _: Index) -> &T
[src]
ⓘImportant traits for &'a mut R
unsafe fn get(&self, _: 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
ⓘImportant traits for &'a mut Runsafe fn get_mut(&mut self, _: Index) -> &mut T
[src]
ⓘImportant traits for &'a mut R
unsafe fn get_mut(&mut self, _: 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, _: Index, _: T)
[src]
unsafe fn insert(&mut self, _: Index, _: T)
Inserts new data for a given Index
.
unsafe fn remove(&mut self, _: Index) -> T
[src]
unsafe fn remove(&mut self, _: Index) -> T
Removes the data associated with an Index
.
unsafe fn drop(&mut self, id: Index)
[src]
unsafe fn drop(&mut self, id: Index)
Drops the data associated with an Index
.
impl<T> Default for NullStorage<T> where
T: Default,
[src]
impl<T> Default for NullStorage<T> where
T: Default,
impl<T> DistinctStorage for NullStorage<T>
[src]
impl<T> DistinctStorage for NullStorage<T>
This is safe because you cannot mutate ZSTs.
Auto Trait Implementations
impl<T> Send for NullStorage<T> where
T: Send,
impl<T> Send for NullStorage<T> where
T: Send,
impl<T> Sync for NullStorage<T> where
T: Sync,
impl<T> Sync for NullStorage<T> where
T: Sync,