pub enum Entry<'g, 'k, K, V>{
Vacant(Vacant<'g, 'k, K, V>),
Occupied(Occupied<'g, V>),
}Expand description
A logical entry in a SequentialMap that may be vacant or occupied.
See: btree_map::Entry.
Variants§
Implementations§
Source§impl<'g, 'k, K: Key, V: Value + 'g> Entry<'g, 'k, K, V>
impl<'g, 'k, K: Key, V: Value + 'g> Entry<'g, 'k, K, V>
Sourcepub fn or_insert(self, default: V) -> &'g mut V
pub fn or_insert(self, default: V) -> &'g mut V
Insert default if there is no value associated with this
entry, then return a mutable reference to the current value.
Sourcepub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'g mut V
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'g mut V
Like or_insert, but lazily evaluates
default.
Sourcepub fn and_modify<F>(self, modify: F) -> Self
pub fn and_modify<F>(self, modify: F) -> Self
If there is a value associated with this entry, then apply modify to it.
Source§impl<'g, 'k, K: Key, V: Value + Default + 'g> Entry<'g, 'k, K, V>
impl<'g, 'k, K: Key, V: Value + Default + 'g> Entry<'g, 'k, K, V>
Sourcepub fn or_default(self) -> &'g mut V
pub fn or_default(self) -> &'g mut V
Call or_insert_with with Default::default.
Auto Trait Implementations§
impl<'g, 'k, K, V> !Send for Entry<'g, 'k, K, V>
impl<'g, 'k, K, V> !Sync for Entry<'g, 'k, K, V>
impl<'g, 'k, K, V> !UnwindSafe for Entry<'g, 'k, K, V>
impl<'g, 'k, K, V> Freeze for Entry<'g, 'k, K, V>
impl<'g, 'k, K, V> RefUnwindSafe for Entry<'g, 'k, K, V>
impl<'g, 'k, K, V> Unpin for Entry<'g, 'k, K, V>
impl<'g, 'k, K, V> UnsafeUnpin for Entry<'g, 'k, K, 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