BiDirHashMap

Struct BiDirHashMap 

Source
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: ?Sized + Hash + Eq>(&self, key: &Q) -> bool
where K: Borrow<Q>,

Source

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

Source

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

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

Read or write this value, depending on whether Visitor::is_reading() is true or false. Read more

Auto Trait Implementations§

§

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

§

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> AsyncTaskResult for T
where T: Any + Send + 'static,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

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

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

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,

Source§

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

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

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

Source§

fn vzip(self) -> V