#enums #primitive #macro #complex #string #derive #u32

no-std primitive-from-enum

macros for get primitive enum from complex

6 releases

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

#607 in Rust patterns

Download history 6/week @ 2024-07-24 1/week @ 2024-07-31 2/week @ 2024-09-18 2/week @ 2024-09-25

233 downloads per month

MIT/Apache

5KB

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