Enum tungstenite::protocol::Message [−][src]
pub enum Message {
Text(String),
Binary(Vec<u8>),
Ping(Vec<u8>),
Pong(Vec<u8>),
Close(Option<CloseFrame<'static>>),
}
Expand description
An enum representing the various forms of a WebSocket message.
Variants
Text(String)
A text WebSocket message
Tuple Fields of Text
0: String
A binary WebSocket message
A ping message with the specified payload
The payload here must have a length less than 125 bytes
A pong message with the specified payload
The payload here must have a length less than 125 bytes
Close(Option<CloseFrame<'static>>)
A close message with the optional close frame.
Tuple Fields of Close
0: Option<CloseFrame<'static>>
Implementations
Create a new text WebSocket message from a stringable.
Create a new binary WebSocket message by converting to Vec
Returns true if the WebSocket message has no content. For example, if the other side of the connection sent an empty string.
Attempt to consume the WebSocket message and convert it to a String.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Message
impl UnwindSafe for Message
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self