use std::path::PathBuf;
use crate::ProgressHandle;
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct DownloadResult {
pub tries: u64,
pub path: PathBuf,
pub file_size: u64,
pub bytes_downloaded: u64,
}
impl DownloadResult {
#[must_use]
pub(crate) fn new(progress: ProgressHandle) -> Self {
Self {
tries: progress.tries,
path: progress.destination.path,
file_size: progress.bytes,
bytes_downloaded: progress.bytes_transferred,
}
}
}