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§
Required Methods§
sourcefn schedule_job<'life0, 'async_trait, J>(
&'life0 mut self,
job: J,
) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>
fn schedule_job<'life0, 'async_trait, J>( &'life0 mut self, job: J, ) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + '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.