Skip to main content

natural_cron/
interfaces.rs

1use std::fmt;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub enum CronTimeUnit {
5    Minute,
6    Hour,
7    DayOfMonth,
8    Month,
9    DayOfWeek,
10}
11
12#[derive(Debug, Clone, PartialEq)]
13pub enum ScheduleValue {
14    String(String),
15    Number(i32),
16}
17
18impl fmt::Display for ScheduleValue {
19    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20        match self {
21            ScheduleValue::String(s) => write!(f, "{}", s),
22            ScheduleValue::Number(n) => write!(f, "{}", n),
23        }
24    }
25}