pub struct CacheManager { /* private fields */ }
Expand description
缓存管理器
Implementations§
Source§impl CacheManager
impl CacheManager
Sourcepub async fn new(
translation_config: &TranslationConfig,
) -> TranslationResult<Self>
pub async fn new( translation_config: &TranslationConfig, ) -> TranslationResult<Self>
创建新的缓存管理器
Sourcepub fn cleanup_expired_entries(&mut self)
pub fn cleanup_expired_entries(&mut self)
清理过期项
Sourcepub fn get_stats(&self) -> &CacheStats
pub fn get_stats(&self) -> &CacheStats
获取缓存统计
Sourcepub async fn save_persistent_cache(&self) -> TranslationResult<()>
pub async fn save_persistent_cache(&self) -> TranslationResult<()>
保存持久化缓存
Auto Trait Implementations§
impl Freeze for CacheManager
impl RefUnwindSafe for CacheManager
impl Send for CacheManager
impl Sync for CacheManager
impl Unpin for CacheManager
impl UnwindSafe for CacheManager
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