Enum bimap::Overwritten
[−]
[src]
pub enum Overwritten<L, R> { Neither, Left(L, R), Right(L, R), Both((L, R), (L, R)), Pair(L, R), }
The previous left-right pairs, if any, that were overwritten by a call to the insert
method
of 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.
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.
Pair(L, R)
The left-right pair already existed in the BiMap
, and the previous left-right pair is
returned.
Methods
impl<L, R> Overwritten<L, R>
[src]
pub fn did_overwrite(&self) -> bool
[src]
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
impl<L: Clone, R: Clone> Clone for Overwritten<L, R>
[src]
fn clone(&self) -> Overwritten<L, R>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<L: Debug, R: Debug> Debug for Overwritten<L, R>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<L: Eq, R: Eq> Eq for Overwritten<L, R>
[src]
impl<L: PartialEq, R: PartialEq> PartialEq for Overwritten<L, R>
[src]
fn eq(&self, __arg_0: &Overwritten<L, R>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Overwritten<L, R>) -> bool
[src]
This method tests for !=
.
Auto Trait Implementations
impl<L, R> Send for Overwritten<L, R> where
L: Send,
R: Send,
L: Send,
R: Send,
impl<L, R> Sync for Overwritten<L, R> where
L: Sync,
R: Sync,
L: Sync,
R: Sync,