[go: up one dir, main page]

sysinfo 0.31.0

Library to get system information such as processes, CPUs, disks, components and networks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Take a look at the license at the top of the repository in the LICENSE file.

// This test is used to ensure that the networks are not loaded by default.

#[cfg(feature = "network")]
#[test]
fn test_networks() {
    use sysinfo::Networks;

    if sysinfo::IS_SUPPORTED_SYSTEM {
        let mut n = Networks::new();
        assert_eq!(n.iter().count(), 0);
        n.refresh();
        assert_eq!(n.iter().count(), 0);
        n.refresh_list();
        assert!(n.iter().count() > 0);
    }
}