Skip to main content

RunControl

Trait RunControl 

Source
pub trait RunControl: Send + Sync {
    // Required methods
    fn cancel(&self) -> Result<(), HarnessError>;
    fn was_cancelled(&self) -> bool;
}
Expand description

Object-safe handle to an in-flight run. A process-backed harness cancels by signalling its child; a request-backed harness (a hosted LLM API) cancels by aborting its HTTP stream. The consumer only needs these two operations, so the concrete mechanism stays behind the trait.

Required Methods§

Source

fn cancel(&self) -> Result<(), HarnessError>

Stop the run. Best-effort; idempotent.

Source

fn was_cancelled(&self) -> bool

Whether cancel was called.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§