pub struct BiMap<L: Hash + Eq, R: Hash + Eq> { /* private fields */ }Implementations§
Source§impl<L: Eq + Hash + Clone, R: Eq + Hash + Clone> BiMap<L, R>
impl<L: Eq + Hash + Clone, R: Eq + Hash + Clone> BiMap<L, R>
pub fn new() -> Self
pub fn from<const N: usize>(pairs: [(L, R); N]) -> Self
pub fn len(&self) -> usize
pub fn into_inner(self) -> (HashMap<L, R>, HashMap<R, L>)
pub fn into_reversed(self) -> BiMap<R, L>
pub fn into_left_map(self) -> HashMap<L, R>
pub fn into_right_map(self) -> HashMap<R, L>
pub fn insert(&mut self, left: L, right: R)
pub fn get_left(&self, left: &L) -> Option<&R>
pub fn get_right(&self, right: &R) -> Option<&L>
pub fn contains_left(&self, left: &L) -> bool
pub fn contains_right(&self, right: &R) -> bool
pub fn remove_left(&mut self, left: &L) -> Option<R>
pub fn remove_right(&mut self, right: &R) -> Option<L>
pub fn right_values(&self) -> impl Iterator<Item = &R>
pub fn left_values(&self) -> impl Iterator<Item = &L>
pub fn iter(&self) -> impl Iterator<Item = (&L, &R)>
Trait Implementations§
Source§impl<'de, L, R> Deserialize<'de> for BiMap<L, R>
impl<'de, L, R> Deserialize<'de> for BiMap<L, R>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<L: Eq + Hash + Eq, R: Eq + Hash + Eq> Eq for BiMap<L, R>
Source§impl<L: PartialEq + Hash + Eq, R: PartialEq + Hash + Eq> PartialEq for BiMap<L, R>
impl<L: PartialEq + Hash + Eq, R: PartialEq + Hash + Eq> PartialEq for BiMap<L, R>
impl<L: Hash + Eq, R: Hash + Eq> StructuralPartialEq for BiMap<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for BiMap<L, R>
impl<L, R> RefUnwindSafe for BiMap<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for BiMap<L, R>
impl<L, R> Sync for BiMap<L, R>
impl<L, R> Unpin for BiMap<L, R>
impl<L, R> UnsafeUnpin for BiMap<L, R>
impl<L, R> UnwindSafe for BiMap<L, R>where
L: UnwindSafe,
R: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, K, V, T> ConsumingIterToJson<'a, K, V> for Twhere
T: IntoIterator<Item = (K, V), Item = (K, V)> + IntoIterator,
K: Serialize + Any,
V: Serialize,
<T as IntoIterator>::IntoIter: 'a,
impl<'a, K, V, T> ConsumingIterToJson<'a, K, V> for Twhere
T: IntoIterator<Item = (K, V), Item = (K, V)> + IntoIterator,
K: Serialize + Any,
V: Serialize,
<T as IntoIterator>::IntoIter: 'a,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.