Crate iterwindows
source ·Expand description
This crate provides an iterator adapter to iterate over all contiguous
windows of length N
.
Getting started
Add the crate to your Cargo manifest.
cargo add iterwindows
And bring the IterWindows
trait into scope.
use iterwindows::IterWindows;
Now you can use the windows
method on any
iterator.
for [a, b, c] in iter.windows() {
println!("{} {} {}", a, b, c)
}
Generally the size of N
can be inferred by the compiler but you can also
specify it manually.
let w = iter.windows::<3>();
Structs
An iterator over all contiguous windows of length
N
.Traits
An extension trait that provides the
windows
method for iterators.