splinter_rs/
lib.rs

1//! Splinter is a compressed bitmap format similar to [Roaring Bitmaps](https://roaringbitmap.org/), optimized specifically for small, sparse sets of 32-bit unsigned integers (`u32`).
2//!
3//! ## Key Features:
4//!
5//! - **Tree-based Encoding**: Splinter encodes `u32` values into a 256-way tree structure by decomposing integers into big-endian component bytes. Leaf nodes efficiently transition from byte lists to compact bitmaps at up to 32 values.
6//!
7//! - **Zero-copy Access**: Designed for efficient querying without deserialization, the `SplinterRef` type allows direct, zero-copy reads from any type implementing `AsRef<[u8]>`.
8
9use thiserror::Error;
10
11mod bitmap;
12mod block;
13mod index;
14pub mod ops;
15mod partition;
16mod relational;
17mod splinter;
18mod util;
19
20#[cfg(test)]
21mod testutil;
22
23pub use splinter::{SPLINTER_MAX_VALUE, Splinter, SplinterRef};
24
25type Segment = u8;
26
27#[derive(Debug, Error)]
28pub enum DecodeErr {
29    #[error("Unable to decode header")]
30    InvalidHeader,
31
32    #[error("Invalid magic number")]
33    InvalidMagic,
34
35    #[error("Unable to decode footer")]
36    InvalidFooter,
37}