Add Event::new

This commit is contained in:
daladim 2021-03-29 09:29:48 +02:00
parent 078b650c00
commit 351d8c73da

View file

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
use crate::item::ItemId; use crate::item::ItemId;
use crate::item::SyncStatus; use crate::item::SyncStatus;
use crate::item::VersionTag;
/// TODO: implement Event one day. /// TODO: implement Event one day.
/// This crate currently only supports tasks, not calendar events. /// This crate currently only supports tasks, not calendar events.
@ -15,6 +16,18 @@ pub struct Event {
} }
impl 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 { pub fn id(&self) -> &ItemId {
&self.id &self.id
} }