pub trait ToolHandler: Send + Sync {
// Required methods
fn execute(&self, args: &SharedArgs<'_>) -> Result<ToolResult, DCPError>;
fn schema(&self) -> &ToolSchema;
// Provided methods
fn tool_id(&self) -> u16 { ... }
fn tool_name(&self) -> &'static str { ... }
}Expand description
Tool handler trait for executing tools
Required Methods§
Sourcefn execute(&self, args: &SharedArgs<'_>) -> Result<ToolResult, DCPError>
fn execute(&self, args: &SharedArgs<'_>) -> Result<ToolResult, DCPError>
Execute the tool with zero-copy arguments
Sourcefn schema(&self) -> &ToolSchema
fn schema(&self) -> &ToolSchema
Get tool schema for validation
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".