pub struct DownloadStateInner {
pub url: Url,
pub etag: Option<Arc<str>>,
pub last_modified: Option<Arc<str>>,
pub config: Config,
pub size: u64,
pub elapsed: Duration,
}Expand description
Full (resolved) download state that is serialized into the .fd file.
DownloadStateInner is the non-partial form of the persisted state: every
field is present. It is encoded to TOML by DownloadState::store and read
back as the generated partial PartialDownloadStateInner on resume. The
size field is recorded for resume validation; older .fd files omit it and
read back as None in the partial form.
Fields§
§url: Url§etag: Option<Arc<str>>§last_modified: Option<Arc<str>>§config: Config§size: u64Total file size recorded at save time, compared against the server
UrlInfo.size during resume validation.
An older .fd written without this field reads back as None, which
makes validate fail and safely fall back to a full re-download.
elapsed: DurationTotal active download time accumulated across all resume runs.
Persisted as a human-readable string (e.g. "1h 30m 2s") via
humantime_serde, so the .fd file stays easy to inspect and edit by
hand. A zero elapsed is omitted from the file, and a missing elapsed
field on load is tolerated (treated as zero). A resumed download
continues this clock instead of restarting it from zero; the progress
reporter folds it into its average-speed calculation, giving a speed that
spans the whole download session rather than only the current run.