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>where
T: Default,
impl<T> Default for NullStorage<T>where
T: Default,
Source§fn default() -> NullStorage<T>
fn default() -> NullStorage<T>
Returns the “default value” for a type. Read more
Source§impl<T> UnprotectedStorage<T> for NullStorage<T>where
T: Default,
impl<T> UnprotectedStorage<T> for NullStorage<T>where
T: Default,
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.
Allows us to safely drop the storage.
Source§unsafe fn get(&self, _: u32) -> &T
unsafe fn get(&self, _: u32) -> &T
Tries reading the data associated with an
Index.
This is unsafe because the external set used
to protect this storage is absent.impl<T> DistinctStorage for NullStorage<T>
This is safe because you cannot mutate ZSTs.
Auto Trait Implementations§
impl<T> Freeze for NullStorage<T>where
T: Freeze,
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
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.