pub struct ChannelTransport { /* private fields */ }Expand description
An in-process ClientTransport that connects directly to an McpRouter.
Messages are passed through tokio channels — the transport spawns a
background task that feeds incoming JSON-RPC requests to a
JsonRpcService<McpRouter> and returns responses.
Implementations§
Trait Implementations§
Source§impl ClientTransport for ChannelTransport
impl ClientTransport for ChannelTransport
Source§fn send<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a raw JSON message to the server. Read more
Source§fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive the next raw JSON message from the server. Read more
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if the transport is still connected.
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 transport gracefully. Read more
Source§fn reset_session<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_session<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reset the transport’s session state for re-initialization. Read more
Source§fn supports_session_recovery(&self) -> bool
fn supports_session_recovery(&self) -> bool
Whether this transport supports automatic session recovery. Read more
Auto Trait Implementations§
impl Freeze for ChannelTransport
impl RefUnwindSafe for ChannelTransport
impl Send for ChannelTransport
impl Sync for ChannelTransport
impl Unpin for ChannelTransport
impl UnsafeUnpin for ChannelTransport
impl UnwindSafe for ChannelTransport
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