Install
Just add this to your Cargo.toml
:
[dependencies]
os-release-rs = "0.1.0"
Now, you can use it in your project. Go to the next chapter to see how to use it.
Usage
os-release-rs
provide a Rust wrapper for /etc/os-release
file.
It's easy to use:
use os_release_rs::OsRelease; fn main() { let os_release = OsRelease::new().unwrap(); println!("I use {} btw!", os_release.name); }
OsRelease is a struct that contains all the informations from /etc/os-release
file.
See the documentation for a complete list of fields.