Trait proto::Downloadable
source · pub trait Downloadable<'tool>: Send + Sync + Describable<'tool> + Resolvable<'tool> {
// Required methods
fn get_download_path(&self) -> Result<PathBuf, ProtoError>;
fn get_download_url(&self) -> Result<String, ProtoError>;
// Provided method
fn download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to_file: &'life1 Path,
from_url: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
}
Required Methods§
sourcefn get_download_path(&self) -> Result<PathBuf, ProtoError>
fn get_download_path(&self) -> Result<PathBuf, ProtoError>
Return an absolute file path to the downloaded file.
This may not exist, as the path is composed ahead of time.
This is typically ~/.proto/temp/
sourcefn get_download_url(&self) -> Result<String, ProtoError>
fn get_download_url(&self) -> Result<String, ProtoError>
Return a URL to download the tool’s archive from a registry.
Provided Methods§
sourcefn download<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to_file: &'life1 Path,
from_url: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn download<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, to_file: &'life1 Path, from_url: Option<&'life2 str> ) -> Pin<Box<dyn Future<Output = Result<bool, ProtoError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,
Download the tool (as an archive) from its distribution registry into the ~/.proto/temp folder and return an absolute file path. A custom URL that points to the downloadable archive can be provided as the 2nd argument.