1 stable release
Uses new Rust 2024
new 1.0.0 | May 23, 2025 |
---|
#157 in Operating systems
33KB
641 lines
osinfo
Overview
Rust library project used to get operating system detail.
Library (osinfo
)
osinfo
usage
To use this crate, add osinfo
as a dependency to your project's Cargo.toml:
[dependencies]
osinfo = "1"
Example
use osinfo;
let info = osinfo::get();
// Print full information:
println!("OS information: {info}");
println!("ID: {}", info.get_id());
println!("Name: {}", info.get_name());
println!("Version: {}", info.get_version());
println!("Variant: {}", info.get_variant());
println!("Edition: {}", info.get_edition());
println!("Codename: {}", info.get_codename());
License
osinfo
is licensed under the MIT license. See (LICENSE) for the details.
Dependencies
~0.3–7.5MB
~52K SLoC