DualHashMap

Struct DualHashMap 

Source
pub struct DualHashMap<K1, K2, V>
where K1: Hash + Eq + Send + Clone, K2: Hash + Eq + Send + Clone,
{ /* private fields */ }

Implementations§

Source§

impl<K1, K2, V> DualHashMap<K1, K2, V>
where K1: Hash + Eq + Send + Clone, K2: Hash + Eq + Send + Clone,

Source

pub fn new() -> Self

Source

pub fn insert(&mut self, k1: K1, k2: K2, value: V)

Source

pub fn get_by_k1(&self, k1: &K1) -> Option<&V>

Source

pub fn get_by_k2(&self, k2: &K2) -> impl Iterator<Item = &V>

Source

pub fn get_mut_by_k1(&mut self, k1: &K1) -> Option<&mut V>

Source

pub fn for_each_mut_by_k2<F>(&mut self, k2: &K2, f: F)
where F: FnMut(&mut V),

Source

pub fn get_values_mut(&mut self) -> impl Iterator<Item = &mut V>

Source

pub fn get_values(&self) -> impl Iterator<Item = &V>

Source

pub fn get_keys1(&self) -> impl Iterator<Item = &K1>

Source

pub fn get_keys2(&self) -> impl Iterator<Item = &K2>

Source

pub fn remove_by_k1(&mut self, k1: &K1)

Source

pub fn remove_by_k2(&mut self, k2: &K2)

Source

pub fn contains_k1(&self, k1: &K1) -> bool

Source

pub fn contains_k2(&self, k2: &K2) -> bool

Source

pub fn get_k1s_by_k2(&self, k2: &K2) -> Option<&HashSet<K1>>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<K1, K2, V: Debug> Debug for DualHashMap<K1, K2, V>
where K1: Hash + Eq + Send + Clone + Debug, K2: Hash + Eq + Send + Clone + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K1, K2, V> Default for DualHashMap<K1, K2, V>
where K1: Hash + Eq + Send + Clone, K2: Hash + Eq + Send + Clone,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<K1, K2, V: PartialEq> PartialEq for DualHashMap<K1, K2, V>
where K1: Hash + Eq + Send + Clone + PartialEq, K2: Hash + Eq + Send + Clone + PartialEq,

Source§

fn eq(&self, other: &DualHashMap<K1, K2, V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K1, K2, V: Eq> Eq for DualHashMap<K1, K2, V>
where K1: Hash + Eq + Send + Clone + Eq, K2: Hash + Eq + Send + Clone + Eq,

Source§

impl<K1, K2, V> StructuralPartialEq for DualHashMap<K1, K2, V>
where K1: Hash + Eq + Send + Clone, K2: Hash + Eq + Send + Clone,

Auto Trait Implementations§

§

impl<K1, K2, V> Freeze for DualHashMap<K1, K2, V>

§

impl<K1, K2, V> RefUnwindSafe for DualHashMap<K1, K2, V>

§

impl<K1, K2, V> Send for DualHashMap<K1, K2, V>
where V: Send,

§

impl<K1, K2, V> Sync for DualHashMap<K1, K2, V>
where K1: Sync, V: Sync, K2: Sync,

§

impl<K1, K2, V> Unpin for DualHashMap<K1, K2, V>
where K1: Unpin, V: Unpin, K2: Unpin,

§

impl<K1, K2, V> UnwindSafe for DualHashMap<K1, K2, V>
where K1: UnwindSafe, V: UnwindSafe, K2: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.