pub trait PathExt {
// Required methods
fn relative_to(&self, to: impl AsRef<Utf8Path>) -> Option<Utf8PathBuf>;
fn rebase(
&self,
src_root: &Utf8Path,
dest_root: &Utf8Path,
) -> Result<Utf8PathBuf>;
fn unbase(&self, base: &Utf8Path) -> Result<Utf8PathBuf>;
}Required Methods§
Sourcefn relative_to(&self, to: impl AsRef<Utf8Path>) -> Option<Utf8PathBuf>
fn relative_to(&self, to: impl AsRef<Utf8Path>) -> Option<Utf8PathBuf>
converts this absolute path to relative if the start matches
Sourcefn rebase(
&self,
src_root: &Utf8Path,
dest_root: &Utf8Path,
) -> Result<Utf8PathBuf>
fn rebase( &self, src_root: &Utf8Path, dest_root: &Utf8Path, ) -> Result<Utf8PathBuf>
removes the src_root from the path and adds the dest_root
Sourcefn unbase(&self, base: &Utf8Path) -> Result<Utf8PathBuf>
fn unbase(&self, base: &Utf8Path) -> Result<Utf8PathBuf>
removes base from path (making sure they match)
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.