pub struct PathManager { /* private fields */ }Expand description
Manages paths for vx tool installations with standardized structure
Implementations§
Source§impl PathManager
impl PathManager
Sourcepub fn with_base_dir<P: AsRef<Path>>(base_dir: P) -> Result<Self>
pub fn with_base_dir<P: AsRef<Path>>(base_dir: P) -> Result<Self>
Create a new PathManager with custom base directory
Sourcepub fn from_paths(paths: VxPaths) -> Self
pub fn from_paths(paths: VxPaths) -> Self
Create a PathManager from existing VxPaths
Sourcepub fn config_dir(&self) -> &Path
pub fn config_dir(&self) -> &Path
Get the config directory
Sourcepub fn tool_dir(&self, tool_name: &str) -> PathBuf
pub fn tool_dir(&self, tool_name: &str) -> PathBuf
Get the installation directory for a specific tool
Returns: ~/.vx/tools/
Sourcepub fn tool_version_dir(&self, tool_name: &str, version: &str) -> PathBuf
pub fn tool_version_dir(&self, tool_name: &str, version: &str) -> PathBuf
Get the installation directory for a specific tool version
Returns: ~/.vx/tools/
Sourcepub fn tool_executable_path(&self, tool_name: &str, version: &str) -> PathBuf
pub fn tool_executable_path(&self, tool_name: &str, version: &str) -> PathBuf
Get the executable path for a specific tool version
Returns: ~/.vx/tools/
Sourcepub fn is_tool_version_installed(&self, tool_name: &str, version: &str) -> bool
pub fn is_tool_version_installed(&self, tool_name: &str, version: &str) -> bool
Check if a tool version is installed
Sourcepub fn list_tool_versions(&self, tool_name: &str) -> Result<Vec<String>>
pub fn list_tool_versions(&self, tool_name: &str) -> Result<Vec<String>>
List all installed versions of a tool
Sourcepub fn get_latest_tool_version(&self, tool_name: &str) -> Result<Option<String>>
pub fn get_latest_tool_version(&self, tool_name: &str) -> Result<Option<String>>
Get the latest installed version of a tool
Sourcepub fn list_installed_tools(&self) -> Result<Vec<String>>
pub fn list_installed_tools(&self) -> Result<Vec<String>>
List all installed tools
Sourcepub fn create_tool_version_dir(
&self,
tool_name: &str,
version: &str,
) -> Result<PathBuf>
pub fn create_tool_version_dir( &self, tool_name: &str, version: &str, ) -> Result<PathBuf>
Create the directory structure for a tool version
Sourcepub fn remove_tool_version(&self, tool_name: &str, version: &str) -> Result<()>
pub fn remove_tool_version(&self, tool_name: &str, version: &str) -> Result<()>
Remove a specific tool version
Sourcepub fn tool_cache_dir(&self, tool_name: &str) -> PathBuf
pub fn tool_cache_dir(&self, tool_name: &str) -> PathBuf
Get cache path for a tool
Sourcepub fn tool_tmp_dir(&self, tool_name: &str, version: &str) -> PathBuf
pub fn tool_tmp_dir(&self, tool_name: &str, version: &str) -> PathBuf
Get temporary path for a tool installation
Trait Implementations§
Source§impl Clone for PathManager
impl Clone for PathManager
Source§fn clone(&self) -> PathManager
fn clone(&self) -> PathManager
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 PathManager
impl Debug for PathManager
Auto Trait Implementations§
impl Freeze for PathManager
impl RefUnwindSafe for PathManager
impl Send for PathManager
impl Sync for PathManager
impl Unpin for PathManager
impl UnwindSafe for PathManager
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