#iterator #generate #macro #permutations #stream #exports #n-nested

macro gen-nested-iter-yield

A macro for creating n-nested for loops over iterators

3 releases

0.1.3 Apr 16, 2022
0.1.2 Apr 15, 2022
0.1.0 Apr 14, 2022

#22 in #permutations


Used in 2 crates (via marigold-impl)

Apache-2.0 OR MIT

7KB
56 lines

gen-nested-iter-yield

crates.io docs.rs CI style

gen-nested-iter-yield exports a helper macro, nested_iter_yield, which can be used to generate n-nested for loops over identical iterators. This is useful for generating a stream of permutations with replacement without storing unnecessary intermediary buffers.

The macro returns a genawaiter::sync generator.


lib.rs:

gen-nested-iter-yield exports a helper macro, nested_iter_yield, which can be used to generate n-nested for loops over identical iterators. This is useful for generating a stream of permutations with replacement without storing unnecessary intermediary buffers.

The macro returns a genawaiter::sync generator which, when the feature futures03 is enabled, implements futures::stream::Stream.

No runtime deps