pub struct ToolExecutionScope {
pub executor: Arc<dyn ToolExecutor>,
pub session_id: SessionId,
pub turn_id: TurnId,
pub permissions: Arc<dyn PermissionChecker>,
pub resources: Arc<dyn ToolResources>,
pub cancellation: Option<TurnCancellation>,
}Expand description
Owned scope for nested tool execution.
This is intentionally executor-centric: tools that compose other tools
must still go through the normal ToolExecutor path so lookup,
permissions, approval interrupts, and output truncation remain centralized.
Fields§
§executor: Arc<dyn ToolExecutor>§session_id: SessionId§turn_id: TurnId§permissions: Arc<dyn PermissionChecker>§resources: Arc<dyn ToolResources>§cancellation: Option<TurnCancellation>Implementations§
Source§impl ToolExecutionScope
impl ToolExecutionScope
Sourcepub fn nested_context(&self, metadata: MetadataMap) -> OwnedToolContext
pub fn nested_context(&self, metadata: MetadataMap) -> OwnedToolContext
Creates an owned tool context for a nested tool call.
Sourcepub async fn execute_child(&self, request: ToolRequest) -> ToolExecutionOutcome
pub async fn execute_child(&self, request: ToolRequest) -> ToolExecutionOutcome
Invokes a nested tool through the same executor and execution context.
Sourcepub async fn execute_approved_child(
&self,
request: ToolRequest,
approval: &ApprovalRequest,
) -> ToolExecutionOutcome
pub async fn execute_approved_child( &self, request: ToolRequest, approval: &ApprovalRequest, ) -> ToolExecutionOutcome
Invokes a nested tool after approval through the same executor and execution context.
Trait Implementations§
Source§impl Clone for ToolExecutionScope
impl Clone for ToolExecutionScope
Source§fn clone(&self) -> ToolExecutionScope
fn clone(&self) -> ToolExecutionScope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ToolExecutionScope
impl !UnwindSafe for ToolExecutionScope
impl Freeze for ToolExecutionScope
impl Send for ToolExecutionScope
impl Sync for ToolExecutionScope
impl Unpin for ToolExecutionScope
impl UnsafeUnpin for ToolExecutionScope
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