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§
Source§impl AsyncRead for RecvStream
impl AsyncRead for RecvStream
Source§impl Drop for RecvStream
impl Drop for RecvStream
Source§impl RecvStream for RecvStream
Available on target_family=wasm only.
impl RecvStream for RecvStream
Available on
target_family=wasm only.Source§async fn read(&mut self, dst: &mut [u8]) -> Result<Option<usize>, Self::Error>
async fn read(&mut self, dst: &mut [u8]) -> Result<Option<usize>, Self::Error>
Read the next chunk of data, up to the max size. Read more
Source§fn stop(&mut self, code: u32)
fn stop(&mut self, code: u32)
Send a
STOP_SENDING QUIC code, informing the peer that no more data will be read. Read moreSource§async fn closed(&mut self) -> Result<(), Self::Error>
async fn closed(&mut self) -> Result<(), Self::Error>
Block until the stream has been closed by either side. Read more
Source§fn read_buf<B>(
&mut self,
buf: &mut B,
) -> impl Future<Output = Result<Option<usize>, Self::Error>> + MaybeSend
fn read_buf<B>( &mut self, buf: &mut B, ) -> impl Future<Output = Result<Option<usize>, Self::Error>> + MaybeSend
Read some data into the provided buffer. Read more
Source§fn read_chunk(
&mut self,
max: usize,
) -> impl Future<Output = Result<Option<Bytes>, Self::Error>> + MaybeSend
fn read_chunk( &mut self, max: usize, ) -> impl Future<Output = Result<Option<Bytes>, Self::Error>> + MaybeSend
Read the next chunk of data, up to the max size. Read more
Auto Trait Implementations§
impl !Freeze for RecvStream
impl !RefUnwindSafe for RecvStream
impl !Send for RecvStream
impl !Sync for RecvStream
impl !UnwindSafe for RecvStream
impl Unpin for RecvStream
impl UnsafeUnpin for RecvStream
Blanket Implementations§
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn chain<R>(self, next: R) -> Chain<Self, R>
fn chain<R>(self, next: R) -> Chain<Self, R>
Creates an adaptor which will chain this stream with another. Read more
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
Tries to read some bytes directly into the given
buf in asynchronous
manner, returning a future type. Read moreSource§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectored<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectored<'a, Self>where
Self: Unpin,
Creates a future which will read from the
AsyncRead into bufs using vectored
IO operations. Read moreSource§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
Creates a future which will read exactly enough bytes to fill
buf,
returning an error if end of file (EOF) is hit sooner. Read moreSource§fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
Creates a future which will read all the bytes from this
AsyncRead. Read moreSource§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToString<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToString<'a, Self>where
Self: Unpin,
Creates a future which will read all the bytes from this
AsyncRead. Read moreSource§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