Skip to main content

FilesystemSnapshot

Struct FilesystemSnapshot 

Source
pub struct FilesystemSnapshot {
    pub mount_point: Box<str>,
    pub device: Option<Box<str>>,
    pub fs_type: Option<Box<str>>,
    pub total_bytes: u64,
    pub available_bytes: MetricState<u64>,
    pub used_bytes: MetricState<u64>,
    pub usage: MetricState<Percent>,
    pub inodes: MetricState<InodeUsage>,
    pub kind: FilesystemKind,
    pub read_only: bool,
}
Expand description

Capacity of one mounted filesystem.

Contains no throughput fields at all; that is DiskSnapshot’s job.

Fields§

§mount_point: Box<str>

Where it is mounted.

§device: Option<Box<str>>

The backing device, where the platform maps it.

§fs_type: Option<Box<str>>

Filesystem type, e.g. apfs, ext4, overlay.

§total_bytes: u64

Total capacity.

§available_bytes: MetricState<u64>

Space available to the current user.

Usually smaller than total - used because of reserved blocks.

§used_bytes: MetricState<u64>

Space in use.

§usage: MetricState<Percent>

Share of capacity used. Never mixed with device utilization (§7.3).

§inodes: MetricState<InodeUsage>

Inode occupancy, where the filesystem has an inode table to report.

A medium-tier read like the byte capacity, and from the same statfs call — sysinfo does not expose f_files, so it is the native layers that fill this in and the baseline that leaves it MetricState::Unsupported.

§kind: FilesystemKind

How the mount is classified.

§read_only: bool

Whether the mount is read-only.

Implementations§

Source§

impl FilesystemSnapshot

Source

pub fn inode_usage(&self) -> MetricState<Percent>

Share of the inode table in use, carrying the inode read’s own availability.

The percentage a display wants: a refused or absent inode count produces a state and never a number, and a retained count produces a percentage that is marked stale exactly as the count was (§4).

Trait Implementations§

Source§

impl Clone for FilesystemSnapshot

Source§

fn clone(&self) -> FilesystemSnapshot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilesystemSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FilesystemSnapshot

Source§

fn eq(&self, other: &FilesystemSnapshot) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FilesystemSnapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.