Struct rcron::Job

source · []
pub struct Job<'a> { /* private fields */ }
Expand description

A schedulable Job.

Implementations

Create a new job.

// Run at second 0 of the 15th minute of the 6th, 8th, and 10th hour
// of any day in March and June that is a Friday of the year 2017.
let s: Schedule = "0 15 6,8,10 * Mar,Jun Fri 2017".into().unwrap();
Job::new(s, || println!("I have a complex schedule...") );

Set the limit for missed jobs in the case of delayed runs. Setting to 0 means unlimited.

let mut job = Job::new("0/1 * * * * *".parse().unwrap(), || {
    println!("I get executed every 1 seconds!");
});
job.limit_missed_runs(99);

Set last tick to force re-running of missed runs.

let mut job = Job::new("0/1 * * * * *".parse().unwrap(), || {
    println!("I get executed every 1 seconds!");
});
job.last_tick(Some(Local::now()));

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.