std::future::ready - Rust
Description: API documentation for the Rust `ready` fn in crate `std`.
Keywords: rust, rustlang, rust-lang, ready

# [−][src]Function std::future::ready

###

    pub fn ready<T>(t: T) -> Ready<T>ⓘNotable traits for Ready<T>impl<T> Future for Ready<T>    type Output = T;

🔬 This is a nightly-only experimental API. (`future_readiness_fns` #70921)

Creates a future that is immediately ready with a value.

# Examples

    #![feature(future_readiness_fns)]
    use core::future;

    let a = future::ready(1);
    assert_eq!(a.await, 1);

Run