[][src]Trait compress_tools::async_support::BlockingExecutor

pub trait BlockingExecutor {
#[must_use]    fn execute_blocking<'async_trait, T, F>(
        f: F
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
    where
        T: Send + 'static,
        F: FnOnce() -> T + Send + 'static,
        T: 'async_trait,
        F: 'async_trait
; }

Required methods

#[must_use]fn execute_blocking<'async_trait, T, F>(
    f: F
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
    T: Send + 'static,
    F: FnOnce() -> T + Send + 'static,
    T: 'async_trait,
    F: 'async_trait, 

Execute the provided function on a thread where blocking is acceptable (in some kind of thread pool).

Loading content...

Implementors

Loading content...