Expand description
enum2str is a rust derive macro that creates Display and FromStr impls for enums. This is useful for strongly typing composable sets of strings.
§Features
try_from_string
(optional): EnablesTryFrom<String>
implementation for enums with only unit variants. This feature is not enabled by default. To enable it, use:enum2str = { version = "0.1.16", features = ["try_from_string"] }
§Usage
Add this to your Cargo.toml
:
enum2str = "0.1.16"