pub struct MountList(pub Vec<MountInfo>);
Expand description
A list of parsed mount entries from /proc/mounts
.
Tuple Fields§
§0: Vec<MountInfo>
Implementations§
Source§impl MountList
impl MountList
Sourcepub fn parse_from<'a, I: Iterator<Item = &'a str>>(
lines: I,
) -> Result<MountList>
pub fn parse_from<'a, I: Iterator<Item = &'a str>>( lines: I, ) -> Result<MountList>
Parse mounts given from an iterator of mount entry lines.
Sourcepub fn new_from_file<P: AsRef<Path>>(path: P) -> Result<MountList>
pub fn new_from_file<P: AsRef<Path>>(path: P) -> Result<MountList>
Read a new list of mounts into memory from any mount-tab-like file.
Sourcepub fn new_from_reader<R: BufRead>(reader: R) -> Result<MountList>
pub fn new_from_reader<R: BufRead>(reader: R) -> Result<MountList>
Read a new list of mounts into memory from any mount-tab-like file.
pub fn source_mounted_at<D: AsRef<Path>, P: AsRef<Path>>( &self, source: D, path: P, ) -> bool
Sourcepub fn get_mount_by_dest<P: AsRef<Path>>(&self, path: P) -> Option<&MountInfo>
pub fn get_mount_by_dest<P: AsRef<Path>>(&self, path: P) -> Option<&MountInfo>
Find the first mount which which has the path
destination.
Sourcepub fn get_mount_by_source<P: AsRef<Path>>(&self, path: P) -> Option<&MountInfo>
pub fn get_mount_by_source<P: AsRef<Path>>(&self, path: P) -> Option<&MountInfo>
Find the first mount hich has the source path
.
Trait Implementations§
impl Eq for MountList
impl StructuralPartialEq for MountList
Auto Trait Implementations§
impl Freeze for MountList
impl RefUnwindSafe for MountList
impl Send for MountList
impl Sync for MountList
impl Unpin for MountList
impl UnwindSafe for MountList
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more