pub struct FetchConfig { /* private fields */ }Expand description
Configuration for downloading a model repository.
Use FetchConfig::builder() to construct.
§Example
use hf_fetch_model::FetchConfig;
let config = FetchConfig::builder()
.revision("main")
.filter("*.safetensors")
.concurrency(4)
.build()?;Implementations§
Source§impl FetchConfig
impl FetchConfig
Sourcepub fn builder() -> FetchConfigBuilder
pub fn builder() -> FetchConfigBuilder
Creates a new FetchConfigBuilder.
Sourcepub const fn concurrency(&self) -> usize
pub const fn concurrency(&self) -> usize
Returns the configured concurrency level (parallel file downloads).
Sourcepub const fn connections_per_file(&self) -> usize
pub const fn connections_per_file(&self) -> usize
Returns the configured number of parallel HTTP connections per file.
Sourcepub const fn chunk_threshold(&self) -> u64
pub const fn chunk_threshold(&self) -> u64
Returns the chunk threshold in bytes (minimum file size for multi-connection chunked downloads).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FetchConfig
impl !RefUnwindSafe for FetchConfig
impl Send for FetchConfig
impl Sync for FetchConfig
impl Unpin for FetchConfig
impl UnsafeUnpin for FetchConfig
impl !UnwindSafe for FetchConfig
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