Skip to main content

PathFileType

Trait PathFileType 

Source
pub trait PathFileType {
    // Required methods
    fn filetype(&self) -> Result<FileType>;
    fn is_symlink(&self) -> bool;
    fn is_char_device(&self) -> bool;
    fn is_block_device(&self) -> bool;
    fn is_fifo(&self) -> bool;
    fn is_socket(&self) -> bool;
}

Required Methods§

Source

fn filetype(&self) -> Result<FileType>

返回一个枚举类型结果 FileType

判断路径是否为一个链接

Source

fn is_char_device(&self) -> bool

判断路径是否为字符设备文件

Source

fn is_block_device(&self) -> bool

判断路径是否为块设备文件

Source

fn is_fifo(&self) -> bool

判断路径是否为管道文件

Source

fn is_socket(&self) -> bool

判断路径是否为套接字文件

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PathFileType for Path

Source§

impl PathFileType for PathBuf

Implementors§