Function smol::future::ready

source · []
pub fn ready<T>(val: T) -> Ready<T>Notable traits for Ready<T>impl<T> Future for Ready<T>    type Output = T;
Expand description

Creates a future that resolves to the provided value.

Examples

use futures_lite::future;

assert_eq!(future::ready(7).await, 7);