From f8c8f09203b150288a661b67315c35896d3c9a1b Mon Sep 17 00:00:00 2001 From: daladim Date: Fri, 19 Feb 2021 07:58:53 +0100 Subject: [PATCH] More API changes --- src/data/calendar.rs | 1 + src/data/mod.rs | 8 ++++++-- src/data/{tasks.rs => task.rs} | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) rename src/data/{tasks.rs => task.rs} (93%) diff --git a/src/data/calendar.rs b/src/data/calendar.rs index b4d7482..8c31076 100644 --- a/src/data/calendar.rs +++ b/src/data/calendar.rs @@ -1,4 +1,5 @@ use crate::data::Task; +use crate::data::task::TaskId; /// A Caldav Calendar pub struct Calendar { diff --git a/src/data/mod.rs b/src/data/mod.rs index 9e14d79..db9e69c 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -5,11 +5,11 @@ use std::sync::Arc; mod calendar; -mod tasks; +mod task; mod client; pub use calendar::Calendar; -pub use tasks::Task; +pub use task::Task; use client::Client; /// A Caldav data source @@ -38,6 +38,10 @@ impl DataSource { // TODO: how to handle conflicts? } + pub fn update_changes_to_server(&self) { + + } + pub fn calendars(&self) -> Vec<&Calendar> { self.calendars .iter() diff --git a/src/data/tasks.rs b/src/data/task.rs similarity index 93% rename from src/data/tasks.rs rename to src/data/task.rs index 838e9cb..91011bf 100644 --- a/src/data/tasks.rs +++ b/src/data/task.rs @@ -1,8 +1,10 @@ use uuid::Uuid; +pub type TaskId = Uuid; + /// A to-do task pub struct Task { - id: Uuid, + id: TaskId, name: String, }