mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-13 23:40:03 +00:00
Use download_and_extract
in fetchers
to improve efficiency by avoiding disk io (except for `PkgFmt::Zip` and `PkgFmt::Bin`) and run the compresser in parallel to the downloader. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
b6bfd40c3a
commit
c9b0d45a24
4 changed files with 19 additions and 24 deletions
|
@ -17,8 +17,8 @@ pub trait Fetcher: Send + Sync {
|
|||
where
|
||||
Self: Sized;
|
||||
|
||||
/// Fetch a package
|
||||
async fn fetch(&self, dst: &Path) -> Result<(), BinstallError>;
|
||||
/// Fetch a package and extract
|
||||
async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError>;
|
||||
|
||||
/// Check if a package is available for download
|
||||
async fn check(&self) -> Result<bool, BinstallError>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue