Trait in_place::entry::OccupiedEntry
source · [−]pub trait OccupiedEntry<'c>: Sized {
type Value: 'c;
fn get_value<'e>(&'e self) -> &'e Self::Value
where
'c: 'e;
fn get_value_mut<'e>(&'e mut self) -> &mut Self::Value
where
'c: 'e;
fn into_value_mut<'e>(self) -> &'c mut Self::Value;
fn replace_value<'e>(&'e mut self, value: Self::Value) -> Self::Value
where
'c: 'e,
{ ... }
}
Expand description
A trait to represent an occupied entry of a collection.
this can be thought of as holding a &mut V
into the collection.
Associated Types
Required methods
get the value, immutably borrowed.
fn get_value_mut<'e>(&'e mut self) -> &mut Self::Value where
'c: 'e,
fn get_value_mut<'e>(&'e mut self) -> &mut Self::Value where
'c: 'e,
get the value, mutably borrowed.
fn into_value_mut<'e>(self) -> &'c mut Self::Value
fn into_value_mut<'e>(self) -> &'c mut Self::Value
convert the entry into a mutable to the value.
Provided methods
fn replace_value<'e>(&'e mut self, value: Self::Value) -> Self::Value where
'c: 'e,
fn replace_value<'e>(&'e mut self, value: Self::Value) -> Self::Value where
'c: 'e,
replace the value in the entry, returning the old value.