pub enum OccupiedEntryRef<'a, T: BiHashItem> {
Unique(&'a T),
NonUnique {
by_key1: Option<&'a T>,
by_key2: Option<&'a T>,
},
}
Expand description
A view into an occupied entry in a BiHashMap
.
Returned by OccupiedEntry::get
.
Variants§
Unique(&'a T)
All keys point to the same entry.
NonUnique
The keys point to different entries, or some keys are not present.
At least one of by_key1
and by_key2
is Some
.
Implementations§
Source§impl<'a, T: BiHashItem> OccupiedEntryRef<'a, T>
impl<'a, T: BiHashItem> OccupiedEntryRef<'a, T>
Sourcepub fn is_unique(&self) -> bool
pub fn is_unique(&self) -> bool
Returns true if the entry is unique.
Since BiHashMap
is keyed by two keys, it’s possible for
OccupiedEntry
to match up to two separate items. This function returns
true if the entry is unique, meaning all keys point to exactly one item.
Sourcepub fn is_non_unique(&self) -> bool
pub fn is_non_unique(&self) -> bool
Returns true if the OccupiedEntryRef
represents more than one item, or
if some keys are not present.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for OccupiedEntryRef<'a, T>
impl<'a, T> RefUnwindSafe for OccupiedEntryRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for OccupiedEntryRef<'a, T>where
T: Sync,
impl<'a, T> Sync for OccupiedEntryRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for OccupiedEntryRef<'a, T>
impl<'a, T> UnwindSafe for OccupiedEntryRef<'a, T>where
T: RefUnwindSafe,
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