Struct specs::storage::NullStorage
source · pub struct NullStorage<T>(/* private fields */);
Expand description
A null storage type, used for cases where the component doesn’t contain any data and instead works as a simple flag.
Trait Implementations§
source§impl<T> Default for NullStorage<T>
impl<T> Default for NullStorage<T>
Gets mutable access to the the data associated with an
Index
. Read moresource§impl<T> UnprotectedStorage<T> for NullStorage<T>
impl<T> UnprotectedStorage<T> for NullStorage<T>
§type AccessMut<'a> = &'a mut T
where
T: 'a
type AccessMut<'a> = &'a mut T where T: 'a
The wrapper through with mutable access of a component is performed.
source§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
dropping all existing components. Read more
source§unsafe fn get(&self, _: Index) -> &T
unsafe fn get(&self, _: Index) -> &T
Gets a shared reference to the data associated with an
Index
. Read moresource§unsafe fn get_mut(&mut self, id: Index) -> &mut T
unsafe fn get_mut(&mut self, id: Index) -> &mut T
Gets mutable access to the the data associated with an
Index
. Read moreimpl<T> DistinctStorage for NullStorage<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for NullStorage<T>where T: RefUnwindSafe,
impl<T> Send for NullStorage<T>where T: Send,
impl<T> Sync for NullStorage<T>where T: Sync,
impl<T> Unpin for NullStorage<T>where T: Unpin,
impl<T> UnwindSafe for NullStorage<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
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere T: Default,
source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.