enum_delegate 0.2.0

Easily replace dynamic dispatch with an enum, for speed and serialization
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[enum_delegate::register]
trait Foo<T> {
    fn foo(&self, x: T);
}

struct A;
impl Foo<i32> for A {
    fn foo(&self, x: i32) {}
}

#[enum_delegate::implement(Foo)]
enum E {
    A(A),
}

fn main() {}