Trait TaskHandler

Source
pub trait TaskHandler<S: SharedData>: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        task_message: TaskMessage,
        shared_data: Arc<S>,
    ) -> Pin<Box<dyn Future<Output = Result<Response, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn authorize<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _shared_data: &'life1 Arc<S>,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, task_message: TaskMessage, shared_data: Arc<S>, ) -> Pin<Box<dyn Future<Output = Result<Response, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn authorize<'life0, 'life1, 'async_trait>( &'life0 self, _shared_data: &'life1 Arc<S>, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§