pub enum DecayFunction {
None,
Exponential {
half_life: f64,
},
Linear {
max_age: f64,
},
Gaussian {
sigma: f64,
},
}Expand description
Time decay function for relevance scoring
Variants§
None
No decay (standard similarity search)
Exponential
Exponential decay: score * exp(-lambda * age) half_life: time in seconds for score to decay to 50%
Linear
Linear decay: score * max(0, 1 - age / max_age) max_age: maximum age in seconds
Gaussian
Gaussian decay: score * exp(-(age^2) / (2 * sigma^2)) sigma: standard deviation in seconds
Implementations§
Trait Implementations§
Source§impl Clone for DecayFunction
impl Clone for DecayFunction
Source§fn clone(&self) -> DecayFunction
fn clone(&self) -> DecayFunction
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 moreSource§impl Debug for DecayFunction
impl Debug for DecayFunction
Source§impl<'de> Deserialize<'de> for DecayFunction
impl<'de> Deserialize<'de> for DecayFunction
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 DecayFunction
impl RefUnwindSafe for DecayFunction
impl Send for DecayFunction
impl Sync for DecayFunction
impl Unpin for DecayFunction
impl UnsafeUnpin for DecayFunction
impl UnwindSafe for DecayFunction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more