A Rust macro to generate structures which behave like a set of bitflags
Add this to your Cargo.toml
:
[dependencies]
bitflags = "0.8"
and this to your crate root:
#[macro_use]
extern crate bitflags;
u128
and i128
are supported just like any other integer type.
#![feature(i128_type)]
#[macro_use]
extern crate bitflags;
bitflags! {
flags Flags128: u128 {
const A = 0x0000_0000_0000_0000_0000_0000_0000_0001,
const B = 0x0000_0000_0000_1000_0000_0000_0000_0000,
const C = 0x8000_0000_0000_0000_0000_0000_0000_0000,
const ABC = A.bits | B.bits | C.bits,
}
}