Struct contiguous_map::ContiguousMap [−][src]
pub struct ContiguousMap<K: Key, V> { /* fields omitted */ }
Expand description
An ordered, associative container like std::collections::BTreeMap
.
Additionally stores values with adjacent keys contiguously so they may
be accessed as a slice.
Implementations
Gets the number of entries in this map.
This is the total number of values in the map, not the number of contiguous regions.
For the number of contiguous regions use ContiguousMap::num_contiguous_regions()
Gets the number of contiguous regions in this map.
This is the number of (key, slice) tuples that will be iterated over
by iterators returned by ContiguousMap::iter_slice()
and
ContiguousMap::iter_slice_mut()
.
This is also th number of (key, vector) tuples that will be iterated over
by iterators returned by ContiguousMap::iter_vec()
.
Inserts a value into a map with a given key. Returns the old value for this key if one existed.
Inserts values into the map from a slice starting at a given key.
Removes a key’s value in this map, returning it if it existed.
Removes all entries within a range of keys.
Removes all entries starting at the provided key for the next len adjacent keys.
Returns a reference to a key’s value, if it exists.
Returns a mutable reference to a key’s value, if it exists.
Gets a slice from this map using a range of keys.
Gets a slice from this map using a key and a length.
pub fn get_slice_mut<R: InclusiveStartRangeBounds<K>>(
&mut self,
range: R
) -> Option<&mut [V]>
pub fn get_slice_mut<R: InclusiveStartRangeBounds<K>>(
&mut self,
range: R
) -> Option<&mut [V]>
Gets a mutable slice from this map using a range of keys.
Gets a mutable slice from this map using a key and a length.
Iteration over all keys and values in this map in ascending key order.
Unlike std::collections::BTreeMap
the tuples yielded by the iterator
contains a key directly instead of a reference to a key.
This is due to how contiguous regions are stored internally.
Mutable iteration over all keys and values in this map in ascending key order.
Unlike std::collections::BTreeMap
the tuples yielded by the iterator
contains a key directly instead of a reference to a key.
This is due to how contiguous regions are stored internally.
Iteration over a range of keys and values in this map in ascending key order.
Unlike std::collections::BTreeMap
the tuples yielded by the iterator
contains a key directly instead of a reference to a key.
This is due to how contiguous regions are stored internally.
Mutable iteration over a range of keys and values in this map in ascending key order.
Unlike std::collections::BTreeMap
the tuples yielded by the iterator
contains a key directly instead of a reference to a key.
This is due to how contiguous regions are stored internally.
Owning iteration over all keys and values in this map grouped up in contiguous regions in ascending key order.
The iterator yields tuples containing a key and vector of values. The key of each value is its index in the vector plus the key in the tuple.
The iterator will never yield a tuple with an empty vector.
Iteration over all keys and values in this map grouped up in contiguous regions in ascending key order.
The iterator yields tuples containing a key and slice of values. The key of each value is its index in the slice plus the key in the tuple.
The iterator will never yield a tuple with an empty slice.
pub fn iter_slice_mut(&mut self) -> IterSliceMut<'_, K, V>ⓘNotable traits for IterSliceMut<'a, K, V>impl<'a, K: Key, V> Iterator for IterSliceMut<'a, K, V> type Item = (&'a K, &'a mut [V]);
pub fn iter_slice_mut(&mut self) -> IterSliceMut<'_, K, V>ⓘNotable traits for IterSliceMut<'a, K, V>impl<'a, K: Key, V> Iterator for IterSliceMut<'a, K, V> type Item = (&'a K, &'a mut [V]);
impl<'a, K: Key, V> Iterator for IterSliceMut<'a, K, V> type Item = (&'a K, &'a mut [V]);
Mutable iteration over all keys and values in this map grouped up in contiguous regions in ascending key order.
The iterator yields tuples containing a key and slice of values. The key of each value is its index in the slice plus the key in the tuple.
The iterator will never yield a tuple with an empty slice.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<K, V> RefUnwindSafe for ContiguousMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for ContiguousMap<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for ContiguousMap<K, V> where
K: Sync,
V: Sync,
impl<K, V> Unpin for ContiguousMap<K, V>
impl<K, V> UnwindSafe for ContiguousMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more