Struct ws_tool::codec::FrameReadState
source · pub struct FrameReadState { /* private fields */ }Expand description
websocket read state
Implementations§
source§impl FrameReadState
impl FrameReadState
sourcepub fn with_config(config: FrameConfig) -> Self
pub fn with_config(config: FrameConfig) -> Self
construct with config
sourcepub fn is_header_ok(&self) -> bool
pub fn is_header_ok(&self) -> bool
check if data in buffer is enough to parse frame header
sourcepub fn get_leading_bits(&self) -> u8
pub fn get_leading_bits(&self) -> u8
return current frame header bits of buffer
sourcepub fn parse_frame_header(&mut self) -> Result<usize, WsError>
pub fn parse_frame_header(&mut self) -> Result<usize, WsError>
try to parse frame header in buffer, return expected payload
sourcepub fn consume_frame(&mut self, len: usize) -> OwnedFrame
pub fn consume_frame(&mut self, len: usize) -> OwnedFrame
get a frame and reset state
Trait Implementations§
source§impl Clone for FrameReadState
impl Clone for FrameReadState
source§fn clone(&self) -> FrameReadState
fn clone(&self) -> FrameReadState
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 FrameReadState
impl Debug for FrameReadState
Auto Trait Implementations§
impl RefUnwindSafe for FrameReadState
impl Send for FrameReadState
impl Sync for FrameReadState
impl Unpin for FrameReadState
impl UnwindSafe for FrameReadState
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