[−][src]Struct vec_collections::VecMap
A map backed by a SmallVec of key value pairs.
Implementations
impl<K, V, A: Array<Item = (K, V)>> VecMap<A>
[src]
pub fn map_values<R, B: Array<Item = (K, R)>, F: FnMut(V) -> R>(
self,
f: F
) -> VecMap<B>
[src]
self,
f: F
) -> VecMap<B>
map values while keeping keys
impl<A: Array> VecMap<A>
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn empty() -> Self
[src]
pub fn len(&self) -> usize
[src]
number of mappings
pub fn retain<F: FnMut(&A::Item) -> bool>(&mut self, f: F)
[src]
retain all pairs matching a predicate
pub fn into_inner(self) -> SmallVec<A>
[src]
pub fn single(item: A::Item) -> Self
[src]
Creates a vecmap with a single item
impl<K: Ord + 'static, V, A: Array<Item = (K, V)>> VecMap<A>
[src]
pub fn insert(&mut self, key: K, value: V) -> Option<V>
[src]
pub fn merge_with<B: Array<Item = (K, V)>>(&mut self, rhs: VecMap<B>)
[src]
in-place merge with another map of the same type. The merge is right-biased, so on collisions the values from the rhs will win.
pub fn combine_with<B: Array<Item = A::Item>, F: Fn(V, V) -> V>(
&mut self,
that: VecMap<B>,
f: F
)
[src]
&mut self,
that: VecMap<B>,
f: F
)
in-place combine with another map of the same type. The given function allows to select the value in case of collisions.
impl<K: Ord + 'static, V, A: Array<Item = (K, V)>> VecMap<A>
[src]
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Ord,
[src]
K: Borrow<Q>,
Q: Ord,
lookup of a mapping. Time complexity is O(log N). Binary search.
pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Ord,
[src]
K: Borrow<Q>,
Q: Ord,
impl<K: Ord + Clone, V: Clone, A: Array<Item = (K, V)>> VecMap<A>
[src]
pub fn outer_join<W: Clone, R, F: Fn(OuterJoinArg<&K, &V, &W>) -> Option<R>, B: Array<Item = (K, W)>>(
&self,
that: &VecMap<B>,
f: F
) -> VecMap1<K, R>
[src]
&self,
that: &VecMap<B>,
f: F
) -> VecMap1<K, R>
pub fn left_join<W: Clone, R, F: Fn(&K, &V, Option<&W>) -> Option<R>, B: Array<Item = (K, W)>>(
&self,
that: &VecMap1<K, W>,
f: F
) -> VecMap1<K, R>
[src]
&self,
that: &VecMap1<K, W>,
f: F
) -> VecMap1<K, R>
pub fn right_join<W: Clone, R, F: Fn(&K, Option<&V>, &W) -> Option<R>, B: Array<Item = (K, W)>>(
&self,
that: &VecMap<B>,
f: F
) -> VecMap1<K, R>
[src]
&self,
that: &VecMap<B>,
f: F
) -> VecMap1<K, R>
pub fn inner_join<W: Clone, R, F: Fn(&K, &V, &W) -> Option<R>, B: Array<Item = (K, W)>>(
&self,
that: &VecMap<B>,
f: F
) -> VecMap1<K, R>
[src]
&self,
that: &VecMap<B>,
f: F
) -> VecMap1<K, R>
Trait Implementations
impl<A: Array> AsRef<[<A as Array>::Item]> for VecMap<A>
[src]
impl<T: Clone, A: Array<Item = T>> Clone for VecMap<A>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug, A: Array<Item = T>> Debug for VecMap<A>
[src]
impl<A: Array> Default for VecMap<A>
[src]
impl<'de, K, V, A: Array<Item = (K, V)>> Deserialize<'de> for VecMap<A> where
K: Deserialize<'de> + Ord + PartialEq + Clone,
V: Deserialize<'de>,
[src]
K: Deserialize<'de> + Ord + PartialEq + Clone,
V: Deserialize<'de>,
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
impl<T: Eq, A: Array<Item = T>> Eq for VecMap<A>
[src]
impl<K: Ord + 'static, V, A: Array<Item = (K, V)>> Extend<<A as Array>::Item> for VecMap<A>
[src]
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
[src]
fn extend_one(&mut self, item: A)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]
impl<K, V, A: Array<Item = (K, V)>> From<BTreeMap<K, V>> for VecMap<A>
[src]
impl<A: Array> From<VecMap<A>> for VecSet<A>
[src]
impl<K: Ord, V, A: Array<Item = (K, V)>> FromIterator<(K, V)> for VecMap<A>
[src]
fn from_iter<I: IntoIterator<Item = A::Item>>(iter: I) -> Self
[src]
impl<T: Hash, A: Array<Item = T>> Hash for VecMap<A>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<A: Array> Into<SmallVec<A>> for VecMap<A>
[src]
impl<'a, A: Array> IntoIterator for &'a VecMap<A>
[src]
type Item = &'a A::Item
The type of the elements being iterated over.
type IntoIter = Iter<'a, A::Item>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<A: Array> IntoIterator for VecMap<A>
[src]
type Item = A::Item
The type of the elements being iterated over.
type IntoIter = IntoIter<A>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T: Ord, A: Array<Item = T>> Ord for VecMap<A>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq, A: Array<Item = T>> PartialEq<VecMap<A>> for VecMap<A>
[src]
impl<T: PartialOrd, A: Array<Item = T>> PartialOrd<VecMap<A>> for VecMap<A>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<K, V, A: Array<Item = (K, V)>> Serialize for VecMap<A> where
K: Serialize,
V: Serialize,
[src]
K: Serialize,
V: Serialize,
Auto Trait Implementations
impl<A> RefUnwindSafe for VecMap<A> where
A: RefUnwindSafe,
<A as Array>::Item: RefUnwindSafe,
A: RefUnwindSafe,
<A as Array>::Item: RefUnwindSafe,
impl<A> Send for VecMap<A> where
<A as Array>::Item: Send,
<A as Array>::Item: Send,
impl<A> Sync for VecMap<A> where
A: Sync,
A: Sync,
impl<A> Unpin for VecMap<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for VecMap<A> where
A: UnwindSafe,
<A as Array>::Item: RefUnwindSafe,
A: UnwindSafe,
<A as Array>::Item: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,