feat(download manager): Added generic download manager

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-01-04 15:47:14 +11:00
parent 8be1dd435c
commit 6159319172
20 changed files with 363 additions and 202 deletions

View File

@ -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);
}
}