pub struct McpProtocolClient { /* private fields */ }Expand description
MCP protocol client
Implementations§
Source§impl McpProtocolClient
impl McpProtocolClient
pub fn new(transport: Box<dyn McpTransport>) -> Self
pub async fn connect(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
pub async fn initialize(&self, timeout_ms: u64) -> Result<McpInitializeResult>
pub async fn list_tools(&self, timeout_ms: u64) -> Result<Vec<McpTool>>
pub async fn call_tool( &self, name: &str, arguments: Value, timeout_ms: u64, ) -> Result<McpCallResult>
pub async fn ping(&self, timeout_ms: u64) -> Result<()>
pub async fn try_receive_notification(&self) -> Option<JsonRpcNotification>
pub async fn is_connected(&self) -> bool
Auto Trait Implementations§
impl !Freeze for McpProtocolClient
impl !RefUnwindSafe for McpProtocolClient
impl Send for McpProtocolClient
impl Sync for McpProtocolClient
impl Unpin for McpProtocolClient
impl UnsafeUnpin for McpProtocolClient
impl !UnwindSafe for McpProtocolClient
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