pub enum KeyConflictError<K1, K2, V = ()> {
Key1Exists(K1, K2, V),
Key2Exists(K1, K2, V),
BothKeysExist(K1, K2, V),
}Expand description
Error returned by DoubleMap::insert and
DoubleMap::entry when one or both of the supplied
keys clash with an existing entry in the map.
The rejected keys are returned in the variant payload so the caller can reuse
them without cloning. insert additionally returns the rejected value, so its
error type is KeyConflictError<K1, K2, V>; entry has no value to hand back
and uses the default V = ().
Variants§
Key1Exists(K1, K2, V)
key1 is already present in the map (paired with a different key2),
while the supplied key2 is not in the map.
Key2Exists(K1, K2, V)
key2 is already present in the map (paired with a different key1),
while the supplied key1 is not in the map.
BothKeysExist(K1, K2, V)
Both key1 and key2 are already present in the map, but in different
entries.
Trait Implementations§
Source§impl<K1, K2, V> Display for KeyConflictError<K1, K2, V>
impl<K1, K2, V> Display for KeyConflictError<K1, K2, V>
Source§impl<K1, K2, V> Error for KeyConflictError<K1, K2, V>
impl<K1, K2, V> Error for KeyConflictError<K1, K2, V>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<K1, K2, V> Freeze for KeyConflictError<K1, K2, V>
impl<K1, K2, V> RefUnwindSafe for KeyConflictError<K1, K2, V>
impl<K1, K2, V> Send for KeyConflictError<K1, K2, V>
impl<K1, K2, V> Sync for KeyConflictError<K1, K2, V>
impl<K1, K2, V> Unpin for KeyConflictError<K1, K2, V>
impl<K1, K2, V> UnsafeUnpin for KeyConflictError<K1, K2, V>
impl<K1, K2, V> UnwindSafe for KeyConflictError<K1, K2, V>
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