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 ToolExecutionContextwhere
*const ArcInner<TreeNode> is !null: Freeze,
PhantomData<ArcInner<TreeNode>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<WorkspacePatchChangeEvidence>: Freeze,
*const ArcInner<Chan<ProcessOutputChunk, Semaphore>> is !null: Freeze,
PhantomData<ArcInner<Chan<ProcessOutputChunk, Semaphore>>>: Freeze,
impl Move for ToolExecutionContext
impl RefUnwindSafe for ToolExecutionContextwhere
CancellationToken: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
Chan<ProcessOutputChunk, Semaphore>: RefUnwindSafe,
impl Send for ToolExecutionContext
impl Sync for ToolExecutionContext
impl Unpin for ToolExecutionContext
impl UnsafeUnpin for ToolExecutionContextwhere
*const ArcInner<TreeNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<TreeNode>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<WorkspacePatchChangeEvidence>: UnsafeUnpin,
*const ArcInner<Chan<ProcessOutputChunk, Semaphore>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Chan<ProcessOutputChunk, Semaphore>>>: UnsafeUnpin,
impl UnwindSafe for ToolExecutionContextwhere
CancellationToken: UnwindSafe,
RawVecInner: UnwindSafe,
Arc<Chan<ProcessOutputChunk, Semaphore>>: UnwindSafe,
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