pub trait SortedMap<Q>: Map{
type RangeIter<'a>: Iterator<Item = (&'a Self::Key, &'a Self::Val)>
where Self: 'a;
type RangeIterMut<'a>: Iterator<Item = (&'a Self::Key, &'a mut Self::Val)>
where Self: 'a;
// Required methods
fn range<R>(&self, range: R) -> Self::RangeIter<'_>
where R: RangeBounds<Q>;
fn range_mut<R>(&mut self, range: R) -> Self::RangeIterMut<'_>
where R: RangeBounds<Q>;
}
Expand description
A map that is sorted by its keys.
Required Associated Types§
Sourcetype RangeIter<'a>: Iterator<Item = (&'a Self::Key, &'a Self::Val)>
where
Self: 'a
type RangeIter<'a>: Iterator<Item = (&'a Self::Key, &'a Self::Val)> where Self: 'a
The type of iterator over the entries of the map within a range of keys.
Sourcetype RangeIterMut<'a>: Iterator<Item = (&'a Self::Key, &'a mut Self::Val)>
where
Self: 'a
type RangeIterMut<'a>: Iterator<Item = (&'a Self::Key, &'a mut Self::Val)> where Self: 'a
The type of iterator over the entries of the map within a range of keys, with mutable references to the values.
Required Methods§
Sourcefn range<R>(&self, range: R) -> Self::RangeIter<'_>where
R: RangeBounds<Q>,
fn range<R>(&self, range: R) -> Self::RangeIter<'_>where
R: RangeBounds<Q>,
Returns an iterator over the entries of the map within a range of keys.
Sourcefn range_mut<R>(&mut self, range: R) -> Self::RangeIterMut<'_>where
R: RangeBounds<Q>,
fn range_mut<R>(&mut self, range: R) -> Self::RangeIterMut<'_>where
R: RangeBounds<Q>,
Returns an iterator over the entries of the map within a range of keys, with mutable references to the values.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.