Struct VacantEntry
pub struct VacantEntry<'a, K, V, A = Global>{ /* private fields */ }Expand description
A view into a vacant entry in a BTreeMap.
It is part of the Entry enum.
Implementations§
§impl<'a, K, V, A> VacantEntry<'a, K, V, A>
impl<'a, K, V, A> VacantEntry<'a, K, V, A>
1.10.0pub fn key(&self) -> &K
pub fn key(&self) -> &K
Gets a reference to the key that would be used when inserting a value through the VacantEntry.
§Examples
1.0.0pub fn insert(self, value: V) -> &'a mut V
pub fn insert(self, value: V) -> &'a mut V
Sets the value of the entry with the VacantEntry’s key,
and returns a mutable reference to it.
§Examples
1.92.0pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>
Sets the value of the entry with the VacantEntry’s key,
and returns an OccupiedEntry.