Skip to content

cron #

fn C.vieter_cron_expr_free #

unsafe
fn C.vieter_cron_expr_free(ce &C.vieter_cron_expression)

fn C.vieter_cron_expr_init #

unsafe
fn C.vieter_cron_expr_init() &C.vieter_cron_expression

fn C.vieter_cron_expr_next #

unsafe
fn C.vieter_cron_expr_next(out &C.vieter_cron_simple_time, ce &C.vieter_cron_expression, ref &C.vieter_cron_simple_time)

fn C.vieter_cron_expr_next_from_now #

unsafe
fn C.vieter_cron_expr_next_from_now(out &C.vieter_cron_simple_time, ce &C.vieter_cron_expression)

fn C.vieter_cron_expr_parse #

unsafe
fn C.vieter_cron_expr_parse(out &C.vieter_cron_expression, s &char) ParseError

fn parse_expression #

pub fn parse_expression(exp string) !&Expression

parse_expression parses a string into an Expression.

type Expression #

pub type Expression = C.vieter_cron_expression

fn (Expression) == #

fn (ce1 Expression) == (ce2 Expression) bool

== returns whether the two expressions are equal by value.

fn (Expression) free #

unsafe
pub fn (ce &Expression) free()

free the memory associated with the Expression.

fn (Expression) next #

pub fn (ce &Expression) next(ref time.Time) time.Time

next calculates the next occurence of the cron schedule, given a reference point.

fn (Expression) next_from_now #

pub fn (ce &Expression) next_from_now() time.Time

next_from_now calculates the next occurence of the cron schedule with the current time as reference.

fn (Expression) next_n #

pub fn (ce &Expression) next_n(ref time.Time, n int) []time.Time

next_n returns the n next occurences of the expression, given a starting time.

type SimpleTime #

type SimpleTime = C.vieter_cron_simple_time

enum ParseError #

enum ParseError as u8 {
	ok = 0
	invalid_expression = 1
	invalid_number = 2
	out_of_range = 3
	too_many_parts = 4
	not_enough_parts = 5
}

fn (ParseError) str #

fn (e ParseError) str() string

str returns the string representation of a ParseError.

struct C.vieter_cron_simple_time #

[typedef]
struct C.vieter_cron_simple_time {
	year   int
	month  int
	day    int
	hour   int
	minute int
}

struct C.vieter_cron_expression #

[typedef]
pub struct C.vieter_cron_expression {
	minutes      &u8
	hours        &u8
	days         &u8
	months       &u8
	minute_count u8
	hour_count   u8
	day_count    u8
	month_count  u8
}