pub struct ClientStreamableTransport<R>{ /* private fields */ }
Implementations§
Source§impl<R> ClientStreamableTransport<R>
impl<R> ClientStreamableTransport<R>
pub fn new( options: &StreamableTransportOptions, session_id: Option<String>, standalone: bool, ) -> Result<ClientStreamableTransport<R>, TransportError>
Trait Implementations§
Source§impl McpDispatch<ServerMessages, ClientMessages, ServerMessage, ClientMessage> for ClientStreamableTransport<ServerMessage>
impl McpDispatch<ServerMessages, ClientMessages, ServerMessage, ClientMessage> for ClientStreamableTransport<ServerMessage>
Source§fn send_message<'life0, 'async_trait>(
&'life0 self,
message: ClientMessages,
request_timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<Option<ServerMessages>, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<ServerMessage>: 'async_trait,
fn send_message<'life0, 'async_trait>(
&'life0 self,
message: ClientMessages,
request_timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<Option<ServerMessages>, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<ServerMessage>: 'async_trait,
Sends a raw message represented by type
S
and optionally includes a request_id
.
The request_id
is used when sending a message in response to an MCP request.
It should match the request_id
of the original request.fn send<'life0, 'async_trait>(
&'life0 self,
message: ClientMessage,
request_timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<Option<ServerMessage>, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<ServerMessage>: 'async_trait,
fn send_batch<'life0, 'async_trait>(
&'life0 self,
message: Vec<ClientMessage>,
request_timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<ServerMessage>>, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<ServerMessage>: 'async_trait,
Source§fn write_str<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: &'life1 str,
skip_store: bool,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ClientStreamableTransport<ServerMessage>: 'async_trait,
fn write_str<'life0, 'life1, 'async_trait>(
&'life0 self,
payload: &'life1 str,
skip_store: bool,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ClientStreamableTransport<ServerMessage>: 'async_trait,
Writes a string payload to the underlying asynchronous writable stream,
appending a newline character and flushing the stream afterward.
Source§impl<R, S, M, OR, OM> Transport<R, S, M, OR, OM> for ClientStreamableTransport<M>
impl<R, S, M, OR, OM> Transport<R, S, M, OR, OM> for ClientStreamableTransport<M>
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ReceiverStream<R>, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MessageDispatcher<M>: McpDispatch<R, OR, M, OM>,
ClientStreamableTransport<M>: 'async_trait,
fn message_sender(&self) -> Arc<RwLock<Option<MessageDispatcher<M>>>>
fn error_stream(&self) -> &RwLock<Option<IoStream>>
fn shut_down<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<M>: 'async_trait,
fn is_shut_down<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<M>: 'async_trait,
fn consume_string_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ClientStreamableTransport<M>: 'async_trait,
fn pending_request_tx<'life0, 'life1, 'async_trait>(
&'life0 self,
request_id: &'life1 RequestId,
) -> Pin<Box<dyn Future<Output = Option<Sender<M>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ClientStreamableTransport<M>: 'async_trait,
fn keep_alive<'life0, 'async_trait>(
&'life0 self,
__arg1: Duration,
__arg2: Sender<()>,
) -> Pin<Box<dyn Future<Output = Result<JoinHandle<()>, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<M>: 'async_trait,
fn session_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
ClientStreamableTransport<M>: 'async_trait,
impl TransportDispatcher<ServerMessages, MessageFromClient, ServerMessage, ClientMessages, ClientMessage> for ClientStreamableTransport<ServerMessage>
Auto Trait Implementations§
impl<R> !Freeze for ClientStreamableTransport<R>
impl<R> !RefUnwindSafe for ClientStreamableTransport<R>
impl<R> Send for ClientStreamableTransport<R>
impl<R> Sync for ClientStreamableTransport<R>
impl<R> Unpin for ClientStreamableTransport<R>
impl<R> !UnwindSafe for ClientStreamableTransport<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