pub struct FrameDecoder { /* private fields */ }Expand description
Splits a byte stream into frame payloads, buffering partial frames.
Implementations§
Source§impl FrameDecoder
impl FrameDecoder
pub fn new(limit: u32) -> FrameDecoder
pub fn limit(&self) -> u32
Sourcepub fn set_limit(&mut self, limit: u32)
pub fn set_limit(&mut self, limit: u32)
Applies limit to frames whose header has not been read yet.
Sourcepub fn next_frame(&mut self) -> Option<Result<&[u8], Oversized>>
pub fn next_frame(&mut self) -> Option<Result<&[u8], Oversized>>
The next complete payload, an oversized frame’s report, or None until
more bytes arrive.
Sourcepub fn is_discarding(&self) -> bool
pub fn is_discarding(&self) -> bool
Whether the decoder is dropping the rest of an oversized frame.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrameDecoder
impl RefUnwindSafe for FrameDecoder
impl Send for FrameDecoder
impl Sync for FrameDecoder
impl Unpin for FrameDecoder
impl UnsafeUnpin for FrameDecoder
impl UnwindSafe for FrameDecoder
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