Trait ClientHandler

Source
pub trait ClientHandler: Send + Sync {
    // Required methods
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_request<'life0, 'async_trait>(
        &'life0 self,
        method: String,
        params: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_notification<'life0, 'async_trait>(
        &'life0 self,
        method: String,
        params: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for implementing MCP client handlers

Required Methods§

Source

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

Handle shutdown request

Source

fn handle_request<'life0, 'async_trait>( &'life0 self, method: String, params: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle requests

Source

fn handle_notification<'life0, 'async_trait>( &'life0 self, method: String, params: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle notifications

Implementors§