Mercurial > templog
diff rust/src/config.rs @ 597:a440eafa84a9 rust
progress for debug
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 07 Jan 2017 00:56:39 +0800 |
parents | ca8102feaca6 |
children | d4fbfb5c46ff |
line wrap: on
line diff
--- a/rust/src/config.rs Fri Jan 06 22:04:10 2017 +0800 +++ b/rust/src/config.rs Sat Jan 07 00:56:39 2017 +0800 @@ -5,7 +5,6 @@ #[derive(Deserialize,Serialize,Debug,Clone)] #[allow(non_snake_case)] pub struct Config { - pub FRIDGE_SLEEP: u64, pub SENSOR_SLEEP: u64, pub UPLOAD_SLEEP: u64, @@ -68,4 +67,35 @@ self.serialize(&mut e).unwrap(); toml::Value::Table(e.toml).to_string() } + + /* + pub fn parse(&mut self, s: &str) { + let filename = "tempserver.conf"; + + let f = File::open(filename) + .map_err(|e| e.to_string()) + .and_then(|mut f| { + let mut s = String::new(); + f.read_to_string(&mut s) + .map_err(|e| e.to_string()) + .map(|_| s) + }) + .and_then(|s| { + + .map_err(|e| e.to_string()) + }); + + match f { + Ok() => { + + }, + Err(e) => { + debug!("Error loading config file {}: {}", + filename, e); + + } + } + + } + */ }