pub enum DownloadEvent {
QueueSnapshot {
items: Vec<DownloadSummary>,
max_size: u32,
},
DownloadStarted {
id: String,
},
DownloadProgress {
id: String,
downloaded: u64,
total: u64,
speed_bps: f64,
eta_seconds: f64,
percentage: f64,
},
ShardProgress {
id: String,
shard_index: u32,
total_shards: u32,
shard_filename: String,
shard_downloaded: u64,
shard_total: u64,
aggregate_downloaded: u64,
aggregate_total: u64,
speed_bps: f64,
eta_seconds: f64,
percentage: f64,
},
DownloadCompleted {
id: String,
message: Option<String>,
},
DownloadFailed {
id: String,
error: String,
},
DownloadCancelled {
id: String,
},
QueueRunComplete {
summary: QueueRunSummary,
},
}Expand description
Single discriminated union for all download events.
The frontend handles this as a TypeScript discriminated union:
type DownloadEvent =
| { type: "queue_snapshot"; items: DownloadSummary[]; max_size: number }
| { type: "download_started"; id: string }
| { type: "download_progress"; id: string; downloaded: number; total: number; ... }
| { type: "shard_progress"; id: string; shard_index: number; ... }
| { type: "download_completed"; id: string }
| { type: "download_failed"; id: string; error: string }
| { type: "download_cancelled"; id: string };Variants§
QueueSnapshot
Snapshot of the entire queue state.
Fields
items: Vec<DownloadSummary>All items currently in the queue.
DownloadStarted
A download has started.
DownloadProgress
Progress update for a non-sharded download.
Fields
ShardProgress
Progress update for a sharded download.
Fields
DownloadCompleted
Download completed successfully.
DownloadFailed
Download failed with an error.
Fields
DownloadCancelled
Download was cancelled by the user.
QueueRunComplete
Queue run completed (all downloads in the queue finished).
Emitted when the download queue transitions from busy → idle, providing a complete summary of all artifacts that were processed during the run.
Fields
summary: QueueRunSummaryComplete summary of the queue run.
Implementations§
Source§impl DownloadEvent
impl DownloadEvent
Sourcepub const fn queue_snapshot(items: Vec<DownloadSummary>, max_size: u32) -> Self
pub const fn queue_snapshot(items: Vec<DownloadSummary>, max_size: u32) -> Self
Create a queue snapshot event.
Sourcepub fn progress(
id: impl Into<String>,
downloaded: u64,
total: u64,
speed_bps: f64,
) -> Self
pub fn progress( id: impl Into<String>, downloaded: u64, total: u64, speed_bps: f64, ) -> Self
Create a non-sharded progress event.
Sourcepub fn shard_progress(
id: impl Into<String>,
shard_index: u32,
total_shards: u32,
shard_filename: impl Into<String>,
shard_downloaded: u64,
shard_total: u64,
aggregate_downloaded: u64,
aggregate_total: u64,
speed_bps: f64,
) -> Self
pub fn shard_progress( id: impl Into<String>, shard_index: u32, total_shards: u32, shard_filename: impl Into<String>, shard_downloaded: u64, shard_total: u64, aggregate_downloaded: u64, aggregate_total: u64, speed_bps: f64, ) -> Self
Create a sharded progress event.
Sourcepub fn completed(
id: impl Into<String>,
message: Option<impl Into<String>>,
) -> Self
pub fn completed( id: impl Into<String>, message: Option<impl Into<String>>, ) -> Self
Create a download completed event.
Sourcepub fn failed(id: impl Into<String>, error: impl Into<String>) -> Self
pub fn failed(id: impl Into<String>, error: impl Into<String>) -> Self
Create a download failed event.
Sourcepub const fn queue_run_complete(summary: QueueRunSummary) -> Self
pub const fn queue_run_complete(summary: QueueRunSummary) -> Self
Create a queue run complete event.
Sourcepub const fn event_name(&self) -> &'static str
pub const fn event_name(&self) -> &'static str
Get the event name for wire protocols.
This provides consistent event naming for Tauri and SSE transports.
Note: Both ShardProgress and DownloadProgress use “download:progress”
as the channel name; differentiation happens via the type discriminator.
Trait Implementations§
Source§impl Clone for DownloadEvent
impl Clone for DownloadEvent
Source§fn clone(&self) -> DownloadEvent
fn clone(&self) -> DownloadEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more