[][src]Module futures_lite::future

Combinators for the Future trait.

Examples

use futures_lite::*;

for step in 0..3 {
    println!("step {}", step);

    // Give other tasks a chance to run.
    future::yield_now().await;
}

Re-exports

pub use std::future::Future;

Structs

Join

Future for the join() function.

Pending

Future for the pending() function.

PollFn

Future for the poll_fn() function.

PollOnce

Future for the poll_once() function.

Race

Future for the race() function.

Ready

Future for the ready() function.

TryJoin

Future for the try_join() function.

YieldNow

Future for the yield_now() function.

Functions

join

Joins two futures, waiting for both to complete.

pending

Creates a future that is always pending.

poll_fn

Creates a future from a function returning Poll.

poll_once

Polls a future just once and returns an Option with the result.

race

Returns the result of the future that completes first.

ready

Creates a future that resolves to the provided value.

try_join

Joins two fallible futures, waiting for both to complete or one of them to error.

yield_now

Wakes the current task and returns Poll::Pending once.