Enum tungstenite::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)
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<CloseFrame<'static>>)
Tuple Fields
0: Option<CloseFrame<'static>>
A close message with the optional close frame.
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