Registry / utility / os-version

os-version

JSON →
library0.2.1rscratesunverified

Get the operating system version.

# Cargo.toml [dependencies] os-version = "0.2.1"
INSTALL
IMPORT
SIG · OS-VERSION
O
os-version
utilityrustv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_os_version
use os_version::get_os_version;

Retrieves the current operating system version string.

use os_version::get_os_version; match get_os_version() { Some(version) => println!("OS version: {}", version), None => println!("Could not determine OS version"), }
Debug
Known issues
gotchaThe function may return None on unsupported platforms.
fix
Check the return value and handle the None case gracefully.
affects: >=0.2.0
Upgrade
Version history
0.2.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
os-version — cargo add os-version · libregistry