enutil_macros

Crates.ioenutil_macros
lib.rsenutil_macros
version0.1.0
sourcesrc
created_at2024-02-06 15:06:08.213909
updated_at2024-02-06 15:06:08.213909
descriptionGeneral Enum Utility Macros
homepagehttps://github.com/Syndelis/enutil
repositoryhttps://github.com/Syndelis/enutil
max_upload_size
id1129008
size12,172
Brenno Lemos (Syndelis)

documentation

README

Enum Utility Macros

Enutil includes general utility macros for dealing with enumerators in Rust. The main objective of this crate is to provide macros that reduce boilerplate and/or repetition of (un)commonly seen patterns associated to enumerators in Rust.

Macro Cheatsheet

Macro Description
EnumDeref Implements Deref and DeretMut for a new-type enum based on a common Target

Using enutil

Simply include it in your Cargo.toml with the derive feature.

  • Via Cargo's CLI:

    $ cargo add enutil --features=derive
    
  • Manually:

    # Cargo.toml
    [dependencies]
    enutil = { version = "<type latest version here>", features = ["derive"] }
    

Acknowledgements

This crate's structure and organization has been largely inspired by that seen in Strum. Checkout that crate for other interesting and useful macros.

Why 'enutil'?

It joins the words "Enum" and "Utility", while also sounding like the word "inĂștil", which is portuguese for "useless".

Commit count: 0

cargo fmt