Trait StorageBackend

Source
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§

Source

fn get( &self, entity_id: u64, space_id: u32, timestamp: i64, ) -> Result<Option<TemporalPoint>, StorageError>

Retrieve a single point by entity, space, and timestamp.

Source

fn put(&self, space_id: u32, point: &TemporalPoint) -> Result<(), StorageError>

Store a temporal point.

Source

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.

Source

fn delete( &self, entity_id: u64, space_id: u32, timestamp: i64, ) -> Result<(), StorageError>

Delete a specific point.

Implementors§