JobHandler

Trait JobHandler 

Source
pub trait JobHandler {
    type Output: WorkerOutputHandler + Send + 'static;

    // Required method
    fn execute(
        &self,
        client: Client,
        job: ActivatedJob,
    ) -> impl Future<Output = ()> + Send;
}

Required Associated Types§

Required Methods§

Source

fn execute( &self, client: Client, job: ActivatedJob, ) -> impl Future<Output = ()> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<F, T, Fut> JobHandler for (F, Arc<SharedState<T>>)
where F: Fn(Client, ActivatedJob, Arc<SharedState<T>>) -> Fut + Send + Sync + 'static, Fut: Future + Send + 'static, Fut::Output: WorkerOutputHandler + Send + 'static, T: Send + Sync + 'static,

Source§

type Output = <Fut as Future>::Output

Source§

async fn execute(&self, client: Client, job: ActivatedJob)

Implementors§

Source§

impl<F, Fut> JobHandler for F
where F: Fn(Client, ActivatedJob) -> Fut + Send + Sync + 'static, Fut: Future + Send + 'static, Fut::Output: WorkerOutputHandler + Send + 'static,

Source§

type Output = <Fut as Future>::Output