pub struct CacheManager {
pub default_ttl: Duration,
/* private fields */
}Expand description
Manages caching of analysis results with TTL and file change detection
Fields§
§default_ttl: DurationDefault TTL for cache entries
Implementations§
Source§impl CacheManager
impl CacheManager
Sourcepub fn get(
&self,
project_root: &Path,
file_mtimes: &HashMap<PathBuf, SystemTime>,
) -> Result<Option<ProjectContext>, ResearchError>
pub fn get( &self, project_root: &Path, file_mtimes: &HashMap<PathBuf, SystemTime>, ) -> Result<Option<ProjectContext>, ResearchError>
Get a cached project context if valid
Sourcepub fn set(
&self,
project_root: &Path,
context: &ProjectContext,
file_mtimes: HashMap<PathBuf, SystemTime>,
) -> Result<(), ResearchError>
pub fn set( &self, project_root: &Path, context: &ProjectContext, file_mtimes: HashMap<PathBuf, SystemTime>, ) -> Result<(), ResearchError>
Store a project context in the cache
Sourcepub fn invalidate(&self, project_root: &Path) -> Result<(), ResearchError>
pub fn invalidate(&self, project_root: &Path) -> Result<(), ResearchError>
Invalidate cache for a specific project
Sourcepub fn clear(&self) -> Result<(), ResearchError>
pub fn clear(&self) -> Result<(), ResearchError>
Clear all cache entries
Sourcepub fn statistics(&self) -> Result<CacheStatistics, ResearchError>
pub fn statistics(&self) -> Result<CacheStatistics, ResearchError>
Get current cache statistics
Sourcepub fn is_cached(
&self,
project_root: &Path,
file_mtimes: &HashMap<PathBuf, SystemTime>,
) -> Result<bool, ResearchError>
pub fn is_cached( &self, project_root: &Path, file_mtimes: &HashMap<PathBuf, SystemTime>, ) -> Result<bool, ResearchError>
Check if a project is cached and valid
Sourcepub fn entry_count(&self) -> Result<usize, ResearchError>
pub fn entry_count(&self) -> Result<usize, ResearchError>
Get cache entry count
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 moreSource§impl Debug for CacheManager
impl Debug for CacheManager
Auto 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