diff options
author | metamuffin <yvchraiqi@protonmail.com> | 2022-06-10 10:47:16 +0200 |
---|---|---|
committer | metamuffin <yvchraiqi@protonmail.com> | 2022-06-10 10:47:16 +0200 |
commit | 3238f8517097745032e19b3e26f57f0465a00b28 (patch) | |
tree | 2c712d2ab45276bed2981dbc32b7a4adeadbc878 /karld/src/protocol.rs | |
parent | 829f0dc5ac68ee8a030894ce26c83b1c4eb02104 (diff) | |
download | karlender-3238f8517097745032e19b3e26f57f0465a00b28.tar karlender-3238f8517097745032e19b3e26f57f0465a00b28.tar.bz2 karlender-3238f8517097745032e19b3e26f57f0465a00b28.tar.zst |
move to workspace
Diffstat (limited to 'karld/src/protocol.rs')
-rw-r--r-- | karld/src/protocol.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/karld/src/protocol.rs b/karld/src/protocol.rs new file mode 100644 index 0000000..40ab0b2 --- /dev/null +++ b/karld/src/protocol.rs @@ -0,0 +1,34 @@ +use crate::condition::Condition; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "type", content = "data", rename_all = "snake_case")] +pub enum ClientboundPacket { + Handshake { version: String }, + Error(String), + DownloadResponse(Vec<Task>), +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "type", content = "data", rename_all = "snake_case")] +pub enum ServerboundPacket { + Download, + UpdateTask(Task), + RemoveTask(u64), +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Task { + pub id: u64, + pub name: String, + pub description: String, + + pub tags: Vec<String>, + pub priority: f64, + + pub completed: Option<u64>, + pub scheduled: Option<u64>, + + pub occurence: Option<Condition>, + pub deadline: Option<Condition>, +} |