Attribute Macro neli::neli_enum

source ·
#[neli_enum]
Expand description

Converts an enum from the form:

use neli_proc_macros::neli_enum;

#[neli_enum(serialized_type = "u16")]
pub enum MyConstants {
    ConstOne = 1,
    ConstTwo = 2,
    ConstThree = 3,
}

to:

pub enum MyConstants {
    ConstOne,
    ConstTwo,
    ConstThree,
}

with From implemented reflexively for MyConstants and u16.