mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-08 11:46:37 +00:00
feat: Support data verification in Download
(#1248)
By accepting `&mut dyn DataVerifier` for users to pass any callback that uses `digest::Digest`/`digest::Mac`, `sigstore` or whatever they want. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
3181e16e36
commit
e4c776f403
5 changed files with 92 additions and 61 deletions
|
@ -18,7 +18,7 @@ where
|
|||
T: Send + 'static,
|
||||
E: From<io::Error>,
|
||||
E: From<StreamError>,
|
||||
S: Stream<Item = Result<Bytes, StreamError>> + Send + Sync + Unpin + 'static,
|
||||
S: Stream<Item = Result<Bytes, StreamError>> + Send + Sync + Unpin,
|
||||
F: FnOnce(mpsc::Receiver<Bytes>) -> io::Result<T> + Send + Sync + 'static,
|
||||
{
|
||||
async fn inner<S, StreamError, Fut, T, E>(
|
||||
|
@ -31,7 +31,7 @@ where
|
|||
E: From<StreamError>,
|
||||
// We do not use trait object for S since there will only be one
|
||||
// S used with this function.
|
||||
S: Stream<Item = Result<Bytes, StreamError>> + Send + Sync + Unpin + 'static,
|
||||
S: Stream<Item = Result<Bytes, StreamError>> + Send + Sync + Unpin,
|
||||
// asyncify would always return the same future, so no need to
|
||||
// use trait object here.
|
||||
Fut: Future<Output = io::Result<T>> + Send + Sync,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue