[−][src]Trait futures_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<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
[+]
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)
[+]
Implementations on Foreign Types
impl<T: ?Sized + AsyncBufRead + Unpin> AsyncBufRead for Box<T>
[src][−]
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
[src]
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)
[src]
impl<T: ?Sized + AsyncBufRead + Unpin, '_> AsyncBufRead for &'_ mut T
[src][−]
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
[src]
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)
[src]
impl<P> AsyncBufRead for Pin<P> where
P: DerefMut + Unpin,
P::Target: AsyncBufRead,
[src][−]
P: DerefMut + Unpin,
P::Target: AsyncBufRead,
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
[src]
self: Pin<&'a mut Self>,
cx: &mut Context
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)
[src]
impl<'_> AsyncBufRead for &'_ [u8]
[src][−]
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_: &mut Context
) -> Poll<Result<&'a [u8]>>
[src]
self: Pin<&'a mut Self>,
_: &mut Context
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)
[src]
impl AsyncBufRead for Empty
[src][−]
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_: &mut Context
) -> Poll<Result<&'a [u8]>>
[src]
self: Pin<&'a mut Self>,
_: &mut Context
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)
[src]
impl<T: AsRef<[u8]> + Unpin> AsyncBufRead for Cursor<T>
[src][−]
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_: &mut Context
) -> Poll<Result<&'a [u8]>>
[src]
self: Pin<&'a mut Self>,
_: &mut Context
) -> Poll<Result<&'a [u8]>>