[][src]Enum small_ord_set::Entry

pub enum Entry<'a, A: Array, K> {
    Occupied(OccupiedEntry<'a, A>),
    Vacant(VacantEntry<'a, A, K>),
}

A view into a single entry in a set, which may either be vacant or occupied.

This enum is constructed from the entry method on SmallOrdSet.

Variants

Occupied(OccupiedEntry<'a, A>)

An occupied entry.

Vacant(VacantEntry<'a, A, K>)

A vacant entry.

Implementations

impl<'a, A, K, V> Entry<'a, A, K> where
    A: Array<Item = KeyValuePair<K, V>>,
    K: Ord + 'a,
    V: 'a, 
[src]

pub fn or_insert(self, default: V) -> &'a mut V[src]

Ensures a value is in the entry by inserting the default if empty, and returns a mutable reference to the value in the entry.

pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V[src]

Ensures a value is in the entry by inserting the result of the default function if empty, and returns a mutable reference to the value in the entry.

pub fn key(&self) -> &K[src]

Returns a reference to this entry's key.

pub fn and_modify<F>(self, f: F) -> Self where
    F: FnOnce(&mut V), 
[src]

Provides in-place mutable access to an occupied entry before any potential inserts into the map.

Trait Implementations

impl<A, K> Debug for Entry<'_, A, K> where
    A: Array,
    A::Item: Debug,
    K: Debug
[src]

Auto Trait Implementations

impl<'a, A, K> RefUnwindSafe for Entry<'a, A, K> where
    A: RefUnwindSafe,
    K: RefUnwindSafe,
    <A as Array>::Item: RefUnwindSafe
[src]

impl<'a, A, K> Send for Entry<'a, A, K> where
    K: Send,
    <A as Array>::Item: Send
[src]

impl<'a, A, K> Sync for Entry<'a, A, K> where
    A: Sync,
    K: Sync
[src]

impl<'a, A, K> Unpin for Entry<'a, A, K> where
    K: Unpin
[src]

impl<'a, A, K> !UnwindSafe for Entry<'a, A, K>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.