Skip to main content

Factor

Trait Factor 

Source
pub trait Factor: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn score(&self, item: &dyn Scoreable, state: &ProfileState, now: u64) -> f32;
}
Expand description

Core trait every scoring factor must implement.

Callers define domain logic entirely through factors. Built-in factors (Challenge, Spacing, Coverage) are provided as reference implementations — callers may use, replace, or extend them.

A factor returns a score in [0.0, 1.0]. Engine multiplies all factor scores together — multiplicative pipeline. A near-zero score from any single factor suppresses the item entirely.

Required Methods§

Source

fn name(&self) -> &str

Source

fn score(&self, item: &dyn Scoreable, state: &ProfileState, now: u64) -> f32

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§