From 351d8c73da3e6f6d18c333a6f688b5198e8d323b Mon Sep 17 00:00:00 2001 From: daladim Date: Mon, 29 Mar 2021 09:29:48 +0200 Subject: [PATCH] Add Event::new --- src/event.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/event.rs b/src/event.rs index 7f8cbf1..d20afa3 100644 --- a/src/event.rs +++ b/src/event.rs @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize}; use crate::item::ItemId; use crate::item::SyncStatus; +use crate::item::VersionTag; /// TODO: implement Event one day. /// This crate currently only supports tasks, not calendar events. @@ -15,6 +16,18 @@ pub struct Event { } impl Event { + pub fn new() -> Self { + let version_tag = VersionTag::from(String::from("not-implemented")); + let sync_status = SyncStatus::Synced(version_tag); + let id: ItemId = "http://not.imp/lemented".parse().unwrap(); + + Self { + id, + name: String::from("Events are not supported (yet?)"), + sync_status + } + } + pub fn id(&self) -> &ItemId { &self.id }