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

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

Important traits for Ready<T>

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

Create a future that is immediately ready with an error value.

Examples

use futures::future;

let a = future::err::<i32, i32>(1);
assert_eq!(a.await, Err(1));