Struct linux_info::storage::MountPoint
source · pub struct MountPoint<'a> { /* private fields */ }
Implementations§
source§impl<'a> MountPoint<'a>
impl<'a> MountPoint<'a>
sourcepub fn values(&self) -> impl Iterator<Item = &'a str>
pub fn values(&self) -> impl Iterator<Item = &'a str>
Returns every value separated by a space.
sourcepub fn mount_id(&self) -> Option<usize>
pub fn mount_id(&self) -> Option<usize>
A unique ID for the mount (may be reused after umount).
sourcepub fn parent_id(&self) -> Option<usize>
pub fn parent_id(&self) -> Option<usize>
The ID of the parent mount (or of self for the root of this mount namespace’s mount tree).
sourcepub fn major_minor(&self) -> Option<&'a str>
pub fn major_minor(&self) -> Option<&'a str>
major:minor: the value of st_dev for files on this filesystem.
sourcepub fn root(&self) -> Option<&'a str>
pub fn root(&self) -> Option<&'a str>
the pathname of the directory in the filesystem which forms the root of this mount.
sourcepub fn mount_point(&self) -> Option<&'a str>
pub fn mount_point(&self) -> Option<&'a str>
The pathname of the mount point relative to the process’s root directory.
Examples found in repository?
examples/df_h.rs (line 30)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
fn print_point(point: MountPoint) -> Option<()> {
let stat = point.stats().ok()?;
if !stat.has_blocks() {
return None
}
println!(
"{:<15} {:>10} {:>10} {:>10} {}",
point.mount_source()?,
format!("{:.1}", stat.total()?),
format!("{:.1}", stat.available()?),
format!("{:.1}", stat.used()?),
point.mount_point()?
);
Some(())
}
sourcepub fn mount_options(&self) -> Option<&'a str>
pub fn mount_options(&self) -> Option<&'a str>
Per-mount options.
sourcepub fn optional_fields(
&self
) -> impl Iterator<Item = (&'a str, Option<&'a str>)>
pub fn optional_fields( &self ) -> impl Iterator<Item = (&'a str, Option<&'a str>)>
Currently, the possible optional fields are shared
, master
,
propagate_from
, and unbindable
.
sourcepub fn filesystem_type(&self) -> Option<&'a str>
pub fn filesystem_type(&self) -> Option<&'a str>
The filesystem type in the form “type[.subtype]”.
sourcepub fn mount_source(&self) -> Option<&'a str>
pub fn mount_source(&self) -> Option<&'a str>
Filesystem-specific information.
df command uses this information as Filesystem.
Examples found in repository?
examples/df_h.rs (line 26)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
fn print_point(point: MountPoint) -> Option<()> {
let stat = point.stats().ok()?;
if !stat.has_blocks() {
return None
}
println!(
"{:<15} {:>10} {:>10} {:>10} {}",
point.mount_source()?,
format!("{:.1}", stat.total()?),
format!("{:.1}", stat.available()?),
format!("{:.1}", stat.used()?),
point.mount_point()?
);
Some(())
}
sourcepub fn super_options(&self) -> Option<&'a str>
pub fn super_options(&self) -> Option<&'a str>
Per-superblock options.
sourcepub fn stats(&self) -> Result<FsStat>
pub fn stats(&self) -> Result<FsStat>
Returns the filesystem statistics of this mount point.
Examples found in repository?
examples/df_h.rs (line 18)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
fn print_point(point: MountPoint) -> Option<()> {
let stat = point.stats().ok()?;
if !stat.has_blocks() {
return None
}
println!(
"{:<15} {:>10} {:>10} {:>10} {}",
point.mount_source()?,
format!("{:.1}", stat.total()?),
format!("{:.1}", stat.available()?),
format!("{:.1}", stat.used()?),
point.mount_point()?
);
Some(())
}
Trait Implementations§
source§impl<'a> Clone for MountPoint<'a>
impl<'a> Clone for MountPoint<'a>
source§fn clone(&self) -> MountPoint<'a>
fn clone(&self) -> MountPoint<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for MountPoint<'a>
impl<'a> Debug for MountPoint<'a>
source§impl<'a> PartialEq for MountPoint<'a>
impl<'a> PartialEq for MountPoint<'a>
source§fn eq(&self, other: &MountPoint<'a>) -> bool
fn eq(&self, other: &MountPoint<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Eq for MountPoint<'a>
impl<'a> StructuralPartialEq for MountPoint<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for MountPoint<'a>
impl<'a> Send for MountPoint<'a>
impl<'a> Sync for MountPoint<'a>
impl<'a> Unpin for MountPoint<'a>
impl<'a> UnwindSafe for MountPoint<'a>
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