Crate proc_mounts
source ·Expand description
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(())
}
Structs
Static list of mounts that is dynamically updated in the background.
A mount entry which contains information regarding how and where a device
is mounted.
Iteratively parse the
/proc/mounts
file.A list of parsed mount entries from
/proc/mounts
.Static list of swap points that is dynamically updated in the background.
A swap entry, which defines an active swap.
Iteratively parse the
/proc/swaps
file.A list of parsed swap entries from
/proc/swaps
.