pub enum WsEvent<'a> {
Data {
text: bool,
payload: &'a [u8],
fin: bool,
},
Ping(&'a [u8]),
Pong(&'a [u8]),
Close {
code: Option<u16>,
reason: &'a str,
},
NeedMore,
}Expand description
One decoded event.
Variants§
Data
A piece of a data message, unmasked. fin marks the message’s last piece; text tells
the message type. Pieces of a text message may split a UTF-8 sequence; the message as a
whole is checked.
Fields
Ping(&'a [u8])
A ping; answer with a pong carrying the same payload.
Pong(&'a [u8])
A pong.
Close
A close, with the code and reason if present; answer with a close and stop.
NeedMore
More bytes are needed.
Trait Implementations§
impl<'a> Eq for WsEvent<'a>
impl<'a> StructuralPartialEq for WsEvent<'a>
Auto Trait Implementations§
impl<'a> Forget for WsEvent<'a>
impl<'a> Freeze for WsEvent<'a>
impl<'a> Move for WsEvent<'a>
impl<'a> RefUnwindSafe for WsEvent<'a>
impl<'a> Send for WsEvent<'a>
impl<'a> Sync for WsEvent<'a>
impl<'a> Unpin for WsEvent<'a>
impl<'a> UnsafeUnpin for WsEvent<'a>
impl<'a> UnwindSafe for WsEvent<'a>
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