disk_list/
lib.rs

1#[allow(warnings)]
2pub fn get_disk_list() -> Vec<Vec<String>> {
3    use get_sys_info::{saturating_sub_bytes, Platform, System};
4    let sys = System::new();
5    let mut re = vec![];
6    match sys.mounts() {
7        Ok(mounts) => {
8            for mount in mounts.iter() {
9                re.push(vec![
10                    format!("{}", mount.fs_mounted_from),
11                    format!("{}", mount.fs_type),
12                    format!("{}", mount.fs_mounted_on),
13                    format!("{}", mount.avail),
14                    format!("{}", mount.total),
15                ]);
16            }
17        }
18        Err(x) => println!("\nget_disk_list error: {}", x),
19    }
20    re
21}