Function futures_util::future::err [−][src]
Expand description
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));
Create a future that is immediately ready with an error value.
use futures::future;
let a = future::err::<i32, i32>(1);
assert_eq!(a.await, Err(1));