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],
) -> Option<(WebSocketFrame, usize)>
pub fn decode_websocket_frame_with_length( data: &[u8], ) -> Option<(WebSocketFrame, usize)>
Sourcepub fn create_response_frame_list(body: &Vec<u8>) -> Vec<Vec<u8>>
pub fn create_response_frame_list(body: &Vec<u8>) -> Vec<Vec<u8>>
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.
Source§impl WebSocketFrame
impl WebSocketFrame
pub fn get_fin(&self) -> &bool
pub fn get_mut_fin(&mut self) -> &mut bool
pub fn get_opcode(&self) -> &u8
pub fn get_mut_opcode(&mut self) -> &mut u8
pub fn get_mask(&self) -> &bool
pub fn get_mut_mask(&mut self) -> &mut bool
pub fn get_payload_data(&self) -> &Vec<u8> ⓘ
pub fn get_mut_payload_data(&mut self) -> &mut Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for WebSocketFrame
impl Clone for WebSocketFrame
Source§fn clone(&self) -> WebSocketFrame
fn clone(&self) -> WebSocketFrame
Returns a copy 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§fn default() -> WebSocketFrame
fn default() -> WebSocketFrame
Returns the “default value” for a type. Read more
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