Expand description
Cache Management and Download Progress
Manages the local model cache with cleanup, statistics, and download progress.
§Features
- Cache size tracking and limits
- LRU eviction for space management
- Download progress callbacks
- Cache statistics and health
§Example
ⓘ
use pacha::cache::{CacheManager, CacheConfig};
let config = CacheConfig::new()
.with_max_size_gb(50.0)
.with_auto_cleanup(true);
let cache = CacheManager::new(config, registry);
// Clean up old models
let freed = cache.cleanup()?;
println!("Freed {} bytes", freed);Structs§
- Cache
Config - Cache configuration
- Cache
Entry - A cached model entry
- Cache
Manager - Cache manager for model storage
- Cache
Stats - Cache statistics
- Download
Progress - Download progress information
Enums§
- Eviction
Policy - Eviction policy for cache cleanup
Functions§
- format_
bytes - Format bytes as human-readable string
- format_
bytes_ per_ sec - Format bytes per second as human-readable string
- format_
duration - Format duration as human-readable string
Type Aliases§
- Progress
Callback - Progress callback type