pub trait BlockingExecutor {
// Required method
fn execute_blocking<'async_trait, T, F>(
f: F
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where T: Send + 'static + 'async_trait,
F: FnOnce() -> T + Send + 'static + 'async_trait;
}
Required Methods§
sourcefn execute_blocking<'async_trait, T, F>(
f: F
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: Send + 'static + 'async_trait,
F: FnOnce() -> T + Send + 'static + 'async_trait,
fn execute_blocking<'async_trait, T, F>( f: F ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where T: Send + 'static + 'async_trait, F: FnOnce() -> T + Send + 'static + 'async_trait,
Execute the provided function on a thread where blocking is acceptable (in some kind of thread pool).