Enum ws::Message
[−]
[src]
pub enum Message { Text(String), Binary(Vec<u8>), }
Variants
Text(String)
Binary(Vec<u8>)
Methods
impl Message
[src]
fn text<S>(string: S) -> Message where S: Into<String>
fn binary<B>(bin: B) -> Message where B: Into<Vec<u8>>
fn len(&self) -> usize
fn opcode(&self) -> OpCode
fn into_data(self) -> Vec<u8>
fn into_text(self) -> Result<String>
fn as_text(&self) -> Result<&str>
Trait Implementations
impl Clone for Message
[src]
fn clone(&self) -> Message
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Message
[src]
fn eq(&self, __arg_0: &Message) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Message) -> bool
This method tests for !=
.