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
Occupied(OccupiedEntry<'a>)
An occupied entry.
Vacant(VacantEntry<'a>)
A vacant entry.
Implementations
sourceimpl<'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.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Entry<'a>
impl<'a> Send for Entry<'a>
impl<'a> Sync for Entry<'a>
impl<'a> Unpin for Entry<'a>
impl<'a> !UnwindSafe for Entry<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more