Struct crontab::Crontab [] [src]

pub struct Crontab {
    pub schedule: ScheduleComponents,
}

Represents a crontab schedule.

Fields

The components parsed from a crontab schedule.

Methods

impl Crontab
[src]

[src]

Parse a crontab schedule into a Crontab instance.

[src]

Given a start time, calculate the next time this event will take place. It will always return a time after the time provided, even if the time provided happens to be a time specified by the cron schedule.

Usage:

extern crate crontab;
extern crate time;

let ct = crontab::Crontab::parse("0 0 * * *").ok().unwrap(); // Every midnight.
let next = ct.find_event_after(&time::now()).unwrap();
println!("Next time is: {:?}", next);

[src]

Find the next occurring event in current local timezone. Keep in mind that Crontabs do not specify a timezone, so the schedule will be relative to the local time when this function is used.

[src]

Find the next occurring event in UTC. Keep in mind that Crontabs do not specify a timezone, so the schedule will be relative to UTC when this function is used.

Trait Implementations

impl Clone for Crontab
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more