[−][src]Trait futures::prelude::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
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[+]
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
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, Error>>
[+]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
Implementations on Foreign Types
impl<T> AsyncRead for Cursor<T> where
T: Unpin + AsRef<[u8]>,
[src][−]
T: Unpin + AsRef<[u8]>,
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Cursor<T>>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Cursor<T>>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl<T> AsyncRead for Box<T> where
T: AsyncRead + Unpin + ?Sized,
[src][−]
T: AsyncRead + Unpin + ?Sized,
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Box<T>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Box<T>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut Box<T>>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Box<T>>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl<P> AsyncRead for Pin<P> where
P: DerefMut + Unpin,
<P as Deref>::Target: AsyncRead,
[src][−]
P: DerefMut + Unpin,
<P as Deref>::Target: AsyncRead,
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Pin<P>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Pin<P>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut Pin<P>>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Pin<P>>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl AsyncRead for Repeat
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Repeat>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Repeat>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl AsyncRead for Empty
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Empty>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Empty>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl<'_> AsyncRead for &'_ [u8]
[src][−]
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut &'_ [u8]>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut &'_ [u8]>,
&mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl<'_, T> AsyncRead for &'_ mut T where
T: AsyncRead + Unpin + ?Sized,
[src][−]
T: AsyncRead + Unpin + ?Sized,
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut &'_ mut T>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut &'_ mut T>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut &'_ mut T>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut &'_ mut T>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
Implementors
impl<R> AsyncRead for Compat01As03<R> where
R: AsyncRead,
[src][−]
R: AsyncRead,
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_read(
self: Pin<&mut Compat01As03<R>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Compat01As03<R>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl<R> AsyncRead for ReadHalf<R> where
R: AsyncRead,
[src][−]
R: AsyncRead,
fn poll_read(
self: Pin<&mut ReadHalf<R>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut ReadHalf<R>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_vectored_read(
self: Pin<&mut ReadHalf<R>>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut ReadHalf<R>>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
unsafe fn initializer(&self) -> Initializer
[src]
impl<St> AsyncRead for IntoAsyncRead<St> where
St: TryStream<Error = Error> + Unpin,
<St as TryStream>::Ok: AsRef<[u8]>,
[src][−]
St: TryStream<Error = Error> + Unpin,
<St as TryStream>::Ok: AsRef<[u8]>,
fn poll_read(
self: Pin<&mut IntoAsyncRead<St>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut IntoAsyncRead<St>>,
cx: &mut Context,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
unsafe fn initializer(&self) -> Initializer
[src]
fn poll_vectored_read(
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
vec: &mut [&mut IoVec]
) -> Poll<Result<usize, Error>>
impl<T> AsyncRead for AllowStdIo<T> where
T: Read,
[src][−]
T: Read,