Trait Client

Source
pub trait Client: Send + Sync {
Show 19 methods // Required methods fn connect<'life0, 'async_trait, T>( &'life0 mut self, transport: T, ) -> Pin<Box<dyn Future<Output = Result<ProtocolHandle, McpError>> + Send + 'async_trait>> where T: 'async_trait + Transport + Send + Sync + 'static, Self: 'async_trait, 'life0: 'async_trait; fn initialize<'life0, 'async_trait>( &'life0 mut self, client_info: ClientInfo, ) -> Pin<Box<dyn Future<Output = Result<InitializeResult, McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_resources<'life0, 'async_trait>( &'life0 self, cursor: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<ListResourcesResponse, McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn read_resource<'life0, 'async_trait>( &'life0 self, uri: String, ) -> Pin<Box<dyn Future<Output = Result<ReadResourceResponse, McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn subscribe_to_resource<'life0, 'async_trait>( &'life0 self, uri: String, ) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_prompts<'life0, 'async_trait>( &'life0 self, cursor: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<ListPromptsResponse, McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_prompt<'life0, 'async_trait>( &'life0 self, name: String, arguments: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<PromptResult, McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_tools<'life0, 'async_trait>( &'life0 self, cursor: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<ListToolsResponse, McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn call_tool<'life0, 'async_trait>( &'life0 self, name: String, arguments: Value, ) -> Pin<Box<dyn Future<Output = Result<ToolResult, McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn set_log_level<'life0, 'async_trait>( &'life0 self, level: String, ) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_server_capabilities<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<ServerCapabilities>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn has_capability<'life0, 'life1, 'async_trait>( &'life0 self, capability: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_client_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<ClientInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn has_client_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn assert_initialized<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn assert_capability<'life0, 'life1, 'async_trait>( &'life0 self, capability: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn cleanup_resources<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn wait_for_shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), McpError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}

Required Methods§

Source

fn connect<'life0, 'async_trait, T>( &'life0 mut self, transport: T, ) -> Pin<Box<dyn Future<Output = Result<ProtocolHandle, McpError>> + Send + 'async_trait>>
where T: 'async_trait + Transport + Send + Sync + 'static, Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

fn read_resource<'life0, 'async_trait>( &'life0 self, uri: String, ) -> Pin<Box<dyn Future<Output = Result<ReadResourceResponse, McpError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

fn get_prompt<'life0, 'async_trait>( &'life0 self, name: String, arguments: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<PromptResult, McpError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

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

Source

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

Source

fn get_server_capabilities<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<ServerCapabilities>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn has_capability<'life0, 'life1, 'async_trait>( &'life0 self, capability: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_client_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<ClientInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

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

Source

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

Source

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

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§