pub fn ready<T>(val: T) -> Ready<T> โ๐Deprecated since 3.0.2:
Use core::future::ready(val) instead.
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);