Embedded spatio-temporal database with 2D/3D indexing, persistence, and lazy TTL support.
Features
- Spatial indexing: 2D/3D points, polygons, bounding boxes with R*-tree spatial indexing
- Persistence: Append-only file (AOF) with configurable sync policies
- Lazy TTL: Expired items are filtered on read, manual cleanup available
- Atomic batches: Group multiple operations atomically
- Temporal queries: Filter by creation time (with
time-indexfeature)
TTL Behavior
TTL is passive/lazy:
- Expired items return
Noneonget()and are skipped in queries - Items remain in storage until overwritten or manually cleaned with
cleanup_expired() - No automatic background cleanup or deletion on insert
use ;
use Duration;
let mut db = memory?;
db.insert?;
// TTL example (lazy expiration)
let opts = with_ttl;
db.insert?;
// Spatial example
let point = new;
db.insert_point?;
let nearby = db.query_within_radius?;
// Manual cleanup of expired items
let removed = db.cleanup_expired?;
# Ok::