blob: 170bc5938124ac33091f7fc840a52ed800a8d245 [file] [log] [blame]
use super::Compat;
use futures::Future as Future01;
impl<Fut: Future01> Future01CompatExt for Fut {}
/// Extension trait for futures 0.1 [`Future`][futures::Future]
pub trait Future01CompatExt: Future01 {
/// Converts a futures 0.1 [`Future<Item = T, Error = E>`][futures::Future]
/// into a futures 0.3 [`Future<Output = Result<T,
/// E>>`][futures_core::Future].
fn compat(self) -> Compat<Self, ()> where Self: Sized {
Compat::new(self, None)
}
}