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 |
#1127 in Rust patterns
570 downloads per month
Used in 12 crates
(3 directly)
30KB
685 lines
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.
lib.rs
:
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 } }
Dependencies
~175KB