mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-15 01:01:25 +10:00
feat(download manager): Added generic download manager
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
use std::sync::{mpsc::Sender, Arc};
|
||||
use std::{fmt::{self, Debug}, sync::{mpsc::Sender, Arc}};
|
||||
|
||||
use tauri::AppHandle;
|
||||
|
||||
@ -7,7 +7,7 @@ use super::{
|
||||
};
|
||||
|
||||
pub trait Downloadable: Send + Sync {
|
||||
fn download(&self) -> Result<bool, ApplicationDownloadError>;
|
||||
fn download(&self, app_handle: &AppHandle) -> Result<bool, ApplicationDownloadError>;
|
||||
fn progress(&self) -> Arc<ProgressObject>;
|
||||
fn control_flag(&self) -> DownloadThreadControl;
|
||||
fn status(&self) -> DownloadStatus;
|
||||
@ -18,4 +18,4 @@ pub trait Downloadable: Send + Sync {
|
||||
fn on_incomplete(&self, app_handle: &AppHandle);
|
||||
fn on_cancelled(&self, app_handle: &AppHandle);
|
||||
fn on_uninstall(&self, app_handle: &AppHandle);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user