pub struct FrameDecoder { /* private fields */ }Expand description
Incremental decoder over a byte stream: accepts arbitrary fragments, yields complete bodies, and holds partial headers/bodies across reads. Bounds trip before unbounded buffering.
Implementations§
Source§impl FrameDecoder
impl FrameDecoder
pub fn new() -> Self
Sourcepub fn accept(&mut self, bytes: &[u8]) -> Result<(), FrameError>
pub fn accept(&mut self, bytes: &[u8]) -> Result<(), FrameError>
Append stream bytes. Fails (typed) the moment a header exceeds its bound; body bounds trip at header parse.
Sourcepub fn next_frame(&mut self) -> Result<Option<Vec<u8>>, FrameError>
pub fn next_frame(&mut self) -> Result<Option<Vec<u8>>, FrameError>
Take one complete frame body, if one is buffered.
Trait Implementations§
Source§impl Debug for FrameDecoder
impl Debug for FrameDecoder
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