pub trait CheckpointBackend:
Send
+ Sync
+ Debug {
Show 13 methods
// Required methods
fn init_run(&self, run_id: RunId, task: &str, run_dir: &str) -> Result<()>;
fn init_run_with_meta(
&self,
run_id: RunId,
task: &str,
run_dir: &str,
workflow_meta: Value,
) -> Result<()>;
fn open_run(&self, run_id: RunId) -> Result<Option<RunCheckpoint>>;
fn append_event(&self, event: &AgentEvent) -> Result<()>;
fn upsert_agent_result(&self, cache: &AgentResultCache) -> Result<()>;
fn upsert_agent_session(
&self,
session: &AgentSessionCheckpoint,
) -> Result<()>;
fn get_checkpoint(&self) -> Option<RunCheckpoint>;
fn get_findings(&self) -> Vec<Finding>;
fn get_event_log(&self) -> Result<Vec<AgentEvent>>;
fn can_resume(&self) -> bool;
fn reset_status_to_running(&self) -> Result<()>;
fn cancel(&self) -> Result<()>;
fn save_checkpoint(&self, checkpoint: &RunCheckpoint) -> Result<()>;
}Expand description
Persistence backend for a single run.
Implementations (e.g. SqliteCheckpointBackend in luft-storage)
provide checkpoint + event log storage. All methods are synchronous;
async backends bridge internally via block_in_place.
Required Methods§
Sourcefn init_run(&self, run_id: RunId, task: &str, run_dir: &str) -> Result<()>
fn init_run(&self, run_id: RunId, task: &str, run_dir: &str) -> Result<()>
Initialize a new run.
Sourcefn init_run_with_meta(
&self,
run_id: RunId,
task: &str,
run_dir: &str,
workflow_meta: Value,
) -> Result<()>
fn init_run_with_meta( &self, run_id: RunId, task: &str, run_dir: &str, workflow_meta: Value, ) -> Result<()>
Initialize a new run with declarative workflow metadata.
Sourcefn open_run(&self, run_id: RunId) -> Result<Option<RunCheckpoint>>
fn open_run(&self, run_id: RunId) -> Result<Option<RunCheckpoint>>
Open an existing run for resume. Returns None if not found.
Sourcefn append_event(&self, event: &AgentEvent) -> Result<()>
fn append_event(&self, event: &AgentEvent) -> Result<()>
Append an event to the log and update checkpoint state.
Sourcefn upsert_agent_result(&self, cache: &AgentResultCache) -> Result<()>
fn upsert_agent_result(&self, cache: &AgentResultCache) -> Result<()>
Insert or update an agent result.
Sourcefn upsert_agent_session(&self, session: &AgentSessionCheckpoint) -> Result<()>
fn upsert_agent_session(&self, session: &AgentSessionCheckpoint) -> Result<()>
Insert or update an agent session.
Sourcefn get_checkpoint(&self) -> Option<RunCheckpoint>
fn get_checkpoint(&self) -> Option<RunCheckpoint>
Get current checkpoint (from in-memory cache).
Sourcefn get_findings(&self) -> Vec<Finding>
fn get_findings(&self) -> Vec<Finding>
Get all findings.
Sourcefn get_event_log(&self) -> Result<Vec<AgentEvent>>
fn get_event_log(&self) -> Result<Vec<AgentEvent>>
Get event log as a vector.
Sourcefn can_resume(&self) -> bool
fn can_resume(&self) -> bool
Check if a run can be resumed.
Sourcefn reset_status_to_running(&self) -> Result<()>
fn reset_status_to_running(&self) -> Result<()>
Reset checkpoint status to Running.
Sourcefn save_checkpoint(&self, checkpoint: &RunCheckpoint) -> Result<()>
fn save_checkpoint(&self, checkpoint: &RunCheckpoint) -> Result<()>
Save checkpoint (full overwrite).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".