Skip to main content

CheckpointStore

Trait CheckpointStore 

Source
pub trait CheckpointStore: Send + Sync {
    // Required methods
    fn save_checkpoint(
        &self,
        checkpoint: Checkpoint,
    ) -> CheckpointFuture<'_, ()>;
    fn load_checkpoint(
        &self,
        id: &str,
    ) -> CheckpointFuture<'_, Option<Checkpoint>>;
    fn list_checkpoints(&self) -> CheckpointFuture<'_, Vec<String>>;
    fn delete_checkpoint(&self, id: &str) -> CheckpointFuture<'_, ()>;
}
Expand description

Async trait for persisting and loading agent checkpoints.

Implementations can back onto any storage: filesystem, database, cloud, etc.

Required Methods§

Source

fn save_checkpoint(&self, checkpoint: Checkpoint) -> CheckpointFuture<'_, ()>

Save a checkpoint. Overwrites any existing checkpoint with the same ID.

Source

fn load_checkpoint(&self, id: &str) -> CheckpointFuture<'_, Option<Checkpoint>>

Load a checkpoint by ID.

Source

fn list_checkpoints(&self) -> CheckpointFuture<'_, Vec<String>>

List all checkpoint IDs, most recent first.

Source

fn delete_checkpoint(&self, id: &str) -> CheckpointFuture<'_, ()>

Delete a checkpoint by ID.

Implementors§