pub enum Entry<'b, 'a, K, V, S = RapidBuildHasher>where
K: Eq + Hash + Clone + Send + Sync + 'static,
V: Clone + Send + Sync + 'static,
S: BuildHasher + Send + Sync + 'static,{
Occupied(OccupiedEntry<'b, 'a, K, V, S>),
Vacant(VacantEntry<'b, 'a, K, V, S>),
}Expand description
A view into a single entry in the map, which may either be vacant or occupied.
Variants§
Occupied(OccupiedEntry<'b, 'a, K, V, S>)
An occupied entry.
Vacant(VacantEntry<'b, 'a, K, V, S>)
A vacant entry.
Implementations§
Source§impl<'b, 'a, K, V, S> Entry<'b, 'a, K, V, S>
impl<'b, 'a, K, V, S> Entry<'b, 'a, K, V, S>
Sourcepub fn or_insert_with<F: FnOnce() -> V>(
self,
default: F,
) -> OccupiedEntry<'b, 'a, K, V, S>
pub fn or_insert_with<F: FnOnce() -> V>( self, default: F, ) -> OccupiedEntry<'b, 'a, K, V, S>
Ensures a value is in the entry by inserting the result of the default function if empty, and returns an occupied entry.
Auto Trait Implementations§
impl<'b, 'a, K, V, S> Freeze for Entry<'b, 'a, K, V, S>where
K: Freeze,
impl<'b, 'a, K, V, S = BuildHasherDefault<RapidHasher>> !RefUnwindSafe for Entry<'b, 'a, K, V, S>
impl<'b, 'a, K, V, S = BuildHasherDefault<RapidHasher>> !Send for Entry<'b, 'a, K, V, S>
impl<'b, 'a, K, V, S> Sync for Entry<'b, 'a, K, V, S>
impl<'b, 'a, K, V, S> Unpin for Entry<'b, 'a, K, V, S>where
K: Unpin,
impl<'b, 'a, K, V, S> UnsafeUnpin for Entry<'b, 'a, K, V, S>where
K: UnsafeUnpin,
impl<'b, 'a, K, V, S = BuildHasherDefault<RapidHasher>> !UnwindSafe for Entry<'b, 'a, K, V, S>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more