1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub fn get_os_name() -> &'static str {
    std::env::consts::OS
}

pub fn get_os_arch() -> &'static str {
    std::env::consts::ARCH
}

pub fn get_os_family() -> &'static str {
    std::env::consts::FAMILY
}

pub fn get_kernel_version() -> String {
    match sysinfo::System::kernel_version() {
        Some(v) => v,
        None => "unknown".to_string(),
    }
}