pub enum Message {
Text(String),
Binary(Vec<u8>),
Ping(Vec<u8>),
Pong(Vec<u8>),
Close(Option<(CloseCode, String)>),
}
This is supported on crate feature
websocket
only.Expand description
An enum representing the various forms of a WebSocket message.
Variants
Text(String)
Tuple Fields
0: String
A text WebSocket message
Binary(Vec<u8>)
A binary WebSocket message
Ping(Vec<u8>)
A ping message with the specified payload
The payload here must have a length less than 125 bytes
Pong(Vec<u8>)
A pong message with the specified payload
The payload here must have a length less than 125 bytes
Close(Option<(CloseCode, String)>)
A close message with the optional close frame.
Implementations
Construct a close message with a code and reason.
Destructure this message into binary data.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Message
impl UnwindSafe for Message
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more