pub trait MapCache: Send + Sync {
// Required methods
fn get(&self, key: &str) -> Option<Arc<TokenizerMap>>;
fn set(&self, key: &str, map: Arc<TokenizerMap>);
}Expand description
Pluggable cache for loaded maps. The default is MemoryMapCache.
Implement this trait to plug in IndexedDB, Redis, on-disk storage, etc.
Required Methods§
Sourcefn set(&self, key: &str, map: Arc<TokenizerMap>)
fn set(&self, key: &str, map: Arc<TokenizerMap>)
Stores map under key.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".