pub struct McpClient<S>where
S: Service<JsonRpcMessage, Response = JsonRpcMessage> + Clone + Send + Sync + 'static,
S::Error: Into<Error>,
S::Future: Send,{ /* private fields */ }
Expand description
The MCP client is the interface for MCP operations.
Implementations§
Trait Implementations§
Source§impl<S> McpClientTrait for McpClient<S>
impl<S> McpClientTrait for McpClient<S>
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,
Auto Trait Implementations§
impl<S> !Freeze for McpClient<S>
impl<S> !RefUnwindSafe for McpClient<S>
impl<S> Send for McpClient<S>
impl<S> Sync for McpClient<S>
impl<S> Unpin for McpClient<S>
impl<S> !UnwindSafe for McpClient<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more