use ambassador::delegatable_trait;
use std::path::Path;
#[delegatable_trait]
pub trait DownloadReportAlg {
type Event;
fn report_download(&self, event: Self::Event);
}
#[delegatable_trait]
pub trait DownloadProgressAlg {
type Progress;
fn report_progress(&self, progress: Self::Progress);
}
#[delegatable_trait]
pub trait DownloadObservationAlg {
type Event;
type Progress;
fn download_progress(&self, destination: &Path, downloaded: u64, total: Option<u64>) -> Self::Progress;
fn download_succeeded(&self, destination: &Path, bytes: u64) -> Self::Event;
fn download_failed(&self, destination: &Path, message: String) -> Self::Event;
}