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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#[derive(Clone)]
pub struct KeyValue{
pub(super) key:String
,pub(super) value:Vec<u8>
}
impl KeyValue{
pub fn new(key:impl Into<String>,value:impl Into<Vec<u8>>)->Self{
KeyValue{
key:key.into()
,value:value.into()
}
}
pub fn key(&self)->&str{
&self.key
}
pub fn value(&self)->&[u8]{
&self.value
}
}
#[derive(Clone,Copy,PartialEq,Debug)]
pub enum Activity{
Inactive=0
,Active=1
}
#[derive(Clone,Copy)]
pub enum Term{
Defalut
,Overwrite(i64)
}
#[derive(Clone)]
pub enum Operation{
New{
activity:Activity
,term_begin:Term
,term_end:Term
,fields:Vec<KeyValue>
}
,Update{
row:u32
,activity:Activity
,term_begin:Term
,term_end:Term
,fields:Vec<KeyValue>}
,Delete{row:u32}
}