2 unstable releases
0.2.0 | Mar 18, 2024 |
---|---|
0.1.0 | Oct 10, 2023 |
#167 in #util
224 downloads per month
Used in 7 crates
(2 directly)
4KB
58 lines
enum_all_variants
Proc macro for generating a list of all enum variants.
Example
use enum_all_variants::AllVariants;
#[derive(AllVariants, Debug)]
enum Direction {
Left,
Top,
Right,
Bottom,
}
fn main() {
println!("{:?}", Direction::all_variants());
}
Outputs:
[Left, Top, Right, Bottom]
Dependencies
~225–670KB
~16K SLoC