Skip to main content

Stat

Trait Stat 

Source
pub trait Stat {
Show 16 methods // Required methods fn dev(&self) -> u64; fn ino(&self) -> u64; fn mode(&self) -> Mode; fn type(&self) -> FileType; fn nlink(&self) -> u64; fn uid(&self) -> Uid; fn gid(&self) -> Gid; fn size(&self) -> u64; // Provided methods fn identity(&self) -> (u64, u64) { ... } fn is_regular_file(&self) -> bool { ... } fn is_directory(&self) -> bool { ... } fn is_symlink(&self) -> bool { ... } fn is_fifo(&self) -> bool { ... } fn is_block_device(&self) -> bool { ... } fn is_character_device(&self) -> bool { ... } fn is_socket(&self) -> bool { ... }
}
Expand description

Metadata of a file

Implementations of this trait represent metadata of a file, such as its type, permissions, owner, size, etc. The Fstat trait provides methods to retrieve Stat objects for files.

Required Methods§

Source

fn dev(&self) -> u64

Device ID

Source

fn ino(&self) -> u64

Inode number

Source

fn mode(&self) -> Mode

File mode (permission bits)

Note that this field does not include the file type bits. Use type to get the file type. You can also use is_regular_file and other similar methods to check the file type.

Source

fn type(&self) -> FileType

File type

Number of hard links

Source

fn uid(&self) -> Uid

User ID of the file owner

Source

fn gid(&self) -> Gid

Group ID of the file owner

Source

fn size(&self) -> u64

Size of the file in bytes

Provided Methods§

Source

fn identity(&self) -> (u64, u64)

Returns the device ID and inode number as a tuple.

This method is useful for testing whether two Stat objects refer to the same file.

Source

fn is_regular_file(&self) -> bool

Whether the file is a regular file

Source

fn is_directory(&self) -> bool

Whether the file is a directory

Whether the file is a symbolic link

Source

fn is_fifo(&self) -> bool

Whether the file is a pipe

Source

fn is_block_device(&self) -> bool

Whether the file is a block device

Source

fn is_character_device(&self) -> bool

Whether the file is a character device

Source

fn is_socket(&self) -> bool

Whether the file is a socket

Implementors§

Source§

impl Stat for yash_env::system::real::Stat

Source§

impl Stat for yash_env::system::virtual::Stat