pub struct DecayConfig {
pub daily_rate: f32,
pub min_threshold: f32,
pub grace_period_days: u32,
}Expand description
Importance decay configuration
Fields§
§daily_rate: f32Decay rate per day (0.0 - 1.0)
min_threshold: f32Minimum importance threshold (memories below this are candidates for removal)
grace_period_days: u32Age in days before decay starts
Implementations§
Source§impl DecayConfig
impl DecayConfig
Sourcepub fn with_min_threshold(self, threshold: f32) -> Self
pub fn with_min_threshold(self, threshold: f32) -> Self
Set minimum threshold
Sourcepub fn with_grace_period(self, days: u32) -> Self
pub fn with_grace_period(self, days: u32) -> Self
Set grace period
Sourcepub fn apply(&self, entry: &mut MemoryEntry) -> bool
pub fn apply(&self, entry: &mut MemoryEntry) -> bool
Apply decay to a memory entry
Trait Implementations§
Source§impl Clone for DecayConfig
impl Clone for DecayConfig
Source§fn clone(&self) -> DecayConfig
fn clone(&self) -> DecayConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DecayConfig
impl Debug for DecayConfig
Source§impl Default for DecayConfig
impl Default for DecayConfig
Source§impl<'de> Deserialize<'de> for DecayConfig
impl<'de> Deserialize<'de> for DecayConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DecayConfig
impl RefUnwindSafe for DecayConfig
impl Send for DecayConfig
impl Sync for DecayConfig
impl Unpin for DecayConfig
impl UnsafeUnpin for DecayConfig
impl UnwindSafe for DecayConfig
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