[−][src]Crate enum_derive_2018
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.
Crate features
"std"
Enabled by default. Disable to make the library#![no_std]
.
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 } }
Macros
EnumDisplay | Derives |
EnumFromInner | Derives |
EnumFromStr | Derives |
EnumInnerAsTrait | Derives a method for an unary enum returning a borrowed pointer to the inner value, cast to a trait object. |
IterVariantNames | Derives |
IterVariants | Derives |
NextVariant | Derives |
PrevVariant | Derives |
Structs
ParseEnumError | The |