pub struct VecMap<K, V>(/* private fields */);Implementations§
Source§impl<K: Eq + PartialEq + Ord + PartialOrd, V> VecMap<K, V>
impl<K: Eq + PartialEq + Ord + PartialOrd, V> VecMap<K, V>
pub fn new() -> Self
pub fn from_sorted(v: Vec<(K, V)>) -> Result<Self, ()>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, (K, V)>
pub fn iter_mut(&mut self) -> IterMut<'_, (K, V)>
pub fn keys(&self) -> impl Iterator<Item = &K>
pub fn values(&self) -> impl Iterator<Item = &V>
pub fn get(&self, k: &K) -> Option<&V>
pub fn get_mut(&mut self, k: &K) -> Option<&mut V>
pub fn map<U>(self, f: impl FnMut(K, V) -> U) -> Vec<U>
pub fn map_ref<U>(&self, f: impl FnMut(&K, &V) -> U) -> Vec<U>
pub fn to_vec(&self) -> Vec<(K, V)>
pub fn into_vec(self) -> Vec<(K, V)>
pub fn insert(&mut self, k: K, v: V) -> Option<(K, V)>
pub fn extend(&mut self, iter: impl IntoIterator<Item = (K, V)>)
pub fn contains_key(&self, k: &K) -> bool
pub fn remove(&mut self, k: &K) -> Option<(K, V)>
pub fn retain(&mut self, f: impl FnMut(&K, &V) -> bool)
Trait Implementations§
Source§impl<K: Decode + Eq + PartialEq + Ord + PartialOrd, V: Decode> Decode for VecMap<K, V>
impl<K: Decode + Eq + PartialEq + Ord + PartialOrd, V: Decode> Decode for VecMap<K, V>
Source§fn decode<I: Input>(input: &mut I) -> Result<Self, DecodeError>
fn decode<I: Input>(input: &mut I) -> Result<Self, DecodeError>
Attempt to deserialise the value from input.
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl<K, V> Encode for VecMap<K, V>
impl<K, V> Encode for VecMap<K, V>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl<K: Eq + PartialEq + Ord + PartialOrd, V> Extend<(K, V)> for VecMap<K, V>
impl<K: Eq + PartialEq + Ord + PartialOrd, V> Extend<(K, V)> for VecMap<K, V>
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<K: Eq + PartialEq + Ord + PartialOrd, V> FromIterator<(K, V)> for VecMap<K, V>
impl<K: Eq + PartialEq + Ord + PartialOrd, V> FromIterator<(K, V)> for VecMap<K, V>
Source§impl<K: Eq + PartialEq + Ord + PartialOrd, V> IntoIterator for VecMap<K, V>
impl<K: Eq + PartialEq + Ord + PartialOrd, V> IntoIterator for VecMap<K, V>
Source§impl<K: Eq + PartialEq + Ord + PartialOrd, V> MapLike<K, V> for VecMap<K, V>
impl<K: Eq + PartialEq + Ord + PartialOrd, V> MapLike<K, V> for VecMap<K, V>
fn insert(&mut self, k: K, v: V) -> Option<V>
fn extend(&mut self, iter: impl Iterator<Item = (K, V)>)
fn contains_key(&self, k: &K) -> bool
fn remove(&mut self, k: &K) -> Option<V>
fn get(&self, k: &K) -> Option<&V>
fn get_mut(&mut self, k: &K) -> Option<&mut V>
fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>where
K: 'a,
Source§impl<K: Ord, V: Ord> Ord for VecMap<K, V>
impl<K: Ord, V: Ord> Ord for VecMap<K, V>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for VecMap<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for VecMap<K, V>
impl<K, V> EncodeLike for VecMap<K, V>
impl<K: Eq, V: Eq> Eq for VecMap<K, V>
impl<K, V> StructuralPartialEq for VecMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for VecMap<K, V>
impl<K, V> RefUnwindSafe for VecMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for VecMap<K, V>
impl<K, V> Sync for VecMap<K, V>
impl<K, V> Unpin for VecMap<K, V>
impl<K, V> UnwindSafe for VecMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
Source§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8] ⓘ
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