Struct Bimap

Source
pub struct Bimap<U: Clone + Ord, V: Clone + Ord> { /* private fields */ }

Implementations§

Source§

impl<U: Clone + Ord, V: Clone + Ord> Bimap<U, V>

Source

pub fn new() -> Self

Source

pub fn insert(&mut self, u: U, v: V)

Source

pub fn get(&self, u: &U) -> Option<&V>

Source

pub fn get_rev(&self, v: &V) -> Option<&U>

Source

pub fn get_mut(&mut self, u: &U) -> Option<&mut V>

Source

pub fn get_rev_mut(&mut self, v: &V) -> Option<&mut U>

Source

pub fn contains(&self, u: &U) -> bool

Source

pub fn contains_rev(&self, v: &V) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn remove(&mut self, u: &U) -> Option<V>

Source

pub fn remove_rev(&mut self, v: &V) -> Option<U>

Source

pub fn clear(&mut self)

Source

pub fn retain(&mut self, f: impl FnMut(&U, &V) -> bool)

Source

pub fn iter(&self) -> impl Iterator<Item = (&U, &V)>

Trait Implementations§

Source§

impl<U: Clone + Clone + Ord, V: Clone + Clone + Ord> Clone for Bimap<U, V>

Source§

fn clone(&self) -> Bimap<U, 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<U: Debug + Clone + Ord, V: Debug + Clone + Ord> Debug for Bimap<U, V>

Source§

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

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

impl<U: Clone + Ord, V: Clone + Ord> Default for Bimap<U, V>

Source§

fn default() -> Self

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

impl<U: Clone + Ord, V: Clone + Ord> FromIterator<(U, V)> for Bimap<U, V>

Source§

fn from_iter<I: IntoIterator<Item = (U, V)>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<U: Clone + Ord, V: Clone + Ord> IntoIterator for Bimap<U, V>

Source§

type Item = (U, V)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<U, V>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<U, V> Freeze for Bimap<U, V>

§

impl<U, V> RefUnwindSafe for Bimap<U, V>

§

impl<U, V> Send for Bimap<U, V>
where U: Send, V: Send,

§

impl<U, V> Sync for Bimap<U, V>
where U: Sync, V: Sync,

§

impl<U, V> Unpin for Bimap<U, V>

§

impl<U, V> UnwindSafe for Bimap<U, V>

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

Source§

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

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

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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