Struct PathManager

Source
pub struct PathManager { /* private fields */ }
Expand description

Manages paths for vx tool installations with standardized structure

Implementations§

Source§

impl PathManager

Source

pub fn new() -> Result<Self>

Create a new PathManager with default paths

Source

pub fn with_base_dir<P: AsRef<Path>>(base_dir: P) -> Result<Self>

Create a new PathManager with custom base directory

Source

pub fn from_paths(paths: VxPaths) -> Self

Create a PathManager from existing VxPaths

Source

pub fn base_dir(&self) -> &Path

Get the base vx directory

Source

pub fn tools_dir(&self) -> &Path

Get the tools directory

Source

pub fn cache_dir(&self) -> &Path

Get the cache directory

Source

pub fn config_dir(&self) -> &Path

Get the config directory

Source

pub fn tmp_dir(&self) -> &Path

Get the temporary directory

Source

pub fn tool_dir(&self, tool_name: &str) -> PathBuf

Get the installation directory for a specific tool Returns: ~/.vx/tools/

Source

pub fn tool_version_dir(&self, tool_name: &str, version: &str) -> PathBuf

Get the installation directory for a specific tool version Returns: ~/.vx/tools//

Source

pub fn tool_executable_path(&self, tool_name: &str, version: &str) -> PathBuf

Get the executable path for a specific tool version Returns: ~/.vx/tools///.exe (Windows) or ~/.vx/tools/// (Unix)

Source

pub fn is_tool_version_installed(&self, tool_name: &str, version: &str) -> bool

Check if a tool version is installed

Source

pub fn list_tool_versions(&self, tool_name: &str) -> Result<Vec<String>>

List all installed versions of a tool

Source

pub fn get_latest_tool_version(&self, tool_name: &str) -> Result<Option<String>>

Get the latest installed version of a tool

Source

pub fn list_installed_tools(&self) -> Result<Vec<String>>

List all installed tools

Source

pub fn create_tool_version_dir( &self, tool_name: &str, version: &str, ) -> Result<PathBuf>

Create the directory structure for a tool version

Source

pub fn remove_tool_version(&self, tool_name: &str, version: &str) -> Result<()>

Remove a specific tool version

Source

pub fn tool_cache_dir(&self, tool_name: &str) -> PathBuf

Get cache path for a tool

Source

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

Source§

fn clone(&self) -> PathManager

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PathManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.