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.
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