Skip to main content

Checkpointer

Trait Checkpointer 

Source
pub trait Checkpointer: Send + Sync {
    // Required method
    fn load(&self, thread_id: &str) -> Result<Option<Checkpoint>>;

    // Provided method
    fn list_threads(&self) -> Result<Vec<String>> { ... }
}
Expand description

Saves and loads graph state keyed by thread id.

Implementations can use in-memory storage, SQLite, Redis, etc.

Required Methods§

Source

fn load(&self, thread_id: &str) -> Result<Option<Checkpoint>>

Load the latest checkpoint for the thread, if any.

Provided Methods§

Source

fn list_threads(&self) -> Result<Vec<String>>

List all thread ids that have at least one checkpoint (optional).

Implementors§