mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 16:51:18 +10:00
refactor(download manager): Added Downloadable trait and replaced references to GameDownloadAgent
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
18
src-tauri/src/download_manager/downloadable.rs
Normal file
18
src-tauri/src/download_manager/downloadable.rs
Normal file
@ -0,0 +1,18 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::downloads::download_agent::GameDownloadError;
|
||||
|
||||
use super::{
|
||||
download_thread_control_flag::DownloadThreadControl,
|
||||
progress_object::ProgressObject,
|
||||
};
|
||||
|
||||
pub trait Downloadable: Sync {
|
||||
fn get_progress_object(&self) -> Arc<ProgressObject>;
|
||||
fn version(&self) -> String;
|
||||
fn id(&self) -> String;
|
||||
fn download(&mut self) -> Result<(), GameDownloadError>;
|
||||
fn progress(&self) -> Arc<ProgressObject>;
|
||||
fn control_flag(&self) -> DownloadThreadControl;
|
||||
fn install_dir(&self) -> String;
|
||||
}
|
||||
Reference in New Issue
Block a user