pub struct CacheManager { /* private fields */ }Expand description
Local cache manager for rpacks
Implementations§
Source§impl CacheManager
impl CacheManager
Sourcepub fn with_dir(cache_dir: PathBuf) -> Result<Self>
pub fn with_dir(cache_dir: PathBuf) -> Result<Self>
Create a cache manager with custom directory (for testing)
Sourcepub async fn ensure(&self, resolved_pack: &ResolvedPack) -> Result<CachedPack>
pub async fn ensure(&self, resolved_pack: &ResolvedPack) -> Result<CachedPack>
Ensure a pack is cached locally
Sourcepub fn load_cached(&self, pack_id: &str, version: &str) -> Result<CachedPack>
pub fn load_cached(&self, pack_id: &str, version: &str) -> Result<CachedPack>
Load a cached pack
Sourcepub fn list_cached(&self) -> Result<Vec<CachedPack>>
pub fn list_cached(&self) -> Result<Vec<CachedPack>>
List all cached packs
Sourcepub fn cleanup_old_versions(&self) -> Result<()>
pub fn cleanup_old_versions(&self) -> Result<()>
Clean up old versions, keeping only the latest
Trait Implementations§
Source§impl Clone for CacheManager
impl Clone for CacheManager
Source§fn clone(&self) -> CacheManager
fn clone(&self) -> CacheManager
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 CacheManager
impl RefUnwindSafe for CacheManager
impl Send for CacheManager
impl Sync for CacheManager
impl Unpin for CacheManager
impl UnwindSafe for CacheManager
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