#bit-fields #buffer #set-bit #sparse #series #allocate

sparse-bitfield

Bitfield that allocates a series of small buffers

20 releases (10 breaking)

0.11.0 Feb 19, 2020
0.10.0 Sep 7, 2019
0.9.0 Sep 7, 2019
0.8.1 Sep 3, 2018
0.1.3 Mar 29, 2018

#342 in Memory management

Download history 41/week @ 2024-11-13 13/week @ 2024-11-20 1/week @ 2024-11-27 3/week @ 2024-12-04 7/week @ 2024-12-11 208/week @ 2025-02-05 8/week @ 2025-02-12 14/week @ 2025-02-19 3/week @ 2025-02-26

233 downloads per month
Used in tree-index

MIT/Apache

15KB
176 lines

sparse-bitfield

crates.io version build status downloads docs.rs docs

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

MIT OR Apache-2.0

Dependencies

~15KB