pub(crate) enum Entry<V> {
Present(V),
Unusable,
}
Expand description
A single entry in one of our careful slotmaps.
An entry can either be Present
(in which case we treat it normally),
or Unusable
, in which case we
Variants§
Present(V)
The entry is available.
Unusable
The entry can no longer be used, removed, or set to anything else.
It must not be removed from the slot map, since doing so would increase its slot’s version number too high.
Implementations§
Source§impl<V> Entry<V>
impl<V> Entry<V>
Sourcepub(crate) fn take_and_mark_unusable(&mut self) -> Option<V>
pub(crate) fn take_and_mark_unusable(&mut self) -> Option<V>
Remove the value of self
(if any), and make it unusable.
Sourcepub(crate) fn value(&self) -> Option<&V>
pub(crate) fn value(&self) -> Option<&V>
Return a reference to the value of self
, if there is one.
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for Entry<V>where
V: Freeze,
impl<V> RefUnwindSafe for Entry<V>where
V: RefUnwindSafe,
impl<V> Send for Entry<V>where
V: Send,
impl<V> Sync for Entry<V>where
V: Sync,
impl<V> Unpin for Entry<V>where
V: Unpin,
impl<V> UnwindSafe for Entry<V>where
V: 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