Skip to main content

CheckpointSaver

Trait CheckpointSaver 

Source
pub trait CheckpointSaver: Send + Sync {
    // Required methods
    fn put(&self, checkpoint: Checkpoint) -> Result<(), CheckpointError>;
    fn get(
        &self,
        thread_id: &str,
        checkpoint_id: &str,
    ) -> Result<Option<Checkpoint>, CheckpointError>;
    fn list(&self, thread_id: &str) -> Result<Vec<Checkpoint>, CheckpointError>;
}

Required Methods§

Source

fn put(&self, checkpoint: Checkpoint) -> Result<(), CheckpointError>

Source

fn get( &self, thread_id: &str, checkpoint_id: &str, ) -> Result<Option<Checkpoint>, CheckpointError>

Source

fn list(&self, thread_id: &str) -> Result<Vec<Checkpoint>, CheckpointError>

Returns checkpoints for a thread.

Order is backend-defined and MUST NOT be relied on by callers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§