pub struct WebSocketFrame { /* private fields */ }
Expand description
Represents a decoded WebSocket frame
Implementations§
Source§impl WebSocketFrame
impl WebSocketFrame
Sourcepub fn decode_ws_frame(data: &[u8]) -> WebsocketFrameWithLengthOption
pub fn decode_ws_frame(data: &[u8]) -> WebsocketFrameWithLengthOption
Decodes a WebSocket frame from the provided data slice.
§Parameters
data
: The raw data slice from the WebSocket stream.
§Returns
- An Option containing a tuple (WebSocketFrame, usize), where the WebSocketFrame is the decoded frame and usize is the number of bytes consumed. Returns None if the frame is incomplete.
Sourcepub fn create_response_frame_list(body: &ResponseBody) -> Vec<ResponseBody> ⓘ
pub fn create_response_frame_list(body: &ResponseBody) -> Vec<ResponseBody> ⓘ
Sourcepub fn generate_accept_key(key: &str) -> String
pub fn generate_accept_key(key: &str) -> String
Sourcepub fn base64_encode(data: &[u8]) -> String
pub fn base64_encode(data: &[u8]) -> String
Sourcepub fn is_continuation_opcode(&self) -> bool
pub fn is_continuation_opcode(&self) -> bool
Sourcepub fn is_text_opcode(&self) -> bool
pub fn is_text_opcode(&self) -> bool
Sourcepub fn is_binary_opcode(&self) -> bool
pub fn is_binary_opcode(&self) -> bool
Sourcepub fn is_close_opcode(&self) -> bool
pub fn is_close_opcode(&self) -> bool
Sourcepub fn is_ping_opcode(&self) -> bool
pub fn is_ping_opcode(&self) -> bool
Sourcepub fn is_pong_opcode(&self) -> bool
pub fn is_pong_opcode(&self) -> bool
Sourcepub fn is_reserved_opcode(&self) -> bool
pub fn is_reserved_opcode(&self) -> bool
Source§impl WebSocketFrame
impl WebSocketFrame
pub fn get_fin(&self) -> &bool
pub fn get_opcode(&self) -> &WebSocketOpcode
pub fn get_mask(&self) -> &bool
pub fn get_payload_data(&self) -> &Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for WebSocketFrame
impl Clone for WebSocketFrame
Source§fn clone(&self) -> WebSocketFrame
fn clone(&self) -> WebSocketFrame
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WebSocketFrame
impl Debug for WebSocketFrame
Source§impl Default for WebSocketFrame
impl Default for WebSocketFrame
Source§impl Display for WebSocketFrame
impl Display for WebSocketFrame
Source§impl PartialEq for WebSocketFrame
impl PartialEq for WebSocketFrame
impl Eq for WebSocketFrame
impl StructuralPartialEq for WebSocketFrame
Auto Trait Implementations§
impl Freeze for WebSocketFrame
impl RefUnwindSafe for WebSocketFrame
impl Send for WebSocketFrame
impl Sync for WebSocketFrame
impl Unpin for WebSocketFrame
impl UnwindSafe for WebSocketFrame
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