pub struct Bimap<K, V, S = RandomState> { /* private fields */ }

Implementations

Creates an empty Bimap.

Creates a Bimap with the given hasher.

Creates a bimap from a HashMap.

Returns the number of elements in the bimap.

Returns whether the bimap is empty.

Removes all elements from the bimap.

Inserts a (key, value) pair into the bimap. Panics if either the key or value is already present in the bimap; to change a key or value, call either remove_fwd or remove_rev before inserting the new (key, value) pair.

Gets the value corresponding to a key.

Gets the key corresponding to a value.

Removes the (key, value) pair with the given key; returns the corresponding value.

Removes the (key, value) pair with the given value; returns the corresponding key.

Returns whether the bimap contains a (key, value) pair with the given key.

Returns whether the bimap contains a (key, value) pair with the given value.

Iterates over all (key, value) pairs in the bimap.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.