Crate fake_enum[][src]

Expand description

Support for fake enum types, that act like rust enums, but all values of the underlying type are accepted as values. See the macro fake_enum for details.


Constructs a “Fake Enum”, that acts like a rust enum with unit variants, but can accept invalid (undefined) variants without undefined behaviour. The enum derives Copy, Clone, Eq, and PartialEq. Additionally, it implements Debug, where all valid variants are printed as defined, and invalid variants are formatted as name(value). Any other derives can be added following the repr. Two forms of this macro is provided. enum name declares an enum named “name”. All the variants are declared with the same visibility as the type in the enclosing module. enum struct name declares an scoped enum named “name”. The variants are declared pub within “name”.