valpackett / systemstat

Rust library for getting system information | also on https://codeberg.org/valpackett/systemstat
https://crates.io/crates/systemstat
The Unlicense
610 stars 71 forks source link

add swap support #102

Closed davidkna closed 2 years ago

davidkna commented 2 years ago

This PR adds swap to Platform and implements the required functionality for Linux, macOS and Windows. Further, TryFrom is implemented between Memory and Swap based on per-platform compatibility (Linux and Windows are supported).

Closes #93

valpackett commented 2 years ago

hmm. I don't think the TryFrom thing is a very good API. The simpler, more obvious way to leverage the fact that some platforms provide both in one syscall would be to just have all the retrieval options as separate functions:

davidkna commented 2 years ago

Done!

valpackett commented 2 years ago

Thanks!