pub trait Installable<'tool>: Send + Sync + Describable<'tool> {
    // Required method
    fn get_install_dir(&self) -> Result<PathBuf, ProtoError>;

    // Provided methods
    fn get_archive_prefix(&self) -> Result<Option<String>, ProtoError> { ... }
    fn install<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        install_dir: &'life1 Path,
        download_path: &'life2 Path
    ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn uninstall<'life0, 'life1, 'async_trait>(
        &'life0 self,
        install_dir: &'life1 Path
    ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

source

fn get_install_dir(&self) -> Result<PathBuf, ProtoError>

Return an absolute file path to the directory containing the installed tool. This is typically ~/.proto/tools//.

Provided Methods§

source

fn get_archive_prefix(&self) -> Result<Option<String>, ProtoError>

Return a prefix that will be removed from all paths when unpacking an archive and copying the files.

source

fn install<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, install_dir: &'life1 Path, download_path: &'life2 Path ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Run any installation steps after downloading and verifying the tool. This is typically unzipping an archive, and running any installers/binaries.

source

fn uninstall<'life0, 'life1, 'async_trait>( &'life0 self, install_dir: &'life1 Path ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Uninstall the tool by deleting the install directory.

Implementors§