Expand description
§download
Download domain types, events, errors, and traits.
This module contains pure data types and trait definitions for the download system. No I/O, networking, or runtime dependencies allowed.
§Structure
types- Core identifiers and data structures (DownloadId,Quantization,ShardInfo).Quantizationmodels Unsloth Dynamic (“UD-”) quants (e.g.UD-Q6_K) as distinct values from their plain counterparts (Q6_K), sinceHuggingFacerepos frequently publish both with the same bit-depth suffix.events- Download events and status types (DownloadEvent,DownloadStatus).DownloadEvent::DownloadNoticeis the one variant that isn’t part of the progress/lifecycle state machine: a transient, non-persisted, free-form note (e.g. “preparing fast downloader…” while the first-run Python venv builds) for renderers to show in place of progress that doesn’t exist yet. UnlikeDownloadStatusChanged, it carries arbitrary text rather than a fixedDownloadStatus, and the next progress or status event overwrites it.errors- Error types for download operationsqueue- Queue snapshot DTOs (QueueSnapshot,QueuedDownload,FailedDownload)completion- Queue run completion tracking typesrate-RateEstimator, the single owner of download speed and ETA math. Decays bytes and elapsed time separately sohf-xet’s bursty on-disk writes do not spike the reported rate. Renderers display what it produces and must never re-derive a rate from byte deltas.format-format_rate/format_duration. Rates are decimal (1 MB/s= 1,000,000 B/s) to match what a system network monitor reports; sizes stay binary and are rendered byindicatif’sHumanBytes. Mirrored exactly byformatRate/formatDurationinsrc/utils/format.ts.
Re-exports§
pub use completion::AttemptCounts;pub use completion::CompletionDetail;pub use completion::CompletionKey;pub use completion::CompletionKind;pub use completion::QueueRunSummary;pub use errors::DownloadError;pub use errors::DownloadResult;pub use events::DownloadEvent;pub use events::DownloadStatus;pub use events::DownloadSummary;pub use format::format_duration;pub use format::format_rate;pub use queue::FailedDownload;pub use queue::QueueSnapshot;pub use queue::QueuedDownload;pub use rate::RateEstimator;pub use types::DownloadId;pub use types::Quantization;pub use types::ShardInfo;
Modules§
- completion
- Queue run completion tracking types.
- errors
- Download error types.
- events
- Download events - discriminated union for all download state changes.
- format
- Display formatting for download rates and durations.
- queue
- Queue DTOs for API responses and snapshots.
- rate
- Time-decayed download rate and ETA estimation.
- types
- Core domain types for downloads.