PathExt

Trait PathExt 

Source
pub trait PathExt {
    // Required methods
    fn canonical(&self) -> Result<PathBuf>;
    fn abbr(&self) -> String;
    fn expanduser(&self) -> PathBuf;
    fn assert_absolute(&self, name: &str);
    fn assert_starts_with(&self, start: impl AsRef<Path>, name: &str);
}

Required Methods§

Source

fn canonical(&self) -> Result<PathBuf>

fs_err::canonicalize but on windows it doesn’t return UNC paths.

Source

fn abbr(&self) -> String

Stringify the path into an abbreviated form.

This replaces the home path with ~, as well as reducing paths that point into the eggs directory to eggs/rest/of/path.

Source

fn expanduser(&self) -> PathBuf

Expands ~ in a path to the home directory.

Source

fn assert_absolute(&self, name: &str)

Source

fn assert_starts_with(&self, start: impl AsRef<Path>, name: &str)

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 canonical(&self) -> Result<PathBuf>

fs_err::canonicalize but on windows it doesn’t return UNC paths.

Source§

fn abbr(&self) -> String

Stringify the path into an abbreviated form.

This replaces the home path with ~, as well as reducing paths that point into the eggs directory to eggs/rest/of/path.

Source§

fn expanduser(&self) -> PathBuf

Expands ~ in a path to the home directory.

Source§

fn assert_absolute(&self, name: &str)

Source§

fn assert_starts_with(&self, start: impl AsRef<Path>, name: &str)

Implementors§