Enum qp_trie::Entry
[−]
[src]
pub enum Entry<'a, K: 'a + ToOwned, V: 'a> { Vacant(VacantEntry<'a, K, V>), Occupied(OccupiedEntry<'a, K, V>), }
An entry - occupied or vacant - in the trie, corresponding to some given key.
Variants
Vacant(VacantEntry<'a, K, V>)
Occupied(OccupiedEntry<'a, K, V>)
Methods
impl<'a, K: 'a + ToOwned + Borrow<[u8]>, V: 'a> Entry<'a, K, V>
[src]
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.
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.
fn key(&self) -> &K
Get a reference to the key associated with this entry.