koivunej / bitflags

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bitflags

A Rust macro to generate structures which behave like a set of bitflags

Build Status

Documentation

Usage

Add this to your Cargo.toml:

[dependencies]
bitflags = "0.8"

and this to your crate root:

#[macro_use]
extern crate bitflags;

128-bit integer bitflags (nightly only)

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,
    }
}

About

License:Apache License 2.0


Languages

Language:Rust 100.0%