aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.rs
blob: e7527eb83f95b983ee848999ac2eeb6e48f866e0 (plain)
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
use serde::{Deserialize, Serialize};

use crate::condition::Condition;

#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "type", content = "data", rename_all = "snake_case")]
pub enum ClientboundPacket {
    Handshake { version: String },
    Error(String),
    DownloadResponse(Vec<Task>),
}

#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "type", content = "data", rename_all = "snake_case")]
pub enum ServerboundPacket {
    Download,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Task {
    name: String,
    description: String,

    tags: Vec<String>,
    priority: f64,

    completed: u64,
    scheduled: u64,

    occurence: Option<Condition>,
    deadline: Option<Condition>,
}