Trait AsyncTool

Source
pub trait AsyncTool: Send + Sync {
Show 13 methods // Required methods fn name(&self) -> &str; fn fetch_versions<'life0, 'async_trait>( &'life0 self, include_prerelease: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<VersionInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn install_version<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_installed_versions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn uninstall_version<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_download_url<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_executable_path(&self, version: &str) -> PathBuf; fn execute<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 ToolContext, ) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn description(&self) -> &str { ... } fn aliases(&self) -> Vec<&str> { ... } fn is_version_installed<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_base_install_dir(&self) -> PathBuf { ... } fn get_version_install_dir(&self, version: &str) -> PathBuf { ... }
}
Expand description

Core async tool interface - all tools are environment-isolated with version control

Required Methods§

Source

fn name(&self) -> &str

Get the name of this tool

Source

fn fetch_versions<'life0, 'async_trait>( &'life0 self, include_prerelease: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<VersionInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch available versions from the tool’s official source

Source

fn install_version<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Install a specific version of the tool

Source

fn get_installed_versions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all installed versions

Source

fn uninstall_version<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Uninstall a specific version

Source

fn get_download_url<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get download URL for a specific version

Source

fn get_executable_path(&self, version: &str) -> PathBuf

Get the executable path for a specific version (vx-managed, environment-isolated)

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 ToolContext, ) -> Pin<Box<dyn Future<Output = Result<i32>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute the tool with given context

Provided Methods§

Source

fn description(&self) -> &str

Get tool description

Source

fn aliases(&self) -> Vec<&str>

Get supported aliases for this tool

Source

fn is_version_installed<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a specific version is installed

Source

fn get_base_install_dir(&self) -> PathBuf

Get the base installation directory for this tool

Source

fn get_version_install_dir(&self, version: &str) -> PathBuf

Get installation directory for a specific version

Implementors§