pub enum Message {
Text(String),
Binary(Vec<u8>),
}
Expand description
An enum representing the various forms of a WebSocket message.
Variants§
Implementations§
Source§impl Message
impl Message
Sourcepub fn binary<B>(bin: B) -> Message
pub fn binary<B>(bin: B) -> Message
Create a new binary WebSocket message by converting to Vec
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the WebSocket message has no content. For example, if the other side of the connection sent an empty string.
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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