variants-macros

Crates.iovariants-macros
lib.rsvariants-macros
version0.0.1
created_at2025-08-26 00:28:53.606102+00
updated_at2025-08-26 00:28:53.606102+00
descriptionprocedural macros supporting the variants crate
homepagehttps://github.com/FL03/variants/wiki
repositoryhttps://github.com/FL03/variants.git
max_upload_size
id1810333
size6,051
Joe McCain III (FL03)

documentation

README

variants

license crates.io docs.rs


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.

Features

  • VariantConstructor - A derive macro for generating functional constructors for enum variants

Getting Started

Building from the source

Start by cloning the repository

git clone https://github.com/FL03/variants.git
cd variants

Building the project

cargo build --all-features -r -v --workspace

Running tests

cargo test --all-features -r -v --workspace

Usage

Add this to your Cargo.toml:

[dependencies.variants]
features = []
version = "0.1.0"

Examples

Basic Usage

    extern crate variants;

    fn main() -> Result<(), Box<dyn std::error::Error>> {
        tracing_subscriber::fmt::init();
        tracing::info!("Welcome to {name}", name = variants);


        Ok(())
    }

Contributing

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.

Commit count: 0

cargo fmt