enum-path 0.1.0

Derive FromStr and Display impls for enums that follow a hierarchical path-like serialization scheme
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use enum_path::EnumPath;

// `foo` and `foo.bar` collide under the default `.` delimiter, since
// any input starting with `foo.bar` would also match `foo`.
#[derive(EnumPath)]
#[enum_path(FromStr)]
enum Bad
{
    #[enum_path(rename = "foo")]
    Short,
    #[enum_path(rename = "foo.bar")]
    Long(String),
}

fn main() {}