num_enum
num_enum copied to clipboard
I'm using this library to help generate a binary protocol so there's lots of `repr(u8)`/`repr(u16)` going around. More often than not, the `try_from` input type is not a match for...
This example… ```rust use num_enum::FromPrimitive; #[derive(FromPrimitive)] #[repr(u8)] pub enum Number { Zero = 0, #[num_enum(catch_all)] Multiple(u8) = 2, One = 1, } ``` produces this compiler error: ``` error[E0308]: `match`...
# Motivation `num_enum` is very effective for manipulating data representations at runtime. However, there are some cases where we might want this functionality in `const` contexts, such as when generating...
Would it be possible for `MyEnum.into()` to be a **const** function? Then I could use it like this, for example with something like the `bitfield-struct` crate: ``` #[derive(Debug, IntoPrimitive)] #[repr(u16)]...