pub struct ExtendedCompressionCache { /* private fields */ }Expand description
扩展压缩缓存:支持多种类型的缓存
包括:焦点预测、优先级分数、复杂度分析等
Implementations§
Source§impl ExtendedCompressionCache
impl ExtendedCompressionCache
pub fn new(config: ExtendedCacheConfig) -> Self
Sourcepub fn get_priority_score(
&self,
message_id: &str,
) -> Option<&CachedPriorityScore>
pub fn get_priority_score( &self, message_id: &str, ) -> Option<&CachedPriorityScore>
获取优先级分数(如果缓存有效)
Sourcepub fn put_priority_score(
&mut self,
message_id: String,
score: CachedPriorityScore,
)
pub fn put_priority_score( &mut self, message_id: String, score: CachedPriorityScore, )
添加优先级分数缓存
Sourcepub fn get_focus_prediction(
&self,
message_id: &str,
) -> Option<&CachedFocusPrediction>
pub fn get_focus_prediction( &self, message_id: &str, ) -> Option<&CachedFocusPrediction>
获取焦点预测
Sourcepub fn put_focus_prediction(
&mut self,
message_id: String,
prediction: CachedFocusPrediction,
)
pub fn put_focus_prediction( &mut self, message_id: String, prediction: CachedFocusPrediction, )
添加焦点预测缓存
Sourcepub fn get_complexity(&self, conversation_id: &str) -> Option<&CachedComplexity>
pub fn get_complexity(&self, conversation_id: &str) -> Option<&CachedComplexity>
获取复杂度分析
Sourcepub fn put_complexity(
&mut self,
conversation_id: String,
complexity: CachedComplexity,
)
pub fn put_complexity( &mut self, conversation_id: String, complexity: CachedComplexity, )
添加复杂度缓存
Sourcepub fn update_priority_incremental(
&mut self,
new_keywords: &[String],
_existing_messages: &[Message],
)
pub fn update_priority_incremental( &mut self, new_keywords: &[String], _existing_messages: &[Message], )
增量更新优先级分数(基于新消息)
Sourcepub fn cleanup_expired(&mut self)
pub fn cleanup_expired(&mut self)
清理过期缓存
Sourcepub fn base_cache(&self) -> &CompressionCache
pub fn base_cache(&self) -> &CompressionCache
获取基础缓存
Sourcepub fn base_cache_mut(&mut self) -> &mut CompressionCache
pub fn base_cache_mut(&mut self) -> &mut CompressionCache
获取基础缓存(可变)
Sourcepub fn extended_stats(&self) -> ExtendedCacheStats
pub fn extended_stats(&self) -> ExtendedCacheStats
获取缓存统计
Trait Implementations§
Source§impl Debug for ExtendedCompressionCache
impl Debug for ExtendedCompressionCache
Auto Trait Implementations§
impl Freeze for ExtendedCompressionCache
impl RefUnwindSafe for ExtendedCompressionCache
impl Send for ExtendedCompressionCache
impl Sync for ExtendedCompressionCache
impl Unpin for ExtendedCompressionCache
impl UnsafeUnpin for ExtendedCompressionCache
impl UnwindSafe for ExtendedCompressionCache
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