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 Future
s.
Provided Methods§
Sourcefn pending<T>() -> FuturePending<T> ⓘ
fn pending<T>() -> FuturePending<T> ⓘ
Creates a future which never resolves.
Sourcefn poll_fn<T, F>(function: F) -> FuturePollFn<F> ⓘ
fn poll_fn<T, F>(function: F) -> FuturePollFn<F> ⓘ
Creates a future that wraps a function
returning TaskPoll
.
Sourcefn ready<T>(value: T) -> FutureReady<T> ⓘ
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.