pub enum Entry<'a, K: 'a, V: 'a> {
Vacant(VacantEntry<'a, K, V>),
Occupied(OccupiedEntry<'a, K, V>),
}
Expand description
An entry - occupied or vacant - in the trie, corresponding to some given key.
Variants§
Vacant(VacantEntry<'a, K, V>)
Occupied(OccupiedEntry<'a, K, V>)
Implementations§
source§impl<'a, K: 'a + Borrow<[u8]>, V: 'a> Entry<'a, K, V>
impl<'a, K: 'a + Borrow<[u8]>, V: 'a> Entry<'a, K, V>
sourcepub fn or_insert(self, default: V) -> &'a mut V
pub fn or_insert(self, default: V) -> &'a mut V
Get a mutable reference to a value already in the trie, if it exists - otherwise, insert a given default value, and return a mutable reference to its new location in the trie.
sourcepub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V
Get a mutable reference to a value already in the trie, if it exists - otherwise, call the provided closure to construct a new value, insert it into the trie, and then return a mutable reference to it.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V> RefUnwindSafe for Entry<'a, K, V>where K: RefUnwindSafe, V: RefUnwindSafe,
impl<'a, K, V> !Send for Entry<'a, K, V>
impl<'a, K, V> !Sync for Entry<'a, K, V>
impl<'a, K, V> Unpin for Entry<'a, K, V>where K: Unpin,
impl<'a, K, V> !UnwindSafe for Entry<'a, K, V>
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