Crates.io | enum_macros |
lib.rs | enum_macros |
version | 0.0.3 |
source | src |
created_at | 2024-07-28 21:26:39.979369 |
updated_at | 2024-10-11 10:07:17.196214 |
description | A collection of useful macros to make working with enums easier. |
homepage | |
repository | https://github.com/cyrgani/enum_macros |
max_upload_size | |
id | 1318263 |
size | 62,165 |
A collection of useful macros to make working with enums easier.
The current set of macros is not fixed yet. More macros will likely be added or removed in the future.
Each macro can be enabled and disabled individually by its respective Cargo feature if it is not wanted. By default, all are enabled.
custom_discriminant
: allows using arbitrary values as discriminants and converting from and to themmarker_type
: creates a copy of an enum where no field holds dataNextVariant
: allows moving forward through the variants of an enumVariantAmount
: adds a constant storing the amount of variants the enum hasUnwrapVariant
: adds methods for unwrapping variants of an enumno_std
compabilityThe crate is fully #![no_std]
compatible at the moment.
Future versions may introduce a subset of features that require std
under a new std
crate feature.