pub struct WebSocketStream<S> { /* private fields */ }Available on crate feature
ws only.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<(), Error>
pub async fn send(&mut self, message: Message) -> Result<(), Error>
Send a message on the WebSocket stream.
Sourcepub async fn read(&mut self) -> Result<Message, Error>
pub async fn read(&mut self) -> Result<Message, Error>
Read a message from the WebSocket stream.
Trait Implementations§
Source§impl<S> Debug for WebSocketStream<S>where
S: Debug,
impl<S> Debug for WebSocketStream<S>where
S: Debug,
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) -> <WebSocketStream<S> as IntoInner>::Inner
fn into_inner(self) -> <WebSocketStream<S> as IntoInner>::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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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