pub trait NomRange<Idx> {
    type Saturating: Iterator<Item = Idx>;
    type Bounded: Iterator<Item = Idx>;
    // Required methods
    fn contains(&self, item: &Idx) -> bool;
    fn bounds(&self) -> (Bound<Idx>, Bound<Idx>);
    fn is_inverted(&self) -> bool;
    fn saturating_iter(&self) -> Self::Saturating;
    fn bounded_iter(&self) -> Self::Bounded;
}Expand description
Abstractions for range-like types.
Required Associated Types§
Sourcetype Saturating: Iterator<Item = Idx>
 
type Saturating: Iterator<Item = Idx>
The saturating iterator type.
Required Methods§
Sourcefn is_inverted(&self) -> bool
 
fn is_inverted(&self) -> bool
true if the range is inverted.
Sourcefn saturating_iter(&self) -> Self::Saturating
 
fn saturating_iter(&self) -> Self::Saturating
Creates a saturating iterator. A saturating iterator counts the number of iterations starting from 0 up to the upper bound of this range. If the upper bound is infinite the iterator saturates at the largest representable value of its type and returns it for all further elements.
Sourcefn bounded_iter(&self) -> Self::Bounded
 
fn bounded_iter(&self) -> Self::Bounded
Creates a bounded iterator.
A bounded iterator counts the number of iterations starting from 0 up to the upper bound of this range.
If the upper bounds is infinite the iterator counts up until the amount of iterations has reached the
largest representable value of its type and then returns None for all further elements.