surjective-enum
Rust macro to derive a surjective mapping from enum representation to enum.
Derive a surjective ::core::convert::From conversion function which maps all values which are not part of the enumeration to the last enum discriminant.
The example
use From;
will create a from(u8) -> Enum conversion function which maps 0 -> Bar, 1 -> Foo and all other values to Rest.