Enum linear_map::Entry
[−]
[src]
pub enum Entry<'a, K: 'a, V: 'a> { Occupied(OccupiedEntry<'a, K, V>), Vacant(VacantEntry<'a, K, V>), }
A view into a single entry in a LinearMap
.
See LinearMap::entry
for details.
Variants
Occupied(OccupiedEntry<'a, K, V>)
An occupied entry.
Vacant(VacantEntry<'a, K, V>)
A vacant entry.
Methods
impl<'a, K, V> Entry<'a, K, V>
[src]
fn or_insert(self, default: V) -> &'a mut V
Ensures that the entry is occupied by inserting the given value if it is vacant.
Returns a mutable reference to the entry's value.
fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V
Ensures that the entry is occupied by inserting the the result of the given function if it is vacant.
Returns a mutable reference to the entry's value.