pub struct RecvStream { /* private fields */ }Expand description
A byte stream received from the remote peer.
Either side may close with an error code, or the peer may close with a FIN.
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 can be more efficient.
Trait Implementations§
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