Trait proto_core::Verifiable
source · pub trait Verifiable<'tool>: Send + Sync + Downloadable<'tool> {
// Required methods
fn get_checksum_path(&self) -> Result<PathBuf, ProtoError>;
fn get_checksum_url(&self) -> Result<Option<String>, ProtoError>;
fn verify_checksum<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
checksum_file: &'life1 Path,
download_file: &'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;
// Provided method
fn download_checksum<'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>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}
Required Methods§
sourcefn get_checksum_path(&self) -> Result<PathBuf, ProtoError>
fn get_checksum_path(&self) -> Result<PathBuf, ProtoError>
Return an absolute file path to the checksum file.
This may not exist, as the path is composed ahead of time.
This is typically ~/.prove/temp/
sourcefn get_checksum_url(&self) -> Result<Option<String>, ProtoError>
fn get_checksum_url(&self) -> Result<Option<String>, ProtoError>
Return a URL to download the tool’s checksum manifest from a registry.
sourcefn verify_checksum<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
checksum_file: &'life1 Path,
download_file: &'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 verify_checksum<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, checksum_file: &'life1 Path, download_file: &'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,
Verify the downloaded file using the checksum strategy for the tool. Common strategies are SHA256 and MD5.
Provided Methods§
sourcefn download_checksum<'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>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn download_checksum<'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>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
If applicable, download all files necessary for verifying checksums.