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
sourceimpl 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
sourceimpl Clone for ConfigRelativePath
impl Clone for ConfigRelativePath
sourcefn clone(&self) -> ConfigRelativePath
fn clone(&self) -> ConfigRelativePath
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConfigRelativePath
impl Debug for ConfigRelativePath
sourceimpl<'de> Deserialize<'de> for ConfigRelativePath
impl<'de> Deserialize<'de> for ConfigRelativePath
sourcefn 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
sourceimpl PartialEq<ConfigRelativePath> for ConfigRelativePath
impl PartialEq<ConfigRelativePath> for ConfigRelativePath
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &ConfigRelativePath) -> bool
fn ne(&self, other: &ConfigRelativePath) -> bool
This method tests for !=
.
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more