pub trait ToolExecutor: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn spec(&self, _ctx: &ToolSpecContext) -> Result<ToolSpec, ToolError>;
fn run<'a>(
&'a self,
call: ToolCall,
ctx: ToolRunContext<'a>,
) -> ToolFuture<'a, ToolExecutionResult>;
// Provided methods
fn exposure(&self) -> ToolExposure { ... }
fn supports_parallel(&self) -> bool { ... }
fn timeout(&self) -> Option<Duration> { ... }
fn approval_requirement(
&self,
_call: &ToolCall,
_ctx: &ToolRunContext<'_>,
) -> ApprovalRequirement { ... }
}Required Methods§
fn name(&self) -> &str
fn description(&self) -> &str
fn spec(&self, _ctx: &ToolSpecContext) -> Result<ToolSpec, ToolError>
fn run<'a>( &'a self, call: ToolCall, ctx: ToolRunContext<'a>, ) -> ToolFuture<'a, ToolExecutionResult>
Provided Methods§
fn exposure(&self) -> ToolExposure
fn supports_parallel(&self) -> bool
fn timeout(&self) -> Option<Duration>
fn approval_requirement( &self, _call: &ToolCall, _ctx: &ToolRunContext<'_>, ) -> ApprovalRequirement
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".