<h1 align="center">sinf</h1>
<p align="center">
<strong>Typed system information for Rust.</strong><br>
Processes, CPU, memory, disks, components, GPUs, networks, users and hardware inventory.
</p>
<p align="center">
<a href="https://crates.io/crates/sinf"><img alt="crates.io" src="https://img.shields.io/crates/v/sinf.svg"></a>
<a href="https://docs.rs/sinf"><img alt="docs.rs" src="https://img.shields.io/docsrs/sinf.svg"></a>
<a href="LICENSE"><img alt="license" src="https://img.shields.io/crates/l/sinf.svg"></a>
<img alt="MSRV" src="https://img.shields.io/badge/MSRV-1.95-blue.svg">
</p>
<p align="center">
<a href="https://github.com/rscluster/sinf/actions/workflows/CI.yml"><img alt="CI" src="https://github.com/rscluster/sinf/actions/workflows/CI.yml/badge.svg"></a>
<a href="https://github.com/rscluster/sinf/actions/workflows/bsd.yml"><img alt="BSD" src="https://github.com/rscluster/sinf/actions/workflows/bsd.yml/badge.svg"></a>
<a href="https://github.com/rscluster/sinf/actions/workflows/apple.yml"><img alt="Apple" src="https://github.com/rscluster/sinf/actions/workflows/apple.yml/badge.svg"></a>
<a href="https://github.com/rscluster/sinf/actions/workflows/security.yml"><img alt="Security" src="https://github.com/rscluster/sinf/actions/workflows/security.yml/badge.svg"></a>
</p>
<p align="center">
<a href="#install">Install</a> ·
<a href="#quick-start">Quick start</a> ·
<a href="#documentation">Documentation</a> ·
<a href="#community">Community</a>
</p>
## 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
| 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
| [Start here](https://github.com/rscluster/sinf/blob/main/docs/en/README.md) | [Empieza aquí](https://github.com/rscluster/sinf/blob/main/docs/es/README.md) |
| [API reference](https://github.com/rscluster/sinf/blob/main/docs/en/api.md) | [Referencia de la API](https://github.com/rscluster/sinf/blob/main/docs/es/api.md) |
| [Architecture](https://github.com/rscluster/sinf/blob/main/docs/en/architecture.md) | [Arquitectura](https://github.com/rscluster/sinf/blob/main/docs/es/architecture.md) |
| [Structural conventions](https://github.com/rscluster/sinf/blob/main/docs/en/structure.md) | [Convenciones estructurales](https://github.com/rscluster/sinf/blob/main/docs/es/structure.md) |
| [Security](https://github.com/rscluster/sinf/blob/main/docs/en/security.md) | [Seguridad](https://github.com/rscluster/sinf/blob/main/docs/es/security.md) |
| [Features and platforms](https://github.com/rscluster/sinf/blob/main/docs/en/features.md) | [Features y plataformas](https://github.com/rscluster/sinf/blob/main/docs/es/features.md) |
| [PCI vendor IDs](https://github.com/rscluster/sinf/blob/main/docs/en/reference/pci-vendor-ids.md) | [IDs de vendor PCI](https://github.com/rscluster/sinf/blob/main/docs/es/reference/pci-vendor-ids.md) |
| [Usage guides](https://github.com/rscluster/sinf/blob/main/docs/snippets/system.md) | [Guías de uso](https://github.com/rscluster/sinf/blob/main/docs/es/snippets/system.md) |
The rustdoc API is available at <https://docs.rs/sinf>.
## Install
```toml
[dependencies]
sinf = "0.1"
```
Default features: `system`, `disk`, `component`, `gpu`, `network`, `user`, `hardware`.
Extra features: `serde` and `multithread`.
## Quick start
```rust,ignore
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](https://github.com/rscluster/sinf/blob/main/docs/snippets/system.md) and the
[API reference](https://github.com/rscluster/sinf/blob/main/docs/en/api.md) for the complete API.
## Feature overview
| `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>/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](https://github.com/rscluster/sinf/blob/main/SECURITY.md) for reporting and scope.
## Community
- [Contributing](https://github.com/rscluster/sinf/blob/main/CONTRIBUTING.md)
- [Code of Conduct](https://github.com/rscluster/sinf/blob/main/CODE_OF_CONDUCT.md)
- [Security policy](https://github.com/rscluster/sinf/blob/main/SECURITY.md)
- [Issues](https://github.com/rscluster/sinf/issues)
- [Pull requests](https://github.com/rscluster/sinf/pulls)
## License
GPL-3.0-or-later. See [LICENSE](https://github.com/rscluster/sinf/blob/main/LICENSE).