logo

Function actix_utils::future::err[−][src]

pub fn err<T, E>(err: E) -> Ready<Result<T, E>>ⓘ
Notable traits for Ready<T>
impl<T> Future for Ready<T> type Output = T;
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));