pub trait DecayPolicy: Send + Sync {
// Required methods
fn decay(&self, entry: &MemoryEntry, current_time: DateTime<Utc>) -> f32;
fn should_evict(&self, entry: &MemoryEntry) -> bool;
}Expand description
记忆衰减策略 trait
定义记忆如何随时间衰减重要性。
Required Methods§
Sourcefn should_evict(&self, entry: &MemoryEntry) -> bool
fn should_evict(&self, entry: &MemoryEntry) -> bool
是否应该清理该记忆
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".