pub struct VacantEntry<'a, K: 'a, V: 'a + WeakElement>(/* private fields */);Expand description
A vacant entry, which can be inserted in or viewed.
Implementations§
Source§impl<'a, K, V: WeakElement> VacantEntry<'a, K, V>
impl<'a, K, V: WeakElement> VacantEntry<'a, K, V>
Sourcepub 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.
O(1) time
Sourcepub fn insert(self, value: V::Strong) -> V::Strong
pub fn insert(self, value: V::Strong) -> V::Strong
Inserts the value into the map, returning the same value.
O(1) time
Sourcepub fn insert_entry(self, value: V::Strong) -> OccupiedEntry<'a, K, V>
pub fn insert_entry(self, value: V::Strong) -> OccupiedEntry<'a, K, V>
Inserts the key and value into the map, returning an OccupiedEntry.
O(1) time
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V> !UnwindSafe for VacantEntry<'a, K, V>
impl<'a, K, V> Freeze for VacantEntry<'a, K, V>where
K: Freeze,
impl<'a, K, V> RefUnwindSafe for VacantEntry<'a, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<'a, K, V> Send for VacantEntry<'a, K, V>
impl<'a, K, V> Sync for VacantEntry<'a, K, V>
impl<'a, K, V> Unpin for VacantEntry<'a, K, V>where
K: Unpin,
impl<'a, K, V> UnsafeUnpin for VacantEntry<'a, K, V>where
K: UnsafeUnpin,
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