Enum linux_stat::Stat
source · pub enum Stat {
Stat64(stat),
Statx(Statx),
}
Expand description
Unified Stat structure.
Variants§
Implementations§
source§impl Stat
impl Stat
sourcepub const fn block_size(&self) -> i32
pub const fn block_size(&self) -> i32
Returns the “preferred” block size for efficient filesystem I/O. (Writing to a file in smaller chunks may cause an inefficient read-modify-rewrite.)
sourcepub const fn is_regular(&self) -> bool
pub const fn is_regular(&self) -> bool
Returns true if file type is regular.
sourcepub const fn is_directory(&self) -> bool
pub const fn is_directory(&self) -> bool
Returns true if file type is directory.
sourcepub const fn is_character(&self) -> bool
pub const fn is_character(&self) -> bool
Returns true if file type is character.
sourcepub const fn size(&self) -> i64
pub const fn size(&self) -> i64
Returns the size of the file (if it is a regular file or a symbolic link) in bytes. The size of a symbolic link is the length of the pathname it contains, without a terminating null byte.
sourcepub const fn blocks(&self) -> i64
pub const fn blocks(&self) -> i64
Returns the number of blocks allocated to the file on the medium, in 512-byte units. (This may be smaller than stx_size/512 when the file has holes.)
sourcepub const fn rdev_major(&self) -> u32
pub const fn rdev_major(&self) -> u32
Returns the major device that this file (inode) represents if the file is of block or character device type
sourcepub const fn rdev_minor(&self) -> u32
pub const fn rdev_minor(&self) -> u32
Returns the minor device that this file (inode) represents if the file is of block or character device type
sourcepub const fn rdev(&self) -> Dev
pub const fn rdev(&self) -> Dev
Returns the device that this file (inode) represents if the file is of block or character device type
sourcepub const fn dev_major(&self) -> u32
pub const fn dev_major(&self) -> u32
Returns the major device on which this file (inode) resides.