pub type WsMessage = Message;Expand description
Communicative type alias for a tungstenite WebSocket Message.
Aliased Type§
enum WsMessage {
Text(Utf8Bytes),
Binary(Bytes),
Ping(Bytes),
Pong(Bytes),
Close(Option<CloseFrame>),
Frame(Frame),
}Variants§
Text(Utf8Bytes)
A text WebSocket message
Binary(Bytes)
A binary WebSocket message
Ping(Bytes)
A ping message with the specified payload
The payload here must have a length less than 125 bytes
Pong(Bytes)
A pong message with the specified payload
The payload here must have a length less than 125 bytes
Close(Option<CloseFrame>)
A close message with the optional close frame.
Frame(Frame)
Raw frame. Note, that you’re not going to get this value while reading the message.