Struct cargo::util::config::ConfigRelativePath
source · pub struct ConfigRelativePath(Value<String>);
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.
Tuple Fields§
§0: Value<String>
Implementations§
source§impl ConfigRelativePath
impl ConfigRelativePath
pub fn new(path: Value<String>) -> 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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
source§impl PartialEq<ConfigRelativePath> for ConfigRelativePath
impl PartialEq<ConfigRelativePath> for ConfigRelativePath
source§fn eq(&self, other: &ConfigRelativePath) -> bool
fn eq(&self, other: &ConfigRelativePath) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl ResolveToPath for ConfigRelativePath
impl ResolveToPath for ConfigRelativePath
impl StructuralPartialEq for ConfigRelativePath
Auto Trait Implementations§
impl RefUnwindSafe for ConfigRelativePath
impl Send for ConfigRelativePath
impl Sync for ConfigRelativePath
impl Unpin for ConfigRelativePath
impl UnwindSafe for ConfigRelativePath
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes