pub struct MemoryInvestigationCache { /* private fields */ }Expand description
In-memory capacity-bounded LRU cache with TTL for investigation reports.
Implementations§
Source§impl MemoryInvestigationCache
impl MemoryInvestigationCache
Sourcepub fn new(capacity: NonZeroUsize, ttl: Duration) -> Self
pub fn new(capacity: NonZeroUsize, ttl: Duration) -> Self
Create a new in-memory cache.
Trait Implementations§
Source§impl InvestigationReportCache for MemoryInvestigationCache
impl InvestigationReportCache for MemoryInvestigationCache
Source§fn get(&self, key: &str) -> Option<InvestigationReport>
fn get(&self, key: &str) -> Option<InvestigationReport>
Look up a cached investigation report by cache key.
Source§fn put(&self, key: String, report: InvestigationReport)
fn put(&self, key: String, report: InvestigationReport)
Insert or replace a cached investigation report.
Source§fn invalidate(&self, key: &str)
fn invalidate(&self, key: &str)
Invalidate a single cache key.
Auto Trait Implementations§
impl !Freeze for MemoryInvestigationCache
impl RefUnwindSafe for MemoryInvestigationCache
impl Send for MemoryInvestigationCache
impl Sync for MemoryInvestigationCache
impl Unpin for MemoryInvestigationCache
impl UnsafeUnpin for MemoryInvestigationCache
impl UnwindSafe for MemoryInvestigationCache
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