use chrono::{NaiveDate, NaiveDateTime, NaiveTime}; #[derive(Debug)] struct DateDelta { years: i32, months: i32, weeks: i32, days: i32, } #[derive(Debug)] struct TimeDelta { hours: i32, minutes: i32, } #[derive(Debug)] enum EndDate { Fixed(NaiveDate), Delta(DateDelta), } #[derive(Debug)] enum EndTime { Fixed(NaiveTime), Delta(TimeDelta), } #[derive(Debug)] struct DateSpec { start: NaiveDate, end: Option, repeat: Option, } #[derive(Debug)] struct TimeSpec { start: NaiveTime, end: Option, } #[derive(Debug)] struct WhenSpec { date: DateSpec, time: Option, } #[derive(Debug)] struct Done { refering_to: Option, created_at: Option, } #[derive(Debug)] struct Task { title: String, when: Option, desc: Option, dones: Vec, } #[derive(Debug)] struct Note { title: String, when: WhenSpec, desc: Option, } #[derive(Debug)] enum BirthdaySpec { Date(NaiveDate), DateWithoutYear { month: u8, day: u8 }, } #[derive(Debug)] struct Birthday { title: String, when: BirthdaySpec, desc: Option, } #[derive(Debug)] enum Command { Task(Task), Note(Note), Birthday(Birthday), }