pub struct CacheManager { /* private fields */ }Expand description
Manages a cache of recent pattern matches.
Implementations§
Source§impl CacheManager
impl CacheManager
pub fn new(max_entries: usize, ttl_seconds: i64) -> Self
pub fn get(&mut self, key: &str) -> Option<&Vec<CachedMatch>>
pub fn put(&mut self, key: &str, matches: Vec<CachedMatch>)
pub fn invalidate(&mut self, key: &str)
pub fn invalidate_pattern(&mut self, pattern_id: &str)
pub fn clear(&mut self)
pub fn size(&self) -> usize
pub fn hit_rate(&self) -> f64
Trait Implementations§
Source§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 UnsafeUnpin 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