Task

Trait Task 

Source
pub trait Task: Send + Sync {
    // Required methods
    fn task(&self) -> TaskInfo;
    fn run<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        app_context: &'life1 AppContext,
        vars: &'life2 BTreeMap<String, String>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

A trait defining the behavior of a task.

Required Methods§

Source

fn task(&self) -> TaskInfo

Get information about the task.

Source

fn run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, app_context: &'life1 AppContext, vars: &'life2 BTreeMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute the task with the provided application context and variables.

Implementors§