pub struct VacantEntry<'a, K, V, A>{ /* private fields */ }
Implementations§
Source§impl<'a, K, V, A> VacantEntry<'a, K, V, A>
impl<'a, K, V, A> VacantEntry<'a, K, V, A>
Source§impl<'a, K, V, A> VacantEntry<'a, K, V, A>
impl<'a, K, V, A> VacantEntry<'a, K, V, A>
Sourcepub fn insert(self, value: V) -> &'a mut Vwhere
K: Ord,
pub fn insert(self, value: V) -> &'a mut Vwhere
K: Ord,
Sets the value of the entry with the VacantEntry
’s key,
and returns a mutable reference to it.
§Examples
use xsl::collections::rbtree_map::Entry;
use xsl::collections::RBTreeMap;
let mut map: RBTreeMap<&str, u32> = RBTreeMap::new();
if let Entry::Vacant(o) = map.entry("poneyland") {
o.insert(37);
}
assert_eq!(map["poneyland"], 37);
Auto Trait Implementations§
impl<'a, K, V, A> Freeze for VacantEntry<'a, K, V, A>where
K: Freeze,
impl<'a, K, V, A> RefUnwindSafe for VacantEntry<'a, K, V, A>
impl<'a, K, V, A> !Send for VacantEntry<'a, K, V, A>
impl<'a, K, V, A> !Sync for VacantEntry<'a, K, V, A>
impl<'a, K, V, A> Unpin for VacantEntry<'a, K, V, A>where
K: Unpin,
impl<'a, K, V, A> !UnwindSafe for VacantEntry<'a, K, V, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more