vsdb_slot_db-8.0.0 has been yanked.
vsdb_slot_db
A skip-list-like index for efficient, timestamp-based paged queries.
This crate provides SlotDB, a data structure that uses a tiered, skip-list-like index to enable fast pagination and range queries over large, ordered datasets. It is ideal for applications where data is associated with a "slot" (such as a timestamp or block number) and needs to be queried in pages.
Installation
Add this to your Cargo.toml:
[]
= "7.0.0"
Usage
SlotDB provides an efficient way to query large, ordered datasets in pages.
use SlotDB;
// Create a new SlotDB with a tier capacity of 10 and normal order.
let mut db = new;
// Insert some keys into different slots.
db.insert.unwrap;
db.insert.unwrap;
db.insert.unwrap;
db.insert.unwrap;
// Check the total number of entries.
assert_eq!;
// Get entries by page.
// Get the first page with a size of 2, in reverse order.
let entries = db.get_entries_by_page;
assert_eq!;
// Get entries within a slot range.
let entries_in_slot = db.get_entries_by_page_slot;
assert_eq!;
assert!;
assert!;
License
For API examples, see API Examples.
This project is licensed under the MIT license.