#ordinal #enums #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

#15 in #ordinal

Download history 126841/week @ 2024-09-01 160024/week @ 2024-09-08 136888/week @ 2024-09-15 172036/week @ 2024-09-22 164203/week @ 2024-09-29 210697/week @ 2024-10-06 178224/week @ 2024-10-13 194071/week @ 2024-10-20 208807/week @ 2024-10-27 208553/week @ 2024-11-03 212206/week @ 2024-11-10 185371/week @ 2024-11-17 130262/week @ 2024-11-24 133967/week @ 2024-12-01 244455/week @ 2024-12-08 181443/week @ 2024-12-15

698,157 downloads per month
Used in 337 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

~230–680KB
~16K SLoC