pub struct FrameReader { /* private fields */ }Expand description
A frame decoder whose partial progress outlives the future that reads it.
read_frame keeps the bytes it has read inside its own future, so a
caller that drops the future mid-frame — tokio::select! choosing another
branch — loses them and every later frame boundary with them. This reader
keeps them in buf instead: FrameReader::next awaits only
AsyncReadExt::read_buf, which is cancel-safe, so dropping a next
future discards nothing, and the next call resumes where the stream is.
Implementations§
Trait Implementations§
Source§impl Debug for FrameReader
impl Debug for FrameReader
Auto Trait Implementations§
impl Freeze for FrameReader
impl RefUnwindSafe for FrameReader
impl Send for FrameReader
impl Sync for FrameReader
impl Unpin for FrameReader
impl UnsafeUnpin for FrameReader
impl UnwindSafe for FrameReader
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