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
49
50
51
use date::Date;
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct Annotation {
entry: Date,
description: String,
}
impl Annotation {
pub fn new(entry: Date, description: String) -> Annotation {
Annotation {
entry: entry,
description: description,
}
}
pub fn entry(&self) -> &Date {
&self.entry
}
pub fn entry_mut(&mut self) -> &mut Date {
&mut self.entry
}
pub fn description(&self) -> &String {
&self.description
}
pub fn description_mut(&mut self) -> &mut String {
&mut self.description
}
}
#[cfg(test)]
mod test {}