Enum bimap::Overwritten
source · [−]Expand description
The previous left-right pairs, if any, that were overwritten by a call to
the insert method of a bimap.
Variants
Neither
Neither the left nor the right value previously existed in the bimap.
Left(L, R)
The left value existed in the bimap, and the previous left-right pair is returned.
Right(L, R)
The right value existed in the bimap, and the previous left-right pair is returned.
Pair(L, R)
The left-right pair already existed in the bimap, and the previous left-right pair is returned.
Both((L, R), (L, R))
Both the left and the right value existed in the bimap, but as part of separate pairs. The first tuple is the left-right pair of the previous left value, and the second is the left-right pair of the previous right value.
Implementations
Returns a boolean indicating if the Overwritten variant implies any
values were overwritten.
This method is true for all variants other than Neither.
Examples
use bimap::{BiMap, Overwritten};
let mut bimap = BiMap::new();
assert!(!bimap.insert('a', 1).did_overwrite());
assert!(bimap.insert('a', 2).did_overwrite());Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl<L, R> RefUnwindSafe for Overwritten<L, R> where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Overwritten<L, R> where
L: Send,
R: Send,
impl<L, R> Sync for Overwritten<L, R> where
L: Sync,
R: Sync,
impl<L, R> Unpin for Overwritten<L, R> where
L: Unpin,
R: Unpin,
impl<L, R> UnwindSafe for Overwritten<L, R> where
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more