Struct vec_collections::VecMap [−][src]
pub struct VecMap<A: Array>(_);
Expand description
A map backed by a SmallVec of key value pairs.
Implementations
retain all pairs matching a predicate
pub fn inner_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F) where
K: Ord + Clone,
F: Fn(&K, V, &W) -> Option<V>,
pub fn left_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F) where
K: Ord + Clone,
F: Fn(&K, V, Option<&W>) -> Option<V>,
pub fn right_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F) where
K: Ord + Clone,
F: Fn(&K, Option<V>, &W) -> Option<V>,
pub fn outer_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F) where
K: Ord + Clone,
F: Fn(OuterJoinArg<&K, V, &W>) -> Option<V>,
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.
Trait Implementations
lookup of a mapping. Time complexity is O(log N). Binary search.
fn outer_join<W, R, F, A>(
&self,
that: &impl AbstractVecMap<K, W>,
f: F
) -> VecMap<A> where
K: Ord + Clone,
A: Array<Item = (K, R)>,
F: Fn(OuterJoinArg<&K, &V, &W>) -> Option<R>,
fn outer_join<W, R, F, A>(
&self,
that: &impl AbstractVecMap<K, W>,
f: F
) -> VecMap<A> where
K: Ord + Clone,
A: Array<Item = (K, R)>,
F: Fn(OuterJoinArg<&K, &V, &W>) -> Option<R>,
Perform an outer join with another VecMap, producing a new result Read more
fn left_join<W, R, F, A>(
&self,
that: &impl AbstractVecMap<K, W>,
f: F
) -> VecMap<A> where
K: Ord + Clone,
F: Fn(&K, &V, Option<&W>) -> Option<R>,
A: Array<Item = (K, R)>,
impl<'de, K, V, A: Array<Item = (K, V)>> Deserialize<'de> for VecMap<A> where
K: Deserialize<'de> + Ord + PartialEq + Clone,
V: Deserialize<'de>,
impl<'de, K, V, A: Array<Item = (K, V)>> Deserialize<'de> for VecMap<A> where
K: Deserialize<'de> + Ord + PartialEq + Clone,
V: Deserialize<'de>,
Deserialize this value from the given Serde deserializer. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<A> RefUnwindSafe for VecMap<A> where
A: RefUnwindSafe,
<A as Array>::Item: RefUnwindSafe,
impl<A> UnwindSafe for VecMap<A> where
A: UnwindSafe,
<A as Array>::Item: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more