pub trait StorageBackend: Send + Sync {
// Required methods
fn get(
&self,
entity_id: u64,
space_id: u32,
timestamp: i64,
) -> Result<Option<TemporalPoint>, StorageError>;
fn put(
&self,
space_id: u32,
point: &TemporalPoint,
) -> Result<(), StorageError>;
fn range(
&self,
entity_id: u64,
space_id: u32,
start: i64,
end: i64,
) -> Result<Vec<TemporalPoint>, StorageError>;
fn delete(
&self,
entity_id: u64,
space_id: u32,
timestamp: i64,
) -> Result<(), StorageError>;
}Expand description
Persistent storage backend for temporal points.
Abstracts over the underlying storage engine (in-memory, RocksDB, etc.).
Required Methods§
Sourcefn get(
&self,
entity_id: u64,
space_id: u32,
timestamp: i64,
) -> Result<Option<TemporalPoint>, StorageError>
fn get( &self, entity_id: u64, space_id: u32, timestamp: i64, ) -> Result<Option<TemporalPoint>, StorageError>
Retrieve a single point by entity, space, and timestamp.
Sourcefn put(&self, space_id: u32, point: &TemporalPoint) -> Result<(), StorageError>
fn put(&self, space_id: u32, point: &TemporalPoint) -> Result<(), StorageError>
Store a temporal point.
Sourcefn range(
&self,
entity_id: u64,
space_id: u32,
start: i64,
end: i64,
) -> Result<Vec<TemporalPoint>, StorageError>
fn range( &self, entity_id: u64, space_id: u32, start: i64, end: i64, ) -> Result<Vec<TemporalPoint>, StorageError>
Retrieve all points for an entity in a time range, ordered by timestamp.