Skip to main content

ErasedTool

Trait ErasedTool 

Source
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§

Source

fn name(&self) -> &str

Source

fn description(&self) -> &str

Source

fn parameters_schema(&self) -> Value

Source

fn execute_erased<'a>( &'a self, input: &'a Value, ) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'a>>

Source

fn retry_policy(&self) -> Option<ToolRetryPolicy>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Tool> ErasedTool for T