Skip to main content

RunContext

Trait RunContext 

Source
pub trait RunContext: SessionContext {
    // Required methods
    fn run_id(&self) -> &RunId;
    fn cancellation_token(&self) -> &CancellationToken;
    fn deadline(&self) -> Option<Instant>;
    fn event_sink(&self) -> &EventSink;
    fn budget(&self) -> &RunBudget;
}
Expand description

Context available during a single run invocation.

Extends SessionContext with run-level controls: cancellation, deadlines, event output, and token budget tracking.

Required Methods§

Source

fn run_id(&self) -> &RunId

Returns the unique run identifier.

Source

fn cancellation_token(&self) -> &CancellationToken

Returns a cancellation token for cooperative cancellation.

Source

fn deadline(&self) -> Option<Instant>

Returns the deadline for this run, if any.

Source

fn event_sink(&self) -> &EventSink

Returns the event sink for emitting structured events.

Source

fn budget(&self) -> &RunBudget

Returns the token budget tracker for this run.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§