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§
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
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
impl PathBufExt for Path
Source§fn canonicalize_safely(&self) -> Result<PathBuf, PathBufExtError>
fn canonicalize_safely(&self) -> Result<PathBuf, PathBufExtError>
Canonicalizes existing and not existing paths
Source§fn normalize(&self) -> PathBuf
fn normalize(&self) -> PathBuf
Normalizes a path. In contrast to canonicalize the path does not need to exist.