pub struct Buffered<S> { /* private fields */ }Expand description
Leases over a transport that cannot keep bytes unconsumed, buffering what it reads.
The transport returns credit as it reads, so incomplete messages are bounded by the largest message each, not by its receive window, and nothing is evicted.
Implementations§
Trait Implementations§
Source§impl<S: Chunks> RecvStream for Buffered<S>
impl<S: Chunks> RecvStream for Buffered<S>
Source§type Lease<'a> = BufferedLease<'a>
where
S: 'a
type Lease<'a> = BufferedLease<'a> where S: 'a
The unreleased bytes borrowed from this stream.
Source§fn poll_lease(
&mut self,
waiter: &Waiter,
want: usize,
) -> Poll<Result<BufferedLease<'_>, S::Error>>
fn poll_lease( &mut self, waiter: &Waiter, want: usize, ) -> Poll<Result<BufferedLease<'_>, S::Error>>
Poll until at least
want bytes are leased, or the peer finished the stream with
fewer. Read moreSource§fn set_priority(&mut self, _priority: i64)
fn set_priority(&mut self, _priority: i64)
Rank this stream for eviction when incomplete messages exhaust the receive window. 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, and discard what is buffered. Read moreSource§fn poll_reset(&mut self, waiter: &Waiter) -> Poll<S::Error>
fn poll_reset(&mut self, waiter: &Waiter) -> Poll<S::Error>
Poll until the stream fails without reading it: the peer resets it, the receiver
evicts it to free a stuck window, or the connection closes. Pending for good once the
peer finished it. Read more
Source§fn set_window(&mut self, window: u64) -> Option<u64>
fn set_window(&mut self, window: u64) -> Option<u64>
Let the peer send at most
window bytes past what the reader took, rather than the
stream’s full receive credit, returning the connection credit the stream may hold from
now on: the bytes that arrived and were not released, and those the peer may still send. Read moreAuto Trait Implementations§
impl<S> Freeze for Buffered<S>where
S: Freeze,
impl<S> RefUnwindSafe for Buffered<S>where
S: RefUnwindSafe,
impl<S> Send for Buffered<S>where
S: Send,
impl<S> Sync for Buffered<S>where
S: Sync,
impl<S> Unpin for Buffered<S>where
S: Unpin,
impl<S> UnsafeUnpin for Buffered<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Buffered<S>where
S: UnwindSafe,
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