dispatch_foreground

Function dispatch_foreground 

Source
pub fn dispatch_foreground<F, T>(future: F) -> impl Handle<T>
where F: Future<Output = T> + Send + 'static, T: Send + 'static,
Expand description

Spawns a foreground task.

This function can either be called from a foreground thread or a background thread, and the future must be Send since the future is sent to the foreground thread when dispatching from a background thread. The result will also need to be moved to the background thread.