typeunion
Instead of declaring simple type unions using an enum like this
this macro lets you simply write this:
// Use an alias to give the enum case a custom name.
// By default, the associated type name is used.
type Int = i32;
pub type MyTypes = String + Int;
It also can generate From-implementations for subsets:
use type_union;
type SuperSet = String + TypeB + TypeC;
type SubSet = String + TypeB;
As the name of the generated enum case is automatically derived from the given type names, only identifiers are allowed as members of a type union. To work around this, you can create a type alias:
type ArcStr = ;
type IntVec = ;
type Types = ArcStr + IntVec;