pub struct CollectiveCache { /* private fields */ }Expand description
A TTL-based cache for collective data.
Implementations§
Source§impl CollectiveCache
impl CollectiveCache
Sourcepub fn get_patterns(&self, key: &str) -> Option<&[UsagePattern]>
pub fn get_patterns(&self, key: &str) -> Option<&[UsagePattern]>
Get cached patterns for a query key, if not expired.
Sourcepub fn put_patterns(&mut self, key: String, patterns: Vec<UsagePattern>)
pub fn put_patterns(&mut self, key: String, patterns: Vec<UsagePattern>)
Store patterns in the cache.
Sourcepub fn evict_expired(&mut self)
pub fn evict_expired(&mut self)
Remove expired entries from the cache.
Trait Implementations§
Source§impl Debug for CollectiveCache
impl Debug for CollectiveCache
Auto Trait Implementations§
impl Freeze for CollectiveCache
impl RefUnwindSafe for CollectiveCache
impl Send for CollectiveCache
impl Sync for CollectiveCache
impl Unpin for CollectiveCache
impl UnsafeUnpin for CollectiveCache
impl UnwindSafe for CollectiveCache
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