[−][src]Trait futures_util::io::AsyncBufRead
Read bytes asynchronously.
This trait is analogous to the std::io::BufRead
trait, but integrates
with the asynchronous task system. In particular, the poll_fill_buf
method, unlike BufRead::fill_buf
, will automatically queue the current task
for wakeup and return if data is not yet available, rather than blocking
the calling thread.
Required methods
fn poll_fill_buf(
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>
[+]
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>
fn consume(self: Pin<&mut Self>, amt: usize)
[+]
Implementations on Foreign Types
impl AsyncBufRead for Empty
[src][−]
fn poll_fill_buf(
self: Pin<&'a mut Empty>,
&mut Context
) -> Poll<Result<&'a [u8], Error>>
[src]
self: Pin<&'a mut Empty>,
&mut Context
) -> Poll<Result<&'a [u8], Error>>
fn consume(self: Pin<&mut Empty>, amt: usize)
[src]
impl<T> AsyncBufRead for Box<T> where
T: AsyncBufRead + Unpin + ?Sized,
[src][−]
T: AsyncBufRead + Unpin + ?Sized,
fn poll_fill_buf(
self: Pin<&'a mut Box<T>>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>
[src]
self: Pin<&'a mut Box<T>>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>
fn consume(self: Pin<&mut Box<T>>, amt: usize)
[src]
impl<'_> AsyncBufRead for &'_ [u8]
[src][−]
fn poll_fill_buf(
self: Pin<&'a mut &'_ [u8]>,
&mut Context
) -> Poll<Result<&'a [u8], Error>>
[src]
self: Pin<&'a mut &'_ [u8]>,
&mut Context
) -> Poll<Result<&'a [u8], Error>>
fn consume(self: Pin<&mut &'_ [u8]>, amt: usize)
[src]
impl<'_, T> AsyncBufRead for &'_ mut T where
T: AsyncBufRead + Unpin + ?Sized,
[src][−]
T: AsyncBufRead + Unpin + ?Sized,
fn poll_fill_buf(
self: Pin<&'a mut &'_ mut T>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>
[src]
self: Pin<&'a mut &'_ mut T>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>
fn consume(self: Pin<&mut &'_ mut T>, amt: usize)
[src]
impl<T> AsyncBufRead for Cursor<T> where
T: Unpin + AsRef<[u8]>,
[src][−]
T: Unpin + AsRef<[u8]>,
fn poll_fill_buf(
self: Pin<&'a mut Cursor<T>>,
&mut Context
) -> Poll<Result<&'a [u8], Error>>
[src]
self: Pin<&'a mut Cursor<T>>,
&mut Context
) -> Poll<Result<&'a [u8], Error>>
fn consume(self: Pin<&mut Cursor<T>>, amt: usize)
[src]
impl<P> AsyncBufRead for Pin<P> where
P: DerefMut + Unpin,
<P as Deref>::Target: AsyncBufRead,
[src][−]
P: DerefMut + Unpin,
<P as Deref>::Target: AsyncBufRead,
fn poll_fill_buf(
self: Pin<&'a mut Pin<P>>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>
[src]
self: Pin<&'a mut Pin<P>>,
cx: &mut Context
) -> Poll<Result<&'a [u8], Error>>