Trait Task

Source
pub trait Task: Send + Sync {
    // Required methods
    fn execute<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = TaskResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn task_type(&self) -> &'static str;
    fn task_id(&self) -> String;

    // Provided methods
    fn estimated_duration(&self) -> Option<Duration> { ... }
    fn description(&self) -> String { ... }
}
Expand description

Trait defining a unit of work

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = TaskResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn task_type(&self) -> &'static str

Source

fn task_id(&self) -> String

Provided Methods§

Implementors§