pub enum Message {
Text(String),
Data(Bytes),
Ping(Bytes),
Pong(Bytes),
Close(CloseMessage),
}
Available on crate feature
ws
only.Expand description
WS message.
Variants§
Trait Implementations§
Source§impl From<CloseMessage> for Message
impl From<CloseMessage> for Message
Source§fn from(close: CloseMessage) -> Self
fn from(close: CloseMessage) -> Self
Converts to this type from the input type.
Source§impl Sink<Message> for WebSocket
impl Sink<Message> for WebSocket
Source§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink
to receive a value. Read moreSource§fn start_send(self: Pin<&mut Self>, msg: Message) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, msg: Message) -> Result<(), Self::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read moreAuto Trait Implementations§
impl !Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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