pub struct Connection {
pub outgoing: Pin<Box<dyn Stream<Item = Result<Value>> + Send>>,
pub incoming: Option<Pin<Box<dyn Sink<Value, Error = YetiError> + Send>>>,
}Expand description
WebSocket/SSE connection handle.
Fields§
§outgoing: Pin<Box<dyn Stream<Item = Result<Value>> + Send>>Outgoing message stream (server -> client)
incoming: Option<Pin<Box<dyn Sink<Value, Error = YetiError> + Send>>>Incoming message sink (client -> server, WebSocket only; None for SSE)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Connection
impl !Sync for Connection
impl !UnwindSafe for Connection
impl Freeze for Connection
impl Send for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
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