Trait Installer

Source
pub trait Installer: Send + Sync {
    // Required methods
    fn tool_name(&self) -> &str;
    fn install<'life0, 'life1, 'async_trait>(
        &'life0 self,
        config: &'life1 InstallConfig,
    ) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn uninstall<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tool_name: &'life1 str,
        version: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn is_version_installed<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tool_name: &'life1 str,
        version: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_install_dir(&self, tool_name: &str, version: &str) -> PathBuf;
    fn get_installed_versions<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tool_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn verify_installation<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tool_name: &'life1 str,
        version: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Trait for installing tools

Required Methods§

Source

fn tool_name(&self) -> &str

Get the name of the tool this installer supports

Source

fn install<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 InstallConfig, ) -> 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 uninstall<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tool_name: &'life1 str, version: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Uninstall a specific version of the tool

Source

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

Check if a specific version is installed

Source

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

Get the installation directory for a tool version

Source

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

Get all installed versions of the tool

Provided Methods§

Source

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

Verify installation integrity

Implementors§