You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This crate provides some useful iterator adaptors and functions. Unlike
itertools this crate provides a separate
extension trait for each adaptor. Additionally, each type of adaptor is
feature flagged so you only have to compile the features you need.
Getting started
Add the crate to Cargo manifest.
cargo add itermore --features full
And bring the extension traits into scope.
use itermore::prelude::*;
Now you can use extension methods like array_windows on any iterator.
It is recommended to only enable the features that you need. For example if
you only want the array_combinations adaptor you would add the following
to your Cargo manifest.
[dependencies]
itermore = { version = "*", features = ["array_combinations"]}
min_max and friends: Returns the minimum and maximum element of an
iterator.
next_chunk: Returns the next N elements of the iterator as an array.
sorted and friends: Returns a new iterator with all elements sorted.
Adaptors
array_chunks returns an iterator over N elements of the iterator at
a time.
array_windows returns an iterator over all contiguous windows of
length N.
array_combinations returns an iterator over K length combinations of
all the elements in the underlying iterator.
array_combinations_with_reps returns an iterator over K length
combinations with repetitions/replacements of all the elements in the
underlying iterator.
cartesian_product returns an iterator over the cartesian product of
the element sets of two iterators.
circular_array_windows returns an iterator over all contiguous windows
of length N that wraps around at the end.
combinations returns an iterator over k length combinations of all
the elements in the underlying iterator.
combinations_with_reps returns an iterator over k length
combinations with repetitions/replacements of all the elements in the
underlying iterator.
License
This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).