Skip to main content

Scheduler

Trait Scheduler 

Source
pub trait Scheduler: Send + Sync {
    // Required methods
    fn schedule(&self, job: Job) -> Result<String>;
    fn list(&self) -> Vec<Job>;
    fn cancel(&self, id: &str) -> Result<()>;
    fn get(&self, id: &str) -> Option<Job>;
    fn tick<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<Job>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn schedule(&self, job: Job) -> Result<String>

Source

fn list(&self) -> Vec<Job>

Source

fn cancel(&self, id: &str) -> Result<()>

Source

fn get(&self, id: &str) -> Option<Job>

Source

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

Run all due jobs

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§