pub struct SharedCache {
pub location: CacheLocation,
/* private fields */
}Expand description
Thread-safe shared cache implementation
Fields§
§location: CacheLocationImplementations§
Sourcepub fn new_with_cache_dir(
repo_path: Option<&Path>,
cache_dir: PathBuf,
) -> Result<Self>
pub fn new_with_cache_dir( repo_path: Option<&Path>, cache_dir: PathBuf, ) -> Result<Self>
Create a new shared cache instance with explicit cache directory (for testing)
Sourcepub fn save_index(&self) -> Result<()>
pub fn save_index(&self) -> Result<()>
Save the current index to disk with comprehensive error handling
Sourcepub fn migrate_from_local(&self, local_cache_path: &Path) -> Result<()>
pub fn migrate_from_local(&self, local_cache_path: &Path) -> Result<()>
Migrate cache from local to shared location
Sourcepub fn clear_project(&self) -> Result<()>
pub fn clear_project(&self) -> Result<()>
Get cache statistics Clear all cache entries for this project
pub fn get_stats(&self) -> CacheStats
pub fn get_full_stats(&self) -> Result<FullCacheStats>
Sourcepub fn with_auto_pruning(
repo_path: Option<&Path>,
pruner: AutoPruner,
) -> Result<Self>
pub fn with_auto_pruning( repo_path: Option<&Path>, pruner: AutoPruner, ) -> Result<Self>
Create a new shared cache with auto-pruning enabled
Sourcepub fn trigger_pruning_if_needed(&self) -> Result<PruneStats>
pub fn trigger_pruning_if_needed(&self) -> Result<PruneStats>
Trigger pruning if needed based on auto-pruner configuration
Sourcepub fn trigger_pruning_if_needed_with_new_entry(
&self,
new_entry_size: usize,
) -> Result<PruneStats>
pub fn trigger_pruning_if_needed_with_new_entry( &self, new_entry_size: usize, ) -> Result<PruneStats>
Trigger pruning if needed, considering a new entry of the given size
Sourcepub fn trigger_pruning(&self) -> Result<PruneStats>
pub fn trigger_pruning(&self) -> Result<PruneStats>
Manually trigger pruning
Sourcepub fn prune_with_strategy(&self, strategy: PruneStrategy) -> Result<PruneStats>
pub fn prune_with_strategy(&self, strategy: PruneStrategy) -> Result<PruneStats>
Prune entries with a specific strategy
Sourcepub fn clean_orphaned_entries(&self) -> Result<usize>
pub fn clean_orphaned_entries(&self) -> Result<usize>
Clean up orphaned index entries where files no longer exist
Sourcepub fn cleanup_old_entries(&self, max_age_days: i64) -> Result<usize>
pub fn cleanup_old_entries(&self, max_age_days: i64) -> Result<usize>
Clean up entries older than specified days
Trait Implementations§
Auto Trait Implementations§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more