Trait glory_cli::ext::PathExt

source ·
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§

source

fn relative_to(&self, to: impl AsRef<Utf8Path>) -> Option<Utf8PathBuf>

converts this absolute path to relative if the start matches

source

fn rebase( &self, src_root: &Utf8Path, dest_root: &Utf8Path ) -> Result<Utf8PathBuf>

removes the src_root from the path and adds the dest_root

source

fn unbase(&self, base: &Utf8Path) -> Result<Utf8PathBuf>

removes base from path (making sure they match)

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl PathExt for Utf8Path

source§

fn relative_to(&self, to: impl AsRef<Utf8Path>) -> Option<Utf8PathBuf>

source§

fn rebase( &self, src_root: &Utf8Path, dest_root: &Utf8Path ) -> Result<Utf8PathBuf>

source§

fn unbase(&self, base: &Utf8Path) -> Result<Utf8PathBuf>

source§

impl PathExt for Utf8PathBuf

source§

fn relative_to(&self, to: impl AsRef<Utf8Path>) -> Option<Utf8PathBuf>

source§

fn rebase( &self, src_root: &Utf8Path, dest_root: &Utf8Path ) -> Result<Utf8PathBuf>where Self: Sized,

source§

fn unbase(&self, base: &Utf8Path) -> Result<Utf8PathBuf>

Implementors§