| Crates.io | variants |
| lib.rs | variants |
| version | 0.0.1 |
| created_at | 2024-12-02 10:55:05.502321+00 |
| updated_at | 2025-08-26 00:29:21.855762+00 |
| description | Useful interfaces and macros for working with enums in Rust. |
| homepage | https://github.com/FL03/variants/wiki |
| repository | https://github.com/FL03/variants.git |
| max_upload_size | |
| id | 1468513 |
| size | 32,731 |
The variants crates provides a suite of abstractions, utilities, and prodedural macros to facilitate the creation and management of enums and their variants in Rust.
VariantConstructor - A derive macro for generating functional constructors for enum variantsStart by cloning the repository
git clone https://github.com/FL03/variants.git
cd variants
cargo build --all-features -r -v --workspace
cargo test --all-features -r -v --workspace
Add this to your Cargo.toml:
[dependencies.variants]
features = []
version = "0.1.0"
extern crate variants;
fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt::init();
tracing::info!("Welcome to {name}", name = variants);
Ok(())
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.