proxy-enum
proxy-enum copied to clipboard
Emulate dynamic dispatch and sealed classes using a proxy enum, which defers all method calls to its variants.
Allow generic arguments in enum variants, for example: ```rust #[proxy_enum::proxy(Animal)] mod proxy { use super::{Cat, Foo, Lion, Mouse}; enum Animal { Cat(Cat), Lion(Lion), Mouse(Mouse), } impl Animal { #[implement] fn...
I might even submit a PR for this. It's a common pattern when using enums to implement MyEnum From\ for each variant, and likewise it would even be nice to...