INNER CODE UNIT · Rust

Ok

HemantKArya/BloomeeTunes · rust/src/api/downloader/mod.rs:124

        if let Ok(mut hub) = self.event_hub.lock() {
            hub.attach(sink);
        }
    }

    /// Restore tasks persisted from a previous run.
    /// Emits `RecoverySummary` after reconciling state.
    pub async fn restore_tasks(&self) -> Result<Vec<DownloadTaskSnapshot>, String> {
        let path = Path::new(&self.manifest_path);
        if !path.exists() {
            self.emit(DownloadManagerEvent::RecoverySummary { restored: 0, cleaned: 0 });
            return Ok(Vec::new());
        }

        let raw = tokio::fs::read_to_string(path)
            .await
            .map_err(|e| format!("Failed to read download manifest: {e}"))?;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…