pub struct BiDirHashMap<K, V> { /* private fields */ }

Implementations§

source§

impl<K: Hash + Eq + Clone, V: Hash + Eq + Clone> BiDirHashMap<K, V>

source

pub fn insert(&mut self, key: K, value: V) -> Option<V>

source

pub fn remove_by_key(&mut self, key: &K) -> Option<V>

source

pub fn contains_key<Q>(&self, key: &Q) -> bool
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

source

pub fn remove_by_value(&mut self, value: &V) -> Option<K>

source

pub fn contains_value<Q>(&self, value: &Q) -> bool
where V: Borrow<Q>, Q: Hash + Eq + ?Sized,

source

pub fn value_of(&self, node: &K) -> Option<&V>

source

pub fn key_of(&self, value: &V) -> Option<&K>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn clear(&mut self)

source

pub fn forward_map(&self) -> &FxHashMap<K, V>

source

pub fn backward_map(&self) -> &FxHashMap<V, K>

source

pub fn into_inner(self) -> (FxHashMap<K, V>, FxHashMap<V, K>)

Trait Implementations§

source§

impl<K: Clone, V: Clone> Clone for BiDirHashMap<K, V>

source§

fn clone(&self) -> BiDirHashMap<K, V>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K: Debug, V: Debug> Debug for BiDirHashMap<K, V>

source§

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

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

impl<K, V> Default for BiDirHashMap<K, V>

source§

fn default() -> Self

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

impl<K: Hash + Eq + Clone, V: Hash + Eq + Clone> From<HashMap<K, V, BuildHasherDefault<FxHasher>>> for BiDirHashMap<K, V>

source§

fn from(forward_map: FxHashMap<K, V>) -> Self

Converts to this type from the input type.
source§

impl<K, V> FromIterator<(K, V)> for BiDirHashMap<K, V>
where K: Hash + Eq + Clone, V: Hash + Eq + Clone,

source§

fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<K, V> Visit for BiDirHashMap<K, V>
where K: Hash + Eq + Clone + Default + Visit, V: Hash + Eq + Clone + Default + Visit,

source§

fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult

Auto Trait Implementations§

§

impl<K, V> RefUnwindSafe for BiDirHashMap<K, V>

§

impl<K, V> Send for BiDirHashMap<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for BiDirHashMap<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for BiDirHashMap<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnwindSafe for BiDirHashMap<K, V>
where K: UnwindSafe, V: 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> FieldValue for T
where T: 'static,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
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> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V