Enum cataclysm_ws::Message
source · pub enum Message {
Text(String),
Binary(Vec<u8>),
Ping(Vec<u8>),
Pong(Vec<u8>),
Close,
}Expand description
Message structure contained in a frame
Variants§
Text(String)
Text message
Binary(Vec<u8>)
Binary message
Ping(Vec<u8>)
Ping message
Pong(Vec<u8>)
Pong message
Close
Close message
Implementations§
source§impl Message
impl Message
sourcepub fn text<A: Into<String>>(text: A) -> Message
pub fn text<A: Into<String>>(text: A) -> Message
Geneates an instances of the Message::Text variant
sourcepub fn binary<A: Into<Vec<u8>>>(bytes: A) -> Message
pub fn binary<A: Into<Vec<u8>>>(bytes: A) -> Message
Geneates an instances of the Message::Binary variant
sourcepub fn ping<A: Into<Vec<u8>>>(payload: A) -> Message
pub fn ping<A: Into<Vec<u8>>>(payload: A) -> Message
Geneates an instances of the Message::Binary variant
sourcepub fn pong<A: Into<Vec<u8>>>(payload: A) -> Message
pub fn pong<A: Into<Vec<u8>>>(payload: A) -> Message
Geneates an instances of the Message::Binary variant
sourcepub fn is_close(&self) -> bool
pub fn is_close(&self) -> bool
Indicates if the variant equates de Message::Close variant
sourcepub fn is_ping(&self) -> bool
pub fn is_ping(&self) -> bool
Indicates if the variant equates de Message::Ping variant
sourcepub fn is_pong(&self) -> bool
pub fn is_pong(&self) -> bool
Indicates if the variant equates de Message::Pong variant
Trait Implementations§
Auto Trait Implementations§
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