From d70fc03ca8e6763bddb0af9e854a6d1734a9f7b5 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 2 Dec 2021 14:06:58 +0100 Subject: Add doc for helper type Signed-off-by: Matthias Beyer --- src/commands/source/download.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/commands/source/download.rs b/src/commands/source/download.rs index f8d5a95..b5223cf 100644 --- a/src/commands/source/download.rs +++ b/src/commands/source/download.rs @@ -30,7 +30,15 @@ use crate::repository::Repository; use crate::source::*; use crate::util::progress::ProgressBars; - +/// A wrapper around the indicatif::ProgressBar +/// +/// A wrapper around the indicatif::ProgressBar that is used to synchronize status information from +/// the individual download jobs to the progress bar that is used to display download progress to +/// the user. +/// +/// The problem this helper solves is that we only have one status bar for all downloads, and all +/// download tasks must be able to increase the number of bytes received, for example, (that is +/// displayed in the status message) but in a sync way. #[derive(Clone)] struct ProgressWrapper { download_count: u64, -- cgit v1.2.3