Trait bones_framework::asset::Absolutize

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

Let Path and PathBuf have absolutize and absolutize_virtually method.

Required Methods§

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

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

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

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

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

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Absolutize for Path

§

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

§

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

§

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

§

impl Absolutize for PathBuf

§

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

§

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

§

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

Implementors§