pub struct PathResolver { /* private fields */ }Expand description
Resolves tool paths and finds installed tools
Implementations§
Source§impl PathResolver
impl PathResolver
Sourcepub fn new(manager: PathManager) -> Self
pub fn new(manager: PathManager) -> Self
Create a new PathResolver
Sourcepub fn find_tool_executables(&self, tool_name: &str) -> Result<Vec<PathBuf>>
pub fn find_tool_executables(&self, tool_name: &str) -> Result<Vec<PathBuf>>
Find all executable paths for a tool (all versions)
Sourcepub fn find_latest_executable(&self, tool_name: &str) -> Result<Option<PathBuf>>
pub fn find_latest_executable(&self, tool_name: &str) -> Result<Option<PathBuf>>
Find the latest executable for a tool
Sourcepub fn find_version_executable(
&self,
tool_name: &str,
version: &str,
) -> Option<PathBuf>
pub fn find_version_executable( &self, tool_name: &str, version: &str, ) -> Option<PathBuf>
Find executable for a specific tool version
Sourcepub fn is_tool_installed(&self, tool_name: &str) -> Result<bool>
pub fn is_tool_installed(&self, tool_name: &str) -> Result<bool>
Check if a tool is installed (any version)
Sourcepub fn get_installed_tools_with_versions(
&self,
) -> Result<Vec<(String, Vec<String>)>>
pub fn get_installed_tools_with_versions( &self, ) -> Result<Vec<(String, Vec<String>)>>
Get all installed tools with their versions
Sourcepub fn resolve_tool_path(
&self,
tool_name: &str,
version: Option<&str>,
) -> Result<Option<PathBuf>>
pub fn resolve_tool_path( &self, tool_name: &str, version: Option<&str>, ) -> Result<Option<PathBuf>>
Resolve tool path with version preference If version is specified, try to find that specific version Otherwise, return the latest version
Sourcepub fn manager(&self) -> &PathManager
pub fn manager(&self) -> &PathManager
Get the path manager
Trait Implementations§
Source§impl Clone for PathResolver
impl Clone for PathResolver
Source§fn clone(&self) -> PathResolver
fn clone(&self) -> PathResolver
Returns a duplicate 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 PathResolver
impl Debug for PathResolver
Auto Trait Implementations§
impl Freeze for PathResolver
impl RefUnwindSafe for PathResolver
impl Send for PathResolver
impl Sync for PathResolver
impl Unpin for PathResolver
impl UnwindSafe for PathResolver
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
Mutably borrows from an owned value. Read more