Skip to main content

flow_application/
install.rs

1//! Progress reporting for long-running Model Hub downloads (LLM fetches).
2
3/// One progress update emitted during a long-running download.
4///
5/// `stage` is a short label (e.g. `"download"`, `"verify"`, `"done"`).
6/// `current` / `total` are stage-local byte/step counts; `total == 0` marks a
7/// non-quantifiable stage. The Tauri command layer maps these to progress
8/// events the frontend renders as a bar.
9#[derive(Debug, Clone)]
10pub struct InstallProgress {
11    pub stage: &'static str,
12    pub current: u64,
13    pub total: u64,
14    pub message: String,
15}
16
17/// Callback invoked at every download milestone. Wrapped in `Arc` so the
18/// hub downloader can clone-and-share it across stages.
19pub type ProgressCallback = std::sync::Arc<dyn Fn(InstallProgress) + Send + Sync>;