Struct ws_tool::codec::FrameReadState
source · [−]pub struct FrameReadState { /* private fields */ }
Expand description
websocket read state
Implementations
sourceimpl FrameReadState
impl FrameReadState
sourceimpl FrameReadState
impl FrameReadState
sourcepub fn with_remain(config: FrameConfig, read_data: BytesMut) -> Self
pub fn with_remain(config: FrameConfig, read_data: BytesMut) -> Self
construct with config and bytes remaining in handshake
sourcepub fn with_config(config: FrameConfig) -> Self
pub fn with_config(config: FrameConfig) -> Self
construct with config
sourcepub fn leading_bits_ok(&self) -> bool
pub fn leading_bits_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) -> ReadFrame
pub fn consume_frame(&mut self, len: usize) -> ReadFrame
get a frame and reset state
Trait Implementations
sourceimpl Clone for FrameReadState
impl Clone for FrameReadState
sourcefn clone(&self) -> FrameReadState
fn clone(&self) -> FrameReadState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more