pub struct InMemoryTransport<R: ServiceRole> { /* private fields */ }Expand description
In-memory transport for connecting McpServer and McpClient in tests
Trait Implementations§
Source§impl<R: ServiceRole> Transport<R> for InMemoryTransport<R>
impl<R: ServiceRole> Transport<R> for InMemoryTransport<R>
type Error = InMemoryTransportError
Source§fn send(
&mut self,
item: TxJsonRpcMessage<R>,
) -> impl Future<Output = Result<(), Self::Error>> + Send + 'static
fn send( &mut self, item: TxJsonRpcMessage<R>, ) -> impl Future<Output = Result<(), Self::Error>> + Send + 'static
Send a message to the transport Read more
Source§fn receive(
&mut self,
) -> impl Future<Output = Option<RxJsonRpcMessage<R>>> + Send
fn receive( &mut self, ) -> impl Future<Output = Option<RxJsonRpcMessage<R>>> + Send
Receive a message from the transport, this operation is sequential.
fn name() -> Cow<'static, str>
Auto Trait Implementations§
impl<R> Freeze for InMemoryTransport<R>
impl<R> !RefUnwindSafe for InMemoryTransport<R>
impl<R> Send for InMemoryTransport<R>
impl<R> Sync for InMemoryTransport<R>
impl<R> Unpin for InMemoryTransport<R>
impl<R> UnsafeUnpin for InMemoryTransport<R>
impl<R> !UnwindSafe for InMemoryTransport<R>
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