forked from uutils/platform-info
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex.rs
More file actions
19 lines (15 loc) · 766 Bytes
/
ex.rs
File metadata and controls
19 lines (15 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// examples/ex.rs
// * use `cargo run --example ex` to execute this example
// spell-checker:ignore (API) nodename osname sysname
use platform_info::{PlatformInfo, PlatformInfoAPI, UNameAPI};
fn main() {
let info = PlatformInfo::new().expect("Unable to determine platform info");
// println!("info={:#?}", info); // note: info *may* contain extra platform-specific fields
println!("{}", info.sysname().to_string_lossy());
println!("{}", info.nodename().to_string_lossy());
println!("{}", info.release().to_string_lossy());
println!("{}", info.version().to_string_lossy());
println!("{}", info.machine().to_string_lossy());
println!("{}", info.processor().to_string_lossy());
println!("{}", info.osname().to_string_lossy());
}