futures::future

Function err

Source
pub fn err<T, E>(e: E) -> FutureResult<T, E>
Expand description

Creates a new future that will immediately fail with the given error.

ยงExamples

use futures_core::future::*;

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