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: Default> UnprotectedStorage<T> for NullStorage<T>
[src]
unsafe fn clean<F>(&mut self, _: F) where
F: Fn(Index) -> bool,
[src]
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, _: Index) -> &T
[src]
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, _: Index) -> &mut T
[src]
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]
Inserts new data for a given Index
.
unsafe fn remove(&mut self, _: Index) -> T
[src]
Removes the data associated with an Index
.
impl<T> Default for NullStorage<T> where
T: Default,
[src]
T: Default,
impl<T> DistinctStorage for NullStorage<T>
[src]
This is safe because you cannot mutate ZSTs.