#enums #primitive #complex #macro #derive

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

#954 in Procedural macros

Download history 9/week @ 2024-07-25 2/week @ 2024-08-01 1/week @ 2024-09-12 7/week @ 2024-09-19 3/week @ 2024-09-26

171 downloads per month
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

~240–690KB
~16K SLoC