pub enum Message {
Text(TextMessage),
Binary(BinaryMessage),
Ping(PingMessage),
Pong(PongMessage),
Close(CloseMessage),
}Expand description
Represents a complete WebSocket message
Variants§
Text(TextMessage)
Text message
Binary(BinaryMessage)
Binary message
Ping(PingMessage)
Ping message
Pong(PongMessage)
Pong message
Close(CloseMessage)
Close message
Implementations§
Source§impl Message
impl Message
Sourcepub fn kind(&self) -> MessageKind
pub fn kind(&self) -> MessageKind
Get the message kind
Sourcepub fn is_control(&self) -> bool
pub fn is_control(&self) -> bool
Check if this is a control message
Trait Implementations§
Auto 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