Enum anymap::Entry
[−]
[src]
pub enum Entry<'a, A: ?Sized + UncheckedAnyExt, V: 'a> { Occupied(OccupiedEntry<'a, A, V>), Vacant(VacantEntry<'a, A, V>), }
A view into a single location in an Map, which may be vacant or occupied.
Variants
Occupied(OccupiedEntry<'a, A, V>)An occupied Entry
Vacant(VacantEntry<'a, A, V>)A vacant Entry
Methods
impl<'a, A: ?Sized + UncheckedAnyExt, V: IntoBox<A>> Entry<'a, A, V>[src]
impl<'a, A: ?Sized + UncheckedAnyExt, V: IntoBox<A>> Entry<'a, A, V>pub fn or_insert(self, default: V) -> &'a mut V[src]
pub fn or_insert(self, default: V) -> &'a mut VEnsures a value is in the entry by inserting the default if empty, and returns a mutable reference to the value in the entry.
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V[src]
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut VEnsures a value is in the entry by inserting the result of the default function if empty, and returns a mutable reference to the value in the entry.