greedy_enum 0.1.0

derive macro of FromStr for enum
Documentation
1
2
3
4
5
6
7
8
pub use greedy_enum_derive::FromStr;

/// Custom error type for parsing strings into enum variants.
#[derive(Debug, thiserror::Error)]
#[error("No valid variant found for string: '{span}'")]
pub struct ParseError {
    pub span: String,
}