pub trait Tool: Send + Sync {
// Required methods
fn name(&self) -> String;
fn definition(&self) -> ToolDefinition;
fn call(
&self,
args: Value,
work_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send>>;
// Provided method
fn exclusive(&self) -> bool { ... }
}Required Methods§
fn name(&self) -> String
fn definition(&self) -> ToolDefinition
fn call( &self, args: Value, work_dir: PathBuf, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send>>
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".