pub struct VacantEntry<'a, T: IdOrdItem> { /* private fields */ }
Expand description
A vacant entry.
Implementations§
Source§impl<'a, T: IdOrdItem> VacantEntry<'a, T>
impl<'a, T: IdOrdItem> VacantEntry<'a, T>
Sourcepub fn insert_ref(self, value: T) -> &'a T
pub fn insert_ref(self, value: T) -> &'a T
Sets the entry to a new value, returning a shared reference to the value.
§Panics
Panics if the key is already present in the map. (The intention is that
the key should be what was passed into IdOrdMap::entry
, but that
isn’t checked in this API due to borrow checker limitations.)
Sourcepub fn insert(self, value: T) -> RefMut<'a, T>
pub fn insert(self, value: T) -> RefMut<'a, T>
Sets the entry to a new value, returning a mutable reference to the value.
Sourcepub fn insert_entry(self, value: T) -> OccupiedEntry<'a, T>
pub fn insert_entry(self, value: T) -> OccupiedEntry<'a, T>
Sets the value of the entry, and returns an OccupiedEntry
.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for VacantEntry<'a, T>
impl<'a, T> RefUnwindSafe for VacantEntry<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for VacantEntry<'a, T>where
T: Send,
impl<'a, T> Sync for VacantEntry<'a, T>where
T: Sync,
impl<'a, T> Unpin for VacantEntry<'a, T>
impl<'a, T> !UnwindSafe for VacantEntry<'a, T>
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