Skip to main content

ToolContextImpl

Struct ToolContextImpl 

Source
pub struct ToolContextImpl {
    pub run: RunContextImpl,
    pub tool_call: ToolCall,
}
Expand description

Tool execution context.

Fields§

§run: RunContextImpl

The underlying run context.

§tool_call: ToolCall

The tool call being executed.

Trait Implementations§

Source§

impl Debug for ToolContextImpl

Source§

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

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

impl ReadonlyContext for ToolContextImpl

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 ToolContextImpl

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 ToolContextImpl

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

impl ToolContext for ToolContextImpl

Source§

fn tool_call(&self) -> &ToolCall

Returns the tool call being executed.
Source§

fn emit_progress(&self, status: &str, data: Value)

Emits a progress update for the current tool execution. Read more
Source§

fn search_memory(&self, _query: &str, _limit: usize) -> Vec<MemoryEntry>

Searches long-term memory for context relevant to the current tool call. Read more

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.