diff rust/src/types.rs @ 593:bf138339d20a rust

fiddling with timeouts and closures
author Matt Johnston <matt@ucc.asn.au>
date Tue, 27 Dec 2016 00:51:28 +0800
parents 03b48ec0bb03
children aff50ee77252
line wrap: on
line diff
--- a/rust/src/types.rs	Sat Dec 24 00:14:58 2016 +0800
+++ b/rust/src/types.rs	Tue Dec 27 00:51:28 2016 +0800
@@ -1,4 +1,4 @@
-#[derive(RustcDecodable, RustcEncodable, Debug)]
+#[derive(RustcDecodable, RustcEncodable, Debug, Clone)]
 pub struct Params {
     pub fridge_setpoint: f32,
     pub fridge_difference: f32,
@@ -55,6 +55,7 @@
     }
 }
 
+#[derive(Debug)]
 pub struct Readings {
     temps: Vec<Vec<Reading>>,
 }
@@ -65,6 +66,11 @@
             temps: Vec::new(),
         }
     }
+
+    pub fn push(&mut self, vals: Vec<Reading>) {
+        self.temps.push(vals);
+    }
+
     pub fn fridge(&self) -> Option<f32> {
         unimplemented!();
     }