enum_variants_strings/lib.rs
1#![doc = include_str!("./README.md")]
2
3pub use enum_variants_strings_derive::EnumVariantsStrings;
4
5pub trait EnumVariantsStrings: Sized {
6 /// Returns a instance of variant of Self which matches input if exists, else returns possible matches
7 fn from_str(input: &str) -> Result<Self, &[&str]>;
8
9 /// Returns the string representation of selfs variant
10 fn to_str(&self) -> &'static str;
11}