#allocation-free #integer-value #bitset #small-values

no-std smallbitset

This crate provides a series of allocation free sets capable of holding small integer values

10 releases (6 breaking)

0.7.1 May 11, 2023
0.7.0 May 11, 2023
0.6.1 Jan 26, 2023
0.5.1 Dec 13, 2021
0.1.0 Feb 4, 2021

#509 in Data structures

Download history 1156/week @ 2024-07-24 1001/week @ 2024-07-31 1319/week @ 2024-08-07 1853/week @ 2024-08-14 1268/week @ 2024-08-21 1969/week @ 2024-08-28 1338/week @ 2024-09-04 830/week @ 2024-09-11 1260/week @ 2024-09-18 1661/week @ 2024-09-25 616/week @ 2024-10-02 1413/week @ 2024-10-09 1620/week @ 2024-10-16 1207/week @ 2024-10-23 1034/week @ 2024-10-30 696/week @ 2024-11-06

4,868 downloads per month
Used in ddo

MIT license

57KB
1K SLoC

smallbitset

Crates.io Documentation Build Tests codecov Quality GitHub

This crate provides a series of allocation free integers set capable of holding small integer values.

Usage

In your Cargo.toml, you should add the following line to your dependencies section.

[dependencies]
smallbitset = "0.6.0"

Then in your main code, you will simply use one of the available collections as shown below:

use smallbitset::Set32;

fn main() {
	let mut x = Set32::empty();

	x = x.insert(1);
	assert_eq!(Set32::singleton(1), x);
	assert!(x.contains(1));
	
	// and so on ... check the online documentation for the complete api details
	
}

Dependencies

~150KB