pub trait Tool: Send + Sync {
// Required methods
fn spec(&self) -> ToolSpec;
fn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn is_readonly(&self) -> bool { ... }
}Required Methods§
fn spec(&self) -> ToolSpec
fn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
Sourcefn is_readonly(&self) -> bool
fn is_readonly(&self) -> bool
Whether this tool only reads data without side effects. Default: false (conservative). Override to true for read-only tools.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".