Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/williamanimate/sysinfo_dot_h
a tiny sys/sysinfo.h wrapper in rust
https://github.com/williamanimate/sysinfo_dot_h
Last synced: 14 days ago
JSON representation
a tiny sys/sysinfo.h wrapper in rust
- Host: GitHub
- URL: https://github.com/williamanimate/sysinfo_dot_h
- Owner: WilliamAnimate
- License: mit
- Created: 2024-03-16T18:40:01.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-18T02:11:48.000Z (7 months ago)
- Last Synced: 2024-08-11T09:08:36.724Z (3 months ago)
- Language: Rust
- Homepage: https://crates.io/crates/sysinfo_dot_h
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sysinfo dot h
A tiny wrapper in Rust
## How?
Quick start:
```rust
use sysinfo_dot_h::try_collect;let info = try_collect().unwrap();
dbg!(info.uptime); // uptime in seconds
```or
```rust
use sysinfo_dot_h::collect;let info = collect();
dbg!(info.uptime); // uptime in seconds
```## Why?
This makes it easier (and quicker) to port the following C code to rust:
```c
#include
int main() {
struct sysinfo *info;
sysinfo(info);
}
```The [sysinfo](https://crates.io/crates/sysinfo) crate was too slow for my use case (200 milliseconds) so I made my own.
Please note that unlike sysinfo, this crate only works on Linux, so if your application is cross platform it may not be favourable to use this crate.