proc-mounts

Crates.ioproc-mounts
lib.rsproc-mounts
version0.3.0
sourcesrc
created_at2018-11-02 16:54:42.478598
updated_at2022-03-21 14:00:37.737688
descriptionFetch active mounts and swaps on a Linux system
homepage
repositoryhttps://github.com/pop-os/proc-mounts
max_upload_size
id94351
size28,671
Jeremy Soller (jackpot51)

documentation

README

proc-mounts

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(())
}
Commit count: 16

cargo fmt