Add Event::new
This commit is contained in:
parent
078b650c00
commit
351d8c73da
1 changed files with 13 additions and 0 deletions
13
src/event.rs
13
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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue