Trait McpClientTrait

Source
pub trait McpClientTrait: Send + Sync {
    // Required methods
    fn initialize<'life0, 'async_trait>(
        &'life0 mut self,
        info: ClientInfo,
        capabilities: ClientCapabilities,
    ) -> Pin<Box<dyn Future<Output = Result<InitializeResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_resources<'life0, 'async_trait>(
        &'life0 self,
        next_cursor: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<ListResourcesResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_resource<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uri: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ReadResourceResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_tools<'life0, 'async_trait>(
        &'life0 self,
        next_cursor: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<ListToolsResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn call_tool<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        arguments: Value,
    ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_prompts<'life0, 'async_trait>(
        &'life0 self,
        next_cursor: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<ListPromptsResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_prompt<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        arguments: Value,
    ) -> Pin<Box<dyn Future<Output = Result<GetPromptResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn initialize<'life0, 'async_trait>( &'life0 mut self, info: ClientInfo, capabilities: ClientCapabilities, ) -> Pin<Box<dyn Future<Output = Result<InitializeResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list_resources<'life0, 'async_trait>( &'life0 self, next_cursor: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<ListResourcesResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn read_resource<'life0, 'life1, 'async_trait>( &'life0 self, uri: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ReadResourceResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list_tools<'life0, 'async_trait>( &'life0 self, next_cursor: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<ListToolsResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn call_tool<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, arguments: Value, ) -> Pin<Box<dyn Future<Output = Result<CallToolResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list_prompts<'life0, 'async_trait>( &'life0 self, next_cursor: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<ListPromptsResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_prompt<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, arguments: Value, ) -> Pin<Box<dyn Future<Output = Result<GetPromptResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

impl<S> McpClientTrait for McpClient<S>
where S: Service<JsonRpcMessage, Response = JsonRpcMessage> + Clone + Send + Sync + 'static, S::Error: Into<Error>, S::Future: Send,