Trait mas_storage::job::JobRepositoryExt

source ·
pub trait JobRepositoryExt {
    type Error;

    // Required method
    fn schedule_job<'life0, 'async_trait, J>(
        &'life0 mut self,
        job: J,
    ) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>
       where J: 'async_trait + Job + Serialize + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An extension trait for JobRepository to schedule jobs directly.

Required Associated Types§

source

type Error

The error type returned by the repository.

Required Methods§

source

fn schedule_job<'life0, 'async_trait, J>( &'life0 mut self, job: J, ) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>
where J: 'async_trait + Job + Serialize + Send, Self: 'async_trait, 'life0: 'async_trait,

Schedule a job to be executed at a later time.

§Parameters
  • job - The job to schedule.
§Errors

Returns Self::Error if the underlying repository fails

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> JobRepositoryExt for T
where T: JobRepository + ?Sized,

§

type Error = <T as JobRepository>::Error