pub struct RecvStream { /* private fields */ }
Expand description
An incoming stream of bytes from the peer.
All bytes are flushed in order and the stream is flow controlled. The stream will be closed with STOP_SENDING code=0 when dropped.
Implementations§
Source§impl RecvStream
impl RecvStream
Sourcepub async fn read(&mut self, max: usize) -> Result<Option<Bytes>, Error>
pub async fn read(&mut self, max: usize) -> Result<Option<Bytes>, Error>
Read the next chunk of data with the provided maximum size.
This returns a chunk of data instead of copying, which may be more efficient.
Auto Trait Implementations§
impl Freeze for RecvStream
impl RefUnwindSafe for RecvStream
impl Send for RecvStream
impl Sync for RecvStream
impl Unpin for RecvStream
impl UnwindSafe for RecvStream
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