pub struct IntelCache { /* private fields */ }Expand description
SQLite-backed TTL cache keyed by (source, target_type, target_value).
Implementations§
Source§impl IntelCache
impl IntelCache
Sourcepub fn get(
&self,
source: &str,
target_type: &str,
target_value: &str,
ttl_secs: u64,
) -> Result<Option<IntelEnrichment>>
pub fn get( &self, source: &str, target_type: &str, target_value: &str, ttl_secs: u64, ) -> Result<Option<IntelEnrichment>>
Get a cached enrichment if it exists and is not stale.
Sourcepub fn put(&self, enrichment: &IntelEnrichment) -> Result<()>
pub fn put(&self, enrichment: &IntelEnrichment) -> Result<()>
Store an enrichment in the cache.
Sourcepub fn evict_stale(&self, ttl_secs: u64) -> Result<usize>
pub fn evict_stale(&self, ttl_secs: u64) -> Result<usize>
Evict entries older than ttl_secs.
Auto Trait Implementations§
impl !Freeze for IntelCache
impl RefUnwindSafe for IntelCache
impl Send for IntelCache
impl Sync for IntelCache
impl Unpin for IntelCache
impl UnsafeUnpin for IntelCache
impl UnwindSafe for IntelCache
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