pub struct WebSocketStream<S> { /* private fields */ }Expand description
A WebSocket stream that works with compio.
Implementations§
Source§impl<S> WebSocketStream<S>where
S: AsyncRead + AsyncWrite,
impl<S> WebSocketStream<S>where
S: AsyncRead + AsyncWrite,
Sourcepub async fn send(&mut self, message: Message) -> Result<(), WsError>
pub async fn send(&mut self, message: Message) -> Result<(), WsError>
Send a message on the WebSocket stream.
Sourcepub async fn read(&mut self) -> Result<Message, WsError>
pub async fn read(&mut self) -> Result<Message, WsError>
Read a message from the WebSocket stream.
Trait Implementations§
Source§impl<S: Debug> Debug for WebSocketStream<S>
impl<S: Debug> Debug for WebSocketStream<S>
Source§impl<S> IntoInner for WebSocketStream<S>
impl<S> IntoInner for WebSocketStream<S>
Source§type Inner = WebSocket<SyncStream<S>>
type Inner = WebSocket<SyncStream<S>>
The inner type.
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Get the inner buffer.
Auto Trait Implementations§
impl<S> !Freeze for WebSocketStream<S>
impl<S> RefUnwindSafe for WebSocketStream<S>where
S: RefUnwindSafe,
impl<S> Send for WebSocketStream<S>where
S: Send,
impl<S> Sync for WebSocketStream<S>where
S: Sync,
impl<S> Unpin for WebSocketStream<S>where
S: Unpin,
impl<S> UnwindSafe for WebSocketStream<S>where
S: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more