pub struct VacantEntry<'a, Key: Hash + Eq, Value> { /* private fields */ }Expand description
A view into a vacant entry in a LFU cache. It is part of the Entry enum.
Implementations§
Source§impl<'a, Key: Hash + Eq, Value> VacantEntry<'a, Key, Value>
impl<'a, Key: Hash + Eq, Value> VacantEntry<'a, Key, Value>
Sourcepub fn key(&self) -> &Key
pub fn key(&self) -> &Key
Gets a reference to the key that would be used when inserting a value
through the VacantEntry.
Sourcepub fn key_rc(&self) -> Rc<Key>
pub fn key_rc(&self) -> Rc<Key>
Gets a Rc to the key that would be used when inserting a value
through the VacantEntry.
Sourcepub fn insert(self, value: Value) -> &'a mut Value
pub fn insert(self, value: Value) -> &'a mut Value
Sets the value of the entry with the VacantEntry’s key, and returns
a mutable reference to it.
Auto Trait Implementations§
impl<'a, Key, Value> Freeze for VacantEntry<'a, Key, Value>
impl<'a, Key, Value> RefUnwindSafe for VacantEntry<'a, Key, Value>where
Key: RefUnwindSafe,
Value: RefUnwindSafe,
impl<'a, Key, Value> !Send for VacantEntry<'a, Key, Value>
impl<'a, Key, Value> !Sync for VacantEntry<'a, Key, Value>
impl<'a, Key, Value> Unpin for VacantEntry<'a, Key, Value>
impl<'a, Key, Value> !UnwindSafe for VacantEntry<'a, Key, Value>
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