pub struct DownloadRequest {
pub repo_id: String,
pub quantization: Quantization,
pub revision: Option<String>,
pub force: bool,
pub add_to_db: bool,
}Expand description
Request to queue a new download.
This is a pure data structure containing all information needed to initiate a download. Infrastructure concerns (tokens, paths) are handled internally by the implementation.
Fields§
§repo_id: StringRepository ID on HuggingFace (e.g., unsloth/Llama-3-GGUF).
quantization: QuantizationThe quantization to download.
revision: Option<String>Git revision/commit SHA (defaults to “main” if not specified).
force: boolForce re-download even if file exists locally.
add_to_db: boolAdd to local model database after download.
Implementations§
Source§impl DownloadRequest
impl DownloadRequest
Sourcepub fn new(repo_id: impl Into<String>, quantization: Quantization) -> Self
pub fn new(repo_id: impl Into<String>, quantization: Quantization) -> Self
Create a new download request with required fields.
Sourcepub fn with_revision(self, revision: impl Into<String>) -> Self
pub fn with_revision(self, revision: impl Into<String>) -> Self
Set the revision/commit SHA.
Sourcepub const fn with_force(self, force: bool) -> Self
pub const fn with_force(self, force: bool) -> Self
Set whether to force re-download.
Sourcepub const fn with_add_to_db(self, add_to_db: bool) -> Self
pub const fn with_add_to_db(self, add_to_db: bool) -> Self
Set whether to add to database after download.
Trait Implementations§
Source§impl Clone for DownloadRequest
impl Clone for DownloadRequest
Source§fn clone(&self) -> DownloadRequest
fn clone(&self) -> DownloadRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DownloadRequest
impl RefUnwindSafe for DownloadRequest
impl Send for DownloadRequest
impl Sync for DownloadRequest
impl Unpin for DownloadRequest
impl UnwindSafe for DownloadRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more