pub struct ToolExecutionContext { /* private fields */ }Expand description
Context passed to a tool executor.
The context is intentionally small for the MVP: cancellation is cooperative
and runtime state mutation stays owned by crate::Runtime::execute_tool_call.
Implementations§
Source§impl ToolExecutionContext
impl ToolExecutionContext
Sourcepub fn new(cancellation_token: CancellationToken) -> Self
pub fn new(cancellation_token: CancellationToken) -> Self
Creates a tool execution context with the provided cancellation token.
Sourcepub fn cancellation_token(&self) -> &CancellationToken
pub fn cancellation_token(&self) -> &CancellationToken
Returns the cancellation token for this tool execution.
Executors should check this token at cancellation points and return
ToolExecutionError::Cancelled when no durable result was produced.
Sourcepub fn approved_apply_patch(&self) -> Option<&WorkspacePatchProposal>
pub fn approved_apply_patch(&self) -> Option<&WorkspacePatchProposal>
Borrows the approved workspace patch proposal for this execution.
This is executor-internal runtime state. It is never rendered into provider-visible tool specs, tool result artifacts, or continuations.
Trait Implementations§
Source§impl Clone for ToolExecutionContext
impl Clone for ToolExecutionContext
Source§impl Debug for ToolExecutionContext
impl Debug for ToolExecutionContext
Auto Trait Implementations§
impl Forget for ToolExecutionContext
impl Freeze for ToolExecutionContext
impl Move for ToolExecutionContext
impl RefUnwindSafe for ToolExecutionContext
impl Send for ToolExecutionContext
impl Sync for ToolExecutionContext
impl Unpin for ToolExecutionContext
impl UnsafeUnpin for ToolExecutionContext
impl UnwindSafe for ToolExecutionContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more