Trait Router

Source
pub trait Router:
    Send
    + Sync
    + 'static {
Show 17 methods // Required methods fn name(&self) -> String; fn instructions(&self) -> String; fn capabilities(&self) -> ServerCapabilities; fn list_tools(&self) -> Vec<Tool>; fn call_tool( &self, tool_name: &str, arguments: Value, ) -> Pin<Box<dyn Future<Output = Result<Vec<Content>, ToolError>> + Send + 'static>>; fn list_resources(&self) -> Vec<Resource>; fn read_resource( &self, uri: &str, ) -> Pin<Box<dyn Future<Output = Result<String, ResourceError>> + Send + 'static>>; fn list_prompts(&self) -> Vec<Prompt>; fn get_prompt( &self, prompt_name: &str, ) -> Pin<Box<dyn Future<Output = Result<String, PromptError>> + Send + 'static>>; // Provided methods fn create_response(&self, id: Option<u64>) -> JsonRpcResponse { ... } fn handle_initialize( &self, req: JsonRpcRequest, ) -> impl Future<Output = Result<JsonRpcResponse, RouterError>> + Send { ... } fn handle_tools_list( &self, req: JsonRpcRequest, ) -> impl Future<Output = Result<JsonRpcResponse, RouterError>> + Send { ... } fn handle_tools_call( &self, req: JsonRpcRequest, ) -> impl Future<Output = Result<JsonRpcResponse, RouterError>> + Send { ... } fn handle_resources_list( &self, req: JsonRpcRequest, ) -> impl Future<Output = Result<JsonRpcResponse, RouterError>> + Send { ... } fn handle_resources_read( &self, req: JsonRpcRequest, ) -> impl Future<Output = Result<JsonRpcResponse, RouterError>> + Send { ... } fn handle_prompts_list( &self, req: JsonRpcRequest, ) -> impl Future<Output = Result<JsonRpcResponse, RouterError>> + Send { ... } fn handle_prompts_get( &self, req: JsonRpcRequest, ) -> impl Future<Output = Result<JsonRpcResponse, RouterError>> + Send { ... }
}

Required Methods§

Source

fn name(&self) -> String

Source

fn instructions(&self) -> String

Source

fn capabilities(&self) -> ServerCapabilities

Source

fn list_tools(&self) -> Vec<Tool>

Source

fn call_tool( &self, tool_name: &str, arguments: Value, ) -> Pin<Box<dyn Future<Output = Result<Vec<Content>, ToolError>> + Send + 'static>>

Source

fn list_resources(&self) -> Vec<Resource>

Source

fn read_resource( &self, uri: &str, ) -> Pin<Box<dyn Future<Output = Result<String, ResourceError>> + Send + 'static>>

Source

fn list_prompts(&self) -> Vec<Prompt>

Source

fn get_prompt( &self, prompt_name: &str, ) -> Pin<Box<dyn Future<Output = Result<String, PromptError>> + Send + 'static>>

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§