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
#[enum_delegate::register]
trait Foo: Clone {}

#[derive(Clone)]
struct A;
impl Foo for A {}

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

fn main() {}