Enum hashlink::linked_hash_map::Entry
source · pub enum Entry<'a, K, V, S> {
Occupied(OccupiedEntry<'a, K, V, S>),
Vacant(VacantEntry<'a, K, V, S>),
}
Variants§
Occupied(OccupiedEntry<'a, K, V, S>)
Vacant(VacantEntry<'a, K, V, S>)
Implementations§
source§impl<'a, K, V, S> Entry<'a, K, V, S>
impl<'a, K, V, S> Entry<'a, K, V, S>
sourcepub fn or_insert(self, default: V) -> &'a mut Vwhere
K: Hash,
S: BuildHasher,
pub fn or_insert(self, default: V) -> &'a mut Vwhere
K: Hash,
S: BuildHasher,
If this entry is vacant, inserts a new entry with the given value and returns a reference to it.
If this entry is occupied, this method moves the occupied entry to the back of the internal linked list and returns a reference to the existing value.
sourcepub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut Vwhere
K: Hash,
S: BuildHasher,
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut Vwhere
K: Hash,
S: BuildHasher,
Similar to Entry::or_insert
, but accepts a function to construct a new value if this entry
is vacant.
pub fn key(&self) -> &K
pub fn and_modify<F>(self, f: F) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V, S> Freeze for Entry<'a, K, V, S>where
K: Freeze,
impl<'a, K, V, S> RefUnwindSafe for Entry<'a, K, V, S>
impl<'a, K, V, S> Send for Entry<'a, K, V, S>
impl<'a, K, V, S> Sync for Entry<'a, K, V, S>
impl<'a, K, V, S> Unpin for Entry<'a, K, V, S>where
K: Unpin,
impl<'a, K, V, S> !UnwindSafe for Entry<'a, K, V, S>
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