Skip to main content

Task

Trait Task 

Source
pub trait Task<S: Clone>:
    Send
    + Sync
    + Debug {
    // Required methods
    fn kind() -> &'static str
       where Self: Sized;
    fn build(id: TaskId, context: &str) -> ClResult<Arc<dyn Task<S>>>
       where Self: Sized;
    fn serialize(&self) -> String;
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state: &'life1 S,
    ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn kind_of(&self) -> &'static str;
}

Required Methods§

Source

fn kind() -> &'static str
where Self: Sized,

Source

fn build(id: TaskId, context: &str) -> ClResult<Arc<dyn Task<S>>>
where Self: Sized,

Source

fn serialize(&self) -> String

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 S, ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Implementors§