JobInterface

Trait JobInterface 

Source
pub trait JobInterface {
    // Required methods
    fn new_cron_job<T>(schedule: &str, run: T) -> Result<Self, JobError>
       where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send,
             Self: Sized;
    fn new_one_shot<T>(duration: Duration, run: T) -> Result<Self, JobError>
       where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send,
             Self: Sized;
    fn new_one_shot_at_instant<T>(
        instant: Instant,
        run: T,
    ) -> Result<Self, JobError>
       where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send,
             Self: Sized;
    fn new_repeated<T>(duration: Duration, run: T) -> Result<Self, JobError>
       where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send,
             Self: Sized;
    fn get_job_id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Uuid> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn new_cron_job<T>(schedule: &str, run: T) -> Result<Self, JobError>
where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send, Self: Sized,

Source

fn new_one_shot<T>(duration: Duration, run: T) -> Result<Self, JobError>
where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send, Self: Sized,

Source

fn new_one_shot_at_instant<T>( instant: Instant, run: T, ) -> Result<Self, JobError>
where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send, Self: Sized,

Source

fn new_repeated<T>(duration: Duration, run: T) -> Result<Self, JobError>
where T: 'static + FnMut(Uuid, JobsSchedulerLocked) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send>> + Send, Self: Sized,

Source

fn get_job_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Uuid> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§