Trait ExtFuture

Source
pub trait ExtFuture: Future {
    // Provided methods
    fn pending<T>() -> FuturePending<T>  { ... }
    fn poll_fn<T, F>(function: F) -> FuturePollFn<F> 
       where F: FnMut(&mut TaskContext<'_>) -> TaskPoll<T> { ... }
    fn ready<T>(value: T) -> FutureReady<T>  { ... }
}
Expand description

Extension trait providing additional methods for Futures.

Provided Methods§

Source

fn pending<T>() -> FuturePending<T>

Creates a future which never resolves.

Source

fn poll_fn<T, F>(function: F) -> FuturePollFn<F>
where F: FnMut(&mut TaskContext<'_>) -> TaskPoll<T>,

Creates a future that wraps a function returning TaskPoll.

Source

fn ready<T>(value: T) -> FutureReady<T>

Creates a future that is immediately ready with a value.

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§

Source§

impl<F: Future> ExtFuture for F