Trait mas_storage::job::JobRepository

source ·
pub trait JobRepository: Send + Sync {
    type Error;

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

A JobRepository is used to schedule jobs to be executed by a worker.

Required Associated Types§

source

type Error

The error type returned by the repository.

Required Methods§

source

fn schedule_submission<'life0, 'async_trait>( &'life0 mut self, submission: JobSubmission, ) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Schedule a job submission to be executed at a later time.

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

Returns Self::Error if the underlying repository fails

Implementations on Foreign Types§

source§

impl<R> JobRepository for Box<R>
where R: JobRepository + ?Sized,

§

type Error = <R as JobRepository>::Error

source§

fn schedule_submission<'life0, 'async_trait>( &'life0 mut self, submission: JobSubmission, ) -> Pin<Box<dyn Future<Output = Result<JobId, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<R, F, E> JobRepository for MapErr<R, F>
where R: JobRepository, F: FnMut(<R as JobRepository>::Error) -> E + Send + Sync,

§

type Error = E