enumtrait 1.0.0

A library of macros for polymorphism using enums
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

struct Bar { common_field: usize }
struct Bing { common_field: usize, other_field: String }

#[enumtrait::quick_enum]
#[enumtrait::store(foo_macro_store)]
enum Foo {
    Bar,
    Bing,
}

fn check(f: Foo) -> usize {
    enumtrait::gen_match!(foo_macro_store as f for it => it.common_field) + 3
}

fn main() {}