pub struct ModelFetcher { /* private fields */ }Expand description
Unified model fetcher with caching and alias support
Implementations§
Source§impl ModelFetcher
impl ModelFetcher
Sourcepub fn with_config(config: FetchConfig) -> Result<Self>
pub fn with_config(config: FetchConfig) -> Result<Self>
Create a fetcher with custom configuration
Sourcepub fn with_cache_dir(cache_dir: PathBuf, config: FetchConfig) -> Result<Self>
pub fn with_cache_dir(cache_dir: PathBuf, config: FetchConfig) -> Result<Self>
Create a fetcher with a specific cache directory
Sourcepub fn config(&self) -> &FetchConfig
pub fn config(&self) -> &FetchConfig
Get configuration
Sourcepub fn aliases(&self) -> &AliasRegistry
pub fn aliases(&self) -> &AliasRegistry
Get alias registry
Sourcepub fn resolve_ref(&self, model_ref: &str) -> Result<ResolvedAlias>
pub fn resolve_ref(&self, model_ref: &str) -> Result<ResolvedAlias>
Resolve a model reference to full URI
Sourcepub fn pull<F>(
&mut self,
model_ref: &str,
progress_fn: F,
) -> Result<FetchResult>where
F: Fn(&DownloadProgress),
pub fn pull<F>(
&mut self,
model_ref: &str,
progress_fn: F,
) -> Result<FetchResult>where
F: Fn(&DownloadProgress),
Pull a model (fetch if not cached)
Sourcepub fn pull_quiet(&mut self, model_ref: &str) -> Result<FetchResult>
pub fn pull_quiet(&mut self, model_ref: &str) -> Result<FetchResult>
Pull without progress callback
Sourcepub fn list(&self) -> Vec<CachedModel>
pub fn list(&self) -> Vec<CachedModel>
List all cached models
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics
Sourcepub fn cleanup_old(&mut self) -> u64
pub fn cleanup_old(&mut self) -> u64
Cleanup models older than specified days
Auto Trait Implementations§
impl !Freeze for ModelFetcher
impl !RefUnwindSafe for ModelFetcher
impl !Sync for ModelFetcher
impl !UnwindSafe for ModelFetcher
impl Send for ModelFetcher
impl Unpin for ModelFetcher
impl UnsafeUnpin for ModelFetcher
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