Trait in_place::entry::VacantEntry
source · [−]pub trait VacantEntry<'c>: Sized {
type Value: 'c;
type Occupied: OccupiedEntry<'c>;
fn occupy(self, val: Self::Value) -> Self::Occupied;
fn insert(self, val: Self::Value) { ... }
}
Expand description
A vacant entry of a collection.
This is a slot into which you can insert a value with no concern for there already being a value there, because if you have a vacant entry, you have already done the work to confirm the slot is open and ready for a value.
The idea is that you’ve done hard work of finding your place in the collection, so inserting shouldn’t be a huge penalty at this point.
Associated Types
type Occupied: OccupiedEntry<'c>
type Occupied: OccupiedEntry<'c>
The type of OccupiedEntry we convert to when inserting.