[−][src]Struct slotmap::secondary::VacantEntry
A view into a vacant entry in a SecondaryMap
. It is part of the
Entry
enum.
Implementations
impl<'a, K: Key, V> VacantEntry<'a, K, V>
[src]
pub fn key(&self) -> K
[src]
Gets the key that would be used when inserting a value through the
VacantEntry
.
Examples
let mut sm = SlotMap::new(); let mut sec: SecondaryMap<_, ()> = SecondaryMap::new(); let k = sm.insert(1); if let Entry::Vacant(v) = sec.entry(k).unwrap() { assert_eq!(v.key(), k); }
pub fn insert(self, value: V) -> &'a mut V
[src]
Sets the value of the entry with the VacantEntry
's key, and returns
a mutable reference to it.
Examples
let mut sm = SlotMap::new(); let mut sec = SecondaryMap::new(); let k = sm.insert(1); if let Entry::Vacant(v) = sec.entry(k).unwrap() { let new_val = v.insert(3); assert_eq!(new_val, &mut 3); }
Trait Implementations
Auto Trait Implementations
impl<'a, K, V> RefUnwindSafe for VacantEntry<'a, K, V> where
V: RefUnwindSafe,
[src]
V: RefUnwindSafe,
impl<'a, K, V> Send for VacantEntry<'a, K, V> where
V: Send,
[src]
V: Send,
impl<'a, K, V> Sync for VacantEntry<'a, K, V> where
V: Sync,
[src]
V: Sync,
impl<'a, K, V> Unpin for VacantEntry<'a, K, V>
[src]
impl<'a, K, V> !UnwindSafe for VacantEntry<'a, K, V>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,