Function libp2p_rs::runtime::task::spawn[][src]

pub fn spawn<F, T>(future: F) -> TaskHandle<T>

Notable traits for TaskHandle<T>

impl<T> Future for TaskHandle<T> type Output = Option<T>;
where
    T: Send + 'static,
    F: Future<Output = T> + Send + 'static, 

Spawns a runtime.

The returned TaskHandle can be used to terminate and wait for its termination.

Note: the output of the future must be ().