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
impl FilesystemStats
Sourcepub const fn total_bytes(&self) -> Option<u64>
pub const fn total_bytes(&self) -> Option<u64>
Total capacity in bytes.
Sourcepub fn with_total_bytes(self, value: Option<u64>) -> FilesystemStats
pub fn with_total_bytes(self, value: Option<u64>) -> FilesystemStats
Set total_bytes; None marks it unknown.
Sourcepub const fn free_bytes(&self) -> Option<u64>
pub const fn free_bytes(&self) -> Option<u64>
Free capacity in bytes, including reserved space.
Sourcepub fn with_free_bytes(self, value: Option<u64>) -> FilesystemStats
pub fn with_free_bytes(self, value: Option<u64>) -> FilesystemStats
Set free_bytes; None marks it unknown.
Sourcepub const fn available_bytes(&self) -> Option<u64>
pub const fn available_bytes(&self) -> Option<u64>
Space available to an unprivileged caller (may exclude reserved blocks).
Sourcepub fn with_available_bytes(self, value: Option<u64>) -> FilesystemStats
pub fn with_available_bytes(self, value: Option<u64>) -> FilesystemStats
Set available_bytes; None marks it unknown.
Sourcepub const fn total_files(&self) -> Option<u64>
pub const fn total_files(&self) -> Option<u64>
Total file count.
Sourcepub fn with_total_files(self, value: Option<u64>) -> FilesystemStats
pub fn with_total_files(self, value: Option<u64>) -> FilesystemStats
Set total_files; None marks it unknown.
Sourcepub const fn free_files(&self) -> Option<u64>
pub const fn free_files(&self) -> Option<u64>
Free file count.
Sourcepub fn with_free_files(self, value: Option<u64>) -> FilesystemStats
pub fn with_free_files(self, value: Option<u64>) -> FilesystemStats
Set free_files; None marks it unknown.
Sourcepub const fn available_files(&self) -> Option<u64>
pub const fn available_files(&self) -> Option<u64>
File count available to an unprivileged caller.
Sourcepub fn with_available_files(self, value: Option<u64>) -> FilesystemStats
pub fn with_available_files(self, value: Option<u64>) -> FilesystemStats
Set available_files; None marks it unknown.
Sourcepub const fn block_size(&self) -> Option<u64>
pub const fn block_size(&self) -> Option<u64>
Preferred I/O block size in bytes.
Sourcepub fn with_block_size(self, value: Option<u64>) -> FilesystemStats
pub fn with_block_size(self, value: Option<u64>) -> FilesystemStats
Set block_size; None marks it unknown.
Sourcepub const fn fragment_size(&self) -> Option<u64>
pub const fn fragment_size(&self) -> Option<u64>
Allocation unit used by capacity counts, in bytes.
Sourcepub fn with_fragment_size(self, value: Option<u64>) -> FilesystemStats
pub fn with_fragment_size(self, value: Option<u64>) -> FilesystemStats
Set fragment_size; None marks it unknown.
Sourcepub const fn max_name_len(&self) -> Option<u64>
pub const fn max_name_len(&self) -> Option<u64>
Maximum filename length in bytes.
Sourcepub fn with_max_name_len(self, value: Option<u64>) -> FilesystemStats
pub fn with_max_name_len(self, value: Option<u64>) -> FilesystemStats
Set max_name_len; None marks it unknown.
Sourcepub const fn max_path_len(&self) -> Option<u64>
pub const fn max_path_len(&self) -> Option<u64>
Maximum path length in bytes.
Sourcepub fn with_max_path_len(self, value: Option<u64>) -> FilesystemStats
pub fn with_max_path_len(self, value: Option<u64>) -> FilesystemStats
Set max_path_len; None marks it unknown.
Sourcepub fn with_max_links(self, value: Option<u64>) -> FilesystemStats
pub fn with_max_links(self, value: Option<u64>) -> FilesystemStats
Set max_links; None marks it unknown.
Sourcepub const fn max_file_size(&self) -> Option<u64>
pub const fn max_file_size(&self) -> Option<u64>
Maximum file size in bytes.
Sourcepub fn with_max_file_size(self, value: Option<u64>) -> FilesystemStats
pub fn with_max_file_size(self, value: Option<u64>) -> FilesystemStats
Set max_file_size; None marks it unknown.
Sourcepub const fn file_size_bits(&self) -> Option<u32>
pub const fn file_size_bits(&self) -> Option<u32>
POSIX FILESIZEBITS; not necessarily the filesystem’s file-size limit.
Sourcepub fn with_file_size_bits(self, value: Option<u32>) -> FilesystemStats
pub fn with_file_size_bits(self, value: Option<u32>) -> FilesystemStats
Set file_size_bits; None marks it unknown.
Sourcepub fn with_read_only(self, value: Option<bool>) -> FilesystemStats
pub fn with_read_only(self, value: Option<bool>) -> FilesystemStats
Set read-only status; None marks it unknown.
Sourcepub const fn no_set_id(&self) -> Option<bool>
pub const fn no_set_id(&self) -> Option<bool>
Whether set-user-ID and set-group-ID bits are ignored, when known.
Sourcepub fn with_no_set_id(self, value: Option<bool>) -> FilesystemStats
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
impl Clone for FilesystemStats
Source§fn clone(&self) -> FilesystemStats
fn clone(&self) -> FilesystemStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more