pub fn err<T, E>(e: E) -> Ready<Result<T, E>> ⓘ
Expand description
Creates a “leaf future” from an immediate value of a failed computation.
The returned future is similar to result
where it will immediately run a
scheduled callback with the provided value.
§Examples
use actix::{fut, Actor, Context};
struct MyActor;
impl Actor for MyActor {
type Context = Context<Self>;
}
let future_of_err_1 = fut::err::<u32, u32>(1);