xgillard / smallbitset

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
	
}

About

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

License:MIT License


Languages

Language:Rust 100.0%