enum_data_proc 0.1.0

a proc-macro,Add bit operations and arithmetic operations to enum
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 10.97 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 289.43 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • aenu

enum_data_proc

Add bit operations and arithmetic operations to enum

example

use enum_data_proc::*;

#[repr(u32)]
#[derive(BitOp,ArithOp)]
enum A{
    a=7,b,c,d,e,f,
}

fn main() {
    println!("{:?}",[
        A::a+1,
        A::b<<1,
        1&A::c,
        A::d|A::d,
        A::e%2,
        2*A::f]
    );
}