pub struct RunStore { /* private fields */ }Expand description
Persistence store for a single run.
Implementations§
Source§impl RunStore
impl RunStore
Sourcepub fn new(run_dir: &Path) -> Result<Arc<Self>, Error>
pub fn new(run_dir: &Path) -> Result<Arc<Self>, Error>
Create or open a run store at the given path.
Sourcepub fn upsert_agent_result(&self, cache: &AgentResultCache) -> Result<(), Error>
pub fn upsert_agent_result(&self, cache: &AgentResultCache) -> Result<(), Error>
Insert or update an agent result in the checkpoint directly. Used by JournalStore to persist cache_key_hash before appending the event.
Sourcepub fn init_run_with_meta(
&self,
run_id: RunId,
task: &str,
workflow_meta: Value,
) -> Result<(), Error>
pub fn init_run_with_meta( &self, run_id: RunId, task: &str, workflow_meta: Value, ) -> Result<(), Error>
Initialize a new run with declarative workflow metadata.
Sourcepub fn open_run(&self, _run_id: RunId) -> Result<Option<RunCheckpoint>, Error>
pub fn open_run(&self, _run_id: RunId) -> Result<Option<RunCheckpoint>, Error>
Open an existing run for resume.
Sourcepub fn append_event(&self, event: &AgentEvent) -> Result<(), Error>
pub fn append_event(&self, event: &AgentEvent) -> Result<(), Error>
Append an event to the log.
Sourcepub fn save_checkpoint(&self, checkpoint: &RunCheckpoint) -> Result<(), Error>
pub fn save_checkpoint(&self, checkpoint: &RunCheckpoint) -> Result<(), Error>
Save checkpoint to disk (public API, acquires lock).
Sourcepub fn get_checkpoint(&self) -> Option<RunCheckpoint>
pub fn get_checkpoint(&self) -> Option<RunCheckpoint>
Get current checkpoint.
Sourcepub fn get_agent_results(&self) -> HashMap<AgentId, AgentResultCache>
pub fn get_agent_results(&self) -> HashMap<AgentId, AgentResultCache>
Get cached agent results.
Sourcepub fn get_findings(&self) -> Vec<Finding>
pub fn get_findings(&self) -> Vec<Finding>
Get all findings collected so far.
Sourcepub fn get_event_log(&self) -> Result<Vec<AgentEvent>, Error>
pub fn get_event_log(&self) -> Result<Vec<AgentEvent>, Error>
Get event log as a vector.
Sourcepub fn can_resume(&self) -> bool
pub fn can_resume(&self) -> bool
Check if a run can be resumed.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RunStore
impl RefUnwindSafe for RunStore
impl Send for RunStore
impl Sync for RunStore
impl Unpin for RunStore
impl UnsafeUnpin for RunStore
impl UnwindSafe for RunStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more