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, gctx: &GlobalContext) -> PathBuf
pub fn resolve_path(&self, gctx: &GlobalContext) -> 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, gctx: &GlobalContext) -> PathBuf
pub fn resolve_program(&self, gctx: &GlobalContext) -> 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 for ConfigRelativePath
impl PartialEq for ConfigRelativePath
Source§impl ResolveToPath for ConfigRelativePath
impl ResolveToPath for ConfigRelativePath
fn resolve(&self, gctx: &GlobalContext) -> PathBuf
impl StructuralPartialEq for ConfigRelativePath
Auto Trait Implementations§
impl Freeze for ConfigRelativePath
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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