enum_builder
Simple macros that allow building enum types from variants that can be defined in multiple dispersed files in the crate.
Example
main.rs
use *;
// expanded result
// enum Animal {
// Dog(Dog),
// Cow(Cow),
// Fish(Fish),
// }
animals.rs
Tips
It can be very useful to combine this crate with the enum_dispatch crate, to allow for a simple "plugin" architecture without the overhead of dynamic dispatch. When doing this, take care to note that the order of macros is important, as [macro@enum_builder] must be used before enum_dispatch.
Example