| Crates.io | vsdb_slot_db |
| lib.rs | vsdb_slot_db |
| version | 5.0.0 |
| created_at | 2023-06-12 11:22:04.592528+00 |
| updated_at | 2025-08-11 04:13:44.131398+00 |
| description | A skip-list like index cache |
| homepage | https://github.com/rust-util-collections/vsdb |
| repository | https://github.com/rust-util-collections/vsdb |
| max_upload_size | |
| id | 888100 |
| size | 73,856 |
A skip-list like index cache.
A Skip List-like index cache, based on the powerful vsdb crate.
If you have a large key-value database and need high-performance pagination or data analysis, this crate could be a great tool for you.
Add this to your Cargo.toml:
[dependencies]
vsdb_slot_db = "4.0"
SlotDB is a skip-list-like index cache that can be used for high-performance pagination and data analysis.
use vsdb_slot_db::{SlotDB, Slot};
// Create a new SlotDB with a maximum of 16 entries per slot
let mut db: SlotDB<String> = SlotDB::new(16, false);
// Insert some data with slot numbers
db.insert(1, "data1".to_string()).unwrap();
db.insert(1, "data2".to_string()).unwrap();
db.insert(2, "data3".to_string()).unwrap();
// Get entries by page
let page1 = db.get_entries_by_page(10, 0, false);
assert_eq!(page1.len(), 3);
// Get entries by page with a specific slot range
let page2 = db.get_entries_by_page_slot(Some(1), Some(1), 10, 0, false);
assert_eq!(page2.len(), 2);
assert_eq!(page2[0], "data1");
assert_eq!(page2[1], "data2");
This project is licensed under the MIT license.