aegis-verify · cache
Declared module signatures, types, configuration, and source documentation.
Source: aegis/aegis-verify/src/cache.rs. SHA-256: b43d476e5c7adaa9f355df896ee1e0382f6d5d87adb6d3d12a6be942e79124ee.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
cache::VerificationCache
A TTL-based cache for OAS document verification results.
Stores [VerificationResult] entries keyed by DID string. Each entry
expires after a configurable duration (capped at 300 seconds per
AEGIS Specification §5.8).
Thread Safety
Uses RwLock for interior mutability, allowing concurrent reads
with exclusive writes.
pub struct VerificationCache {
}Source line: 44.
cache::VerificationCache::new
Creates a new cache with the specified TTL in seconds.
The TTL is capped at 300 seconds per the AEGIS specification. Values exceeding this limit are silently clamped.
Arguments
ttl_secs- Time-to-live in seconds (capped at 300).
pub fn new(ttl_secs: u64) -> Self;Source line: 71.
cache::VerificationCache::get
Returns a cached verification result if present and not expired.
Expired entries are lazily evicted: if a cached entry is found but has exceeded its TTL, it is not returned but remains in the map until the next write operation or explicit invalidation.
Arguments
did- The DID to look up.
Returns
Some(VerificationResult) if a valid, non-expired entry exists.
None if the DID is not cached or the entry has expired.
pub fn get(&self, did: &str) -> Option<VerificationResult>;Source line: 93.
cache::VerificationCache::insert
Inserts a verification result into the cache.
If an entry already exists for the given DID, it is replaced.
Arguments
did- The DID to cache.result- The verification result to store.
pub fn insert(&self, did: &str, result: VerificationResult);Source line: 111.
cache::VerificationCache::invalidate
Removes a specific entry from the cache.
Arguments
did- The DID to invalidate.
pub fn invalidate(&self, did: &str);Source line: 129.
cache::VerificationCache::clear
Removes all entries from the cache.
pub fn clear(&self);Source line: 136.
cache::VerificationCache::len
Returns the number of entries currently in the cache (including expired).
pub fn len(&self) -> usize;Source line: 143.
cache::VerificationCache::is_empty
Returns true if the cache contains no entries.
pub fn is_empty(&self) -> bool;Source line: 148.
cache::VerificationCache::ttl
Returns the configured TTL duration.
pub fn ttl(&self) -> Duration;Source line: 153.