pub trait PathExt: Sealed {
// Required methods
fn shorten<P>(&self, base: P) -> &Path
where P: AsRef<Path>;
fn shorten_here(&self) -> &Path;
fn file_system(&self) -> Result<FileSystem>;
}Required Methods§
Sourcefn shorten<P>(&self, base: P) -> &Path
fn shorten<P>(&self, base: P) -> &Path
§Shortens this path from a base
If there’s an error, the original path is returned.
Sourcefn shorten_here(&self) -> &Path
fn shorten_here(&self) -> &Path
§Shortens this path from current directory
If there’s an error, the original path is returned.
Sourcefn file_system(&self) -> Result<FileSystem>
Available on crate feature libc and Unix only.
fn file_system(&self) -> Result<FileSystem>
libc and Unix only.§Gets file system which this path resides on
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl PathExt for &Path
impl PathExt for &Path
fn shorten<P>(&self, base: P) -> &Path
fn shorten_here(&self) -> &Path
Source§fn file_system(&self) -> Result<FileSystem>
fn file_system(&self) -> Result<FileSystem>
Available on crate feature
libc and Unix only.Source§impl PathExt for PathBuf
impl PathExt for PathBuf
fn shorten<P>(&self, base: P) -> &Path
fn shorten_here(&self) -> &Path
Source§fn file_system(&self) -> Result<FileSystem>
fn file_system(&self) -> Result<FileSystem>
Available on crate feature
libc and Unix only.