kitchen-freezer/src/event.rs

55 lines
1.1 KiB
Rust
Raw Normal View History

//! Calendar events
use serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc};
use crate::item::ItemId;
2021-03-22 23:42:41 +01:00
use crate::item::SyncStatus;
/// 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,
2021-03-22 23:42:41 +01:00
sync_status: SyncStatus,
}
impl Event {
2021-03-29 09:29:48 +02:00
pub fn new() -> Self {
2021-04-03 17:41:25 +02:00
unimplemented!();
2021-03-29 09:29:48 +02:00
}
pub fn id(&self) -> &ItemId {
&self.id
}
2021-04-12 09:21:50 +02:00
pub fn uid(&self) -> &str {
unimplemented!()
}
pub fn name(&self) -> &str {
&self.name
}
2021-04-16 09:05:30 +02:00
pub fn creation_date(&self) -> Option<&DateTime<Utc>> {
unimplemented!()
}
pub fn last_modified(&self) -> &DateTime<Utc> {
unimplemented!()
}
2021-03-22 23:42:41 +01:00
pub fn sync_status(&self) -> &SyncStatus {
&self.sync_status
}
pub fn set_sync_status(&mut self, new_status: SyncStatus) {
self.sync_status = new_status;
}
2021-04-03 17:42:55 +02:00
2021-04-17 20:20:30 +02:00
#[cfg(any(test, feature = "integration_tests"))]
2021-04-04 01:02:37 +02:00
pub fn has_same_observable_content_as(&self, _other: &Event) -> bool {
2021-04-03 17:42:55 +02:00
unimplemented!();
}
}