2 unstable releases
0.2.0 | Mar 18, 2024 |
---|---|
0.1.0 | Oct 10, 2023 |
#1676 in Procedural macros
88 downloads per month
Used in 6 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
~275–730KB
~17K SLoC