devela::_dep::itertools::traits

Trait IteratorIndex

pub trait IteratorIndex<I>: Sealed
where I: Iterator,
{ type Output: Iterator<Item = <I as Iterator>::Item>; // Required method fn index(self, from: I) -> Self::Output; }
Available on crate feature dep_itertools only.
Expand description

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

Required Associated Types§

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

The type returned for this type of index.

Required Methods§

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

Returns an adapted iterator for the current index.

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

Implementors§

§

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

§

type Output = Skip<Take<I>>

§

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

§

type Output = Skip<I>

§

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

§

type Output = I

§

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

§

type Output = Take<Skip<I>>

§

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

§

type Output = Take<I>

§

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

§

type Output = Take<I>