pub struct ForgetConfig {
pub ttl: Duration,
pub min_importance: f64,
pub weak_grace: Duration,
}Expand description
Decay policy configuration.
Fields§
§ttl: DurationA memory forgotten once idle this long (based on last_access_at).
min_importance: f64Contents importance in [0, 1]; below this floor counts as weak.
weak_grace: DurationA weak memory is pruned once it has been idle at least this long (even before TTL).
Implementations§
Source§impl ForgetConfig
impl ForgetConfig
Sourcepub fn with_ttl(self, ttl: Duration) -> Self
pub fn with_ttl(self, ttl: Duration) -> Self
Set the idle TTL after which a memory is forgotten.
Sourcepub fn with_min_importance(self, min_importance: f64) -> Self
pub fn with_min_importance(self, min_importance: f64) -> Self
Set the importance floor; below it a memory is weak.
Sourcepub fn with_weak_grace(self, weak_grace: Duration) -> Self
pub fn with_weak_grace(self, weak_grace: Duration) -> Self
Set how long a weak memory may stay idle before consolidation prunes it.
Trait Implementations§
Source§impl Clone for ForgetConfig
impl Clone for ForgetConfig
Source§fn clone(&self) -> ForgetConfig
fn clone(&self) -> ForgetConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ForgetConfig
Source§impl Debug for ForgetConfig
impl Debug for ForgetConfig
Auto Trait Implementations§
impl Freeze for ForgetConfig
impl RefUnwindSafe for ForgetConfig
impl Send for ForgetConfig
impl Sync for ForgetConfig
impl Unpin for ForgetConfig
impl UnsafeUnpin for ForgetConfig
impl UnwindSafe for ForgetConfig
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