1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{Deserialize, Serialize};
use uuid::Uuid;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "tag", content = "content")]
pub enum WorkUnit {
    LocalChange(Uuid),
    ServerChange(Uuid),
}

impl WorkUnit {
    pub fn id(&self) -> Uuid {
        *match self {
            WorkUnit::LocalChange(id) => id,
            WorkUnit::ServerChange(id) => id,
        }
    }
}