Crates.io | ukhasnet-parser |
lib.rs | ukhasnet-parser |
version | 0.4.0 |
source | src |
created_at | 2016-03-20 15:13:42.663854 |
updated_at | 2017-03-18 14:29:11.981884 |
description | A parser for the UKHASnet protocol |
homepage | https://github.com/adamgreig/ukhasnet-parser |
repository | https://github.com/adamgreig/ukhasnet-parser |
max_upload_size | |
id | 4501 |
size | 16,973 |
A parser for the UKHASnet protocol written in Rust.
See the examples
directory for further usage, or simply:
extern crate ukhasnet_parser;
use ukhasnet_parser::{parse};
pub fn main() {
let s = "2bT12,15H38:test[AG]".to_owned();
match parse(&s) {
Ok(p) => println!("{:?}", p),
Err(e) => println!("{}", e),
}
}
$ cargo run --example simple
Packet { repeat: 2, sequence: 'b', data: [Temperature([12, 15]), Humidity([38])], comment: Some("test"), path: ["AG"] }