#integer-value #bitset #allocation-free #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

#257 in Data structures

Download history 4453/week @ 2023-12-08 4498/week @ 2023-12-15 5281/week @ 2023-12-22 4231/week @ 2023-12-29 5803/week @ 2024-01-05 5638/week @ 2024-01-12 6475/week @ 2024-01-19 6239/week @ 2024-01-26 6002/week @ 2024-02-02 1055/week @ 2024-02-09 2641/week @ 2024-02-16 5919/week @ 2024-02-23 4448/week @ 2024-03-01 4169/week @ 2024-03-08 5045/week @ 2024-03-15 3443/week @ 2024-03-22

18,156 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

~155KB