Struct cargo::util::config::ConfigRelativePath
source · pub struct ConfigRelativePath(_);
Expand description
Use with the get
API to fetch a string that will be converted to a
PathBuf
. Relative paths are converted to absolute paths based on the
location of the config file.
Implementations§
source§impl ConfigRelativePath
impl ConfigRelativePath
sourcepub fn resolve_path(&self, config: &Config) -> PathBuf
pub fn resolve_path(&self, config: &Config) -> PathBuf
Resolves this configuration-relative path to an absolute path.
This will always return an absolute path where it’s relative to the location for configuration for this value.
sourcepub fn resolve_program(&self, config: &Config) -> PathBuf
pub fn resolve_program(&self, config: &Config) -> PathBuf
Resolves this configuration-relative path to either an absolute path or
something appropriate to execute from PATH
.
Values which don’t look like a filesystem path (don’t contain /
or
\
) will be returned as-is, and everything else will fall through to an
absolute path.
Trait Implementations§
source§impl Clone for ConfigRelativePath
impl Clone for ConfigRelativePath
source§fn clone(&self) -> ConfigRelativePath
fn clone(&self) -> ConfigRelativePath
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ConfigRelativePath
impl Debug for ConfigRelativePath
source§impl<'de> Deserialize<'de> for ConfigRelativePath
impl<'de> Deserialize<'de> for ConfigRelativePath
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<ConfigRelativePath> for ConfigRelativePath
impl PartialEq<ConfigRelativePath> for ConfigRelativePath
source§fn eq(&self, other: &ConfigRelativePath) -> bool
fn eq(&self, other: &ConfigRelativePath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.