Crate sparse_bitfield [] [src]

sparse-bitfield

[crates.io version][2] [build status][4] [downloads][6] [docs.rs docs]8

Bitfield that allocates a series of small buffers. Adapted from mafintosh/sparse-bitfield.

Usage

extern crate sparse_bitfield;

use sparse_bitfield::Bitfield;

let mut bits = Bitfield::new(1024);
bits.set(0, true);            // set first bit
bits.set(1, true);            // set second bit
// bits.set(1_000_000, true); // set the millionth bit
assert!(bits.get(1));

Installation

$ cargo add sparse-bitfield

License

Apache-2.0

Structs

Bitfield

Bitfield instance.