pub enum WebSocketMessage {
Text(String),
Binary(Vec<u8>),
Ping(Vec<u8>),
Pong(Vec<u8>),
}
Expand description
An enum that represents a websocket message.
See also [tungstenite::Message].
Variants§
Text(String)
A text message
Binary(Vec<u8>)
A binary message
Ping(Vec<u8>)
A ping message
Pong(Vec<u8>)
A pong message
Trait Implementations§
source§impl Clone for WebSocketMessage
impl Clone for WebSocketMessage
source§fn clone(&self) -> WebSocketMessage
fn clone(&self) -> WebSocketMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WebSocketMessage
impl Debug for WebSocketMessage
source§impl Hash for WebSocketMessage
impl Hash for WebSocketMessage
source§impl PartialEq for WebSocketMessage
impl PartialEq for WebSocketMessage
source§fn eq(&self, other: &WebSocketMessage) -> bool
fn eq(&self, other: &WebSocketMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for WebSocketMessage
impl StructuralEq for WebSocketMessage
impl StructuralPartialEq for WebSocketMessage
Auto Trait Implementations§
impl RefUnwindSafe for WebSocketMessage
impl Send for WebSocketMessage
impl Sync for WebSocketMessage
impl Unpin for WebSocketMessage
impl UnwindSafe for WebSocketMessage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.