Trait NomRange

pub trait NomRange<Idx>

Abstractions for range-like types.

Associated Types

type Saturating: Iterator<Item = Idx>;

The saturating iterator type.

type Bounded: Iterator<Item = Idx>;

The bounded iterator type.

Required Methods

fn contains(&self, item: &Idx) -> bool

true if item is contained in the range.

fn bounds(&self) -> (Bound<Idx>, Bound<Idx>)

Returns the bounds of this range.

fn is_inverted(&self) -> bool

true if the range is inverted.

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.

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.

Implementors