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

15 stable releases

4.3.2 Oct 28, 2025
4.3.1 Dec 15, 2023
4.2.4 Nov 30, 2023

#20 in #ordinal

Download history 529306/week @ 2025-10-13 558013/week @ 2025-10-20 697803/week @ 2025-10-27 797490/week @ 2025-11-03 743831/week @ 2025-11-10 829551/week @ 2025-11-17 600626/week @ 2025-11-24 687393/week @ 2025-12-01 893348/week @ 2025-12-08 835428/week @ 2025-12-15 379708/week @ 2025-12-22 351515/week @ 2025-12-29 802024/week @ 2026-01-05 946323/week @ 2026-01-12 1045664/week @ 2026-01-19 999709/week @ 2026-01-26

3,827,840 downloads per month
Used in 2,260 crates (2 directly)

MIT license

46KB
1K SLoC

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.


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

Dependencies

~155–560KB
~13K SLoC