Struct crontab::Crontab
[−]
[src]
pub struct Crontab { pub schedule: ScheduleComponents, }
Represents a crontab schedule.
Fields
schedule: ScheduleComponents
The components parsed from a crontab schedule.
Methods
impl Crontab
[src]
fn parse(crontab_schedule: &str) -> Result<Crontab, CrontabError>
[src]
Parse a crontab schedule into a Crontab instance.
fn find_event_after(&self, start_time: &Tm) -> Option<Tm>
[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);
fn find_next_event(&self) -> Option<Tm>
[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.
fn find_next_event_utc(&self) -> Option<Tm>
[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.