pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
pub fn new() -> Self
pub async fn connect<T: Transport>( &mut self, transport: T, ) -> Result<ProtocolHandle, McpError>
pub async fn initialize( &mut self, client_info: ClientInfo, ) -> Result<InitializeResult, McpError>
pub async fn list_resources( &self, cursor: Option<String>, ) -> Result<ListResourcesResponse, McpError>
pub async fn read_resource( &self, uri: String, ) -> Result<ReadResourceResponse, McpError>
pub async fn subscribe_to_resource(&self, uri: String) -> Result<(), McpError>
pub async fn list_prompts( &self, cursor: Option<String>, ) -> Result<ListPromptsResponse, McpError>
pub async fn get_prompt( &self, name: String, arguments: Option<Value>, ) -> Result<PromptResult, McpError>
pub async fn list_tools( &self, cursor: Option<String>, ) -> Result<ListToolsResponse, McpError>
pub async fn call_tool( &self, name: String, arguments: Value, ) -> Result<ToolResult, McpError>
pub async fn set_log_level(&self, level: String) -> Result<(), McpError>
Sourcepub async fn shutdown(&mut self) -> Result<(), McpError>
pub async fn shutdown(&mut self) -> Result<(), McpError>
Performs graceful shutdown of the client
pub async fn assert_initialized(&self) -> Result<(), McpError>
pub async fn get_server_capabilities(&self) -> Option<ServerCapabilities>
pub async fn has_capability(&self, capability: &str) -> bool
pub async fn get_client_info(&self) -> Option<ClientInfo>
pub async fn has_client_info(&self) -> bool
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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