pub struct DenseIdMapWithReuse<K, V> { /* private fields */ }Expand description
Like a DenseIdMap, but supports freeing (and reusing) slots.
Implementations§
Source§impl<K: NumericId, V> DenseIdMapWithReuse<K, V>
impl<K: NumericId, V> DenseIdMapWithReuse<K, V>
Sourcepub fn reserve_slot(&mut self) -> K
pub fn reserve_slot(&mut self) -> K
Reserve a slot in the map for use later with DenseIdMapWithReuse::insert.
Sourcepub fn insert(&mut self, key: K, value: V)
pub fn insert(&mut self, key: K, value: V)
Insert the given mapping into the table. You probably
want to use DenseIdMapWithReuse::push instead, unless you need to use
the key to build the value, in which case you can
use DenseIdMapWithReuse::reserve_slot to get the key for this method.
Trait Implementations§
Source§impl<K: Clone, V: Clone> Clone for DenseIdMapWithReuse<K, V>
impl<K: Clone, V: Clone> Clone for DenseIdMapWithReuse<K, V>
Source§fn clone(&self) -> DenseIdMapWithReuse<K, V>
fn clone(&self) -> DenseIdMapWithReuse<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V> Default for DenseIdMapWithReuse<K, V>
impl<K, V> Default for DenseIdMapWithReuse<K, V>
Source§impl<K: NumericId, V> Index<K> for DenseIdMapWithReuse<K, V>
impl<K: NumericId, V> Index<K> for DenseIdMapWithReuse<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for DenseIdMapWithReuse<K, V>
impl<K, V> RefUnwindSafe for DenseIdMapWithReuse<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for DenseIdMapWithReuse<K, V>
impl<K, V> Sync for DenseIdMapWithReuse<K, V>
impl<K, V> Unpin for DenseIdMapWithReuse<K, V>
impl<K, V> UnwindSafe for DenseIdMapWithReuse<K, V>where
K: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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