Skip to main content

PathBufExt

Trait PathBufExt 

Source
pub trait PathBufExt {
    // Required methods
    fn as_relative(&self) -> Result<&Path, PathBufExtError>;
    fn join_safely<P: AsRef<Path>>(
        &self,
        p: P,
    ) -> Result<PathBuf, PathBufExtError>;
    fn canonicalize_safely(&self) -> Result<PathBuf, PathBufExtError>;
    fn normalize(&self) -> PathBuf;
}

Required Methods§

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 PathBufExt for Path

Source§

fn canonicalize_safely(&self) -> Result<PathBuf, PathBufExtError>

Canonicalizes existing and not existing paths

Source§

fn normalize(&self) -> PathBuf

Normalizes a path. In contrast to canonicalize the path does not need to exist.

Source§

fn as_relative(&self) -> Result<&Path, PathBufExtError>

Source§

fn join_safely<P: AsRef<Path>>( &self, path: P, ) -> Result<PathBuf, PathBufExtError>

Implementors§