pub enum WsEvent {
Text(String),
Binary(Vec<u8>),
Ping(Vec<u8>),
Pong(Vec<u8>),
Close(Option<WsClose>),
}Expand description
An event from WebSocket::recv_event — every frame type, including the
control frames that WebSocket::recv handles for you silently.
Variants§
Text(String)
A reassembled UTF-8 text message.
Binary(Vec<u8>)
A reassembled binary message.
Ping(Vec<u8>)
A ping from the peer (already answered with a pong unless auto-pong was
disabled via WebSocket::set_auto_pong); carries its application data.
Pong(Vec<u8>)
An unsolicited or solicited pong from the peer; carries its data.
Close(Option<WsClose>)
The peer closed the connection (already echoed). Carries the close code and reason when the peer supplied them.
Trait Implementations§
impl Eq for WsEvent
impl StructuralPartialEq for WsEvent
Auto Trait Implementations§
impl Freeze for WsEvent
impl RefUnwindSafe for WsEvent
impl Send for WsEvent
impl Sync for WsEvent
impl Unpin for WsEvent
impl UnsafeUnpin for WsEvent
impl UnwindSafe for WsEvent
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