try_execute_locally

Function try_execute_locally 

Source
pub fn try_execute_locally<F>(f: F) -> Result<(), F>
where F: FnOnce() + Send + 'static,
Expand description

Tries run the job on the same executor that spawned the thread running the job.

This is not supported on all executor implementations, and will return Err variant with the original job if it can’t be scheduled.