Function futures::future::err[][src]

pub fn err<T, E>(e: E) -> FutureResult<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 futures::future::*;

let future_of_err_1 = err::<u32, u32>(1);