Mercurial > templog
comparison rust/src/main.rs @ 639:89818a14648b rust tip
- switch to using anyhow for errors, surf for http
runs but surf has problems
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 28 Nov 2019 23:57:00 +0800 |
parents | a9f353f488d0 |
children |
comparison
equal
deleted
inserted
replaced
638:a9f353f488d0 | 639:89818a14648b |
---|---|
2 // riker has its own logging? | 2 // riker has its own logging? |
3 //extern crate env_logger; | 3 //extern crate env_logger; |
4 | 4 |
5 #[macro_use] extern crate lazy_static; | 5 #[macro_use] extern crate lazy_static; |
6 | 6 |
7 use anyhow::{Result}; | |
7 | 8 |
8 mod config; | 9 mod config; |
9 mod sensor; | 10 mod sensor; |
10 mod fridge; | 11 mod fridge; |
11 mod types; | 12 mod types; |
15 | 16 |
16 use riker::actors::*; | 17 use riker::actors::*; |
17 | 18 |
18 use structopt::StructOpt; | 19 use structopt::StructOpt; |
19 | 20 |
20 use types::TemplogError; | 21 fn run(conf_file: &str, nowait: bool, testmode: bool) -> Result<()> { |
21 | |
22 fn run(conf_file: &str, nowait: bool, testmode: bool) -> Result<(), TemplogError> { | |
23 | 22 |
24 let cf = config::Config::load(conf_file)?; | 23 let cf = config::Config::load(conf_file)?; |
25 | 24 |
26 let sys = ActorSystem::new().unwrap(); | 25 let sys = ActorSystem::new().unwrap(); |
27 | 26 |