pub enum Opcode {
Continuation = 0,
Text = 1,
Binary = 2,
ConnectionClose = 8,
Ping = 9,
Pong = 10,
// some variants omitted
}
Expand description
WebSocket frame type.
Also includes reserved opcode types as #[doc(hidden)]
items.
Variants§
Continuation = 0
A continuation frame. Follows Opcode::Text
or Opcode::Binary
frames, extending content of it.
Final Continuation
frames has FrameInfo::fin
set to true.
There may be control frames (e.g. Opcode::Ping
) between initial data frame and continuation frames.
Text = 1
First frame of a text WebSocket message.
Binary = 2
First frame of a binary WebSocket message.
ConnectionClose = 8
Last frame, indicating that WebSocket connection is now closed. You should close the socket upon receipt of this message.
Ping = 9
WebSocket ping message. You should copy the payload to outgoing
Opcode::Pong
frame.
Pong = 10
A reply to Opcode::Pong
message.
Implementations§
Trait Implementations§
Source§impl Ord for Opcode
impl Ord for Opcode
Source§impl PartialOrd for Opcode
impl PartialOrd for Opcode
impl Copy for Opcode
impl Eq for Opcode
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
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