pub trait ErasedTool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn parameters_schema(&self) -> Value;
fn execute_erased<'a>(
&'a self,
input: &'a Value,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'a>>;
fn retry_policy(&self) -> Option<ToolRetryPolicy>;
}Expand description
Object-safe wrapper for the Tool trait, enabling dynamic dispatch via Arc<dyn ErasedTool>.
Required Methods§
fn name(&self) -> &str
fn description(&self) -> &str
fn parameters_schema(&self) -> Value
fn execute_erased<'a>( &'a self, input: &'a Value, ) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'a>>
fn retry_policy(&self) -> Option<ToolRetryPolicy>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".