TaskExecutor

Trait TaskExecutor 

Source
pub trait TaskExecutor:
    Sync
    + Send
    + 'static {
    // Required methods
    fn execute_task(&self, task: Task) -> BoxFuture<'static, Result<()>>;
    fn can_execute(&self, task: &Task) -> bool;
}
Expand description

Interface to a task executor

Required Methods§

Source

fn execute_task(&self, task: Task) -> BoxFuture<'static, Result<()>>

Execute the given task. The function is expected to block until the execution is completed. It will be called from an async context by the default executor.

Source

fn can_execute(&self, task: &Task) -> bool

Check if the given executor can execute the task

Implementors§