pub struct MountInfo {
pub id: Option<MountId>,
pub parent: Option<MountId>,
pub dev: DeviceId,
pub root: PathBuf,
pub mount_point: PathBuf,
pub options: Vec<MountOption>,
pub fs: String,
pub fs_type: String,
pub bound: bool,
}Expand description
A mount point as described in /proc/self/mountinfo
Fields§
§id: Option<MountId>§parent: Option<MountId>§dev: DeviceId§root: PathBuf§mount_point: PathBuf§options: Vec<MountOption>§fs: String§fs_type: String§bound: boolwhether it’s a bound mount (usually mirroring part of another device)
Implementations§
Source§impl MountInfo
impl MountInfo
Sourcepub fn is_remote(&self) -> bool
pub fn is_remote(&self) -> bool
tell whether the mount looks remote
Heuristics copied from https://github.com/coreutils/gnulib/blob/master/lib/mountlist.c
Sourcepub fn options_string(&self) -> String
pub fn options_string(&self) -> String
return a string like “rw,noatime,compress=zstd:3,space_cache=v2,subvolid=256” (as in /proc/mountinfo)
Some options may be skipped as they’re less relevant (but you may still find them in the options vec)
Sourcepub fn has_option(&self, name: &str) -> bool
pub fn has_option(&self, name: &str) -> bool
tell whether the option (eg “compress”, “rw”, “noatime”) is present among options
Sourcepub fn option_value(&self, name: &str) -> Option<&str>
pub fn option_value(&self, name: &str) -> Option<&str>
return the value of the mountoption, or None
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MountInfo
impl RefUnwindSafe for MountInfo
impl Send for MountInfo
impl Sync for MountInfo
impl Unpin for MountInfo
impl UnwindSafe for MountInfo
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