PathExt

Trait PathExt 

Source
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>;
}
Expand description

§Extensions for Path

This (sealed) trait provides some extensions for Path.

Required Methods§

Source

fn shorten<P>(&self, base: P) -> &Path
where P: AsRef<Path>,

§Shortens this path from a base

If there’s an error, the original path is returned.

Source

fn shorten_here(&self) -> &Path

§Shortens this path from current directory

If there’s an error, the original path is returned.

Source

fn file_system(&self) -> Result<FileSystem>

Available on crate feature 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

Source§

fn shorten<P>(&self, base: P) -> &Path
where P: AsRef<Path>,

Source§

fn shorten_here(&self) -> &Path

Source§

fn file_system(&self) -> Result<FileSystem>

Available on crate feature libc and Unix only.
Source§

impl PathExt for PathBuf

Source§

fn shorten<P>(&self, base: P) -> &Path
where P: AsRef<Path>,

Source§

fn shorten_here(&self) -> &Path

Source§

fn file_system(&self) -> Result<FileSystem>

Available on crate feature libc and Unix only.

Implementors§