Daniel Hofstetter 3c0f3fa67e Merge pull request #91 from uutils/renovate/mozilla-actions-sccache-action-0.x
chore(deps): update mozilla-actions/sccache-action action to v0.0.9
2025-03-27 11:30:45 +01:00
2024-04-09 23:15:11 +02:00
2024-12-22 04:23:52 +00:00
2024-04-09 23:15:11 +02:00
2024-12-22 14:21:26 +01:00
2023-02-13 22:16:00 -06:00
2023-05-28 15:19:55 -05:00

platform-info

Crates.io License CodeCov

A simple cross-platform way to get information about the currently running system.

Examples

This simple example:

// examples/ex.rs
// * use `cargo run --example ex` to execute this example

// spell-checker:ignore (API) nodename osname sysname

use platform_info::*;

fn main() {
    let info = PlatformInfo::new().expect("Unable to determine platform info");
    // println!("info={:#?}", info);

    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.osname().to_string_lossy());
}

should display something like:

Linux
hostname
5.10.0-8-amd64
#1 SMP Debian 5.10.46-4 (2021-08-03)
x86_64
GNU/Linux

Using cargo run --example ex will build and execute this example code.

Other examples can be found in the examples directory.

License

platform-info is licensed under the MIT License.

S
Description
Languages
Rust 100%