pub struct TrailerRecv { /* private fields */ }Expand description
Trailer receive handle.
Implementations§
Source§impl TrailerRecv
impl TrailerRecv
Sourcepub fn release(&mut self, n: usize)
pub fn release(&mut self, n: usize)
Returns n bytes of credit to the peer.
Only meaningful on a trailer obtained in manual-credit mode — via
CallContext::trailer_manual_credit or
CallResult::into_response_trailer_manual_credit.
§Deadlocks
Never attempt to receive multiple chunks or a fixed amount of data
(e.g. via AsyncReadExt::read_exact)
between credit releases, or a deadlock may result.
§Panics
In debug builds, if called on an automatic trailer, or if the running total exceeds the bytes actually delivered.
Source§impl TrailerRecv
impl TrailerRecv
Sourcepub fn poll_read_uninit(
&mut self,
cx: &mut Context<'_>,
buf: &mut [MaybeUninit<u8>],
) -> Poll<Result<usize>>
pub fn poll_read_uninit( &mut self, cx: &mut Context<'_>, buf: &mut [MaybeUninit<u8>], ) -> Poll<Result<usize>>
Reads into storage that need not be initialized, as
[AsyncRead::poll_read] does into storage that is.
Only initialized bytes are written, at the front of buf; the count
is returned, and zero means the trailer has ended.
Trait Implementations§
Source§impl AsyncRead for TrailerRecv
impl AsyncRead for TrailerRecv
Source§impl Drop for TrailerRecv
impl Drop for TrailerRecv
Auto Trait Implementations§
impl Freeze for TrailerRecv
impl RefUnwindSafe for TrailerRecv
impl Send for TrailerRecv
impl Sync for TrailerRecv
impl Unpin for TrailerRecv
impl UnsafeUnpin for TrailerRecv
impl UnwindSafe for TrailerRecv
Blanket Implementations§
§impl<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
impl<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
§fn chain<R>(self, next: R) -> Chain<Self, R>where
Self: Sized,
R: AsyncRead,
fn chain<R>(self, next: R) -> Chain<Self, R>where
Self: Sized,
R: AsyncRead,
Creates an adaptor which will chain this stream with another. Read more
§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 more§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 more§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 more§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 more§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