itertools::traits

Trait IteratorIndex

Source
pub trait IteratorIndex<I>: Sealed
where I: Iterator,
{ type Output: Iterator<Item = I::Item>; // Required method fn index(self, from: I) -> Self::Output; }
Expand description

Used by Itertools::get to know which iterator to turn different ranges into.

Required Associated Types§

Source

type Output: Iterator<Item = I::Item>

The type returned for this type of index.

Required Methods§

Source

fn index(self, from: I) -> Self::Output

Returns an adapted iterator for the current index.

Prefer calling Itertools::get instead of calling this directly.

Implementations on Foreign Types§

Source§

impl<I> IteratorIndex<I> for Range<usize>
where I: Iterator,

Source§

type Output = Skip<Take<I>>

Source§

fn index(self, iter: I) -> Self::Output

Source§

impl<I> IteratorIndex<I> for RangeFrom<usize>
where I: Iterator,

Source§

type Output = Skip<I>

Source§

fn index(self, iter: I) -> Self::Output

Source§

impl<I> IteratorIndex<I> for RangeFull
where I: Iterator,

Source§

type Output = I

Source§

fn index(self, iter: I) -> Self::Output

Source§

impl<I> IteratorIndex<I> for RangeInclusive<usize>
where I: Iterator,

Source§

type Output = Take<Skip<I>>

Source§

fn index(self, iter: I) -> Self::Output

Source§

impl<I> IteratorIndex<I> for RangeTo<usize>
where I: Iterator,

Source§

type Output = Take<I>

Source§

fn index(self, iter: I) -> Self::Output

Source§

impl<I> IteratorIndex<I> for RangeToInclusive<usize>
where I: Iterator,

Source§

type Output = Take<I>

Source§

fn index(self, iter: I) -> Self::Output

Implementors§