like this
parent
4067bd75fe
commit
c9ee9d9a27
|
|
@ -158,12 +158,28 @@ impl File {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
struct Delta(json_patch::Patch);
|
||||
struct Delta{
|
||||
ts: u64,
|
||||
patch: json_patch::Patch,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
struct TaskAt {
|
||||
struct TaskTs {
|
||||
task: Task,
|
||||
at: usize,
|
||||
ts: u64,
|
||||
}
|
||||
|
||||
impl Delta {
|
||||
fn new(patch: json_patch::Patch, ts: u64) -> TaskTs {
|
||||
Delta{
|
||||
patch: patch,
|
||||
ts: ts,
|
||||
}
|
||||
}
|
||||
|
||||
fn now(patch: json_patch::Patch) -> Delta {
|
||||
Self::new(patch, std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs().try_into().unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
|
|
|
|||
Loading…
Reference in New Issue