2021-02-28 11:54:31 +01:00
|
|
|
//! Calendar events
|
|
|
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use chrono::{Utc, DateTime};
|
|
|
|
|
|
|
|
use crate::item::ItemId;
|
2021-03-22 22:06:43 +01:00
|
|
|
use crate::item::VersionTag;
|
2021-02-28 11:54:31 +01:00
|
|
|
|
|
|
|
/// TODO: implement Event one day.
|
|
|
|
/// This crate currently only supports tasks, not calendar events.
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct Event {
|
|
|
|
id: ItemId,
|
|
|
|
name: String,
|
|
|
|
last_modified: DateTime<Utc>,
|
2021-03-22 22:06:43 +01:00
|
|
|
version_tag: VersionTag,
|
2021-02-28 11:54:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Event {
|
|
|
|
pub fn id(&self) -> &ItemId {
|
|
|
|
&self.id
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn name(&self) -> &str {
|
|
|
|
&self.name
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn last_modified(&self) -> DateTime<Utc> {
|
|
|
|
self.last_modified
|
|
|
|
}
|
2021-03-22 22:06:43 +01:00
|
|
|
|
|
|
|
pub fn version_tag(&self) -> &VersionTag {
|
|
|
|
&self.version_tag
|
|
|
|
}
|
2021-02-28 11:54:31 +01:00
|
|
|
}
|