Derive Macro integral_enum::IntegralEnum
source · #[derive(IntegralEnum)]
{
// Attributes available to this derive:
#[no_clone]
#[no_copy]
#[no_display]
#[no_debug]
#[no_total_eq]
}
Expand description
Macro that implements bunch of traits for enums that simply are aliases for integer type
example:
#[derive(IntegralEnum)]
#[repr(u8)]
pub enum Yuu {
// explicit discriminant is required
Hatred = 0,
Pain = 1,
}Macro will automatically generate such trait implementations: Clone, Copy, PartialEq, Eq, Debug, Display, TryFrom