Skip to main content

CheckpointStorage

Trait CheckpointStorage 

Source
pub trait CheckpointStorage: Send + Sync {
    // Required methods
    fn store(&self, checkpoint: &TemporalCheckpoint) -> Result<()>;
    fn get(&self, id: CheckpointId) -> Result<TemporalCheckpoint>;
    fn get_latest(
        &self,
        session_id: SessionId,
    ) -> Result<Option<TemporalCheckpoint>>;
    fn list_by_session(
        &self,
        session_id: SessionId,
    ) -> Result<Vec<CheckpointSummary>>;
    fn list_by_tag(&self, tag: &str) -> Result<Vec<CheckpointSummary>>;
    fn delete(&self, id: CheckpointId) -> Result<()>;
    fn next_sequence(&self, session_id: SessionId) -> Result<u64>;
    fn get_max_sequence(&self) -> Result<u64>;
}
Expand description

Storage backend trait for checkpoints

Thread-safe version requires Send + Sync

Required Methods§

Source

fn store(&self, checkpoint: &TemporalCheckpoint) -> Result<()>

Store a checkpoint

Source

fn get(&self, id: CheckpointId) -> Result<TemporalCheckpoint>

Retrieve a checkpoint by ID

Source

fn get_latest( &self, session_id: SessionId, ) -> Result<Option<TemporalCheckpoint>>

Get the latest checkpoint for a session

Source

fn list_by_session( &self, session_id: SessionId, ) -> Result<Vec<CheckpointSummary>>

List all checkpoints for a session

Source

fn list_by_tag(&self, tag: &str) -> Result<Vec<CheckpointSummary>>

List checkpoints with a specific tag

Source

fn delete(&self, id: CheckpointId) -> Result<()>

Delete a checkpoint

Source

fn next_sequence(&self, session_id: SessionId) -> Result<u64>

Get the next sequence number for a session

Source

fn get_max_sequence(&self) -> Result<u64>

Get the maximum sequence number across all checkpoints

Implementors§