pub enum ToolSpec {
Path(PathBuf),
Name(String),
}Expand description
Either a bare command name (resolved against PATH) or an
explicit filesystem path. The resolver turns either form into a
concrete PathBuf when it builds a ResolvedTool.
Variants§
Path(PathBuf)
Filesystem path. Absolute paths are validated as-is; relative paths are resolved against the current working directory at build time.
Name(String)
Bare command name searched on PATH.
Implementations§
Source§impl ToolSpec
impl ToolSpec
Sourcepub fn parse(raw: impl Into<String>) -> Self
pub fn parse(raw: impl Into<String>) -> Self
Parse a user-supplied string into the matching variant.
Anything that contains a path separator (/, or \ on
Windows) is treated as a path; otherwise the value is a
bare name.
Sourcepub fn parse_non_empty(raw: &str) -> Option<ToolSpec>
pub fn parse_non_empty(raw: &str) -> Option<ToolSpec>
Parse a [toolchain] cc/cxx/ar value, treating an empty or
whitespace-only string as absent: returns None so each
caller can map that to its own “empty tool spec” diagnostic;
otherwise trims and delegates to ToolSpec::parse. Shared by
the manifest and config parsers.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolSpec
impl<'de> Deserialize<'de> for ToolSpec
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>,
impl Eq for ToolSpec
impl StructuralPartialEq for ToolSpec
Auto Trait Implementations§
impl Freeze for ToolSpec
impl RefUnwindSafe for ToolSpec
impl Send for ToolSpec
impl Sync for ToolSpec
impl Unpin for ToolSpec
impl UnsafeUnpin for ToolSpec
impl UnwindSafe for ToolSpec
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.