Expand description
Indexing module for RustLite.
This module provides B-Tree and Hash index implementations for efficient data retrieval.
§Index Types
- B-Tree Index: Ordered index supporting range queries and prefix scans
- Hash Index: Fast O(1) exact-match lookups
§Example
use rustlite_core::index::{BTreeIndex, HashIndex, Index};
// B-Tree index for ordered access
let mut btree = BTreeIndex::new();
btree.insert(b"user:001", 100).unwrap();
btree.insert(b"user:002", 200).unwrap();
// Range query
let range = btree.range(b"user:001", b"user:999").unwrap();
// Hash index for fast lookups
let mut hash = HashIndex::new();
hash.insert(b"session:abc", 500).unwrap();
assert_eq!(hash.find(b"session:abc").unwrap(), vec![500]);Structs§
- BTree
Index - B-Tree based index for ordered key lookups and range queries.
- Hash
Index - Hash-based index for fast O(1) exact-match lookups.
- Index
Info - Information about an index.
- Index
Manager - Manages multiple indexes for a database.
Enums§
- Index
Type - Index type enumeration
Traits§
- Index
- Index trait defining the common interface for all index types