pub struct WebSocketFrame { /* private fields */ }Expand description
Represents a decoded WebSocket frame
Implementations§
Source§impl WebSocketFrame
impl WebSocketFrame
Sourcepub fn decode_websocket_frame_with_length(
data: &[u8],
) -> WebsocketFrameWithLengthOption
pub fn decode_websocket_frame_with_length( data: &[u8], ) -> WebsocketFrameWithLengthOption
Sourcepub fn create_response_frame_list(body: &ResponseBody) -> Vec<ResponseBody> ⓘ
pub fn create_response_frame_list(body: &ResponseBody) -> Vec<ResponseBody> ⓘ
create_response_frame_list
body: A reference to a response body (payload) as a byte slice.- Returns: A vector of response bodies (frames) representing the framed data.
Sourcepub fn sha1(data: &[u8]) -> [u8; 20]
pub fn sha1(data: &[u8]) -> [u8; 20]
sha1
data: A byte slice containing the input data to be hashed.- Returns: A 20-byte array representing the SHA-1 hash of the input data.
Sourcepub fn generate_accept_key(key: &str) -> String
pub fn generate_accept_key(key: &str) -> String
generate_accept_key
key: A string slice containing the client-provided key.- Returns: A string representing the generated WebSocket accept key.
Sourcepub fn base64_encode(data: &[u8]) -> String
pub fn base64_encode(data: &[u8]) -> String
base64_encode
data: A byte slice containing the data to encode in base64.- Returns: A string with the base64 encoded representation of the input data.
Sourcepub fn opcode_is_continuation(&self) -> bool
pub fn opcode_is_continuation(&self) -> bool
Sourcepub fn opcode_is_text(&self) -> bool
pub fn opcode_is_text(&self) -> bool
Sourcepub fn opcode_is_binary(&self) -> bool
pub fn opcode_is_binary(&self) -> bool
Sourcepub fn opcode_is_close(&self) -> bool
pub fn opcode_is_close(&self) -> bool
Sourcepub fn opcode_is_ping(&self) -> bool
pub fn opcode_is_ping(&self) -> bool
Sourcepub fn opcode_is_pong(&self) -> bool
pub fn opcode_is_pong(&self) -> bool
Sourcepub fn opcode_is_reserved(&self) -> bool
pub fn opcode_is_reserved(&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§fn clone_from(&mut self, source: &Self)
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