pub struct BiMap<L, R> { /* private fields */ }Implementations§
Source§impl<L, R> BiMap<L, R>
impl<L, R> BiMap<L, R>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn get_by_left<Q>(&self, left: &Q) -> Option<&R>
pub fn get_by_right<Q>(&self, right: &Q) -> Option<&L>
pub fn contains_left<Q>(&self, left: &Q) -> bool
pub fn contains_right<Q>(&self, right: &Q) -> bool
pub fn remove_by_left<Q>(&mut self, left: &Q) -> Option<(L, R)>
pub fn remove_by_right<Q>(&mut self, right: &Q) -> Option<(L, R)>
pub fn insert(&mut self, left: L, right: R) -> Overwritten<L, R>
pub fn insert_no_overwrite(&mut self, left: L, right: R) -> Result<(), (L, R)>
pub fn retain<F>(&mut self, f: F)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn iter(&self) -> Iter<'_, L, R> ⓘ
pub fn left_values(&self) -> LeftValues<'_, L, R> ⓘ
pub fn right_values(&self) -> RightValues<'_, L, R> ⓘ
Trait Implementations§
Source§impl<'de, L, R> Deserialize<'de> for BiMap<L, R>
impl<'de, L, R> Deserialize<'de> for BiMap<L, R>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'de, L, R, LAs, RAs> DeserializeAs<'de, BiMap<L, R>> for BiMap<LAs, RAs>where
L: Eq + Hash + Deserialize<'de>,
R: Eq + Hash,
LAs: DeserializeAs<'de, L>,
RAs: DeserializeAs<'de, R>,
impl<'de, L, R, LAs, RAs> DeserializeAs<'de, BiMap<L, R>> for BiMap<LAs, RAs>where
L: Eq + Hash + Deserialize<'de>,
R: Eq + Hash,
LAs: DeserializeAs<'de, L>,
RAs: DeserializeAs<'de, R>,
Source§fn deserialize_as<D>(deserializer: D) -> Result<BiMap<L, R>, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<BiMap<L, R>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
impl<L, R> Eq for BiMap<L, R>
Source§impl<L, R> FromIterator<(L, R)> for BiMap<L, R>
impl<L, R> FromIterator<(L, R)> for BiMap<L, R>
Source§impl<L, R, NewL> FuncMap<L, NewL> for BiMap<L, R>
impl<L, R, NewL> FuncMap<L, NewL> for BiMap<L, R>
Source§fn func_map<F>(self, f: F) -> Self::Outputwhere
F: FnMut(L) -> NewL,
fn func_map<F>(self, f: F) -> Self::Outputwhere
F: FnMut(L) -> NewL,
Applies the closure
f to self in a functorial way§fn func_map_over<Q, F>(self, f: F) -> Self::Outputwhere
F: FnMut(A) -> B,
Q: FuncMarker<P>,
fn func_map_over<Q, F>(self, f: F) -> Self::Outputwhere
F: FnMut(A) -> B,
Q: FuncMarker<P>,
Applies the closure
f to self in a functorial way, allowing explicit
specification of the marker type P Read moreSource§impl<L, R, NewR> FuncMap<R, NewR, TypeParam<1>> for BiMap<L, R>
impl<L, R, NewR> FuncMap<R, NewR, TypeParam<1>> for BiMap<L, R>
Source§fn func_map<F>(self, f: F) -> Self::Outputwhere
F: FnMut(R) -> NewR,
fn func_map<F>(self, f: F) -> Self::Outputwhere
F: FnMut(R) -> NewR,
Applies the closure
f to self in a functorial way§fn func_map_over<Q, F>(self, f: F) -> Self::Outputwhere
F: FnMut(A) -> B,
Q: FuncMarker<P>,
fn func_map_over<Q, F>(self, f: F) -> Self::Outputwhere
F: FnMut(A) -> B,
Q: FuncMarker<P>,
Applies the closure
f to self in a functorial way, allowing explicit
specification of the marker type P Read moreSource§impl<L, R> IntoIterator for BiMap<L, R>
impl<L, R> IntoIterator for BiMap<L, R>
Source§impl<L, R> Quine for BiMap<L, R>
impl<L, R> Quine for BiMap<L, R>
fn ctor_tokens(&self) -> TokenStream
Source§impl<L, R, LAs, RAs> SerializeAs<BiMap<L, R>> for BiMap<LAs, RAs>
impl<L, R, LAs, RAs> SerializeAs<BiMap<L, R>> for BiMap<LAs, RAs>
Source§fn serialize_as<S>(
source: &BiMap<L, R>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &BiMap<L, R>,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
Source§impl<L, R, NewL> TryFuncMap<L, NewL> for BiMap<L, R>
impl<L, R, NewL> TryFuncMap<L, NewL> for BiMap<L, R>
Source§fn try_func_map<E, F>(self, f: F) -> Result<Self::Output, E>
fn try_func_map<E, F>(self, f: F) -> Result<Self::Output, E>
Auto Trait Implementations§
impl<L, R> Freeze for BiMap<L, R>where
BiHashMap<L, R>: Freeze,
impl<L, R> RefUnwindSafe for BiMap<L, R>where
BiHashMap<L, R>: RefUnwindSafe,
impl<L, R> Send for BiMap<L, R>where
BiHashMap<L, R>: Send,
impl<L, R> Sync for BiMap<L, R>where
BiHashMap<L, R>: Sync,
impl<L, R> Unpin for BiMap<L, R>where
BiHashMap<L, R>: Unpin,
impl<L, R> UnsafeUnpin for BiMap<L, R>where
BiHashMap<L, R>: UnsafeUnpin,
impl<L, R> UnwindSafe for BiMap<L, R>where
BiHashMap<L, R>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<I> IWLitIter for Iwhere
I: IntoIterator<Item = (Lit, isize)>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<I> WClsIter for Iwhere
I: IntoIterator<Item = (Clause, usize)>,
impl<I> WLitIter for Iwhere
I: IntoIterator<Item = (Lit, usize)>,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes