#derive #enums #primitive #complex #macro

macro primitive-enum-derive

macros for get primitive enum from complex

4 releases (2 breaking)

0.3.1 Mar 19, 2024
0.3.0 Jun 10, 2023
0.2.0 Mar 16, 2023
0.1.0 Aug 15, 2022

#878 in Procedural macros


Used in primitive-from-enum

MIT/Apache

9KB
159 lines

Macros for get primitive enum from complex

examples:

#[derive(PrimitiveFromEnum)]
#[coming(primitive = "Primitive")]
enum Complex {
    A(String),
    B(u32),
    C
}
#[derive(FromU8)]
enum Primitive {
    A,
    B,
    C,
}

Dependencies

~260–710KB
~17K SLoC