#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

#15 in #ordinal

Download history 97965/week @ 2024-07-04 99714/week @ 2024-07-11 98031/week @ 2024-07-18 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 151246/week @ 2024-10-17

731,591 downloads per month
Used in 219 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

~1.5MB
~42K SLoC