Crontab Expression Parser and Driver
Overview
A library to parse and drive the crontab expression.
Documentation
Example
Here is a quick example that shows how to parse a cron expression and drive it with a timestamp:
Usage
cronexpr is on crates.io and can be used by adding cronexpr to your dependencies in your project's Cargo.toml. Or more simply, just run cargo add cronexpr.
Dependencies
cronexpr depends on:
- thiserror to define our
Errortype. - jiff for all the datetime things. This is almost internal, except:
- the timestamp returned is a
jiff::Zoned, although you can treat it as something defined bycronexpr. - the input type
MakeTimestampis a wrapper ofjiff::Timestamp, but it's defined bycronexprand enables you create a Timestamp from a string, milliseconds, nanoseconds, and more, without directly depend onjiff::Timestamp(you can still depend on it if you'd like).
- the timestamp returned is a
- winnow for parsing the crontab expression. This is fully internal: you don't need to understand it.
Minimum Rust version policy
This crate is built against the latest stable release, and its minimum supported rustc version is 1.75.0.
The policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if cronexpr 1.0 requires Rust 1.20.0, then cronexpr 1.0.z for all values of z will also require Rust 1.20.0 or newer. However, cronexpr 1.y for y > 0 may require a newer minimum version of Rust.
License
This project is licensed under Apache License, Version 2.0.