INNER CODE UNIT · Rust

Some

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

            if let Some(snap) = self.snapshot_for(&task_id) {
                self.emit(DownloadManagerEvent::TaskUpdated(snap));
            }
            self.spawn_worker(task_id);
        }
        should_spawn
    }

    /// Request cancellation of a task.
    /// `delete_partial`: if `true`, remove the .part file too.
    pub async fn cancel_task(&self, task_id: String, delete_partial: bool) -> bool {
        let Some(task) = self.get_task(&task_id) else { return false };

        let (remove_now, temp_path, target_path) = {
            let mut g = match task.lock() {
                Ok(g) => g,
                Err(_) => return false,
            };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…