#iterator #generate #macro #permutations #stream #identical #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

#8 in #identical

Download history 11/week @ 2024-02-20 21/week @ 2024-02-27 1/week @ 2024-03-05 7/week @ 2024-03-12 1/week @ 2024-03-19 13/week @ 2024-03-26 56/week @ 2024-04-02

70 downloads per month
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