pub struct WsStream(/* private fields */);Expand description
WebSocket message stream
Implementations§
Source§impl WsStream
impl WsStream
Sourcepub fn into_inner(
self,
) -> Pin<Box<dyn Stream<Item = Result<WsMessage, StreamError>> + Send>>
pub fn into_inner( self, ) -> Pin<Box<dyn Stream<Item = Result<WsMessage, StreamError>> + Send>>
Convert into the inner pinned boxed stream
Sourcepub fn tee(self) -> (WsStream, WsStream)
pub fn tee(self) -> (WsStream, WsStream)
Split this stream into two streams that both receive all messages
Messages are cloned (cheaply via Bytes rc). Spawns a forwarder task. Both returned streams will receive all messages from the original stream. The forwarder continues as long as at least one stream is alive. If the underlying stream errors, both teed streams will end.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsStream
impl !RefUnwindSafe for WsStream
impl Send for WsStream
impl !Sync for WsStream
impl Unpin for WsStream
impl UnsafeUnpin for WsStream
impl !UnwindSafe for WsStream
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