Struct range_map::RangeMultiMap
[−]
[src]
pub struct RangeMultiMap<T, V> { // some fields omitted }
A multi-valued mapping from primitive integers to other data.
Methods
impl<T: Debug + PrimInt, V: Clone + Debug + PartialEq> RangeMultiMap<T, V>
[src]
fn new() -> RangeMultiMap<T, V>
Creates a new empty map.
fn num_ranges(&self) -> usize
Returns the number of mapped ranges.
fn is_empty(&self) -> bool
Checks if the map is empty.
fn insert(&mut self, range: Range<T>, value: V)
Adds a new mapping from a range of characters to value
.
fn from_vec(vec: Vec<(Range<T>, V)>) -> RangeMultiMap<T, V>
Creates a map from a vector of pairs.
fn intersection(&self, other: &RangeSet<T>) -> RangeMultiMap<T, V>
Returns a new RangeMultiMap
containing only the mappings for keys that belong to the
given set.
fn map_values<F>(&mut self, f: F) where F: FnMut(&V) -> V
fn retain_values<F>(&mut self, f: F) where F: FnMut(&V) -> bool
Modifies this map in place to only contain mappings whose values v
satisfy f(v)
.
fn into_vec(self) -> Vec<(Range<T>, V)>
Returns the underlying Vec
.
fn ranges_values<'a>(&'a self) -> Iter<'a, (Range<T>, V)>
Iterates over all the mapped ranges and values.
impl<T: Debug + PrimInt, V: Clone + Debug + Ord> RangeMultiMap<T, V>
[src]
fn group(&self) -> RangeMap<T, Vec<V>>
Makes the ranges sorted and non-overlapping. The data associated with each range will
be a Vec<T>
instead of a single T
.
Trait Implementations
impl<T: Debug + PrimInt, V: Clone + Debug + PartialEq> FromIterator<(Range<T>, V)> for RangeMultiMap<T, V>
[src]
fn from_iter<I: IntoIterator<Item=(Range<T>, V)>>(iter: I) -> Self
Builds a RangeMultiMap
from an iterator over Range
and values..
impl<T: Debug + PrimInt, V: Clone + Debug + PartialEq> Debug for RangeMultiMap<T, V>
[src]
Derived Implementations
impl<T: PartialEq, V: PartialEq> PartialEq for RangeMultiMap<T, V>
[src]
fn eq(&self, __arg_0: &RangeMultiMap<T, V>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RangeMultiMap<T, V>) -> bool
This method tests for !=
.
impl<T: Hash, V: Hash> Hash for RangeMultiMap<T, V>
[src]
fn hash<__HTV: Hasher>(&self, __arg_0: &mut __HTV)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<T: Eq, V: Eq> Eq for RangeMultiMap<T, V>
[src]
impl<T: Clone, V: Clone> Clone for RangeMultiMap<T, V>
[src]
fn clone(&self) -> RangeMultiMap<T, V>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more