Skip to main content

Crate sinf

Crate sinf 

Source
Expand description

sinf

Typed system information for Rust.
Processes, CPU, memory, disks, components, GPUs, networks, users and hardware inventory.

crates.io docs.rs license MSRV

CI BSD Apple Security

Install · Quick start · Documentation · Community

§Why sinf

  • Typed, refreshable snapshots of the local system, with platform data parsed inside the library.
  • Modular by domain: enable only the features you need.
  • Safe public API: public modules use #![forbid(unsafe_code)]; OS access stays behind safe platform wrappers.
  • Direct reads: uses procfs/sysfs, Win32, IOKit and BSD syscalls. On Linux the default build depends only on libc; platform crates are used only on their targets.
  • Hardware inventory on Linux: BIOS/SMBIOS, RAM modules, PCI, USB, batteries, sensors, displays and storage.
  • Checked: cross-platform CI, fuzzing, cargo audit and cargo deny.

§Supported platforms

PlatformStatus
Linux, Android, Raspberry PiFull backend
WindowsFull backend
macOS, iOSShared Apple backend
FreeBSD, NetBSDFull backend
Other targetsRejected at compile time with a clear error

Hardware inventory is Linux-only; other platforms return Error::Unsupported for the hardware module. Minimum supported Rust version: 1.95.

§Documentation

The rustdoc API is available at https://docs.rs/sinf.

§Install

[dependencies]
sinf = "0.1"

Default features: system, disk, component, gpu, network, user, hardware. Extra features: serde and multithread.

§Quick start

ⓘ
use sinf::system::{RefreshKind, System};

let mut sys = System::new_with_specifics(RefreshKind::everything())?;
sys.refresh_all();

Values based on differences, such as CPU or network usage, require two refreshes. Keep one System instance for the lifetime of your program.

See the system guide and the API reference for the complete API.

§Feature overview

FeatureDefaultAdds
systemyesSystem, CPU, memory, processes, motherboard and product
diskyesDisks, mounts and I/O
componentyesTemperature and component sensors
gpuyesGPU identity, usage and memory
networkyesInterfaces, addresses and traffic
useryesLocal users and groups
hardwareyesFirmware, PCI, USB, batteries, sensors, displays and storage
serdenoSerialization/deserialization of supported types
multithreadnoParallel refresh with rayon

§Quality and security

  • Public API modules forbid unsafe.
  • OS access is isolated behind platform/FFI wrappers.
  • DMI, EDID, /proc/<pid>/stat and /proc/diskstats parsers have fuzz targets.
  • Monthly dependency and supply-chain checks.
  • CI runs on Linux, Windows, macOS, iOS simulator, FreeBSD and NetBSD.

See SECURITY.md for reporting and scope.

§Community

§License

GPL-3.0-or-later. See LICENSE. Enabling serde makes public types serializable.

Modules§

common
Types shared by more than one domain.
component
Hardware components and their sensors.
disk
Disks and their usage statistics.
gpu
GPUs and PCI device information.
hardware
Hardware inventory: firmware, PCI, USB, power, sensors, displays and storage.
network
Network interfaces and their addresses.
prelude
Convenience re-exports of the most commonly used types. Convenience re-exports for common types.
system
System, CPU, memory, process, motherboard and product information.
user
Users and groups.

Enums§

Error
Error type for the main failures that can occur while querying system information.