| Crates.io | light_bitmap |
| lib.rs | light_bitmap |
| version | 0.1.0 |
| created_at | 2025-04-08 11:27:09.937447+00 |
| updated_at | 2025-04-08 11:27:09.937447+00 |
| description | A minimal, fixed-size bitmap library written in pure Rust. |
| homepage | |
| repository | https://github.com/bachmannscode/light-bitmap |
| max_upload_size | |
| id | 1625366 |
| size | 84,494 |
A minimal, fixed-size bitmap library written in pure Rust.
no_std, no heap / alloc, no unsafe — just core.
Designed for use in embedded and resource-constrained environments.
[BitMap] is the main struct in this library. Its features
are listed below.
use light_bitmap::{bucket_count, BitMap};
const BIT_COUNT: usize = 10;
let mut bitmap = BitMap::<BIT_COUNT, { bucket_count(BIT_COUNT) }>::new();
assert_eq!(bitmap.popcount(), 0);
assert!(!bitmap.is_set(3));
bitmap.set(3);
assert!(bitmap.is_set(3));
assert_eq!(bitmap.popcount(), 1);
#![no_std] compatibleBitMap<const BIT_COUNT, const BUCKET_COUNT>iter() (all bits as bools)iter_ones() (indices of set bits)iter_zeros() (indices of unset bits)&, |, ^, !<<, >>&=, |=, ^=, <<=, >>=set_range, unset_rangepopcount, first_set_bitrotate_left, rotate_rightMIT licensed. Maintained with love for bitwise enthusiasts.