sys-lib 0.5.0

System facts for Rust services: OS, CPU, memory, disks, network, host, this process, virtualization, power, and device identity, container-aware by default, plus build info, instance info, and a process guard. No subprocesses, zero third-party dependencies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! An application-scoped device id, and what this machine's sources look like.
//!
//! ```text
//! cargo run --example device_id --features device-id
//! ```

use sys_lib::device;

fn main() {
    println!("{}", device::report());
    match device::id("com.example.device-id-example") {
        Ok(id) => println!("device id: {id}"),
        Err(e) => println!("no device id: {e}"),
    }
}