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
52
use std::time::Instant;
use inc_dec::IntIncDecSelf;
use crate::ItemUpdater;
pub struct U32Updater
{
}
impl ItemUpdater<u32> for U32Updater
{
fn init() -> u32
{
u32::default()
}
fn update(item: &mut u32)
{
item.wpp();
}
}
pub struct InstantUpdater
{
}
impl ItemUpdater<Instant> for InstantUpdater
{
fn init() -> Instant
{
Instant::now()
}
fn update(item: &mut Instant)
{
*item = Instant::now();
}
}