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
A mount entry which contains information regarding how and where a source is mounted.
Iteratively parse the /proc/mounts
file.
A list of parsed mount entries from /proc/mounts
.
Provides an abstract representation of the contents of a mount tab.
A swap entry, which defines an active swap.
Iteratively parse the /proc/swaps
file.
A list of parsed swap entries from /proc/swaps
.
Enums
An element in an abtract representation of the mount tab that was read into memory.