forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits
| 1 | //! Standard 5-field cron expressions in UTC, for `[on] schedule`. |
| 2 | //! |
| 3 | //! Times are Unix seconds. The functions are pure, so the scheduler's tick logic can be tested |
| 4 | //! with a fake clock. |
| 5 | |
| 6 | use DateTime; |
| 7 | use Cron; |
| 8 | |
| 9 | /// Parses a 5-field cron expression (`minute hour day-of-month month day-of-week`). |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | /// The first time strictly after `after` that `cron` matches. |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | /// The first time strictly after `after` that any of `exprs` matches. Expressions that do not |
| 28 | /// parse are ignored. |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | /// Whether any of `exprs` matched a time `t` with `last < t <= now`. However many ticks fell in |
| 38 | /// that window, the answer is one yes: a scheduler that was down catches up once. |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 |