Trait internal_iterator::IteratorExt[][src]

pub trait IteratorExt: IntoIterator {
    fn into_internal(self) -> Internal<Self::IntoIter>
    where
        Self: Sized
, { ... } }
Expand description

Extension trait to add conversion to InternalIterator for regular iterators.

Provided methods

Convert an std::iter::Iterator to an InternalIterator.

Composing internal iterators together requires all used iterators to be internal iterators. Given that regular iterators are far more prevalent, this function can be used to allow them to be used together with internal iterators.


fn flatten_ranges(
    ranges: impl InternalIterator<Item = (i32, i32)>,
) -> impl InternalIterator<Item = i32> {
    ranges.flat_map(|(from, to)| (from..to).into_internal())
}

Implementors