pub struct McpToolManager { /* private fields */ }Expand description
MCP 工具管理器 - 管理多个 MCP 服务器的连接
Implementations§
Source§impl McpToolManager
impl McpToolManager
Sourcepub async fn connect_server(
&self,
server_name: impl Into<String>,
config: TransportConfig,
) -> Result<Vec<Box<dyn Tool>>>
pub async fn connect_server( &self, server_name: impl Into<String>, config: TransportConfig, ) -> Result<Vec<Box<dyn Tool>>>
连接 MCP 服务器并获取工具
Sourcepub async fn server_count(&self) -> usize
pub async fn server_count(&self) -> usize
获取已连接的服务器数量
Sourcepub async fn server_names(&self) -> Vec<String>
pub async fn server_names(&self) -> Vec<String>
获取所有已连接的服务器名称
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for McpToolManager
impl !RefUnwindSafe for McpToolManager
impl Send for McpToolManager
impl Sync for McpToolManager
impl Unpin for McpToolManager
impl UnsafeUnpin for McpToolManager
impl !UnwindSafe for McpToolManager
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