Spawn a `Future` as a `Task` on the current `Reactor`. Panics if called from outside `block_on`.
(fut: F)
| 28 | /// |
| 29 | /// Panics if called from outside `block_on`. |
| 30 | pub fn spawn<F, T>(fut: F) -> Task<T> |
| 31 | where |
| 32 | F: std::future::Future<Output = T> + 'static, |
| 33 | T: 'static, |
| 34 | { |
| 35 | Reactor::current().spawn(fut) |
| 36 | } |