[−][src]Trait futures_io::AsyncRead
Read bytes asynchronously.
This trait is analogous to the std::io::Read
trait, but integrates
with the asynchronous task system. In particular, the poll_read
method, unlike Read::read
, will automatically queue the current task
for wakeup and return if data is not yet available, rather than blocking
the calling thread.
Required methods
Provided methods
unsafe fn initializer(&self) -> Initializer
[+]
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[+]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
Implementations on Foreign Types
impl<T: ?Sized + AsyncRead + Unpin> AsyncRead for Box<T>
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
impl<T: ?Sized + AsyncRead + Unpin, '_> AsyncRead for &'_ mut T
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
impl<P> AsyncRead for Pin<P> where
P: DerefMut + Unpin,
P::Target: AsyncRead,
[src][−]
P: DerefMut + Unpin,
P::Target: AsyncRead,
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
impl<'_> AsyncRead for &'_ [u8]
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
impl AsyncRead for Repeat
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
impl AsyncRead for Empty
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
impl<T: AsRef<[u8]> + Unpin> AsyncRead for Cursor<T>
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
_: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize>>