pub struct VacantEntry<'a, K, V, C = Slab<Node<K, V>>> { /* private fields */ }Implementations§
Source§impl<'a, K, V, C: Slab<Node<K, V>>> VacantEntry<'a, K, V, C>
impl<'a, K, V, C: Slab<Node<K, V>>> VacantEntry<'a, K, V, C>
Source§impl<'a, K, V, C> VacantEntry<'a, K, V, C>
impl<'a, K, V, C> VacantEntry<'a, K, V, C>
Sourcepub 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.
§Example
use btree_slab::BTreeMap;
use btree_slab::generic::map::Entry;
let mut map: BTreeMap<&str, u32> = BTreeMap::new();
if let Entry::Vacant(o) = map.entry("poneyland") {
o.insert(37);
}
assert_eq!(map["poneyland"], 37);Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V, C> Freeze for VacantEntry<'a, K, V, C>where
K: Freeze,
impl<'a, K, V, C> RefUnwindSafe for VacantEntry<'a, K, V, C>
impl<'a, K, V, C> Send for VacantEntry<'a, K, V, C>
impl<'a, K, V, C> Sync for VacantEntry<'a, K, V, C>
impl<'a, K, V, C> Unpin for VacantEntry<'a, K, V, C>where
K: Unpin,
impl<'a, K, V, C = Slab<Node<K, V>>> !UnwindSafe for VacantEntry<'a, K, V, C>
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