From 3238f8517097745032e19b3e26f57f0465a00b28 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 10 Jun 2022 10:47:16 +0200 Subject: move to workspace --- karld/src/protocol.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 karld/src/protocol.rs (limited to 'karld/src/protocol.rs') 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), +} + +#[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, + pub priority: f64, + + pub completed: Option, + pub scheduled: Option, + + pub occurence: Option, + pub deadline: Option, +} -- cgit v1.2.3-70-g09d2