pub trait DiscoveryCache: Send + Sync {
// Required methods
fn get(&self, key: &CacheKey) -> Result<Option<CacheValue>, PathError>;
fn put(&self, key: CacheKey, value: CacheValue) -> Result<(), PathError>;
fn invalidate(&self, root: &Path) -> Result<(), PathError>;
fn clear(&self) -> Result<(), PathError>;
}Expand description
Trait for discovery result caches.
Required Methods§
Sourcefn get(&self, key: &CacheKey) -> Result<Option<CacheValue>, PathError>
fn get(&self, key: &CacheKey) -> Result<Option<CacheValue>, PathError>
Get a cached value by key.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl DiscoveryCache for MemoryCache
impl DiscoveryCache for PersistentCache
Available on crate feature
persistent-cache only.