pub struct SseTransport { /* private fields */ }Expand description
A transport that wraps an SSE-style message sender
Implementations§
Source§impl SseTransport
impl SseTransport
pub fn new( sender: UnboundedSender<JsonRpcMessage>, receiver: UnboundedReceiver<JsonRpcMessage>, ) -> Self
Trait Implementations§
Source§impl ServerTransport for SseTransport
impl ServerTransport for SseTransport
Source§fn write_message<'life0, 'async_trait>(
&'life0 mut self,
msg: JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_message<'life0, 'async_trait>(
&'life0 mut self,
msg: JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a JSON-RPC message (usually a Response)
Source§fn read_message<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<Result<JsonRpcMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_message<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<Result<JsonRpcMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reads a JSON-RPC message (could be a Request or Notification)
Auto Trait Implementations§
impl Freeze for SseTransport
impl RefUnwindSafe for SseTransport
impl Send for SseTransport
impl Sync for SseTransport
impl Unpin for SseTransport
impl UnwindSafe for SseTransport
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