Trait Client

Source
pub trait Client: Send + Sync {
    // Required methods
    fn config(&self) -> &ClientConfig;
    fn handle_sampling<'life0, 'async_trait>(
        &'life0 self,
        prompt: Value,
    ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_root_context<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Represents an MCP client

Required Methods§

Source

fn config(&self) -> &ClientConfig

Returns the client configuration

Source

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

Handles a sampling request from the server

Source

fn get_root_context<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provides context from root directories

Implementors§