pub struct VacantEntry<'a, A: Hash + Eq, V: Tagged<A>>(/* private fields */);
Expand description
An entry for a key in a map that does not have a value.
This type maintains the invariant that, if a VacantEntry(map, a)
exists,
SocketMap::get(map, a)
is None
. This means that in the HashMap
that
SocketMap
wraps, either there is no value for key a
or there is a
MapValue
whose value
field is None
.
Implementations§
Source§impl<'a, K: Eq + Hash + IterShadows, V: Tagged<K>> VacantEntry<'a, K, V>
impl<'a, K: Eq + Hash + IterShadows, V: Tagged<K>> VacantEntry<'a, K, V>
Sourcepub fn insert(self, value: V) -> OccupiedEntry<'a, K, V>where
K: Clone,
pub fn insert(self, value: V) -> OccupiedEntry<'a, K, V>where
K: Clone,
Inserts a value for the key referenced by this entry.
Returns a reference to the newly-inserted value.
Sourcepub fn into_map(self) -> &'a mut SocketMap<K, V>
pub fn into_map(self) -> &'a mut SocketMap<K, V>
Extracts the underlying SocketMap
reference backing this entry.
Sourcepub fn descendant_counts(
&self,
) -> impl ExactSizeIterator<Item = &(V::Tag, NonZeroUsize)>
pub fn descendant_counts( &self, ) -> impl ExactSizeIterator<Item = &(V::Tag, NonZeroUsize)>
Gets the descendant counts for this entry.
Auto Trait Implementations§
impl<'a, A, V> Freeze for VacantEntry<'a, A, V>where
A: Freeze,
impl<'a, A, V> RefUnwindSafe for VacantEntry<'a, A, V>
impl<'a, A, V> Send for VacantEntry<'a, A, V>
impl<'a, A, V> Sync for VacantEntry<'a, A, V>
impl<'a, A, V> Unpin for VacantEntry<'a, A, V>where
A: Unpin,
impl<'a, A, V> !UnwindSafe for VacantEntry<'a, A, V>
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
Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more