pub struct VecMap<A: Array>(/* private fields */);Expand description
A map backed by a SmallVec of key value pairs.
Implementations§
Source§impl<A: Array> VecMap<A>
impl<A: Array> VecMap<A>
Source§impl<K: Ord + 'static, V, A: Array<Item = (K, V)>> VecMap<A>
impl<K: Ord + 'static, V, A: Array<Item = (K, V)>> VecMap<A>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn inner_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F)
pub fn left_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F)
pub fn right_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F)
pub fn outer_join_with<W, F>(&mut self, that: &impl AbstractVecMap<K, W>, f: F)
Sourcepub fn merge_with<B: Array<Item = (K, V)>>(&mut self, that: VecMap<B>)
pub fn merge_with<B: Array<Item = (K, V)>>(&mut self, that: VecMap<B>)
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§
Source§impl<K, V, A: Array<Item = (K, V)>> AbstractVecMap<K, V> for VecMap<A>
impl<K, V, A: Array<Item = (K, V)>> AbstractVecMap<K, V> for VecMap<A>
fn as_slice(&self) -> &[A::Item]
fn is_empty(&self) -> bool
fn iter(&self) -> VecMapIter<Iter<'_, (K, V)>>
Source§fn get<Q>(&self, key: &Q) -> Option<&V>
fn get<Q>(&self, key: &Q) -> Option<&V>
lookup of a mapping. Time complexity is O(log N). Binary search.
Source§fn outer_join<W, R, F, A>(
&self,
that: &impl AbstractVecMap<K, W>,
f: F,
) -> VecMap<A>
fn outer_join<W, R, F, A>( &self, that: &impl AbstractVecMap<K, W>, f: F, ) -> VecMap<A>
Perform an outer join with another VecMap, producing a new result
fn left_join<W, R, F, A>( &self, that: &impl AbstractVecMap<K, W>, f: F, ) -> VecMap<A>
fn right_join<W, R, F, A>( &self, that: &impl AbstractVecMap<K, W>, f: F, ) -> VecMap<A>
fn inner_join<W, R, F, A>( &self, that: &impl AbstractVecMap<K, W>, f: F, ) -> VecMap<A>
Source§impl<'de, K, V, A: Array<Item = (K, V)>> Deserialize<'de> for VecMap<A>
impl<'de, K, V, A: Array<Item = (K, V)>> Deserialize<'de> for VecMap<A>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: Ord + 'static, V, A: Array<Item = (K, V)>> Extend<<A as Array>::Item> for VecMap<A>
impl<K: Ord + 'static, V, A: Array<Item = (K, V)>> Extend<<A as Array>::Item> for VecMap<A>
Source§fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<A: Array> IntoIterator for VecMap<A>
impl<A: Array> IntoIterator for VecMap<A>
Source§impl<T: Ord, A: Array<Item = T>> Ord for VecMap<A>
impl<T: Ord, A: Array<Item = T>> Ord for VecMap<A>
Source§impl<T: PartialOrd, A: Array<Item = T>> PartialOrd for VecMap<A>
impl<T: PartialOrd, A: Array<Item = T>> PartialOrd for VecMap<A>
impl<T: Eq, A: Array<Item = T>> Eq for VecMap<A>
Auto Trait Implementations§
impl<A> Freeze for VecMap<A>where
A: Freeze,
impl<A> RefUnwindSafe for VecMap<A>
impl<A> Send for VecMap<A>
impl<A> Sync for VecMap<A>where
A: Sync,
impl<A> Unpin for VecMap<A>where
A: Unpin,
impl<A> UnwindSafe for VecMap<A>
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