diff options
author | tom barrett <spalf0@gmail.com> | 2018-04-13 03:39:24 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-04-13 03:39:24 -0500 |
commit | 4d7a7e368a3f0a6b1261e1b9180a2647eb158047 (patch) | |
tree | 50ead62fdc5e22e839920dae44a02dc25b247678 /src/mining.rs | |
parent | 74c7e70096ebcb0cab10f24ce1d348198d583161 (diff) |
moved over to mass struct with enum for types
Diffstat (limited to 'src/mining.rs')
-rw-r--r-- | src/mining.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mining.rs b/src/mining.rs new file mode 100644 index 0000000..ae4af49 --- /dev/null +++ b/src/mining.rs @@ -0,0 +1,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; + } +} |