summaryrefslogtreecommitdiff
path: root/src/mining.rs
blob: ae4af49100d42a52f881fea958a499db0620627f (plain)
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
extern crate serde_json;

use std::time::SystemTime;

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Mining {
    pub range   : f64,
    pub status  : bool,
    time    : u64,
    start   : Option<SystemTime>,
}

impl Mining {
    pub fn new() -> Mining {
        Mining {
            range   : 10.0,
            status  : false,
            time    : 1,
            start   : None,
        }
    }

    pub fn start(&mut self) {
        self.status = true;
    }

    pub fn stop(&mut self) {
        self.status = false;
    }
}