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 send_tool_call(
&self,
invocation: ToolInvocation,
) -> Result<TraceEntry, SessionError>
pub async fn send_tool_call( &self, invocation: ToolInvocation, ) -> Result<TraceEntry, SessionError>
Sends a tool invocation via rmcp and records 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 async fn run_invocations<I>(
&self,
invocations: I,
) -> Result<Vec<TraceEntry>, SessionError>where
I: IntoIterator<Item = ToolInvocation>,
pub async fn run_invocations<I>(
&self,
invocations: I,
) -> Result<Vec<TraceEntry>, SessionError>where
I: IntoIterator<Item = ToolInvocation>,
Sends a sequence of tool invocations via rmcp.
Auto Trait Implementations§
impl Freeze for SessionDriver
impl !RefUnwindSafe for SessionDriver
impl Send for SessionDriver
impl Sync for SessionDriver
impl Unpin 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