scv 0.1.2

A Rust procedural macro
Documentation

scv

A Rust procedural macro that enables bitwise operations on enums.

Installation

Add this to your Cargo.toml:

[dependencies]
scv = "0.1.0"

Usage

Use the #[derive(scv)] attribute on enums to enable bitwise operations:

use scv::scv;
use std::ops::BitOr;

#[derive(scv)]
enum Permission {
    Read = 0x110,
    Write = 0x101,
    Exec = 0x001,
}

fn main() {
    let x = Permission::Read | Permission::Write;
    println!("{}", x);
}

License

This project is licensed under MIT OR Apache-2.0.