[][src]Function tokio::prelude::future::ok

pub fn ok<T, E>(t: T) -> FutureResult<T, E>

Creates a "leaf future" from an immediate value of a finished and successful 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_1 = ok::<u32, u32>(1);