Struct routerify_websocket::Message [−][src]
pub struct Message { /* fields omitted */ }
Expand description
A WebSocket message.
Implementations
Create a new Text
WebSocket message from a stringable.
Constructs a Text
WebSocket message with the json value.
Optional
This requires the optional json
feature to be enabled.
Construct a new Ping
WebSocket message.
The payload here must have a length less than 125 bytes.
Construct a new Pong
WebSocket message.
The payload here must have a length less than 125 bytes.
Construct a Close
WebSocket message with a code and reason.
Returns true if the WebSocket message has no content. For example, if the other side of the connection sent an empty string.
The Close
code if available.
The Close
reason if available.
Attempts to convert the message data as text in UTF8
format.
Return the bytes of this message.
Consumes the message and returns its data as bytes.
Consumes the WebSocket message and attempts to converts it to a String
.
Try to deserialize the message data as JSON
.
Optional
This requires the optional json
feature to be enabled.
Trait Implementations
type Error = WebsocketError
type Error = WebsocketError
The type of value produced by the sink when an error occurs.
Attempts to prepare the Sink
to receive a value. Read more
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read more
Flush any remaining output from this sink. Read more
Auto Trait Implementations
impl RefUnwindSafe for Message
impl UnwindSafe for Message
Blanket Implementations
Mutably borrows from an owned value. Read more
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