Skip to main content

ToolHandler

Trait ToolHandler 

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

Source

fn execute(&self, args: &SharedArgs<'_>) -> Result<ToolResult, DCPError>

Execute the tool with zero-copy arguments

Source

fn schema(&self) -> &ToolSchema

Get tool schema for validation

Provided Methods§

Source

fn tool_id(&self) -> u16

Get the tool ID

Source

fn tool_name(&self) -> &'static str

Get the tool name

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§