spawn_on_main

Function spawn_on_main 

Source
pub fn spawn_on_main<F, T>(future: F) -> Task<T> 
where F: Future<Output = T> + 'static, T: 'static,
Expand description

Spawn a future on the main thread’s dispatch queue.

Use this for work that must run on the main thread, such as UI updates.