enum-from-str-rs
Allow derive FromStr for enums
Overview
This library adds the #[derive(FromStr)]
attribute for enums, thus allowing parsing strings into enum variants. Even though there are other libraries that allows this, like enum_derive, it only allows you to parse from strings with the exact name of a variant. This library allows you to define a custom string for each enum variant.
Basic usage
use ParseEnumVariantError;
use FromStr;
Known issues
Currently, proc-macro crates doesn't allow exporting anything other than the proc-macro function. That's why ParseEnumVariantError is in a different crate. When Rust allows it, it should be moved into a single crate.