Trait futures::compat::Future01CompatExt[][src]

pub trait Future01CompatExt: Future {
    pub fn compat(self) -> Compat01As03<Self>

Notable traits for Compat01As03<Fut>

impl<Fut> Future for Compat01As03<Fut> where
    Fut: Future
type Output = Result<<Fut as Future>::Item, <Fut as Future>::Error>;
{ ... } }

Extension trait for futures 0.1 Future

Provided methods

pub fn compat(self) -> Compat01As03<Self>

Notable traits for Compat01As03<Fut>

impl<Fut> Future for Compat01As03<Fut> where
    Fut: Future
type Output = Result<<Fut as Future>::Item, <Fut as Future>::Error>;
[src]

Converts a futures 0.1 Future<Item = T, Error = E> into a futures 0.3 Future<Output = Result<T, E>>.

use futures_util::compat::Future01CompatExt;

let future = futures_01::future::ok::<u32, ()>(1);
assert_eq!(future.compat().await, Ok(1));
Loading content...

Implementors

impl<Fut> Future01CompatExt for Fut where
    Fut: Future
[src]

Loading content...