pub struct ExpiringLru<Key, Value> { /* private fields */ }Expand description
Small process-local expiring LRU for data that is already bound to an authenticated authority fingerprint by its key.
Browser adapters use this for short-lived connection-plan and delegated
answer reuse. Consensus, proof, DNSSEC, and DANE caches should use
SecureCache so the engine also binds their generation and chain anchor.
Implementations§
Source§impl<Key, Value> ExpiringLru<Key, Value>
impl<Key, Value> ExpiringLru<Key, Value>
Sourcepub fn new(max_entries: NonZeroUsize) -> Self
pub fn new(max_entries: NonZeroUsize) -> Self
Construct an empty cache with a nonzero hard entry bound.
Sourcepub fn insert(
&mut self,
key: Key,
value: Value,
ttl: Duration,
) -> Result<(), CacheError>
pub fn insert( &mut self, key: Key, value: Value, ttl: Duration, ) -> Result<(), CacheError>
Insert or replace one entry for a finite positive lifetime.
Trait Implementations§
Auto Trait Implementations§
impl<Key, Value> Freeze for ExpiringLru<Key, Value>
impl<Key, Value> RefUnwindSafe for ExpiringLru<Key, Value>
impl<Key, Value> Send for ExpiringLru<Key, Value>
impl<Key, Value> Sync for ExpiringLru<Key, Value>
impl<Key, Value> Unpin for ExpiringLru<Key, Value>
impl<Key, Value> UnsafeUnpin for ExpiringLru<Key, Value>
impl<Key, Value> UnwindSafe for ExpiringLru<Key, Value>
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