1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
use chrono::{DateTime, Utc}; use recurdates::ReDateTime; use std::collections::HashMap; #[derive(Serialize, Deserialize, Clone, Debug)] pub struct Task { pub id: Option<i32>, pub at: Option<DateTime<Utc>>, pub repeat: Option<ReDateTime>, pub title: String, pub crossout: bool, pub priority: u8, pub attrs: HashMap<String, String>, } impl Default for Task { fn default() -> Self { Task { id: None, at: None, repeat: None, title: String::default(), crossout: false, priority: 0, attrs: HashMap::new(), } } }