Struct StdioTransport
pub struct StdioTransport { /* private fields */ }Expand description
Stdio-based transport (spawn local process).
Implementations§
Source§impl StdioTransport
impl StdioTransport
pub fn new(config: &McpServerConfig) -> Result<Self>
Trait Implementations§
Source§impl McpTransportConn for StdioTransport
impl McpTransportConn for StdioTransport
Source§fn send_and_recv<'life0, 'life1, 'async_trait>(
&'life0 mut self,
request: &'life1 JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_and_recv<'life0, 'life1, 'async_trait>(
&'life0 mut self,
request: &'life1 JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a JSON-RPC request and receive the response.
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the connection.
Source§fn health_check(&mut self) -> bool
fn health_check(&mut self) -> bool
Check whether the underlying transport is still alive without sending a
real request. The HTTP and SSE transports always return
Ok(true) —
connection drops surface through send_and_recv errors. The stdio
transport verifies the child process is still running via try_wait().Source§fn reset<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reset per-connection session state so the next operation re-establishes
a fresh session. Default is a no-op for stateless transports (stdio).
Auto Trait Implementations§
impl Freeze for StdioTransport
impl !RefUnwindSafe for StdioTransport
impl Send for StdioTransport
impl Sync for StdioTransport
impl Unpin for StdioTransport
impl UnsafeUnpin for StdioTransport
impl !UnwindSafe for StdioTransport
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more