pub struct DiscreteRangeMap<I, K, V> { /* private fields */ }
Expand description
An ordered map of non-overlapping ranges based on BTreeMap
.
I
is the generic type parameter for the Ord
type the K
type is a range over.
K
is the generic type parameter for the range type stored as the
keys in the map.
V
is the generic type parameter for the values associated with the
keys in the map.
Phrasing it another way: I
is the point type, K
is the range type, and V
is the value type.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
// Make a map of ranges to booleans
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(4, 8), false),
(ie(8, 18), true),
(ie(20, 100), false),
])
.unwrap();
// Change a value in the map
*map.get_at_point_mut(7).unwrap() = true;
if map.contains_point(99) {
println!("Map contains value at 99 :)");
}
// Iterate over the entries in the map
for (range, value) in map.iter() {
println!("{range:?}, {value:?}");
}
Implementations§
source§impl<I, K, V> DiscreteRangeMap<I, K, V>
impl<I, K, V> DiscreteRangeMap<I, K, V>
sourcepub fn overlaps<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
pub fn overlaps<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
Returns true
if the given range overlaps any of the
other ranges in the map, and false
if not.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::{ie, ii};
use discrete_range_map::DiscreteRangeMap;
let mut map = DiscreteRangeMap::new();
map.insert_strict(ie(5, 10), false);
assert_eq!(map.overlaps(ii(1, 3)), false);
assert_eq!(map.overlaps(ie(4, 5)), false);
assert_eq!(map.overlaps(ii(4, 5)), true);
assert_eq!(map.overlaps(ie(4, 6)), true);
sourcepub fn overlapping<Q>(
&self,
range: Q
) -> impl DoubleEndedIterator<Item = (&K, &V)>where
Q: RangeType<I>,
pub fn overlapping<Q>(
&self,
range: Q
) -> impl DoubleEndedIterator<Item = (&K, &V)>where
Q: RangeType<I>,
Returns an iterator over every entry in the map that overlaps the given range in ascending order.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
let mut overlapping = map.overlapping(ie(2, 8));
assert_eq!(
overlapping.collect::<Vec<_>>(),
[(&ie(1, 4), &false), (&ie(4, 8), &true)]
);
sourcepub fn overlapping_mut<Q>(
&mut self,
range: Q
) -> impl DoubleEndedIterator<Item = (&K, &mut V)>where
Q: RangeType<I>,
pub fn overlapping_mut<Q>(
&mut self,
range: Q
) -> impl DoubleEndedIterator<Item = (&K, &mut V)>where
Q: RangeType<I>,
Returns an mutable iterator over every entry in the map that overlaps the given range in ascending order.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
for (range, value) in map.overlapping_mut(ie(3, 7)) {
if *range == ie(4, 8) {
*value = false
} else {
*value = true
}
}
sourcepub fn get_at_point(&self, point: I) -> Option<&V>
pub fn get_at_point(&self, point: I) -> Option<&V>
Returns a reference to the value corresponding to the range in the map that overlaps the given point, if any.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
assert_eq!(map.get_at_point(3), Some(&false));
assert_eq!(map.get_at_point(4), Some(&true));
assert_eq!(map.get_at_point(101), None);
sourcepub fn get_at_point_mut(&mut self, point: I) -> Option<&mut V>
pub fn get_at_point_mut(&mut self, point: I) -> Option<&mut V>
Returns a mutable reference to the value corresponding to the range that overlaps the given point, if any.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let mut map =
DiscreteRangeMap::from_slice_strict([(ie(1, 4), false)])
.unwrap();
if let Some(x) = map.get_at_point_mut(2) {
*x = true;
}
assert_eq!(map.get_at_point(1), Some(&true));
sourcepub fn contains_point(&self, point: I) -> bool
pub fn contains_point(&self, point: I) -> bool
Returns true
if the map contains a range that overlaps the
given point, and false
if not.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
assert_eq!(map.contains_point(3), true);
assert_eq!(map.contains_point(4), true);
assert_eq!(map.contains_point(101), false);
sourcepub fn get_entry_at_point(&self, point: I) -> Result<(&K, &V), K>
pub fn get_entry_at_point(&self, point: I) -> Result<(&K, &V), K>
Returns the entry corresponding to the range that overlaps the given point, if any.
If there is no range that overlaps the given point the maximally-sized gap at the given point is returned.
Examples
use discrete_range_map::test_ranges::{ie, iu};
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 6), true),
(ie(8, 100), false),
])
.unwrap();
assert_eq!(map.get_entry_at_point(3), Ok((&ie(1, 4), &false)));
assert_eq!(map.get_entry_at_point(5), Ok((&ie(4, 6), &true)));
assert_eq!(map.get_entry_at_point(7), Err(ie(6, 8)));
assert_eq!(map.get_entry_at_point(101), Err(iu(100)));
sourcepub fn remove_overlapping<'a, Q>(
&'a mut self,
range: Q
) -> impl Iterator<Item = (K, V)> + '_where
Q: RangeType<I> + 'a,
pub fn remove_overlapping<'a, Q>(
&'a mut self,
range: Q
) -> impl Iterator<Item = (K, V)> + '_where
Q: RangeType<I> + 'a,
Removes every entry in the map which overlaps the given range and returns them in an iterator.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
let mut removed = map.remove_overlapping(ie(2, 8));
assert_eq!(
removed.collect::<Vec<_>>(),
[(ie(1, 4), false), (ie(4, 8), true)]
);
assert_eq!(
map.into_iter().collect::<Vec<_>>(),
[(ie(8, 100), false)]
);
sourcepub fn cut<'a, Q>(&'a mut self, range: Q) -> impl Iterator<Item = (K, V)> + '_
pub fn cut<'a, Q>(&'a mut self, range: Q) -> impl Iterator<Item = (K, V)> + '_
Cuts a given range out of the map and returns an iterator of the full or partial ranges that were cut.
V
must implement Clone
as if you try to cut out the center
of a range in the map it will split into two different entries
using Clone
. Or if you partially cut a range then
V
must be cloned to be returned in the iterator.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::{ie, ii};
use discrete_range_map::DiscreteRangeMap;
let mut base = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
let after_cut = DiscreteRangeMap::from_slice_strict([
(ie(1, 2), false),
(ie(40, 100), false),
])
.unwrap();
assert_eq!(
base.cut(ie(2, 40)).collect::<Vec<_>>(),
[(ie(2, 4), false), (ie(4, 8), true), (ie(8, 40), false),]
);
assert_eq!(base, after_cut);
sourcepub fn gaps<'a, Q>(&'a self, outer_range: Q) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
pub fn gaps<'a, Q>(&'a self, outer_range: Q) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
Returns an iterator of ranges over all the maximally-sized
gaps in the map that are also within the given outer_range
.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::{ie, iu};
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 3), false),
(ie(5, 7), true),
(ie(9, 100), false),
])
.unwrap();
let mut gaps = map.gaps(iu(2));
assert_eq!(
gaps.collect::<Vec<_>>(),
[ie(3, 5), ie(7, 9), iu(100)]
);
sourcepub fn contains_range<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
pub fn contains_range<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
Returns true
if the map covers every point in the given
range, and false
if it does not.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 3), false),
(ie(5, 8), true),
(ie(8, 100), false),
])
.unwrap();
assert_eq!(map.contains_range(ie(1, 3)), true);
assert_eq!(map.contains_range(ie(2, 6)), false);
assert_eq!(map.contains_range(ie(6, 100)), true);
sourcepub fn insert_strict(
&mut self,
range: K,
value: V
) -> Result<(), OverlapError<V>>
pub fn insert_strict( &mut self, range: K, value: V ) -> Result<(), OverlapError<V>>
Adds a new entry to the map without modifying other entries.
If the given range overlaps one or more ranges already in the
map, then an OverlapError
is returned and the map is not
updated.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::{DiscreteRangeMap, OverlapError};
let mut map = DiscreteRangeMap::new();
assert_eq!(map.insert_strict(ie(5, 10), 9), Ok(()));
assert_eq!(
map.insert_strict(ie(5, 10), 2),
Err(OverlapError { value: 2 })
);
assert_eq!(map.len(), 1);
sourcepub fn insert_merge_touching(
&mut self,
range: K,
value: V
) -> Result<K, OverlapError<V>>
pub fn insert_merge_touching( &mut self, range: K, value: V ) -> Result<K, OverlapError<V>>
Adds a new entry to the map and merges into other ranges in the map which touch it.
The value of the merged-together range is set to the value given for this insertion.
If successful then the newly inserted (possibly merged) range is returned.
If the given range overlaps one or more ranges already in the
map, then an OverlapError
is returned and the map is not
updated.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::{DiscreteRangeMap, OverlapError};
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(6, 8), true),
])
.unwrap();
// Touching
assert_eq!(
map.insert_merge_touching(ie(4, 6), true),
Ok(ie(1, 8))
);
// Overlapping
assert_eq!(
map.insert_merge_touching(ie(4, 8), false),
Err(OverlapError { value: false }),
);
// Neither Touching or Overlapping
assert_eq!(
map.insert_merge_touching(ie(10, 16), false),
Ok(ie(10, 16))
);
assert_eq!(
map.into_iter().collect::<Vec<_>>(),
[(ie(1, 8), true), (ie(10, 16), false)]
);
sourcepub fn insert_merge_touching_if_values_equal(
&mut self,
range: K,
value: V
) -> Result<K, OverlapError<V>>where
V: Eq,
pub fn insert_merge_touching_if_values_equal(
&mut self,
range: K,
value: V
) -> Result<K, OverlapError<V>>where
V: Eq,
Adds a new entry to the map and merges into other ranges in the map which touch it if the touching ranges’ values are equal to the value being inserted.
If successful then the newly inserted (possibly merged) range is returned.
If the given range overlaps one or more ranges already in the
map, then an OverlapError
is returned and the map is not
updated.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::{DiscreteRangeMap, OverlapError};
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(6, 8), true),
])
.unwrap();
// Touching
assert_eq!(
map.insert_merge_touching_if_values_equal(ie(4, 6), true),
Ok(ie(4, 8))
);
// Overlapping
assert_eq!(
map.insert_merge_touching_if_values_equal(ie(4, 8), false),
Err(OverlapError { value: false }),
);
// Neither Touching or Overlapping
assert_eq!(
map.insert_merge_touching_if_values_equal(ie(10, 16), false),
Ok(ie(10, 16))
);
assert_eq!(
map.into_iter().collect::<Vec<_>>(),
[(ie(1, 4), false), (ie(4, 8), true), (ie(10, 16), false)]
);
sourcepub fn insert_merge_overlapping(&mut self, range: K, value: V) -> K
pub fn insert_merge_overlapping(&mut self, range: K, value: V) -> K
Adds a new entry to the map and merges into other ranges in the map which overlap it.
The value of the merged-together range is set to the value given for this insertion.
The newly inserted (possibly merged) range is returned.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::{DiscreteRangeMap, OverlapError};
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(6, 8), true),
])
.unwrap();
// Touching
assert_eq!(
map.insert_merge_overlapping(ie(4, 6), true),
ie(4, 6)
);
// Overlapping
assert_eq!(
map.insert_merge_overlapping(ie(4, 8), false),
ie(4, 8)
);
// Neither Touching or Overlapping
assert_eq!(
map.insert_merge_overlapping(ie(10, 16), false),
ie(10, 16)
);
assert_eq!(
map.into_iter().collect::<Vec<_>>(),
[(ie(1, 4), false), (ie(4, 8), false), (ie(10, 16), false)]
);
sourcepub fn insert_merge_touching_or_overlapping(&mut self, range: K, value: V) -> K
pub fn insert_merge_touching_or_overlapping(&mut self, range: K, value: V) -> K
Adds a new entry to the map and merges into other ranges in the map which touch or overlap it.
The value of the merged-together range is set to the value given for this insertion.
The newly inserted (possibly merged) range is returned.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::{DiscreteRangeMap, OverlapError};
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(6, 8), true),
])
.unwrap();
// Touching
assert_eq!(
map.insert_merge_touching_or_overlapping(ie(4, 6), true),
ie(1, 8)
);
// Overlapping
assert_eq!(
map.insert_merge_touching_or_overlapping(ie(4, 8), false),
ie(1, 8)
);
// Neither Touching or Overlapping
assert_eq!(
map.insert_merge_touching_or_overlapping(ie(10, 16), false),
ie(10, 16)
);
assert_eq!(
map.into_iter().collect::<Vec<_>>(),
[(ie(1, 8), false), (ie(10, 16), false)]
);
sourcepub fn insert_overwrite(&mut self, range: K, value: V)where
V: Clone,
pub fn insert_overwrite(&mut self, range: K, value: V)where
V: Clone,
Adds a new entry to the map and overwrites any other ranges that overlap the new range.
This is equivalent to using DiscreteRangeMap::cut()
followed by DiscreteRangeMap::insert_strict()
. Hence the
same V: Clone
trait bound applies.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let mut map =
DiscreteRangeMap::from_slice_strict([(ie(2, 8), false)])
.unwrap();
map.insert_overwrite(ie(4, 6), true);
assert_eq!(
map.into_iter().collect::<Vec<_>>(),
[(ie(2, 4), false), (ie(4, 6), true), (ie(6, 8), false)]
);
sourcepub fn from_slice_strict<const N: usize>(
slice: [(K, V); N]
) -> Result<DiscreteRangeMap<I, K, V>, OverlapError<V>>
pub fn from_slice_strict<const N: usize>( slice: [(K, V); N] ) -> Result<DiscreteRangeMap<I, K, V>, OverlapError<V>>
Allocates a DiscreteRangeMap
and moves the given entries from
the given slice into the map using
DiscreteRangeMap::insert_strict()
.
May return an Err
while inserting. See
DiscreteRangeMap::insert_strict()
for details.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
sourcepub fn from_iter_strict(
iter: impl Iterator<Item = (K, V)>
) -> Result<DiscreteRangeMap<I, K, V>, OverlapError<V>>
pub fn from_iter_strict( iter: impl Iterator<Item = (K, V)> ) -> Result<DiscreteRangeMap<I, K, V>, OverlapError<V>>
Collects a DiscreteRangeMap
from an iterator of (range,
value) tuples using DiscreteRangeMap::insert_strict()
.
May return an Err
while inserting. See
DiscreteRangeMap::insert_strict()
for details.
Panics
Panics if the given range is an invalid range. See Invalid Ranges
for more details.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let slice =
[(ie(1, 4), false), (ie(4, 8), true), (ie(8, 100), false)];
let map: DiscreteRangeMap<_, _, _> =
DiscreteRangeMap::from_iter_strict(
slice.into_iter().filter(|(range, _)| range.start > 2),
)
.unwrap();
source§impl<I, K, V> DiscreteRangeMap<I, K, V>
impl<I, K, V> DiscreteRangeMap<I, K, V>
sourcepub fn new() -> Self
pub fn new() -> Self
Makes a new, empty DiscreteRangeMap
.
Examples
use discrete_range_map::{DiscreteRangeMap, InclusiveInterval};
let map: DiscreteRangeMap<i8, InclusiveInterval<i8>, bool> =
DiscreteRangeMap::new();
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of ranges in the map.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let mut map = DiscreteRangeMap::new();
assert_eq!(map.len(), 0);
map.insert_strict(ie(0, 1), false).unwrap();
assert_eq!(map.len(), 1);
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if the map contains no ranges, and
false
if it does.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let mut map = DiscreteRangeMap::new();
assert_eq!(map.is_empty(), true);
map.insert_strict(ie(0, 1), false).unwrap();
assert_eq!(map.is_empty(), false);
sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = (&K, &V)>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = (&K, &V)>
Returns an iterator over every entry in the map in ascending order.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
let mut iter = map.iter();
assert_eq!(iter.next(), Some((&ie(1, 4), &false)));
assert_eq!(iter.next(), Some((&ie(4, 8), &true)));
assert_eq!(iter.next(), Some((&ie(8, 100), &false)));
assert_eq!(iter.next(), None);
sourcepub fn iter_mut(&mut self) -> impl DoubleEndedIterator<Item = (&K, &mut V)>
pub fn iter_mut(&mut self) -> impl DoubleEndedIterator<Item = (&K, &mut V)>
Returns an mutable iterator over every entry in the map in ascending order.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let mut map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
for (range, value) in map.iter_mut() {
if *range == ie(4, 8) {
*value = false
} else {
*value = true
}
}
sourcepub fn first_entry(&self) -> Option<(&K, &V)>
pub fn first_entry(&self) -> Option<(&K, &V)>
Returns the first entry in the map, if any.
Examples
use discrete_range_map::test_ranges::ie;
use discrete_range_map::DiscreteRangeMap;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
assert_eq!(map.first_entry(), Some((&ie(1, 4), &false)));
sourcepub fn last_entry(&self) -> Option<(&K, &V)>
pub fn last_entry(&self) -> Option<(&K, &V)>
Returns the last entry in the map, if any.
Examples
use discrete_range_map::DiscreteRangeMap;
use discrete_range_map::test_ranges::ie;
let map = DiscreteRangeMap::from_slice_strict([
(ie(1, 4), false),
(ie(4, 8), true),
(ie(8, 100), false),
])
.unwrap();
assert_eq!(
map.last_entry(),
Some((&ie(8, 100), &false))
);
Trait Implementations§
source§impl<I: Clone, K: Clone, V: Clone> Clone for DiscreteRangeMap<I, K, V>
impl<I: Clone, K: Clone, V: Clone> Clone for DiscreteRangeMap<I, K, V>
source§fn clone(&self) -> DiscreteRangeMap<I, K, V>
fn clone(&self) -> DiscreteRangeMap<I, K, V>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<I, K, V> Default for DiscreteRangeMap<I, K, V>
impl<I, K, V> Default for DiscreteRangeMap<I, K, V>
source§impl<'de, I, K, V> Deserialize<'de> for DiscreteRangeMap<I, K, V>
impl<'de, I, K, V> Deserialize<'de> for DiscreteRangeMap<I, K, V>
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<I, K, V> IntoIterator for DiscreteRangeMap<I, K, V>
impl<I, K, V> IntoIterator for DiscreteRangeMap<I, K, V>
source§impl<I: PartialEq, K: PartialEq, V: PartialEq> PartialEq for DiscreteRangeMap<I, K, V>
impl<I: PartialEq, K: PartialEq, V: PartialEq> PartialEq for DiscreteRangeMap<I, K, V>
source§fn eq(&self, other: &DiscreteRangeMap<I, K, V>) -> bool
fn eq(&self, other: &DiscreteRangeMap<I, K, V>) -> bool
self
and other
values to be equal, and is used
by ==
.