sys_metrics 0.2.7

Cross-platform library to gather stats/information from the host
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[cfg(test)]
#[allow(unused_comparisons)]
mod network {
    // Note this useful idiom: importing names from outer (for mod tests) scope.
    use sys_metrics::network::*;

    #[test]
    fn test_ionets() {
        #[cfg(target_os = "linux")]
        let ionets = get_physical_ionets().unwrap();
        #[cfg(target_os = "macos")]
        let ionets = get_ionets().unwrap();

        assert!(!ionets.is_empty());
    }
}