pub struct SecondarySlotVec<Tag: ?Sized, Val> { /* private fields */ }
Expand description
A secondary map used to associated data with keys from elements in an existing SlotVec
.
Analogous to slotmap::SecondaryMap
.
Implementations§
Source§impl<Tag: ?Sized, Val> SecondarySlotVec<Tag, Val>
impl<Tag: ?Sized, Val> SecondarySlotVec<Tag, Val>
Sourcepub fn insert(&mut self, key: Key<Tag>, value: Val) -> Option<Val>
pub fn insert(&mut self, key: Key<Tag>, value: Val) -> Option<Val>
Inserts a value into the SecondarySlotVec
and returns the previous value associated with the key.
Sourcepub fn remove(&mut self, key: Key<Tag>) -> Option<Val>
pub fn remove(&mut self, key: Key<Tag>) -> Option<Val>
Removes a value associated with the key from the SecondarySlotVec
and returns it.
Trait Implementations§
Source§impl<Tag: ?Sized, Val> Default for SecondarySlotVec<Tag, Val>
impl<Tag: ?Sized, Val> Default for SecondarySlotVec<Tag, Val>
Auto Trait Implementations§
impl<Tag, Val> Freeze for SecondarySlotVec<Tag, Val>where
Tag: ?Sized,
impl<Tag, Val> RefUnwindSafe for SecondarySlotVec<Tag, Val>
impl<Tag, Val> Send for SecondarySlotVec<Tag, Val>
impl<Tag, Val> Sync for SecondarySlotVec<Tag, Val>
impl<Tag, Val> Unpin for SecondarySlotVec<Tag, Val>
impl<Tag, Val> UnwindSafe for SecondarySlotVec<Tag, Val>
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more