pub struct SessionDriver { /* private fields */ }Expand description
Session driver that uses rmcp client/session APIs.
Implementations§
Source§impl SessionDriver
impl SessionDriver
Sourcepub async fn connect_stdio(config: &StdioConfig) -> Result<Self, SessionError>
pub async fn connect_stdio(config: &StdioConfig) -> Result<Self, SessionError>
Connects to an MCP server over stdio using rmcp child-process transport.
Sourcepub async fn connect_http(config: &HttpConfig) -> Result<Self, SessionError>
pub async fn connect_http(config: &HttpConfig) -> Result<Self, SessionError>
Connects to an MCP server over HTTP using rmcp streamable HTTP transport.
Sourcepub async fn connect_with_transport<T, E, A>(
transport: T,
) -> Result<Self, SessionError>
pub async fn connect_with_transport<T, E, A>( transport: T, ) -> Result<Self, SessionError>
Connects using a custom rmcp transport implementation.
Sourcepub async fn call_tool(
&self,
invocation: ToolInvocation,
) -> Result<CallToolResult, SessionError>
pub async fn call_tool( &self, invocation: ToolInvocation, ) -> Result<CallToolResult, SessionError>
Sends a tool invocation via rmcp and returns the response.
Sourcepub async fn list_tools(&self) -> Result<Vec<Tool>, SessionError>
pub async fn list_tools(&self) -> Result<Vec<Tool>, SessionError>
Lists all tools available from the MCP session.
Sourcepub fn server_protocol_version(&self) -> Option<String>
pub fn server_protocol_version(&self) -> Option<String>
Returns the server-reported MCP protocol version, if available.
Auto Trait Implementations§
impl Freeze for SessionDriver
impl !RefUnwindSafe for SessionDriver
impl Send for SessionDriver
impl Sync for SessionDriver
impl Unpin for SessionDriver
impl UnsafeUnpin for SessionDriver
impl !UnwindSafe for SessionDriver
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