Struct warp::filters::ws::Message

source ·
pub struct Message { /* private fields */ }
Expand description

A WebSocket message.

Only repesents Text and Binary messages.

This will likely become a non-exhaustive enum in the future, once that language feature has stabilized.

Implementations

Construct a new Text Message.

Construct a new Binary Message.

Returns true if this message is a Text message.

Returns true if this message is a Binary message.

Returns true if this message is a Ping message.

Try to get a reference to the string text, if this is a Text message.

Return the bytes of this message.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.