pub struct VecMap<K, V> { /* private fields */ }Expand description
A vector-based map implementation which retains the order of inserted entries.
Internally it is represented as a Vec<(K, V)> to support keys that are neither Hash nor
Ord.
Implementations§
Source§impl<K, V> VecMap<K, V>
impl<K, V> VecMap<K, V>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new map. (Does not allocate.)
§Examples
use vecset::VecMap;
let mut map: VecMap<i32, &str> = VecMap::new();Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new map with capacity for capacity key-value pairs. (Does not allocate if
capacity is zero.)
§Examples
use vecset::VecMap;
let mut map: VecMap<i32, &str> = VecMap::with_capacity(10);
assert_eq!(map.len(), 0);
assert!(map.capacity() >= 10);Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of entries the map can hold without reallocating.
§Examples
use vecset::VecMap;
let mut map: VecMap<i32, &str> = VecMap::with_capacity(10);
assert_eq!(map.capacity(), 10);Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of entries in the map, also referred to as its ‘length’.
§Examples
use vecset::VecMap;
let mut a = VecMap::new();
assert_eq!(a.len(), 0);
a.insert(1, "a");
assert_eq!(a.len(), 1);Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the map contains no entries.
§Examples
use vecset::VecMap;
let mut a = VecMap::new();
assert!(a.is_empty());
a.insert(1, "a");
assert!(!a.is_empty());Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the map, removing all entries.
§Examples
use vecset::VecMap;
let mut a = VecMap::new();
a.insert(1, "a");
a.clear();
assert!(a.is_empty());Sourcepub fn truncate(&mut self, len: usize)
pub fn truncate(&mut self, len: usize)
Shortens the map, keeping the first len key-value pairs and dropping the rest.
If len is greater than the map’s current length, this has no effect.
§Examples
Truncating a four element map to two elements:
use vecset::VecMap;
let mut map = VecMap::from([("a", 1), ("b", 2), ("c", 3), ("d", 4)]);
map.truncate(2);
assert_eq!(map, VecMap::from([("a", 1), ("b", 2)]));No truncation occurs when len is greater than the map’s current length:
use vecset::VecMap;
let mut map = VecMap::from([("a", 1), ("b", 2), ("c", 3), ("d", 4)]);
map.truncate(8);
assert_eq!(map, VecMap::from([("a", 1), ("b", 2), ("c", 3), ("d", 4)]));Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements to be inserted in the given
VecMap<K, V>. The collection may reserve more space to speculatively avoid frequent
reallocations. After calling reserve, capacity will be greater than or equal to
self.len() + additional. Does nothing if capacity is already sufficient.
§Panics
Panics if the new capacity exceeds isize::MAX bytes.
§Examples
use vecset::VecMap;
let mut map = VecMap::from_iter([("a", 1)]);
map.reserve(10);
assert!(map.capacity() >= 11);Sourcepub fn retain<F>(&mut self, f: F)
pub fn retain<F>(&mut self, f: F)
Retains only the elements specified by the predicate.
In other words, remove all pairs (k, v) for which f(&k, &mut v) returns false.
§Examples
use vecset::VecMap;
let mut map: VecMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();
map.retain(|&k, _| k % 2 == 0);
assert_eq!(map.len(), 4);Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the map as much as possible. It will drop down as much as possible while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
§Examples
use vecset::VecMap;
let mut map: VecMap<i32, i32> = VecMap::with_capacity(100);
map.insert(1, 2);
map.insert(3, 4);
assert!(map.capacity() >= 100);
map.shrink_to_fit();
assert!(map.capacity() >= 2);Sourcepub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to(&mut self, min_capacity: usize)
Shrinks the capacity of the map with a lower limit. It will drop down no lower than the supplied limit while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
If the current capacity is less than the lower limit, this is a no-op.
§Examples
use vecset::VecMap;
let mut map: VecMap<i32, i32> = VecMap::with_capacity(100);
map.insert(1, 2);
map.insert(3, 4);
assert!(map.capacity() >= 100);
map.shrink_to(10);
assert!(map.capacity() >= 10);
map.shrink_to(0);
assert!(map.capacity() >= 2);Sourcepub fn split_off(&mut self, at: usize) -> VecMap<K, V>
pub fn split_off(&mut self, at: usize) -> VecMap<K, V>
Splits the map into two at the given index.
Returns a newly allocated map containing the key-value pairs in the range [at, len).
After the call, the original map will be left containing the key-value pairs [0, at)
with its previous capacity unchanged.
§Panics
Panics if at > len.
§Examples
use vecset::VecMap;
let mut map = VecMap::from([("a", 1), ("b", 2), ("c", 3)]);
let map2 = map.split_off(1);
assert_eq!(map, VecMap::from([("a", 1)]));
assert_eq!(map2, VecMap::from([("b", 2), ("c", 3)]));Sourcepub fn drain<R>(&mut self, range: R) -> Drain<'_, (K, V)>where
R: RangeBounds<usize>,
pub fn drain<R>(&mut self, range: R) -> Drain<'_, (K, V)>where
R: RangeBounds<usize>,
Removes the specified range from the vector in bulk, returning all removed elements as an iterator. If the iterator is dropped before being fully consumed, it drops the remaining removed elements.
The returned iterator keeps a mutable borrow on the vector to optimize its implementation.
§Panics
Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
§Examples
use vecset::{vecmap, VecMap};
let mut v = vecmap!["a" => 1, "b" => 2, "c" => 3];
let u: VecMap<_, _> = v.drain(1..).collect();
assert_eq!(v, vecmap!["a" => 1]);
assert_eq!(u, vecmap!["b" => 2, "c" => 3]);
// A full range clears the vector, like `clear()` does
v.drain(..);
assert_eq!(v, vecmap![]);Sourcepub fn as_slice(&self) -> &[(K, V)]
pub fn as_slice(&self) -> &[(K, V)]
Extracts a slice containing the map entries.
use vecset::VecMap;
let map = VecMap::from([("b", 2), ("a", 1), ("c", 3)]);
let slice = map.as_slice();
assert_eq!(slice, [("a", 1), ("b", 2), ("c", 3)]);Sourcepub fn to_vec(&self) -> Vec<(K, V)>
pub fn to_vec(&self) -> Vec<(K, V)>
Copies the map entries into a new Vec<(K, V)>.
use vecset::VecMap;
let map = VecMap::from([("b", 2), ("a", 1), ("c", 3)]);
let vec = map.to_vec();
assert_eq!(vec, [("a", 1), ("b", 2), ("c", 3)]);
// Here, `map` and `vec` can be modified independently.Sourcepub fn into_vec(self) -> Vec<(K, V)>
pub fn into_vec(self) -> Vec<(K, V)>
Takes ownership of the map and returns its entries as a Vec<(K, V)>.
use vecset::VecMap;
let map = VecMap::from([("b", 2), ("a", 1), ("c", 3)]);
let vec = map.into_vec();
assert_eq!(vec, [("a", 1), ("b", 2), ("c", 3)]);Sourcepub unsafe fn from_sorted_vec(vec: Vec<(K, V)>) -> Self
pub unsafe fn from_sorted_vec(vec: Vec<(K, V)>) -> Self
Takes ownership of provided vector and converts it into VecMap.
§Safety
The vector must be sorted and have no duplicate keys. One way to guarantee it is to
sort the vector (e.g. by using [T]::sort_by_key) and then drop
duplicate keys (e.g. by using Vec::dedup_by_key).
§Example
use vecset::VecMap;
let mut vec = vec![("b", 2), ("a", 1), ("c", 3), ("b", 4)];
vec.sort_by_key(|slot| slot.0);
vec.dedup_by_key(|slot| slot.0);
// SAFETY: We've just deduplicated the vector.
let map = unsafe { VecMap::from_sorted_vec(vec) };
assert_eq!(map, VecMap::from([("b", 2), ("a", 1), ("c", 3)]));Sourcepub fn as_mut_keyed_set(&mut self) -> &mut KeyedVecSet<K, (K, V)>
pub fn as_mut_keyed_set(&mut self) -> &mut KeyedVecSet<K, (K, V)>
Returns based KeyedVecSet.
Because VecMap itself never expose &mut K,
this is useful when you need to edit keys, which are basically unsafe operations.
Source§impl<K, V> VecMap<K, V>
impl<K, V> VecMap<K, V>
Sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Return true if an equivalent to key exists in the map.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
assert_eq!(map.contains_key(&1), true);
assert_eq!(map.contains_key(&2), false);Sourcepub fn first(&self) -> Option<(&K, &V)>
pub fn first(&self) -> Option<(&K, &V)>
Get the first key-value pair.
use vecset::VecMap;
let mut map = VecMap::from_iter([("a", 1), ("b", 2)]);
assert_eq!(map.first(), Some((&"a", &1)));Sourcepub fn first_mut(&mut self) -> Option<(&K, &mut V)>
pub fn first_mut(&mut self) -> Option<(&K, &mut V)>
Get the first key-value pair, with mutable access to the value.
§Examples
use vecset::VecMap;
let mut map = VecMap::from_iter([("a", 1), ("b", 2)]);
if let Some((_, v)) = map.first_mut() {
*v = *v + 10;
}
assert_eq!(map.first(), Some((&"a", &11)));Sourcepub fn last(&self) -> Option<(&K, &V)>
pub fn last(&self) -> Option<(&K, &V)>
Get the last key-value pair.
§Examples
use vecset::VecMap;
let mut map = VecMap::from_iter([("a", 1), ("b", 2)]);
assert_eq!(map.last(), Some((&"b", &2)));
map.pop();
map.pop();
assert_eq!(map.last(), None);Sourcepub fn last_mut(&mut self) -> Option<(&K, &mut V)>
pub fn last_mut(&mut self) -> Option<(&K, &mut V)>
Get the last key-value pair, with mutable access to the value.
§Examples
use vecset::VecMap;
let mut map = VecMap::from_iter([("a", 1), ("b", 2)]);
if let Some((_, v)) = map.last_mut() {
*v = *v + 10;
}
assert_eq!(map.last(), Some((&"b", &12)));Sourcepub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Return a reference to the value stored for key, if it is present, else None.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
assert_eq!(map.get(&1), Some(&"a"));
assert_eq!(map.get(&2), None);Sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Return a mutable reference to the value stored for key, if it is present, else None.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
if let Some(x) = map.get_mut(&1) {
*x = "b";
}
assert_eq!(map[&1], "b");Sourcepub fn get_index(&self, index: usize) -> Option<(&K, &V)>
pub fn get_index(&self, index: usize) -> Option<(&K, &V)>
Return references to the key-value pair stored at index, if it is present, else None.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
assert_eq!(map.get_index(0), Some((&1, &"a")));
assert_eq!(map.get_index(1), None);Sourcepub fn get_index_mut(&mut self, index: usize) -> Option<(&K, &mut V)>
pub fn get_index_mut(&mut self, index: usize) -> Option<(&K, &mut V)>
Return a reference to the key and a mutable reference to the value stored at index, if it
is present, else None.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
if let Some((_, v)) = map.get_index_mut(0) {
*v = "b";
}
assert_eq!(map[0], "b");Sourcepub unsafe fn get_unchecked(&self, index: usize) -> &V
pub unsafe fn get_unchecked(&self, index: usize) -> &V
Sourcepub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut V
pub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut V
Returns a mutable reference to an element or subslice, without doing bounds checking.
For a safe alternative see get_index_mut.
§Safety
Calling this method with an out-of-bounds index is [undefined behavior] even if the resulting reference is not used.
Sourcepub fn get_full<Q>(&self, key: &Q) -> Result<(usize, &K, &V), usize>
pub fn get_full<Q>(&self, key: &Q) -> Result<(usize, &K, &V), usize>
Return the index and references to the key-value pair stored for key, if it is present,
else None.
§Errors
Returns Err(index) if the key is not found, where index is the position where the key would be inserted.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
assert_eq!(map.get_full(&1), Ok((0, &1, &"a")));
assert_eq!(map.get_full(&2), Err(1));Sourcepub fn get_full_mut<Q>(&mut self, key: &Q) -> Result<(usize, &K, &mut V), usize>
pub fn get_full_mut<Q>(&mut self, key: &Q) -> Result<(usize, &K, &mut V), usize>
Return the index, a reference to the key and a mutable reference to the value stored for
key, if it is present, else None.
§Errors
Returns Err(index) if the key is not found, where index is the position where the key would be inserted.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
if let Ok((_, _, v)) = map.get_full_mut(&1) {
*v = "b";
}
assert_eq!(map.get(&1), Some(&"b"));Sourcepub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)>
pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)>
Return references to the key-value pair stored for key, if it is present, else None.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert(1, "a");
assert_eq!(map.get_key_value(&1), Some((&1, &"a")));
assert_eq!(map.get_key_value(&2), None);Sourcepub fn binary_search<Q>(&self, key: &Q) -> Result<usize, usize>
pub fn binary_search<Q>(&self, key: &Q) -> Result<usize, usize>
Return item index, if it exists in the map.
§Errors
Returns Err(index) if the key is not found, where index is the position where the key would be inserted.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
map.insert("a", 10);
map.insert("b", 20);
assert_eq!(map.binary_search("a"), Ok(0));
assert_eq!(map.binary_search("b"), Ok(1));
assert_eq!(map.binary_search("c"), Err(2));Source§impl<K, V> VecMap<K, V>
impl<K, V> VecMap<K, V>
Sourcepub fn remove<Q>(&mut self, key: &Q) -> Option<V>
pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
Remove the key-value pair equivalent to key and return its value.
Like Vec::remove, the pair is removed by shifting all of the elements that follow it,
preserving their relative order. This perturbs the index of all of those elements!
§Examples
use vecset::VecMap;
let mut map = VecMap::from_iter([(1, "a"), (2, "b"), (3, "c"), (4, "d")]);
assert_eq!(map.remove(&2), Some("b"));
assert_eq!(map.remove(&2), None);
assert_eq!(map, VecMap::from_iter([(1, "a"), (3, "c"), (4, "d")]));Sourcepub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
Remove and return the key-value pair equivalent to key.
Like Vec::remove, the pair is removed by shifting all of the elements that follow it,
preserving their relative order. This perturbs the index of all of those elements!
§Examples
use vecset::VecMap;
let mut map = VecMap::from_iter([(1, "a"), (2, "b"), (3, "c"), (4, "d")]);
assert_eq!(map.remove_entry(&2), Some((2, "b")));
assert_eq!(map.remove_entry(&2), None);
assert_eq!(map, VecMap::from_iter([(1, "a"), (3, "c"), (4, "d")]));Sourcepub fn remove_index(&mut self, index: usize) -> (K, V)
pub fn remove_index(&mut self, index: usize) -> (K, V)
Removes and returns the key-value pair at position index within the map, shifting all
elements after it to the left.
§Panics
Panics if index is out of bounds.
§Examples
use vecset::VecMap;
let mut v = VecMap::from([("a", 1), ("b", 2), ("c", 3)]);
assert_eq!(v.remove_index(1), ("b", 2));
assert_eq!(v, VecMap::from([("a", 1), ("c", 3)]));Source§impl<K, V> VecMap<K, V>where
K: Ord,
impl<K, V> VecMap<K, V>where
K: Ord,
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Insert a key-value pair in the map.
If an equivalent key already exists in the map: the key remains and retains in its place
in the order, its corresponding value is updated with value and the older value is
returned inside Some(_).
If no equivalent key existed in the map: the new key-value pair is inserted, last in
order, and None is returned.
See also entry if you you want to insert or modify or if you need to
get the index of the corresponding key-value pair.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
assert_eq!(map.insert(37, "a"), None);
assert_eq!(map.is_empty(), false);
map.insert(37, "b");
assert_eq!(map.insert(37, "c"), Some("b"));
assert_eq!(map[&37], "c");Sourcepub fn insert_full(&mut self, key: K, value: V) -> (usize, Option<V>)
pub fn insert_full(&mut self, key: K, value: V) -> (usize, Option<V>)
Insert a key-value pair in the map, and get their index.
If an equivalent key already exists in the map: the key remains and
retains in its place in the order, its corresponding value is updated
with value and the older value is returned inside (index, Some(_)).
If no equivalent key existed in the map: the new key-value pair is
inserted, last in order, and (index, None) is returned.
See also entry if you you want to insert or modify
or if you need to get the index of the corresponding key-value pair.
§Examples
use vecset::VecMap;
let mut map = VecMap::new();
assert_eq!(map.insert_full("a", 1), (0, None));
assert_eq!(map.insert_full("b", 2), (1, None));
assert_eq!(map.insert_full("b", 3), (1, Some(2)));
assert_eq!(map["b"], 3);Sourcepub fn entry(&mut self, key: K) -> Entry<'_, K, V>
pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
Get the given key’s corresponding entry in the map for insertion and/or in-place manipulation.
§Examples
use vecset::VecMap;
let mut letters = VecMap::new();
for ch in "a short treatise on fungi".chars() {
letters.entry(ch).and_modify(|counter| *counter += 1).or_insert(1);
}
assert_eq!(letters[&'s'], 2);
assert_eq!(letters[&'t'], 3);
assert_eq!(letters[&'u'], 1);
assert_eq!(letters.get(&'y'), None);Source§impl<K, V> VecMap<K, V>
impl<K, V> VecMap<K, V>
Sourcepub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
An iterator visiting all key-value pairs in insertion order. The iterator element type is
(&'a K, &'a V).
§Examples
use vecset::VecMap;
let map = VecMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
for (key, val) in map.iter() {
println!("key: {key} val: {val}");
}Sourcepub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
An iterator visiting all key-value pairs in insertion order, with mutable references to the
values. The iterator element type is (&'a K, &'a mut V).
§Examples
use vecset::VecMap;
let mut map = VecMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
// Update all values
for (_, val) in map.iter_mut() {
*val *= 2;
}
for (key, val) in &map {
println!("key: {key} val: {val}");
}Sourcepub fn keys(&self) -> Keys<'_, K, V> ⓘ
pub fn keys(&self) -> Keys<'_, K, V> ⓘ
An iterator visiting all keys in insertion order. The iterator element type is &'a K.
§Examples
use vecset::VecMap;
let map = VecMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
for key in map.keys() {
println!("{key}");
}Sourcepub fn into_keys(self) -> IntoKeys<K, V> ⓘ
pub fn into_keys(self) -> IntoKeys<K, V> ⓘ
Creates a consuming iterator visiting all the keys in insertion order. The object cannot be
used after calling this. The iterator element type is K.
§Examples
use vecset::VecMap;
let map = VecMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
let mut vec: Vec<&str> = map.into_keys().collect();
assert_eq!(vec, ["a", "b", "c"]);Sourcepub fn values(&self) -> Values<'_, K, V> ⓘ
pub fn values(&self) -> Values<'_, K, V> ⓘ
An iterator visiting all values in insertion order. The iterator element type is &'a V.
§Examples
use vecset::VecMap;
let map = VecMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
for val in map.values() {
println!("{val}");
}Sourcepub fn values_mut(&mut self) -> ValuesMut<'_, K, V> ⓘ
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> ⓘ
An iterator visiting all values mutably in insertion order. The iterator element type is
&'a mut V.
§Examples
use vecset::VecMap;
let mut map = VecMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
for val in map.values_mut() {
*val = *val + 10;
}
for val in map.values() {
println!("{val}");
}Sourcepub fn into_values(self) -> IntoValues<K, V> ⓘ
pub fn into_values(self) -> IntoValues<K, V> ⓘ
Creates a consuming iterator visiting all the values in insertion order. The object cannot
be used after calling this. The iterator element type is V.
§Examples
use vecset::VecMap;
let map = VecMap::from([
("a", 1),
("b", 2),
("c", 3),
]);
let mut vec: Vec<i32> = map.into_values().collect();
assert_eq!(vec, [1, 2, 3]);Trait Implementations§
Source§impl<'de, K, V> Deserialize<'de> for VecMap<K, V>
Available on crate feature serde only.
impl<'de, K, V> Deserialize<'de> for VecMap<K, V>
serde only.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>,
Source§impl<'a, K, V> Extend<&'a (K, V)> for VecMap<K, V>
impl<'a, K, V> Extend<&'a (K, V)> for VecMap<K, V>
Source§fn extend<I>(&mut self, iterable: I)where
I: IntoIterator<Item = &'a (K, V)>,
fn extend<I>(&mut self, iterable: I)where
I: IntoIterator<Item = &'a (K, V)>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<'a, K, V> Extend<(&'a K, &'a V)> for VecMap<K, V>
impl<'a, K, V> Extend<(&'a K, &'a V)> for VecMap<K, V>
Source§fn extend<I>(&mut self, iterable: I)
fn extend<I>(&mut self, iterable: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<K, V> Extend<(K, V)> for VecMap<K, V>where
K: Ord,
impl<K, V> Extend<(K, V)> for VecMap<K, V>where
K: Ord,
Source§fn extend<I>(&mut self, iterable: I)where
I: IntoIterator<Item = (K, V)>,
fn extend<I>(&mut self, iterable: I)where
I: IntoIterator<Item = (K, V)>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<Item, K, V> FromIterator<Item> for VecMap<K, V>where
Self: Extend<Item>,
impl<Item, K, V> FromIterator<Item> for VecMap<K, V>where
Self: Extend<Item>,
Source§fn from_iter<I: IntoIterator<Item = Item>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = Item>>(iter: I) -> Self
Source§impl<'de, K, V, E> IntoDeserializer<'de, E> for VecMap<K, V>
Available on crate feature serde only.
impl<'de, K, V, E> IntoDeserializer<'de, E> for VecMap<K, V>
serde only.