Skip to main content

perform_download

Function perform_download 

Source
async fn perform_download<R: Runtime>(
    attempt_id: AttemptId,
    dirmgr: &Weak<DirMgr<R>>,
    now: &mut SystemTime,
    parallelism: u8,
    schedule: &mut TaskSchedule<R>,
    state: &mut Box<dyn DirState>,
) -> Result<DownloadOutcome>
Expand description

Attempts to download the current directory’s state.

On success, it reports the outcome of the download using a DownloadOutcome instance and updates now to the current wallclock time.

The possible outcomes are:

  • DownloadOutcome::DownloadFailed: the download failed with a non-fatal error; the caller should proceed to the next state.
  • DownloadOutcome::DirectoryOutdated: The directory being downloaded is outdated. The caller should attempt a new download. As a side effect, the directory state has been reset.
  • DownloadOutcome::Applied: The download attempt was successful, and the result has been applied to the state.

Returns an error only if a fatal error occurred.