$ bit-set

v0.9.1

A set of bits

Downloads: 211.7M
Recent: 39.3M
Versions: 13
Updated: March 12, 2026

Latest Update Summary

Crate

Name: bit-set New version: 0.9.0 Release date: 2026-03-10T12:56:36.545568Z

Crate readme

Short description A compact set of bits.

Long description An implementation of a set using a bit vector as an underlying representation for holding unsigned numerical elements. It should also be noted that the amount of storage necessary for holding a set of objects is proportional to the maximum of the objects when viewed as a usize.

Features • serde • serde_no_std • no_std

Code Examples Add to Cargo.toml

 [dependencies]
bit-set = "0.9"

Example usage of BitSet

 use bit_set::BitSet;

let mut s = BitSet::new();
s.insert(0);
s.insert(3);
s.insert(7);
s.remove(7);

if !s.contains(7) {
    println!("There is no 7");
}

let other = BitSet::from_bytes(&[0b11010000]);
s.union_with(&other);
for x in s.iter() {
    println!("{}", x);
}
let bv = s.into_bit_vec();
assert!(bv[3]);

Linkshttps://crates.io/crates/bit-sethttps://docs.rs/bit-set/0.9.0/bit_set/

https://docs.rs/bit-set/ https://api.github.com/repos/contain-rs/bit-set/releases/72659970

Release info

Release version:

Release description

Code Examples

Patch update: 0.9.0 → 0.9.1

$ DOWNLOADS TREND

152.2M211.7M

$ VERSION HISTORY

v0.9.1March 12, 2026
v0.9.0March 10, 2026
v0.8.0July 16, 2024

$ LINKS

$ INSTALL

cargo add bit-set

Or add to Cargo.toml: bit-set = "0.9.1"