Expand description
sinf
Typed system information for Rust.
Processes, CPU, memory, disks, components, GPUs, networks, users and hardware inventory.
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 onlibc; 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 auditandcargo deny.
§Supported platforms
| Platform | Status |
|---|---|
| Linux, Android, Raspberry Pi | Full backend |
| Windows | Full backend |
| macOS, iOS | Shared Apple backend |
| FreeBSD, NetBSD | Full backend |
| Other targets | Rejected 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
| Feature | Default | Adds |
|---|---|---|
system | yes | System, CPU, memory, processes, motherboard and product |
disk | yes | Disks, mounts and I/O |
component | yes | Temperature and component sensors |
gpu | yes | GPU identity, usage and memory |
network | yes | Interfaces, addresses and traffic |
user | yes | Local users and groups |
hardware | yes | Firmware, PCI, USB, batteries, sensors, displays and storage |
serde | no | Serialization/deserialization of supported types |
multithread | no | Parallel refresh with rayon |
§Quality and security
- Public API modules forbid
unsafe. - OS access is isolated behind platform/FFI wrappers.
- DMI, EDID,
/proc/<pid>/statand/proc/diskstatsparsers 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.