[−][src]Trait gaps::RangeGappable
An extension trait that provides range based access to the "gaps" in
collections with a range
method.
BTreeSet
and BTreeMap
are the two most prominent examples of
such collections.
use std::ops::Bound; let set = btreeset!{1, 3, 4}; let mut gaps = set.gaps(0..=6); assert_eq!(gaps.next(), Some((Bound::Included(0), Bound::Excluded(1)))); assert_eq!(gaps.next(), Some((Bound::Excluded(1), Bound::Excluded(3)))); assert_eq!(gaps.next(), Some((Bound::Excluded(4), Bound::Included(6)))); assert_eq!(gaps.next(), None);
Associated Types
Loading content...Required methods
pub fn gaps<R>(&'s self, range: R) -> GapIter<Copied<Self::Iter>, T> where
R: RangeBounds<T>,
[src]
R: RangeBounds<T>,
Implementations on Foreign Types
impl<'s, V> RangeGappable<'s, V> for BTreeSet<V> where
V: Copy + Ord + Inc + 's,
[src]
V: Copy + Ord + Inc + 's,
type Iter = BTreeSetRange<'s, V>
pub fn gaps<R>(&'s self, range: R) -> GapIter<Copied<Self::Iter>, V> where
R: RangeBounds<V>,
[src]
R: RangeBounds<V>,
impl<'s, K, V> RangeGappable<'s, K> for BTreeMap<K, V> where
K: Copy + Ord + Inc + 's,
V: 's,
[src]
K: Copy + Ord + Inc + 's,
V: 's,
type Iter = Map<BTreeMapRange<'s, K, V>, fn(_: (&'s K, &'s V)) -> &'s K>
pub fn gaps<R>(&'s self, range: R) -> GapIter<Copied<Self::Iter>, K> where
R: RangeBounds<K>,
[src]
R: RangeBounds<K>,