spawn_on_main

Function spawn_on_main 

Source
pub fn spawn_on_main<FUT, N: AsRef<str>>(
    name: N,
    fut: FUT,
) -> Result<JoinHandle<FUT::Output>>
where FUT: Future + Send + 'static, FUT::Output: Send,
Expand description

Spawn a named future onto the main runtime, or onto the current runtime when the main runtime is unassigned (eg: in unit tests).