Function futures_core::future::result[][src]

pub fn result<T, E>(r: Result<T, E>) -> FutureResult<T, E>

Creates a new future that will immediate resolve with the given result.

Examples

use futures_core::future::*;

let future_of_1 = result::<u32, u32>(Ok(1));
let future_of_err_2 = result::<u32, u32>(Err(2));