[−][src]Trait futures::compat::AsyncRead01CompatExt
Extension trait for tokio-io AsyncRead
Provided methods
ⓘImportant traits for Compat01As03<Fut>fn compat(self) -> Compat01As03<Self>
ⓘImportant traits for Compat01As03<Fut>
Converts a tokio-io AsyncRead
into a futures-io 0.3
AsyncRead
.
#![feature(async_await, await_macro, impl_trait_in_bindings)] use futures::io::AsyncReadExt; use futures_util::compat::AsyncRead01CompatExt; let input = b"Hello World!"; let reader: impl tokio_io::AsyncRead = std::io::Cursor::new(input); let mut reader: impl futures::io::AsyncRead + Unpin = reader.compat(); let mut output = Vec::with_capacity(12); await!(reader.read_to_end(&mut output)).unwrap(); assert_eq!(output, input);
Implementors
impl<R> AsyncRead01CompatExt for R where
R: AsyncRead,
[src]
R: AsyncRead,
ⓘImportant traits for Compat01As03<Fut>fn compat(self) -> Compat01As03<Self>
[src]
ⓘImportant traits for Compat01As03<Fut>