futures::prelude

Trait IntoFuture

Source
pub trait IntoFuture {
    type Future: Future<Item = Self::Item, Error = Self::Error>;
    type Item;
    type Error;

    // Required method
    fn into_future(self) -> Self::Future;
}
Expand description

Types that can be converted into a future.

This trait is very similar to the IntoIterator trait.

Required Associated Types§

Source

type Future: Future<Item = Self::Item, Error = Self::Error>

The future that this type can be converted into.

Source

type Item

The item that the future may resolve with.

Source

type Error

The error that the future may resolve with.

Required Methods§

Source

fn into_future(self) -> Self::Future

Consumes this object and produces a future.

Implementations on Foreign Types§

Source§

impl<T> IntoFuture for Option<T>
where T: IntoFuture,

Source§

impl<T, E> IntoFuture for Result<T, E>

Implementors§

Source§

impl<F> IntoFuture for F
where F: Future,

Source§

type Future = F

Source§

type Item = <F as Future>::Item

Source§

type Error = <F as Future>::Error