#enums #ordinal #numbers #proc-macro #ordinalize

macro no-std enum-ordinalize-derive

This crate provides a procedural macro that enables enums to not only obtain the ordinal values of their variants but also allows for the construction of enums from an ordinal value

14 stable releases

4.3.1 Dec 15, 2023
4.2.9 Dec 15, 2023
4.2.4 Nov 30, 2023

#9 in #ordinal

Download history 6211/week @ 2023-12-23 6723/week @ 2023-12-30 8384/week @ 2024-01-06 9109/week @ 2024-01-13 8791/week @ 2024-01-20 10013/week @ 2024-01-27 8996/week @ 2024-02-03 5395/week @ 2024-02-10 9070/week @ 2024-02-17 9720/week @ 2024-02-24 9351/week @ 2024-03-02 9664/week @ 2024-03-09 10429/week @ 2024-03-16 9930/week @ 2024-03-23 10397/week @ 2024-03-30 10003/week @ 2024-04-06

42,632 downloads per month
Used in 120 crates (2 directly)

MIT license

46KB
1K SLoC

Enum Ordinalize Derive

CI

This crate provides a procedural macro that enables enums to not only obtain the ordinal values of their variants but also allows for the construction of enums from an ordinal value.

See the enum-ordinalize crate.

Crates.io

https://crates.io/crates/enum-ordinalize

Documentation

https://docs.rs/enum-ordinalize

License

MIT


lib.rs:

Enum Ordinalize Derive

This library enables enums to not only obtain the ordinal values of their variants but also allows for the construction of enums from an ordinal value. See the enum-ordinalize crate.

Dependencies

~315–770KB
~18K SLoC