1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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>,
}
|