pub trait AuthzCache<V: Clone + Send + Sync>: Send + Sync {
// Required methods
fn get(&self, key: &str) -> Option<V>;
fn insert(&self, key: &str, value: V);
fn invalidate(&self, key: &str);
fn invalidate_all(&self);
fn metrics(&self) -> Box<dyn CacheMetrics>;
}Expand description
Generic cache abstraction for authz resolution caches.
Implementations must be Send + Sync so they can be shared across threads
and stored behind Arc.
Required Methods§
Sourcefn invalidate(&self, key: &str)
fn invalidate(&self, key: &str)
Remove a single entry by key.
Sourcefn invalidate_all(&self)
fn invalidate_all(&self)
Remove all entries from the cache.
Sourcefn metrics(&self) -> Box<dyn CacheMetrics>
fn metrics(&self) -> Box<dyn CacheMetrics>
Get cache performance metrics.