pub trait PathExt {
// Required methods
fn readable(&self) -> bool;
fn writable(&self) -> bool;
fn executable(&self) -> bool;
fn exists_and_is_block_device(&self) -> bool;
fn exists_and_is_char_device(&self) -> bool;
fn exists_and_is_fifo(&self) -> bool;
fn exists_and_is_socket(&self) -> bool;
fn exists_and_is_setgid(&self) -> bool;
fn exists_and_is_setuid(&self) -> bool;
fn exists_and_is_sticky_bit(&self) -> bool;
fn get_device_and_inode(&self) -> Result<(u64, u64), Error>;
}Expand description
Extension trait for path-related filesystem operations.
Required Methods§
Sourcefn readable(&self) -> bool
fn readable(&self) -> bool
Returns true if the path exists and is readable by the current user.
Sourcefn writable(&self) -> bool
fn writable(&self) -> bool
Returns true if the path exists and is writable by the current user.
Sourcefn executable(&self) -> bool
fn executable(&self) -> bool
Returns true if the path exists and is executable by the current user.
On Windows, this returns true if either the path itself is a file with
a PATHEXT extension or appending some PATHEXT extension resolves
to an existing file. To recover the actual on-disk path in the
latter case, use resolve_executable which takes ownership
and avoids copies on platforms where no resolution is needed.
Sourcefn exists_and_is_block_device(&self) -> bool
fn exists_and_is_block_device(&self) -> bool
Returns true if the path exists and is a block device.
Sourcefn exists_and_is_char_device(&self) -> bool
fn exists_and_is_char_device(&self) -> bool
Returns true if the path exists and is a character device.
Sourcefn exists_and_is_fifo(&self) -> bool
fn exists_and_is_fifo(&self) -> bool
Returns true if the path exists and is a FIFO (named pipe).
Sourcefn exists_and_is_socket(&self) -> bool
fn exists_and_is_socket(&self) -> bool
Returns true if the path exists and is a socket.
Sourcefn exists_and_is_setgid(&self) -> bool
fn exists_and_is_setgid(&self) -> bool
Returns true if the path exists and has the setgid bit set.
Sourcefn exists_and_is_setuid(&self) -> bool
fn exists_and_is_setuid(&self) -> bool
Returns true if the path exists and has the setuid bit set.
Sourcefn exists_and_is_sticky_bit(&self) -> bool
fn exists_and_is_sticky_bit(&self) -> bool
Returns true if the path exists and has the sticky bit set.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".