automata/cron/validator
Types
pub type StepBase {
StepAny
StepExact(Int)
StepRange(Int, Int)
}
Constructors
-
StepAny -
StepExact(Int) -
StepRange(Int, Int)
A cron expression that has passed validate/1. opaque so the
only way to obtain a value is through validation, preventing
callers from forging “validated” inputs.
pub opaque type ValidCron
pub type ValidationError {
UnsupportedSyntax(field: ast.Field, value: String)
InvalidNumber(field: ast.Field, value: String)
InvalidAlias(field: ast.Field, value: String)
InvalidRange(field: ast.Field, value: String)
InvalidStep(field: ast.Field, value: String)
InvalidList(field: ast.Field, value: String)
OutOfRange(field: ast.Field, min: Int, max: Int, actual: Int)
ImpossibleDate(day_of_month: String, month: String)
}
Constructors
-
UnsupportedSyntax(field: ast.Field, value: String) -
InvalidNumber(field: ast.Field, value: String) -
InvalidAlias(field: ast.Field, value: String) -
InvalidRange(field: ast.Field, value: String) -
InvalidStep(field: ast.Field, value: String) -
InvalidList(field: ast.Field, value: String) -
OutOfRange(field: ast.Field, min: Int, max: Int, actual: Int) -
ImpossibleDate(day_of_month: String, month: String)
Values
pub fn selector_values(
selector: Selector,
min: Int,
max: Int,
normalize_day_of_week normalize_day_of_week: Bool,
) -> List(Int)
pub fn validate(
raw raw: ast.RawCron,
) -> Result(ValidCron, ValidationError)