Function actix::fut::future::result::err[][src]

pub fn err<T, E>(e: E) -> Ready<Result<T, E>>

Notable traits for Ready<T>

impl<T> Future for Ready<T> type Output = T;

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