Skip to main content

DynToolHandler

Trait DynToolHandler 

Source
pub trait DynToolHandler: Send + Sync {
    // Required methods
    fn list_tools<'a>(
        &'a self,
        ctx: &'a Context<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Tool>, McpError>> + Send + 'a>>;
    fn call_tool<'a>(
        &'a self,
        name: &'a str,
        args: Object,
        ctx: &'a Context<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<ToolOutput, McpError>> + Send + 'a>>;
}
Expand description

Object-safe form of ToolHandler (only the dispatched methods).

Required Methods§

Source

fn list_tools<'a>( &'a self, ctx: &'a Context<'_>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Tool>, McpError>> + Send + 'a>>

Source

fn call_tool<'a>( &'a self, name: &'a str, args: Object, ctx: &'a Context<'_>, ) -> Pin<Box<dyn Future<Output = Result<ToolOutput, McpError>> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§