A library providing access to all sorts of system information.
Linux • macOS • Windows • NetBSD • FreeBSD • Android • OpenWrt
Usage
Add the following to your project's Cargo.toml file:
libmacchina = "3"
Examples
use libmacchina::{GeneralReadout, MemoryReadout};
fn main() {
use libmacchina::traits::GeneralReadout as _;
let general_readout = GeneralReadout::new();
let cpu_cores = general_readout.cpu_cores().unwrap(); let cpu = general_readout.cpu_model_name().unwrap(); let uptime = general_readout.uptime().unwrap();
use libmacchina::traits::MemoryReadout as _;
let memory_readout = MemoryReadout::new();
let total_mem = memory_readout.total(); let used_mem = memory_readout.used(); }