Skip to main content

DownloadReporter

Trait DownloadReporter 

Source
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§

Source

fn on_progress(&self, download_id: u64, progress: QueueItemProgress)

Report download progress update

Source

fn on_complete( &self, download_id: u64, file_path: Option<String>, file_size_bytes: Option<u64>, )

Report download completion

Source

fn on_error(&self, download_id: u64, error_message: String)

Report download error

Source

fn on_retry(&self, download_id: u64, attempt: u32, delay_ms: u64)

Report retry attempt

Source

fn on_phase_change(&self, download_id: u64, phase: String)

Report phase change (e.g., “Fetching Info”, “Downloading”, “Merging”)

Source

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)

Source

fn on_queue_update(&self, state: Vec<QueueItemInfo>)

Report a full queue state update

Source

fn on_system_progress(&self, title: &str, percent: f32, message: &str)

Report system-level progress (e.g., dependency updates)

Implementors§