#ordinal

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

#16 in #ordinal

Download history 107312/week @ 2024-07-25 99938/week @ 2024-08-01 126694/week @ 2024-08-08 135935/week @ 2024-08-15 133126/week @ 2024-08-22 125107/week @ 2024-08-29 151307/week @ 2024-09-05 151281/week @ 2024-09-12 162287/week @ 2024-09-19 161220/week @ 2024-09-26 195975/week @ 2024-10-03 184107/week @ 2024-10-10 186875/week @ 2024-10-17 217547/week @ 2024-10-24 190352/week @ 2024-10-31 212467/week @ 2024-11-07

843,454 downloads per month
Used in 274 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

~210–650KB
~15K SLoC