pub trait ReprEnum: Sized + Into<Self::Repr> {
type Repr: TryInto<Self> + Number;
type FlagsRepr: Shl<Self::Repr, Output = Self::FlagsRepr> + Number + Shift<Self::Repr> + Shift<u32>;
}
Expand description
A trait indicating a type is a enum and can be made into an enum set.
Repr
The integer representation of the enum.
Requires into
casting from the enum and try_into
casting to the enum.
Use num_enum
to generate these implementations.
FlagsRepr
The flags representation of the enum,
this should usually be a larger type like u64
or u128
.
Currently signed numbers are allowed but negative signed numbers are not supported.