pub struct ToolExecutor<H: ApprovalHandler = AutoApproveHandler> { /* private fields */ }Expand description
Parallel tool executor with approval support
Implementations§
Source§impl<H: ApprovalHandler + 'static> ToolExecutor<H>
impl<H: ApprovalHandler + 'static> ToolExecutor<H>
Sourcepub fn with_approval_handler(config: ExecutorConfig, handler: H) -> Self
pub fn with_approval_handler(config: ExecutorConfig, handler: H) -> Self
Create executor with custom approval handler
Create executor with shared approval handler
Sourcepub fn with_scope_guard(self, guard: ScopeGuard) -> Self
pub fn with_scope_guard(self, guard: ScopeGuard) -> Self
Attach a scope guard to this executor.
Returns a new executor (immutable pattern) with the scope guard set.
Sourcepub fn with_trace(self, trace: Arc<ExecutionTrace>) -> Self
pub fn with_trace(self, trace: Arc<ExecutionTrace>) -> Self
Attach an execution trace collector.
Returns a new executor (immutable pattern) with the trace set.
Sourcepub async fn execute_tools(
&self,
tool_calls: &[ToolCall],
registry: &Arc<ToolRegistry>,
agent_id: &AgentId,
) -> Vec<ToolResult>
pub async fn execute_tools( &self, tool_calls: &[ToolCall], registry: &Arc<ToolRegistry>, agent_id: &AgentId, ) -> Vec<ToolResult>
Execute multiple tools in parallel with approval checks
Sourcepub async fn execute_tools_with_outcomes(
&self,
tool_calls: &[ToolCall],
registry: &Arc<ToolRegistry>,
agent_id: &AgentId,
) -> Vec<ExecutionOutcome>
pub async fn execute_tools_with_outcomes( &self, tool_calls: &[ToolCall], registry: &Arc<ToolRegistry>, agent_id: &AgentId, ) -> Vec<ExecutionOutcome>
Execute tools and return detailed outcomes
Trait Implementations§
Source§impl<H: ApprovalHandler + Clone> Clone for ToolExecutor<H>
impl<H: ApprovalHandler + Clone> Clone for ToolExecutor<H>
Auto Trait Implementations§
impl<H> Freeze for ToolExecutor<H>
impl<H> RefUnwindSafe for ToolExecutor<H>where
H: RefUnwindSafe,
impl<H> Send for ToolExecutor<H>
impl<H> Sync for ToolExecutor<H>
impl<H> Unpin for ToolExecutor<H>
impl<H> UnsafeUnpin for ToolExecutor<H>
impl<H> UnwindSafe for ToolExecutor<H>where
H: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more