Skip to main content

Tool

Trait Tool 

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

Source

fn name(&self) -> String

Source

fn definition(&self) -> ToolDefinition

Source

fn call( &self, args: Value, work_dir: PathBuf, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send>>

Provided Methods§

Source

fn exclusive(&self) -> bool

A tool with side effects on the working tree. A turn containing one runs its calls sequentially in provider order instead of concurrently.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§