pub trait Absolutize {
    // Required methods
    fn absolutize(&self) -> Result<Cow<'_, Path>>;
    fn absolutize_from(&self, cwd: impl AsRef<Path>) -> Result<Cow<'_, Path>>;
    fn absolutize_virtually(
        &self,
        virtual_root: impl AsRef<Path>
    ) -> Result<Cow<'_, Path>>;
}
Expand description

Let Path and PathBuf have absolutize and absolutize_virtually method.

Required Methods§

source

fn absolutize(&self) -> Result<Cow<'_, Path>>

Get an absolute path. This works even if the path does not exist.

source

fn absolutize_from(&self, cwd: impl AsRef<Path>) -> Result<Cow<'_, Path>>

Get an absolute path. This works even if the path does not exist. It gets the current working directory as the second argument.

source

fn absolutize_virtually( &self, virtual_root: impl AsRef<Path> ) -> Result<Cow<'_, Path>>

Get an absolute path. This works even if the path does not exist.

Implementations on Foreign Types§

source§

impl Absolutize for Path

source§

fn absolutize(&self) -> Result<Cow<'_, Path>>

source§

fn absolutize_from(&self, cwd: impl AsRef<Path>) -> Result<Cow<'_, Path>>

source§

fn absolutize_virtually( &self, virtual_root: impl AsRef<Path> ) -> Result<Cow<'_, Path>>

source§

impl Absolutize for PathBuf

source§

fn absolutize(&self) -> Result<Cow<'_, Path>>

source§

fn absolutize_from(&self, cwd: impl AsRef<Path>) -> Result<Cow<'_, Path>>

source§

fn absolutize_virtually( &self, virtual_root: impl AsRef<Path> ) -> Result<Cow<'_, Path>>

Implementors§