INNER CODE UNIT · Rust

snapshot_for

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

    fn snapshot_for(&self, task_id: &str) -> Option<DownloadTaskSnapshot> {
        let task = self.get_task(task_id)?;
        let g = task.lock().ok()?;
        Some(DownloadTaskSnapshot::from_persisted(&g.persisted))
    }

    // ── Internal: event emission ──────────────────────────────────────────────

    fn emit(&self, event: DownloadManagerEvent) {
        if let Ok(mut hub) = self.event_hub.lock() {
            hub.emit(event);
        }
    }

    // ── Internal: manifest persistence ───────────────────────────────────────

    /// Serialize all tasks and write atomically (temp-rename pattern).
    /// Failures are silently swallowed — a missing manifest is handled on the

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…