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 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);