Skip to main content

Entry

Enum Entry 

Source
pub enum Entry<'g, 'k, K, V>
where K: Key, V: Value + 'g,
{ 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§

§

Vacant(Vacant<'g, 'k, K, V>)

A vacant entry.

§

Occupied(Occupied<'g, V>)

An occupied entry.

Implementations§

Source§

impl<'g, 'k, K: Key, V: Value + 'g> Entry<'g, 'k, K, V>

Source

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.

See: btree_map::Entry::or_insert.

Source

pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'g mut V

Like or_insert, but lazily evaluates default.

See: btree_map::Entry::or_insert_with.

Source

pub fn and_modify<F>(self, modify: F) -> Self
where F: FnOnce(&mut V),

If there is a value associated with this entry, then apply modify to it.

See: btree_map::Entry::and_modify.

Source§

impl<'g, 'k, K: Key, V: Value + Default + 'g> Entry<'g, 'k, K, V>

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>
where <K as Key>::Read<'k>: Freeze,

§

impl<'g, 'k, K, V> RefUnwindSafe for Entry<'g, 'k, K, V>
where <K as Key>::Read<'k>: RefUnwindSafe, V: RefUnwindSafe, <K as Key>::Edge: RefUnwindSafe,

§

impl<'g, 'k, K, V> Unpin for Entry<'g, 'k, K, V>
where <K as Key>::Read<'k>: Unpin,

§

impl<'g, 'k, K, V> UnsafeUnpin for Entry<'g, 'k, K, V>
where <K as Key>::Read<'k>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.