libmacchina 0.8.0

A library that can fetch all sorts of system information, super-duper fast!
docs.rs failed to build libmacchina-0.8.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: libmacchina-7.2.2

A library that can fetch all sorts of system information, super-duper fast!

Linux • macOS • Windows • NetBSD • Android • OpenWrt

Usage

Add the following to your project's Cargo.toml file:

libmacchina = "0.5.0"

Examples

// Let's import two of the several types.
use libmacchina::{GeneralReadout, MemoryReadout};

fn main() {
    // Let's import the GeneralReadout trait so we
    // can fetch some general information about the host.
    use libmacchina::traits::GeneralReadout as _;
    
    // There are too many  functions within GeneralReadout to list, but you get the gist ;)
    let general_readout = GeneralReadout::new();
    let cpu_cores = general_readout.cpu_cores().unwrap();          // 8
    let cpu = general_readout.cpu_model_name().unwrap();          // Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
    let uptime = general_readout.uptime().unwrap();                // 1500 [in seconds]

    // Now we'll import the MemoryReadout trait to get an
    // idea of what the host's memory usage looks like.
    use libmacchina::traits::MemoryReadout as _;

    let memory_readout = MemoryReadout::new();          
    let total_mem = memory_readout.total();       // 20242204 [in kB]
    let used_mem = memory_readout.used();         // 3894880 [in kB]
}