mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-24 17:03:00 +10:00
d74e7a26eb
* feat: add clippy ci * fix: clippy errors * fix: ci/cd * fix: update ci packages * fix: add gtk3 to ci deps * fix: add webkit to ci deps * fix: ci deps and perms * fix: add clippy settings to lib.rs
28 lines
1014 B
Rust
28 lines
1014 B
Rust
use std::sync::Arc;
|
|
|
|
use tauri::AppHandle;
|
|
|
|
use crate::{
|
|
database::models::data::DownloadableMetadata,
|
|
error::application_download_error::ApplicationDownloadError,
|
|
};
|
|
|
|
use super::{
|
|
download_manager_frontend::DownloadStatus,
|
|
util::{download_thread_control_flag::DownloadThreadControl, progress_object::ProgressObject},
|
|
};
|
|
|
|
pub trait Downloadable: Send + Sync {
|
|
fn download(&self, app_handle: &AppHandle) -> Result<bool, ApplicationDownloadError>;
|
|
fn progress(&self) -> Arc<ProgressObject>;
|
|
fn control_flag(&self) -> DownloadThreadControl;
|
|
fn validate(&self) -> Result<bool, ApplicationDownloadError>;
|
|
fn status(&self) -> DownloadStatus;
|
|
fn metadata(&self) -> DownloadableMetadata;
|
|
fn on_initialised(&self, app_handle: &AppHandle);
|
|
fn on_error(&self, app_handle: &AppHandle, error: &ApplicationDownloadError);
|
|
fn on_complete(&self, app_handle: &AppHandle);
|
|
fn on_incomplete(&self, app_handle: &AppHandle);
|
|
fn on_cancelled(&self, app_handle: &AppHandle);
|
|
}
|