Skip to main content

RunControlStore

Trait RunControlStore 

Source
pub trait RunControlStore: Send + Sync {
    // Required methods
    fn status(&self, run_id: &RunId) -> Result<RunStatus, AgentError>;
    fn terminal_result(
        &self,
        run_id: &RunId,
    ) -> Result<Option<RunResult>, AgentError>;
    fn request_cancel(&self, run_id: &RunId) -> Result<(), AgentError>;
}
Expand description

Port or behavior contract for run control store. Implementors should preserve policy, redaction, idempotency, and replay expectations from the surrounding module. Implementations may perform side effects only as described by the trait methods.

Required Methods§

Source

fn status(&self, run_id: &RunId) -> Result<RunStatus, AgentError>

Returns the status currently held by this value. This reads run-control status for the handle and does not change the run.

Source

fn terminal_result( &self, run_id: &RunId, ) -> Result<Option<RunResult>, AgentError>

Returns terminal result for callers that need to inspect the contract state. Implementations read terminal result state for the run and do not change run status.

Source

fn request_cancel(&self, run_id: &RunId) -> Result<(), AgentError>

Requests cancellation for a registered run. Implementations may mutate run-control state to record the request; provider/tool cleanup remains owned by the run coordinator that observes the cancellation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§