pub struct AnalysisCache { /* private fields */ }
Expand description
Analysis result cache with LRU eviction and TTL expiration
Implementations§
Source§impl AnalysisCache
impl AnalysisCache
Sourcepub fn with_config(config: CacheConfig) -> Self
pub fn with_config(config: CacheConfig) -> Self
Create a new analysis cache with custom configuration
Sourcepub fn get(
&self,
tool_name: &str,
parameters: &Value,
target: Option<&str>,
) -> Result<Option<Value>>
pub fn get( &self, tool_name: &str, parameters: &Value, target: Option<&str>, ) -> Result<Option<Value>>
Get a cached result
Sourcepub fn put(
&self,
tool_name: &str,
parameters: &Value,
target: Option<&str>,
result: Value,
) -> Result<()>
pub fn put( &self, tool_name: &str, parameters: &Value, target: Option<&str>, result: Value, ) -> Result<()>
Store a result in the cache
Sourcepub fn cleanup_expired(&self) -> Result<usize>
pub fn cleanup_expired(&self) -> Result<usize>
Clear expired entries
Sourcepub fn get_stats(&self) -> Result<CacheStats>
pub fn get_stats(&self) -> Result<CacheStats>
Get cache statistics
Sourcepub fn should_cache(&self, tool_name: &str) -> bool
pub fn should_cache(&self, tool_name: &str) -> bool
Check if caching is beneficial for a tool
Source§impl AnalysisCache
impl AnalysisCache
Sourcepub fn warm_cache(&self, workflow_patterns: &[String]) -> Result<()>
pub fn warm_cache(&self, workflow_patterns: &[String]) -> Result<()>
Warm cache with commonly used results
Sourcepub fn invalidate_by_pattern(&self, pattern: &str) -> Result<usize>
pub fn invalidate_by_pattern(&self, pattern: &str) -> Result<usize>
Invalidate cache entries based on code changes
Sourcepub fn get_advanced_stats(&self) -> Result<AdvancedCacheStats>
pub fn get_advanced_stats(&self) -> Result<AdvancedCacheStats>
Get advanced cache statistics for optimization
Sourcepub fn persist_to_storage(&self, file_path: &str) -> Result<()>
pub fn persist_to_storage(&self, file_path: &str) -> Result<()>
Persist cache to storage for recovery
Sourcepub fn restore_from_storage(&self, file_path: &str) -> Result<()>
pub fn restore_from_storage(&self, file_path: &str) -> Result<()>
Restore cache from persistent storage
Sourcepub fn optimize_cache(&self) -> Result<CacheOptimizationResult>
pub fn optimize_cache(&self) -> Result<CacheOptimizationResult>
Optimize cache performance by reorganizing entries
Trait Implementations§
Source§impl Debug for AnalysisCache
impl Debug for AnalysisCache
Auto Trait Implementations§
impl Freeze for AnalysisCache
impl RefUnwindSafe for AnalysisCache
impl Send for AnalysisCache
impl Sync for AnalysisCache
impl Unpin for AnalysisCache
impl UnwindSafe for AnalysisCache
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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