pub enum ResumeOutcome {
Fresh,
Resumable {
config_path: PathBuf,
progress: Vec<ProgressEntry>,
downloaded: u64,
},
Mismatch(StateError),
}Expand description
What the disk probe found for the download a DownloadPlan describes.
Variants§
Fresh
Nothing to continue from: either no state was found, or resuming is disabled / unsupported by the server. Starting the plan downloads the whole file.
Resumable
A .fd/.part pair was found and validates against the current remote
file. Starting the plan continues from progress.
Fields
progress: Vec<ProgressEntry>Byte ranges already written to the .part file.
Mismatch(StateError)
A .fd/.part pair was found but cannot be continued — most often
because the remote file changed since it was written.
What DownloadPlan::start does depends on which entry point produced
the plan. From plan it falls back to a fresh download (overwriting
the stale .part, or claiming a new name when overwrite is disabled).
From plan_resume the caller asked for a resume specifically, so it
refuses instead: Event::ResumeError and
TerminationReason::Failed, leaving the .part and .fd untouched.
Either way DownloadPlan::start_forced_resume continues from the
stale state, but only when the mismatch is limited to the identity
headers.