pub fn err<T, E>(err: E) -> Ready<Result<T, E>> โ๐Deprecated since 3.0.2:
Use core::future::ready(Err(err)) instead.
Expand description
Creates a future that is immediately ready with an error value.
ยงExamples
use actix_utils::future::err;
let a = err::<(), _>(1);
assert_eq!(a.await, Err(1));