mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-16 15:46:36 +00:00
Format
This commit is contained in:
parent
4e0ca0c1c3
commit
a12e934940
9 changed files with 199 additions and 117 deletions
|
@ -11,11 +11,13 @@ mod quickinstall;
|
|||
#[async_trait::async_trait]
|
||||
pub trait Fetcher {
|
||||
/// Create a new fetcher from some data
|
||||
async fn new(data: &Data) -> Result<Box<Self>, anyhow::Error> where Self: Sized;
|
||||
async fn new(data: &Data) -> Result<Box<Self>, anyhow::Error>
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
/// Fetch a package
|
||||
async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error>;
|
||||
|
||||
|
||||
/// Check if a package is available for download
|
||||
async fn check(&self) -> Result<bool, anyhow::Error>;
|
||||
}
|
||||
|
@ -46,7 +48,7 @@ impl MultiFetcher {
|
|||
return Some(&**fetcher);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue