Mercurial > templog
view rust/src/main.rs @ 590:dccd8504aa38 rust
it runs
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 21 Dec 2016 21:40:32 +0800 |
parents | f2508125adf1 |
children | 4a944663fa8d |
line wrap: on
line source
extern crate tokio_core; extern crate futures; use tokio_core::reactor::Core; use futures::Stream; mod sensor; fn main() { println!("Wort Templog"); let mut core = Core::new().unwrap(); let handle = core.handle(); let s = sensor::Sensor::run(&handle); let h = s.for_each(|r| { println!("readings {:?}", r); Ok(()) }); core.run(h); }