pub trait DownloadReporter:
Send
+ Sync
+ 'static {
// Required methods
fn on_progress(&self, download_id: u64, progress: QueueItemProgress);
fn on_complete(
&self,
download_id: u64,
file_path: Option<String>,
file_size_bytes: Option<u64>,
);
fn on_error(&self, download_id: u64, error_message: String);
fn on_retry(&self, download_id: u64, attempt: u32, delay_ms: u64);
fn on_phase_change(&self, download_id: u64, phase: String);
fn on_media_preview(
&self,
url: String,
title: String,
author: String,
thumbnail_url: Option<String>,
duration_seconds: Option<f64>,
);
fn on_queue_update(&self, state: Vec<QueueItemInfo>);
fn on_system_progress(&self, title: &str, percent: f32, message: &str);
}Expand description
Reporter trait for download progress and events. Implementations can be Tauri-based (desktop app) or CLI-based (terminal output).
Required Methods§
Sourcefn on_progress(&self, download_id: u64, progress: QueueItemProgress)
fn on_progress(&self, download_id: u64, progress: QueueItemProgress)
Report download progress update
Sourcefn on_complete(
&self,
download_id: u64,
file_path: Option<String>,
file_size_bytes: Option<u64>,
)
fn on_complete( &self, download_id: u64, file_path: Option<String>, file_size_bytes: Option<u64>, )
Report download completion
Sourcefn on_phase_change(&self, download_id: u64, phase: String)
fn on_phase_change(&self, download_id: u64, phase: String)
Report phase change (e.g., “Fetching Info”, “Downloading”, “Merging”)
Sourcefn on_media_preview(
&self,
url: String,
title: String,
author: String,
thumbnail_url: Option<String>,
duration_seconds: Option<f64>,
)
fn on_media_preview( &self, url: String, title: String, author: String, thumbnail_url: Option<String>, duration_seconds: Option<f64>, )
Report media preview info (for URL previews)
Sourcefn on_queue_update(&self, state: Vec<QueueItemInfo>)
fn on_queue_update(&self, state: Vec<QueueItemInfo>)
Report a full queue state update
Sourcefn on_system_progress(&self, title: &str, percent: f32, message: &str)
fn on_system_progress(&self, title: &str, percent: f32, message: &str)
Report system-level progress (e.g., dependency updates)