Enum trillium_websockets::Message [−]
pub enum Message { Text(String), Binary(Vec<u8, Global>), Ping(Vec<u8, Global>), Pong(Vec<u8, Global>), Close(Option<CloseFrame<'static>>), }
Expand description
An enum representing the various forms of a WebSocket message.
Variants
Text(String)
A text WebSocket message
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.
Implementations
impl Message
impl Message
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
pub fn vzip(self) -> V