pipecircuit 0.0.24

Correct. Robust. Fast. Portable. Pick four.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core::num::NonZeroU32;
use pipecircuit::storage::warp_table::{Capacity, RangeQueryWorkspace, WarpTable, WarpTableRow};

#[derive(WarpTableRow)]
struct Row {
    #[index(range)]
    rank: u64,
}

fn main() {
    let mut table = WarpTable::<Row>::try_new(Capacity::new(NonZeroU32::MIN)).unwrap();
    let _inserted = table.insert(Row { rank: 1 });
    let mut words = [0];
    let mut workspace = RangeQueryWorkspace::new(&mut words);
    let selection = table.query().find_rank_in_with(.., &mut workspace).unwrap();
    let _inserted = table.insert(Row { rank: 2 });
    let _ = selection.rows().next();
}