apcaccess 0.2.0

A Rust implementation of apcaccess to get data from apcupsd.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::time::Duration;
use apcaccess::{APCAccess, APCAccessConfig};

pub fn main() {
  let apc = APCAccess::new(Some(APCAccessConfig {
    host: "127.0.0.1".into(),
    port: 3551,
    strip_units: true,
    timeout: Duration::from_secs(5),
  }));

  let data = apc.fetch().unwrap();

  println!("{:?}", data);
}