4个版本
| 0.1.3 | 2023年8月30日 |
|---|---|
| 0.1.2 | 2023年8月30日 |
| 0.1.1 | 2023年8月30日 |
| 0.1.0 | 2023年8月27日 |
4 in #ups
5KB
103 行
apcaccess-rs
一个Rust库,允许访问apcupsd提供的数据。
用法
use apcaccess_rs::{APCAccess, APCAccessConfig};
let apc = APCAccess::new(Some(APCAccessConfig { ..Default::default() }));
let data = apc.fetch().unwrap(); // returns a hashmap of the data
您可以根据您的UPS在资源文件夹中查看可能的键。
fetch()如果您的IP地址无效,将会panic。