pub trait CheckpointStorage: Send + Sync {
// Required methods
fn save_checkpoint(
&self,
execution_id: ExecutionId,
checkpoint: &ExecutionCheckpoint,
) -> Result<CheckpointId, CheckpointError>;
fn load_latest_checkpoint(
&self,
execution_id: ExecutionId,
) -> Result<Option<ExecutionCheckpoint>, CheckpointError>;
fn load_checkpoint(
&self,
checkpoint_id: CheckpointId,
) -> Result<Option<ExecutionCheckpoint>, CheckpointError>;
fn list_checkpoints(
&self,
execution_id: ExecutionId,
) -> Result<Vec<CheckpointMetadata>, CheckpointError>;
fn prune_checkpoints(
&self,
execution_id: ExecutionId,
keep_count: usize,
) -> Result<usize, CheckpointError>;
fn delete_checkpoints(
&self,
execution_id: ExecutionId,
) -> Result<usize, CheckpointError>;
}Expand description
Storage abstraction for checkpoints
Required Methods§
Sourcefn save_checkpoint(
&self,
execution_id: ExecutionId,
checkpoint: &ExecutionCheckpoint,
) -> Result<CheckpointId, CheckpointError>
fn save_checkpoint( &self, execution_id: ExecutionId, checkpoint: &ExecutionCheckpoint, ) -> Result<CheckpointId, CheckpointError>
Save a checkpoint
Sourcefn load_latest_checkpoint(
&self,
execution_id: ExecutionId,
) -> Result<Option<ExecutionCheckpoint>, CheckpointError>
fn load_latest_checkpoint( &self, execution_id: ExecutionId, ) -> Result<Option<ExecutionCheckpoint>, CheckpointError>
Load the latest checkpoint for an execution
Sourcefn load_checkpoint(
&self,
checkpoint_id: CheckpointId,
) -> Result<Option<ExecutionCheckpoint>, CheckpointError>
fn load_checkpoint( &self, checkpoint_id: CheckpointId, ) -> Result<Option<ExecutionCheckpoint>, CheckpointError>
Load a specific checkpoint by ID
Sourcefn list_checkpoints(
&self,
execution_id: ExecutionId,
) -> Result<Vec<CheckpointMetadata>, CheckpointError>
fn list_checkpoints( &self, execution_id: ExecutionId, ) -> Result<Vec<CheckpointMetadata>, CheckpointError>
List all checkpoints for an execution
Sourcefn prune_checkpoints(
&self,
execution_id: ExecutionId,
keep_count: usize,
) -> Result<usize, CheckpointError>
fn prune_checkpoints( &self, execution_id: ExecutionId, keep_count: usize, ) -> Result<usize, CheckpointError>
Delete old checkpoints beyond retention limit
Sourcefn delete_checkpoints(
&self,
execution_id: ExecutionId,
) -> Result<usize, CheckpointError>
fn delete_checkpoints( &self, execution_id: ExecutionId, ) -> Result<usize, CheckpointError>
Delete all checkpoints for an execution