use chrono::NaiveDateTime; use super::schema::{calendars, events}; #[derive(Debug, Queryable)] pub struct Calendar { pub id: String, pub url: String, pub last_fetch: Option, pub last_success: Option, pub error_message: Option, pub etag: Option, pub last_modified: Option, } #[derive(Debug, Insertable)] #[table_name = "calendars"] pub struct NewCalendar { pub id: String, pub url: String, pub last_fetch: Option, } #[derive(Debug, Queryable, Insertable)] pub struct Event { pub calendar: String, pub id: String, pub dtstart: NaiveDateTime, pub dtend: Option, pub summary: String, pub location: Option, pub url: Option, pub recurrence: bool, }