Crate interleave [] [src]

This crate allows you to create an arbitrary interleaving iterator. Each iterator is guaranteed to be behind the most advanced iterator by at max one next() call. The interleave macro is of arbitrary arity.

#[macro_use]
extern crate interleave;
fn main() {
    use interleave::{IterList, MultiIter};
    let iter = interleave!(1..5, 9..12, -3..2);
    for i in iter {
        println!("{:?}", i);
    }
}

The types returned by the iterator can also be forced:

#[macro_use]
extern crate interleave;
fn main() {
    use interleave::{IterList, MultiIter};
    let iter = interleave!(i8; 1..5, 9..12, -3..2);
    for i in iter {
        println!("{:?}", i);
    }
}

Most information can be found in the examples or the test module.

Macros

interleave!

Main macro for creating a MultiIter

Structs

MultiIter

Holds the state of the interleave iterator

Type Definitions

Iter
IterList

Vector of boxed iterator traits