[−][src]Trait pasts::prelude::Select
A trait to select on a slice of Future
s or Option<Future>
s.
Select on slice of futures.
use pasts::prelude::*; async fn async_main() { let mut hello = async { "Hello" }; let mut world = async { "World!" }; // Hello is ready, so returns with index and result. assert_eq!((0, "Hello"), [hello.fut(), world.fut()].select().await); } pasts::ThreadInterrupt::block_on(async_main());
Required methods
fn select(&mut self) -> SelectFuture<T, A>
Poll multiple futures, and return the value from future that returns
Ready
first.