std::time::cronCron expression parsing and scheduling.
Parse cron expressions and compute the next firing time relative to a given epoch timestamp.
import std::time::cron;
import std::time::datetime;
fn main() {
let expr = cron.parse("0 */5 * * *");
let next_run = expr.next(datetime.now_secs());
println(next_run);
expr.free();
}
parseParse a cron expression string.
Panics if the expression syntax is invalid.
let every_minute = cron.parse("* * * * *");
let weekdays_9am = cron.parse("0 9 * * 1-5");
ExprA parsed cron expression.
Created by cron.parse(expr). Must be freed with free() when
no longer needed to avoid leaking memory.
CronErrorStructured cron scheduling errors surfaced by the native ABI.
NoNextOccurrence(string)InvalidInput(string)InvalidEpoch(string)ExprMethodsMethods available on a parsed Expr.
Compute the next firing time (epoch seconds) after the given timestamp.
Compute the next firing time (epoch seconds) after the given timestamp.
Returns Err(CronError) when the schedule has no future match or the
native ABI rejects the input.
Return the cron expression as a string.
Release the parsed expression resources.