Implement basic structure for task evaluation

This commit is contained in:
Joscha 2021-11-25 01:24:16 +01:00
parent 11399468e7
commit 21739c7314
3 changed files with 146 additions and 82 deletions

View file

@ -1,6 +1,6 @@
use chrono::NaiveDate;
#[derive(Debug)]
#[derive(Debug, Clone, Copy)]
pub struct Time {
pub hour: u8,
pub min: u8,
@ -285,7 +285,7 @@ pub enum Spec {
Formula(FormulaSpec),
}
#[derive(Debug)]
#[derive(Debug, Clone, Copy)]
pub enum DoneDate {
Date {
root: NaiveDate,
@ -306,6 +306,17 @@ pub enum DoneDate {
},
}
impl DoneDate {
pub fn root(&self) -> NaiveDate {
match self {
DoneDate::Date { root } => *root,
DoneDate::DateWithTime { root, .. } => *root,
DoneDate::DateToDate { root, .. } => *root,
DoneDate::DateToDateWithTime { root, .. } => *root,
}
}
}
#[derive(Debug)]
pub struct Done {
pub date: Option<DoneDate>,