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 Unpin for RecvStream
impl UnsafeUnpin 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