Function actix_utils::future::ready
source · pub fn ready<T>(val: T) -> Ready<T> ⓘ
Expand description
Creates a future that is immediately ready with a value.
§Examples
use actix_utils::future::ready;
let a = ready(1);
assert_eq!(a.await, 1);
// sync
let a = ready(1);
assert_eq!(a.into_inner(), 1);