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)
17fn print_point(point: MountPoint) -> Option<()> {
18 let stat = point.stats().ok()?;
19
20 if !stat.has_blocks() {
21 return None
22 }
23
24 println!(
25 "{:<15} {:>10} {:>10} {:>10} {}",
26 point.mount_source()?,
27 format!("{:.1}", stat.total()?),
28 format!("{:.1}", stat.available()?),
29 format!("{:.1}", stat.used()?),
30 point.mount_point()?
31 );
32
33 Some(())
34}
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)
17fn print_point(point: MountPoint) -> Option<()> {
18 let stat = point.stats().ok()?;
19
20 if !stat.has_blocks() {
21 return None
22 }
23
24 println!(
25 "{:<15} {:>10} {:>10} {:>10} {}",
26 point.mount_source()?,
27 format!("{:.1}", stat.total()?),
28 format!("{:.1}", stat.available()?),
29 format!("{:.1}", stat.used()?),
30 point.mount_point()?
31 );
32
33 Some(())
34}
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)
17fn print_point(point: MountPoint) -> Option<()> {
18 let stat = point.stats().ok()?;
19
20 if !stat.has_blocks() {
21 return None
22 }
23
24 println!(
25 "{:<15} {:>10} {:>10} {:>10} {}",
26 point.mount_source()?,
27 format!("{:.1}", stat.total()?),
28 format!("{:.1}", stat.available()?),
29 format!("{:.1}", stat.used()?),
30 point.mount_point()?
31 );
32
33 Some(())
34}
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>
impl<'a> Eq for MountPoint<'a>
impl<'a> StructuralPartialEq for MountPoint<'a>
Auto Trait Implementations§
impl<'a> Freeze for MountPoint<'a>
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