rin-sys 0.1.4

A small library to fetch system information in linux
Documentation
  • Coverage
  • 0%
    0 out of 21 items documented0 out of 6 items with examples
  • Size
  • Source code size: 8.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.66 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Icelain/rin
    6 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Icelain

Rust Docs

rin

A small rust library to fetch system information on linux

Installation

Add rin-sys = "0.1.4" to your Cargo.toml

Usage


let ram_info = rin_sys::get_ram_info();
let cpu_info = rin_sys::get_cpu_info();

RAM info struct -

#[derive(Default, Debug)]
pub struct RamInfo {
   pub mem_used: usize,
   pub mem_free: usize,
   pub mem_total: usize,
   pub percent_free: f32,
   pub percent_used: f32,
}

CPU info struct -

#[derive(Debug, Default)]
pub struct CpuInfo {
   pub cache_size: String,
   pub cores: usize,
   pub cpu_speed: Vec<(usize, f64)>,
   pub model_name: String,
   pub vendor_id: String,
   pub is_fpu: bool,
   pub cpuid_level: f32,
}