pub struct DownloadPlan {
pub repo_id: String,
pub revision: String,
pub files: Vec<FilePlan>,
pub total_bytes: u64,
pub cached_bytes: u64,
pub download_bytes: u64,
}Expand description
A download plan describing which files need downloading and which are cached.
Created by download_plan(). Contains per-file metadata and aggregate
byte counts. Use recommended_config() to
compute an optimized FetchConfig based on the file size distribution.
Fields§
§repo_id: StringRepository identifier (e.g., "google/gemma-2-2b-it").
revision: StringResolved revision (commit hash or branch name).
files: Vec<FilePlan>Per-file plan entries.
total_bytes: u64Total bytes across all files (cached + uncached).
cached_bytes: u64Bytes already present in local cache.
download_bytes: u64Bytes that need downloading.
Implementations§
Source§impl DownloadPlan
impl DownloadPlan
Sourcepub fn files_to_download(&self) -> usize
pub fn files_to_download(&self) -> usize
Number of files that still need downloading.
Sourcepub const fn fully_cached(&self) -> bool
pub const fn fully_cached(&self) -> bool
Whether all files are already cached (download would be a no-op).
Sourcepub fn recommended_config(&self) -> Result<FetchConfig, FetchError>
pub fn recommended_config(&self) -> Result<FetchConfig, FetchError>
Computes an optimized FetchConfig based on the size distribution
of uncached files.
The returned config has no token, revision, on_progress, or
glob filters set — only the performance-tuning fields (concurrency,
connections_per_file, chunk_threshold). Merge with user config
before use.
§Errors
Returns FetchError::InvalidPattern if the internal builder fails
(should not happen since no patterns are set).
Sourcepub fn recommended_config_builder(&self) -> FetchConfigBuilder
pub fn recommended_config_builder(&self) -> FetchConfigBuilder
Like recommended_config() but returns a
FetchConfigBuilder so the caller can override specific fields.
Trait Implementations§
Source§impl Clone for DownloadPlan
impl Clone for DownloadPlan
Source§fn clone(&self) -> DownloadPlan
fn clone(&self) -> DownloadPlan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more