Skip to main content

RunContextImpl

Struct RunContextImpl 

Source
pub struct RunContextImpl {
    pub session: SessionContextImpl,
    pub run_id: RunId,
    pub cancel: CancellationToken,
    pub deadline: Option<Instant>,
    pub sink: EventSink,
    pub budget: RunBudget,
}
Expand description

Run-level context with cancellation, deadline, event sink, and budget.

Fields§

§session: SessionContextImpl

The underlying session context.

§run_id: RunId

The unique run identifier.

§cancel: CancellationToken

Cancellation token for cooperative cancellation.

§deadline: Option<Instant>

Deadline for this run, if any.

§sink: EventSink

Event sink for emitting structured events.

§budget: RunBudget

Token budget tracker.

Trait Implementations§

Source§

impl Debug for RunContextImpl

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ReadonlyContext for RunContextImpl

Source§

fn invocation_id(&self) -> &str

Returns the unique invocation identifier for this run.
Source§

fn session_id(&self) -> &str

Returns the session identifier.
Source§

fn user_id(&self) -> &str

Returns the authenticated user identifier.
Source§

fn app_name(&self) -> &str

Returns the application name.
Source§

impl RunContext for RunContextImpl

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.
Source§

impl SessionContext for RunContextImpl

Source§

fn session_state(&self) -> &SessionState

Returns the current session state (key-value store scoped to the session).
Source§

fn session_state_mut(&mut self) -> &mut SessionState

Returns mutable access to session state.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.