pub enum Entry<'a> {
Occupied(OccupiedEntry<'a>),
Vacant(VacantEntry<'a>),
}Expand description
A view into a single entry in a map, which may either be vacant or occupied.
This enum is constructed from the entry method on HashMap.
Variants§
Implementations§
source§impl<'a> Entry<'a>
impl<'a> Entry<'a>
sourcepub fn or_insert(self, default: Bson) -> &'a mut Bson
pub fn or_insert(self, default: Bson) -> &'a mut Bson
Inserts the given default value in the entry if it is vacant and returns a mutable reference to it. Otherwise a mutable reference to an already existent value is returned.
sourcepub fn or_insert_with<F: FnOnce() -> Bson>(self, default: F) -> &'a mut Bson
pub fn or_insert_with<F: FnOnce() -> Bson>(self, default: F) -> &'a mut Bson
Inserts the result of the default function in the entry if it is vacant and returns a
mutable reference to it. Otherwise a mutable reference to an already existent value is
returned.