OxL Reference

method Cron.parse

Checks expr at run time; prefer the literal cron"…", which is checked at compile time.

Example:

oxl✓ checked in CI
use std.time { Cron }

fn main() io {
  match Cron.parse("61 * * * *") {
    Cron c => print(c.expr)
    ParseError _ => print("invalid")
  }
}
Output
invalid
pub(api) static fn parse(expr: str) -> Cron | ParseError

Since. 1.0.0-beta

Parameters

NameType
exprstr

Returns

Cron

Errors

  • ParseError @error
  • `ParseError` when the expression is not valid cron syntax.

Effects

none declared (pure unless the body says otherwise)

Defined in: std/time/time.oxl:2450

See also