pub struct ToolCallRuntime { /* private fields */ }Expand description
The parallel tool call runtime.
Wraps a ToolExecutor and adds concurrency control via RwLock.
Clone is cheap — all state is behind Arc.
Implementations§
Source§impl ToolCallRuntime
impl ToolCallRuntime
Sourcepub fn new(executor: Arc<dyn ToolExecutor>) -> Self
pub fn new(executor: Arc<dyn ToolExecutor>) -> Self
Create a new runtime wrapping the given executor.
Sourcepub fn supports_parallel(
executor: &Arc<dyn ToolExecutor>,
call: &ToolCall,
) -> bool
pub fn supports_parallel( executor: &Arc<dyn ToolExecutor>, call: &ToolCall, ) -> bool
Determine if a tool supports parallel execution.
Sourcepub async fn execute(
&self,
call: &ToolCall,
ctx: ToolExecutionContext<'_>,
) -> ToolCallResult
pub async fn execute( &self, call: &ToolCall, ctx: ToolExecutionContext<'_>, ) -> ToolCallResult
Execute a single tool call with appropriate concurrency control.
Sourcepub async fn execute_batch(
&self,
calls: Vec<(ToolCall, ToolExecutionContext<'_>)>,
) -> Vec<ToolCallResult>
pub async fn execute_batch( &self, calls: Vec<(ToolCall, ToolExecutionContext<'_>)>, ) -> Vec<ToolCallResult>
Execute multiple tool calls with automatic parallel/sequential scheduling.
Tool calls are partitioned into batches:
- Consecutive read-only tools run concurrently
- Mutating tools run one at a time
- Order is preserved (mutating tools act as barriers)
Trait Implementations§
Source§impl Clone for ToolCallRuntime
impl Clone for ToolCallRuntime
Source§fn clone(&self) -> ToolCallRuntime
fn clone(&self) -> ToolCallRuntime
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for ToolCallRuntime
impl !RefUnwindSafe for ToolCallRuntime
impl Send for ToolCallRuntime
impl Sync for ToolCallRuntime
impl Unpin for ToolCallRuntime
impl UnsafeUnpin for ToolCallRuntime
impl !UnwindSafe for ToolCallRuntime
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