pub struct ToolExecutor { /* private fields */ }Expand description
Handles tool execution with approval, undo, and result formatting.
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub async fn execute(
&mut self,
tool_call: &Value,
registry: &ToolRegistry,
context: &ToolContext,
) -> Result<ToolExecutionResult, ReplError>
pub async fn execute( &mut self, tool_call: &Value, registry: &ToolRegistry, context: &ToolContext, ) -> Result<ToolExecutionResult, ReplError>
Execute a single tool call.
Parses the tool call JSON, dispatches via the registry, and returns a formatted result.
Sourcepub async fn execute_batch(
&mut self,
tool_calls: &[Value],
registry: &ToolRegistry,
context: &ToolContext,
) -> Vec<Result<ToolExecutionResult, ReplError>>
pub async fn execute_batch( &mut self, tool_calls: &[Value], registry: &ToolRegistry, context: &ToolContext, ) -> Vec<Result<ToolExecutionResult, ReplError>>
Execute multiple tool calls, potentially in parallel for read-only tools.
Uses ParallelPolicy to partition tool calls into execution groups.
Read-only tools within the same group run concurrently via join_all.
Groups are executed in order to preserve write-after-read semantics.
Sourcepub fn format_result(result: &ToolExecutionResult) -> String
pub fn format_result(result: &ToolExecutionResult) -> String
Format a tool execution result for display.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolExecutor
impl RefUnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl UnsafeUnpin for ToolExecutor
impl UnwindSafe for ToolExecutor
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