[−][src]Enum small_ord_set::Entry
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]
A: Array<Item = KeyValuePair<K, V>>,
K: Ord + 'a,
V: 'a,
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]
F: FnOnce(&mut V),
Provides in-place mutable access to an occupied entry before any potential inserts into the map.
Trait Implementations
Auto Trait Implementations
impl<'a, A, K> RefUnwindSafe for Entry<'a, A, K> where
A: RefUnwindSafe,
K: RefUnwindSafe,
<A as Array>::Item: RefUnwindSafe,
[src]
A: RefUnwindSafe,
K: RefUnwindSafe,
<A as Array>::Item: RefUnwindSafe,
impl<'a, A, K> Send for Entry<'a, A, K> where
K: Send,
<A as Array>::Item: Send,
[src]
K: Send,
<A as Array>::Item: Send,
impl<'a, A, K> Sync for Entry<'a, A, K> where
A: Sync,
K: Sync,
[src]
A: Sync,
K: Sync,
impl<'a, A, K> Unpin for Entry<'a, A, K> where
K: Unpin,
[src]
K: Unpin,
impl<'a, A, K> !UnwindSafe for Entry<'a, A, K>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,