pub struct DatabaseCache { /* private fields */ }Expand description
Thread-safe database cache with proper key generation
Implementations§
Source§impl DatabaseCache
impl DatabaseCache
pub fn new() -> Self
Sourcepub fn builder() -> DatabaseCacheBuilder
pub fn builder() -> DatabaseCacheBuilder
Create a cache with custom settings
Sourcepub fn create_key(
patterns: &[Pattern],
mode: Mode,
platform: Option<&Platform>,
) -> CacheKey
pub fn create_key( patterns: &[Pattern], mode: Mode, platform: Option<&Platform>, ) -> CacheKey
Create cache key from patterns and configuration
Sourcepub async fn get_or_compile<F>(
&self,
key: CacheKey,
compile_fn: F,
) -> Result<Arc<Database>>
pub async fn get_or_compile<F>( &self, key: CacheKey, compile_fn: F, ) -> Result<Arc<Database>>
Get or compile a database
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics
Auto Trait Implementations§
impl Freeze for DatabaseCache
impl !RefUnwindSafe for DatabaseCache
impl Send for DatabaseCache
impl Sync for DatabaseCache
impl Unpin for DatabaseCache
impl !UnwindSafe for DatabaseCache
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