Trait FutureFrom

Source
pub trait FutureFrom<T>: Sized {
    type Future: Future<Item = Self, Error = Self::Error>;
    type Error;

    // Required method
    fn future_from(_: T) -> Self::Future;
}
Expand description

Asynchronous conversion from a type T.

This trait is analogous to std::convert::From, adapted to asynchronous computation.

Required Associated Types§

Source

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

The future for the conversion.

Source

type Error

Possible errors during conversion.

Required Methods§

Source

fn future_from(_: T) -> Self::Future

Consume the given value, beginning the conversion.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§