| Crates.io | variants-macros |
| lib.rs | variants-macros |
| version | 0.0.1 |
| created_at | 2025-08-26 00:28:53.606102+00 |
| updated_at | 2025-08-26 00:28:53.606102+00 |
| description | procedural macros supporting the variants crate |
| homepage | https://github.com/FL03/variants/wiki |
| repository | https://github.com/FL03/variants.git |
| max_upload_size | |
| id | 1810333 |
| size | 6,051 |
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.