3 releases
Uses new Rust 2024
new 0.1.11 | Mar 20, 2025 |
---|---|
0.1.1 | Mar 17, 2025 |
0.1.0 | Mar 17, 2025 |
#8 in #rotary
156 downloads per month
Used in rotary-permutator
6KB
104 lines
rotary-permutator-derive - macro for generating enum permutations
This is the macro crate for rotary-permutator crate: https://crates.io/crates/rotary-permutator-derive.
It generates permutations of enums with repetitions.
Please note the default trait has to be implemented.
Example
use rotary_permutator_derive::EnumRotor;
#[derive(EnumRotor, Clone, Debug, Default)]
enum Levels {
#[default]
High,
Normal,
Low,
}
fn main() {
let mut levels_engine = Levels::init_rotor_engine(2);
while let Some(val) = levels_engine.next() {
println!("{:?}", val);
}
}
Dependencies
~195–630KB
~15K SLoC