pub trait ErasedToolExecutor: Send + Sync {
// Required methods
fn execute_erased<'a>(
&'a self,
response: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>;
fn execute_confirmed_erased<'a>(
&'a self,
response: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>;
fn tool_definitions_erased(&self) -> Vec<ToolDef>;
fn execute_tool_call_erased<'a>(
&'a self,
call: &'a ToolCall,
) -> Pin<Box<dyn Future<Output = Result<Option<ToolOutput>, ToolError>> + Send + 'a>>;
// Provided method
fn set_skill_env(&self, _env: Option<HashMap<String, String>>) { ... }
}Expand description
Object-safe erased version of ToolExecutor using boxed futures.
Implemented automatically for all T: ToolExecutor + 'static.
Use Box<dyn ErasedToolExecutor> when dynamic dispatch is required.