Trait mq::JobHandler

source ·
pub trait JobHandler: Send + Sync {
    // Required methods
    fn kind(&self) -> &str;
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        ctx: Context
    ) -> Pin<Box<dyn Future<Output = Result<JobResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn queue(&self) -> &str { ... }
}

Required Methods§

source

fn kind(&self) -> &str

source

fn handle<'life0, 'async_trait>( &'life0 self, ctx: Context ) -> Pin<Box<dyn Future<Output = Result<JobResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

source

fn queue(&self) -> &str

Implementations on Foreign Types§

source§

impl<F, Fut> JobHandler for (&str, &str, F)
where F: Fn(Context) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<JobResult, Error>> + Send,

source§

fn queue(&self) -> &str

source§

fn kind(&self) -> &str

source§

fn handle<'life0, 'async_trait>( &'life0 self, ctx: Context ) -> Pin<Box<dyn Future<Output = Result<JobResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<F, Fut> JobHandler for (&str, F)
where F: Fn(Context) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<JobResult, Error>> + Send,

source§

fn kind(&self) -> &str

source§

fn handle<'life0, 'async_trait>( &'life0 self, ctx: Context ) -> Pin<Box<dyn Future<Output = Result<JobResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§