[−][src]Macro futures_util::spawn
macro_rules! spawn { ($future:expr) => { ... }; }
Spawns a task onto the context's executor that polls the given future with
output ()
to completion.
This macro returns a Result
that contains a
SpawnError
if spawning fails.
You can use spawn_with_handle!
if you want to spawn a future
with output other than ()
or if you want to be able to await its
completion.
#![feature(async_await, await_macro, futures_api)] use futures::spawn; let future = async { /* ... */ }; spawn!(future).unwrap();