Expand description
§Strum
Strum is a set of macros and traits for working with enums and strings easier in Rust.
Derive Macros§
- AsRef
Str - Converts enum variants to
&'static str. - AsStatic
Str Deprecated - Display
- Converts enum variants to strings.
- Enum
Count - Add a constant
usizeequal to the number of variants. - Enum
Discriminants - Generate a new type with only the discriminant names.
- Enum
Iter - Creates a new type that iterates of the variants of an enum.
- Enum
Message - Add a verbose message to an enum variant.
- Enum
Property - Add custom properties to enum variants.
- Enum
String - Converts strings to enum variants based on their name.
- Enum
Variant Names - Implements Strum::VariantNames which adds an associated constant
VARIANTSwhich is an array of discriminant names. - From
Repr - Add a function to enum that allows accessing variants by its discriminant
- Into
Static Str - Implements
From<MyEnum> for &'static stron an enum. - ToString
Deprecated - implements
std::string::ToStringon en enum