| Crates.io | proc-mounts |
| lib.rs | proc-mounts |
| version | 0.3.0 |
| created_at | 2018-11-02 16:54:42.478598+00 |
| updated_at | 2022-03-21 14:00:37.737688+00 |
| description | Fetch active mounts and swaps on a Linux system |
| homepage | |
| repository | https://github.com/pop-os/proc-mounts |
| max_upload_size | |
| id | 94351 |
| size | 28,671 |
Rust crate that provides easy access to data from the /proc/swaps and /proc/mounts files.
extern crate proc_mounts;
use proc_mounts::{MountIter, SwapIter};
use std::io;
fn main() -> io::Result<()> {
println!("# Active Mounts");
for mount in MountIter::new()? {
println!("{:#?}", mount);
}
println!("# Active Swaps");
for swap in SwapIter::new()? {
println!("{:#?}", swap);
}
Ok(())
}