Skip to main content

FilesystemStats

Struct FilesystemStats 

Source
pub struct FilesystemStats { /* private fields */ }
Expand description

Filesystem capacity and limits for the filesystem containing a target. Values are observations, not reservations. None means unknown or unsupported. Byte counts use the filesystem allocation unit, not its preferred I/O size. Getters preserve zero and false as known values. Fluent with_* setters accept None to restore an unknown value.

use vfsi_core::FilesystemStats;
let stats = FilesystemStats::default()
    .with_free_bytes(Some(0))
    .with_read_only(Some(false));
assert_eq!(stats.free_bytes(), Some(0));
assert_eq!(stats.read_only(), Some(false));
assert_eq!(stats.total_bytes(), None);

Implementations§

Source§

impl FilesystemStats

Source

pub const fn total_bytes(&self) -> Option<u64>

Total capacity in bytes.

Source

pub fn with_total_bytes(self, value: Option<u64>) -> FilesystemStats

Set total_bytes; None marks it unknown.

Source

pub const fn free_bytes(&self) -> Option<u64>

Free capacity in bytes, including reserved space.

Source

pub fn with_free_bytes(self, value: Option<u64>) -> FilesystemStats

Set free_bytes; None marks it unknown.

Source

pub const fn available_bytes(&self) -> Option<u64>

Space available to an unprivileged caller (may exclude reserved blocks).

Source

pub fn with_available_bytes(self, value: Option<u64>) -> FilesystemStats

Set available_bytes; None marks it unknown.

Source

pub const fn total_files(&self) -> Option<u64>

Total file count.

Source

pub fn with_total_files(self, value: Option<u64>) -> FilesystemStats

Set total_files; None marks it unknown.

Source

pub const fn free_files(&self) -> Option<u64>

Free file count.

Source

pub fn with_free_files(self, value: Option<u64>) -> FilesystemStats

Set free_files; None marks it unknown.

Source

pub const fn available_files(&self) -> Option<u64>

File count available to an unprivileged caller.

Source

pub fn with_available_files(self, value: Option<u64>) -> FilesystemStats

Set available_files; None marks it unknown.

Source

pub const fn block_size(&self) -> Option<u64>

Preferred I/O block size in bytes.

Source

pub fn with_block_size(self, value: Option<u64>) -> FilesystemStats

Set block_size; None marks it unknown.

Source

pub const fn fragment_size(&self) -> Option<u64>

Allocation unit used by capacity counts, in bytes.

Source

pub fn with_fragment_size(self, value: Option<u64>) -> FilesystemStats

Set fragment_size; None marks it unknown.

Source

pub const fn max_name_len(&self) -> Option<u64>

Maximum filename length in bytes.

Source

pub fn with_max_name_len(self, value: Option<u64>) -> FilesystemStats

Set max_name_len; None marks it unknown.

Source

pub const fn max_path_len(&self) -> Option<u64>

Maximum path length in bytes.

Source

pub fn with_max_path_len(self, value: Option<u64>) -> FilesystemStats

Set max_path_len; None marks it unknown.

Maximum number of hard links.

Set max_links; None marks it unknown.

Source

pub const fn max_file_size(&self) -> Option<u64>

Maximum file size in bytes.

Source

pub fn with_max_file_size(self, value: Option<u64>) -> FilesystemStats

Set max_file_size; None marks it unknown.

Source

pub const fn file_size_bits(&self) -> Option<u32>

POSIX FILESIZEBITS; not necessarily the filesystem’s file-size limit.

Source

pub fn with_file_size_bits(self, value: Option<u32>) -> FilesystemStats

Set file_size_bits; None marks it unknown.

Source

pub const fn read_only(&self) -> Option<bool>

Whether the filesystem is read-only, when known.

Source

pub fn with_read_only(self, value: Option<bool>) -> FilesystemStats

Set read-only status; None marks it unknown.

Source

pub const fn no_set_id(&self) -> Option<bool>

Whether set-user-ID and set-group-ID bits are ignored, when known.

Source

pub fn with_no_set_id(self, value: Option<bool>) -> FilesystemStats

Set the no-set-ID status; None marks it unknown.

Trait Implementations§

Source§

impl Clone for FilesystemStats

Source§

fn clone(&self) -> FilesystemStats

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 FilesystemStats

Source§

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

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

impl Default for FilesystemStats

Source§

fn default() -> FilesystemStats

Returns the “default value” for a type. Read more
Source§

impl Eq for FilesystemStats

Source§

impl PartialEq for FilesystemStats

Source§

fn eq(&self, other: &FilesystemStats) -> 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 FilesystemStats

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.