Bytenum is a rust derive macro that creates a try_from<T>
implementation for an enum with only unit variants.
T
must be an unsigned numeric type such as u8
, u16
, or u32
.
Add this to your Cargo.toml
:
toml
bytenum = "0.1.3"
Example:
```rust use bytenum::Bytenum;
enum Color { Red, Green, Blue, }
fn convertvariants() -> Result<(), Box