11 releases (stable)
| 3.0.2 | Sep 8, 2024 |
|---|---|
| 3.0.1 | Jul 24, 2023 |
| 2.0.1 | May 24, 2022 |
| 1.0.2 | Jul 15, 2021 |
| 0.2.1 | Sep 6, 2020 |
#1069 in Rust patterns
264 downloads per month
Used in 13 crates
(4 directly)
30KB
685 lines
This crate provides several macros for deriving some useful methods for unitary enums (i.e. enums where variants do not have payloads) and unary enums.
Feature flags
Using with and without macro_attr!
All of the macros are designed to be used with the
macro-attr-2018 crate,
though they can be used independent of it. The following:
macro_attr! {
#[derive(Copy, Clone, Debug, IterVariants!(Vars))]
enum ItAintRight { BabeNo, NoNo, BoyBoy }
}
can also be written as
#[derive(Copy, Clone, Debug)]
enum ItAintRight { BabeNo, NoNo, BoyBoy }
IterVariants! { (Vars) enum ItAintRight { BabeNo, NoNo, BoyBoy } }
enum-derive-2018
The enum-derive modern fork.
This crate provides several macros for deriving some useful methods for unitary enums (i.e. enums where variants do not have payloads).
All of these macros are designed to be used with
the macro-attr-2018 crate,
though they can be used independent of it.
Dependencies
~190KB