#[repr(u8)]pub enum WebSocketOpcode {
Continuation = 0,
Text = 1,
Binary = 2,
Close = 8,
Ping = 9,
Pong = 10,
Reserved(u8),
}Expand description
WebSocket frame opcode types
Variants§
Continuation = 0
Represents a continuation frame (0x0).
Text = 1
Represents a text frame (0x1).
Binary = 2
Represents a binary frame (0x2).
Close = 8
Represents a connection close frame (0x8).
Ping = 9
Represents a ping frame (0x9).
Pong = 10
Represents a pong frame (0xA).
Reserved(u8)
Represents a reserved opcode for future use, including the specific byte value.
Implementations§
Source§impl WebSocketOpcode
impl WebSocketOpcode
Sourcepub fn is_control(&self) -> bool
pub fn is_control(&self) -> bool
Checks if the opcode is a control frame.
§Returns
bool-trueif the opcode represents a control frame (Close, Ping, Pong), otherwisefalse.
Sourcepub fn is_data(&self) -> bool
pub fn is_data(&self) -> bool
Checks if the opcode is a data frame.
§Returns
bool-trueif the opcode represents a data frame (Text, Binary, Continuation), otherwisefalse.
Sourcepub fn is_continuation(&self) -> bool
pub fn is_continuation(&self) -> bool
Checks if the opcode is a continuation frame.
§Returns
bool-trueif the opcode isContinuation, otherwisefalse.
Sourcepub fn is_binary(&self) -> bool
pub fn is_binary(&self) -> bool
Checks if the opcode is a binary frame.
§Returns
bool-trueif the opcode isBinary, otherwisefalse.
Sourcepub fn is_close(&self) -> bool
pub fn is_close(&self) -> bool
Checks if the opcode is a close frame.
§Returns
bool-trueif the opcode isClose, otherwisefalse.
Sourcepub fn is_reserved(&self) -> bool
pub fn is_reserved(&self) -> bool
Checks if the opcode is a reserved frame.
§Returns
bool-trueif the opcode isReserved(_), otherwisefalse.
Trait Implementations§
Source§impl Clone for WebSocketOpcode
impl Clone for WebSocketOpcode
Source§fn clone(&self) -> WebSocketOpcode
fn clone(&self) -> WebSocketOpcode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebSocketOpcode
impl Debug for WebSocketOpcode
Source§impl<'de> Deserialize<'de> for WebSocketOpcode
impl<'de> Deserialize<'de> for WebSocketOpcode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WebSocketOpcode
impl PartialEq for WebSocketOpcode
Source§fn eq(&self, other: &WebSocketOpcode) -> bool
fn eq(&self, other: &WebSocketOpcode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for WebSocketOpcode
impl Serialize for WebSocketOpcode
impl Copy for WebSocketOpcode
impl Eq for WebSocketOpcode
impl StructuralPartialEq for WebSocketOpcode
Auto Trait Implementations§
impl Freeze for WebSocketOpcode
impl RefUnwindSafe for WebSocketOpcode
impl Send for WebSocketOpcode
impl Sync for WebSocketOpcode
impl Unpin for WebSocketOpcode
impl UnsafeUnpin for WebSocketOpcode
impl UnwindSafe for WebSocketOpcode
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